Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling of updates to default values to the CRD Upgrade Safety preflight check #950

Conversation

rashmigottipati
Copy link
Contributor

What this PR does / why we need it:

This PR adds another field change validation to the CRD Upgrade Safety checks to prevent changes to a field's default values for a given CRD version during an upgrade and ensures the below:

  • No new value can be added as default that did not previously have a default value present
  • Default value of a field cannot be changed
  • Existing default value for a field cannot be removed

Which issue(s) this PR fixes:

#949

Does this PR introduce a user-facing change?

Add logic to the CRD Upgrade Safety pre-flight check to ensure that default values are not changed for a given CRD version during an upgrade

Additional Notes for your reviewer:

Review Checklist:
  • Follows the developer guidelines
  • Relevant tests are added or updated
  • Relevant docs in this repo added or updated
  • Relevant carvel.dev docs added or updated in a separate PR and there's
    a link to that PR
  • Code is at least as readable and maintainable as it was before this
    change

Additional documentation e.g., Proposal, usage docs, etc.:


@rashmigottipati
Copy link
Contributor Author

cc @everettraven

Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor nit!

@rashmigottipati rashmigottipati mentioned this pull request May 3, 2024
6 tasks
@praveenrewar
Copy link
Member

@rashmigottipati Since I merged the other PR, this now has some merge conflicts.

@rashmigottipati
Copy link
Contributor Author

Thanks @everettraven for the approval!

@praveenrewar Thanks for merging the other PR. Rebased this PR and squashed commits.

Copy link
Contributor

@100mik 100mik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!
@praveenrewar merge away if you are fine with this

Copy link
Member

@praveenrewar praveenrewar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants