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

Prevent incompatible migration of Shoot to Runtime CR #405

Merged
merged 22 commits into from
Oct 16, 2024

Conversation

mvshao
Copy link
Contributor

@mvshao mvshao commented Oct 1, 2024

Description

Changes proposed in this pull request:

  • implemented the prevention mechanism in runtime-migrator to abandon migration of existing Shoot if the generated shoot based on runtime CR will differ from the one on the cluster

Related issue(s)
#400

@kyma-bot kyma-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cla: yes Indicates the PR's author has signed the CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 1, 2024
@kyma-bot kyma-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 2, 2024
@mvshao mvshao marked this pull request as ready for review October 10, 2024 13:43
@mvshao mvshao requested a review from a team as a code owner October 10, 2024 13:43
@kyma-bot kyma-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2024
VOID404
VOID404 previously approved these changes Oct 16, 2024
Comment on lines +27 to +32
equal := len(differences) == 0

return Result{
Equal: equal,
Diff: differences,
}, nil
Copy link
Contributor

@VOID404 VOID404 Oct 16, 2024

Choose a reason for hiding this comment

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

equal could be a method that returns len(this.differences) == 0, but this is fine too, although easier to break


if !equal {
diff := Difference{
ShootName: leftShoot.Name, // assumption that leftShoot and rightShoot have the same name
Copy link
Contributor

Choose a reason for hiding this comment

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

should that assumption be checked? If this is supposed to be always true, maybe it's safer to even crash if it ever isn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thx, I will add the step with checking if left == right

@kyma-bot kyma-bot added the lgtm Looks good to me! label Oct 16, 2024
@VOID404 VOID404 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2024
@kyma-bot kyma-bot removed the lgtm Looks good to me! label Oct 16, 2024
@kyma-bot kyma-bot added the lgtm Looks good to me! label Oct 16, 2024
@mvshao mvshao removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 16, 2024
@mvshao mvshao merged commit d1bcfb5 into kyma-project:main Oct 16, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. lgtm Looks good to me! size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants