-
Notifications
You must be signed in to change notification settings - Fork 435
feat: Backport v1beta1 support to 4.11 #2386
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
Conversation
Adds code to convert from v1alpha1 to v1beta1 Updates code to use the new version
…onditionalUpdates So that folks driving a HostedCluster have a way to steer their update-recommendation engine. The spec controls flow into external systems to HostedCluster. HostedCluster passes them along to HostedControlPlane. HostedControlPlane passes them along to the hosted ClusterVersion resource. And then the status data flows back up from ClusterVersion to HostedControlPlane to HostedCluster for folks making update decisions. An alternative approach to managing hosted-cluster updates would be: * Teaching the cluster-version operator to be HyperShift aware, with a separate kubeconfig for the management- and hosted-cluster control planes. * Asking the CVO to automatically update whenever the update service recommeneded. * Feeding admin update policy into the update service. But I haven't been able to talk folks into that yet, so this commit is piping the relevant data up from ClusterVersion to HostedCluster, and it can be shipped on from there to whichever actor makes update decisions. The lint:ignore comment avoids Staticcheck complaints [1] like [2]: cd ./hack/tools; GO111MODULE=on GOFLAGS=-mod=vendor go build -tags=tools -o bin/staticcheck honnef.co/go/tools/cmd/staticcheck /go/src/github.com/openshift/hypershift/hack/tools/bin/staticcheck \ ./control-plane-operator/... \ ./hypershift-operator/controllers/... \ ./ignition-server/... \ ./cmd/... \ ./support/certs/... \ ./support/releaseinfo/... \ ./support/upsert/... \ ./konnectivity-socks5-proxy/... \ ./contrib/... \ ./availability-prober/... control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:102:3: hcp.Status.Version is deprecated: Use versionStatus.desired.version instead. +kubebuilder:validation:Optional (SA1019) control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:103:3: hcp.Status.ReleaseImage is deprecated: Use versionStatus.desired.image instead. +optional (SA1019) [1]: https://staticcheck.io/docs/configuration/#line-based-linter-directives [2]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_hypershift/1954/pull-ci-openshift-hypershift-main-verify/1612859041380306944#1:build-log.txt%3A280
…lUpdates
I'd recently added these to v1beta1, but it lead to TestFuzzyConversion failures like [1]:
--- FAIL: TestFuzzyConversion (17.55s)
--- FAIL: TestFuzzyConversion/for_HostedCluster (13.82s)
--- FAIL: TestFuzzyConversion/for_HostedCluster/hub-spoke-hub (0.06s)
fuzz.go:122:
&v1beta1.HostedCluster{
TypeMeta: {},
ObjectMeta: {Name: "實ū", GenerateName: "C", Namespace: "桵ǯƢƋIʦƯ揦Ŭõ", SelfLink: "餹擧ijƊ6ȓŰ蓁<码竆唥鎾It¬O僸戸", ...},
Spec: v1beta1.HostedClusterSpec{
Release: {Image: "Ĉy篽Õ"},
ClusterID: "ȹR>迨Ǣ軃鄖5!:鏨ĭkīRU鮎",
- Channel: "x荓!*Tt缽s览vɦrŸƻț罘`",
+ Channel: "",
...
The fuzzy-conversion injection seems to only be defined for v1alpha1:
$ git grep 'for HostedCluster' | grep _test.go
api/v1alpha1/zz_conversion_test.go: t.Run("for HostedCluster", conversiontest.FuzzTestFunc(conversiontest.FuzzTestFuncInput{
From Cesar:
Just make the same changes you made to the v1beta1 API to the
v1alpha1 API. For now, to simplify conversion, we're keeping
v1alpha1 as a superset of v1beta1 (it's essentially v1beta1 +
several deprecated fields)
So this commit catches v1alpha1 up with my new v1beta1 properties.
[1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_hypershift/1954/pull-ci-openshift-hypershift-main-unit/1603176003130101760
Use v1beta1 as the documented API documentation instead of v1alpha1 which is deprecated
- test(api): Add tracer stmts for HC conversion - test(api): Fix deprecated API conversion - test(api): Fix deprecated API conversion v2 - Revert "test(api): Fix deprecated API conversion v2" - This reverts commit 8a429ba. - test(api): Fix deprecated API conversion v3 - Revert "test(api): Add tracer stmts for HC conversion" - This reverts commit 95e9e9a. - chore: Clean up - chore: Address review feedback
|
@a-dsouza: No Bugzilla bug is referenced in the title of this pull request. DetailsIn response to this:
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. |
|
/retest |
|
@a-dsouza: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-dsouza, sjenning The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
What this PR does / why we need it: Backporting the following v1beta1 support PRs for v4.11 control planes:
This is part of work preparing for the eventual deprecation of v1alpha1.
Checklist