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

🐛 Restore v1alpha3/v1alpha4 conversion to fix SSA issue & add e2e test coverage #10147

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Feb 13, 2024

What this PR does / why we need it:

This PR:

  • Fixes the issue with old apiVersions in managedFields + SSA by restoring conversion of v1alpha3 & v1alpha4
  • Adds corresponding e2e test coverage to verify the fix works and avoid regressions

More details on the issue soon.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #10051

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label labels Feb 13, 2024
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 13, 2024
@sbueringer sbueringer changed the title [WIP] [DON'T REVIEW] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix [WIP DONT REVIEW] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix Feb 13, 2024
@sbueringer sbueringer changed the title [WIP DONT REVIEW] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix [WIP-DON'T-REVIEW] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix Feb 13, 2024
@sbueringer sbueringer changed the title [WIP-DON'T-REVIEW] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix [WIP] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix Feb 13, 2024
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer sbueringer force-pushed the pr-fix-apiversion-issue-with-fix branch 2 times, most recently from 2ce619a to d30cb88 Compare February 13, 2024 21:13
@sbueringer
Copy link
Member Author

/test ?

@k8s-ci-robot
Copy link
Contributor

@sbueringer: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-build-main
  • /test pull-cluster-api-e2e-blocking-main
  • /test pull-cluster-api-e2e-conformance-ci-latest-main
  • /test pull-cluster-api-e2e-conformance-main
  • /test pull-cluster-api-e2e-dualstack-and-ipv6-main
  • /test pull-cluster-api-e2e-main
  • /test pull-cluster-api-e2e-mink8s-main
  • /test pull-cluster-api-e2e-upgrade-1-29-1-30-main
  • /test pull-cluster-api-test-main
  • /test pull-cluster-api-test-mink8s-main
  • /test pull-cluster-api-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-apidiff-main
  • pull-cluster-api-build-main
  • pull-cluster-api-e2e-blocking-main
  • pull-cluster-api-test-main
  • pull-cluster-api-verify-main

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-conformance-ci-latest-main
/test pull-cluster-api-e2e-upgrade-1-29-1-30-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2024
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Feb 14, 2024

@sbueringer: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-e2e-conformance-ci-latest-main d30cb88 link true /test pull-cluster-api-e2e-conformance-ci-latest-main
pull-cluster-api-e2e-upgrade-1-29-1-30-main d30cb88 link true /test pull-cluster-api-e2e-upgrade-1-29-1-30-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

Awesome!
This is a big PR and a lot of work in such a short time and I would like to praise a few things make this PR to stand out

  • Restoring APIs in internal packages really helps in keeping the public API surfaces as minimal and possible
  • Adding E2e test validating a double clusterctl upgrade allows us to make this change with confidence (and we will benefit from this as well down the line when working to a more sophisticated solution)
  • The trick to force controller manager restart is a real piece of art

just a few nits, nothing really blocking

Makefile Show resolved Hide resolved
test/framework/clusterctl/client.go Show resolved Hide resolved
test/e2e/clusterctl_upgrade_test.go Show resolved Hide resolved
test/e2e/clusterctl_upgrade_test.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@fabriziopandini
Copy link
Member

fabriziopandini commented Feb 14, 2024

/lgtm
/approve
Feel free to unwip/unhold when the test are completed

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 14, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: fd27c37fb7323e2fc2188bf2875f79388daa56fe

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2024
@sbueringer sbueringer changed the title [WIP] 🌱 Add e2e test to reproduce SSA apiVersion issue + fix 🌱 Add e2e test to reproduce SSA apiVersion issue + fix Feb 14, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 14, 2024
@sbueringer sbueringer changed the title 🌱 Add e2e test to reproduce SSA apiVersion issue + fix 🐛 Restore v1alpha3/v1alpha4 conversion to fix SSA issue & add e2e test coverage Feb 14, 2024
@sbueringer sbueringer added the area/api Issues or PRs related to the APIs label Feb 14, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Feb 14, 2024
@sbueringer sbueringer added area/e2e-testing Issues or PRs related to e2e testing do-not-merge/needs-area PR is missing an area label labels Feb 14, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Feb 14, 2024
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

I haven't done a full review of this -but I'm trying to understand the change and the root cause.

Do we need to keep apiVersions around pretty much indefinitely - but with served: false in order to keep the conversion webhooks working?

At least until we can be sure that all apiVersions in the managed fields have been updated?

@k8s-ci-robot k8s-ci-robot merged commit e8eda40 into kubernetes-sigs:main Feb 14, 2024
49 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Feb 14, 2024
@sbueringer
Copy link
Member Author

sbueringer commented Feb 14, 2024

I haven't done a full review of this -but I'm trying to understand the change and the root cause.

Do we need to keep apiVersions around pretty much indefinitely - but with served: false in order to keep the conversion webhooks working?

At least until we can be sure that all apiVersions in the managed fields have been updated?

Yup. That's exactly it on a high-level. Fabrizio will share more details in the office hours (please check the agenda the information is already there, we'll update the issue later accordingly as well).

This PR and its cherry-pick are only meant as a temporary solution until we figure out the right way to handle this problem. The idea was to only restore the minimal amount necessary to get conversion working again (which is the reason why we restored v1alpha3/v1alpha4 under internal).

@sbueringer
Copy link
Member Author

P.S. Happy to follow-up if you have further findings

@sbueringer
Copy link
Member Author

sbueringer commented Feb 14, 2024

P.S.2 Sorry for the short time frame to review. Trying to get this fixed up before I'm going on PTO on Friday and in time so we have some time in CI before the 1.6 patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api Issues or PRs related to the APIs area/e2e-testing Issues or PRs related to e2e testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSA failure after removal of old API versions
4 participants