-
Notifications
You must be signed in to change notification settings - Fork 57
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
Move to operator sdk version 1.24.0 #729
Conversation
Operator SDK related version upgrade change as per documentation here are made in series. Updated gomega in mod, which indirectly upgrades the dependent x/net to 0.7.0 (and other indirect dependents). Changes to test are due to better error reporting, which as a result failed the tests that were updated. There is one pending test failure, where a VRG is left behind and hence the API server does not stop, which will be fixed in a subsequent commit. |
This is pretty big single commit pr. Can we split the work to smaller commits or multiple prs |
ef6bf41
to
7a95350
Compare
Posted multiple commits... |
Most of the above are now in commit messages, but note that |
Much nicer! The first commits updating the version looks trivial and Regarding gomega - if I understand this correctly, we update it for If we want to ensure that we have safe version of /x/net, why not make
I don't understand the problem - the test failure are result of upgaraing I think it would be useful to merge what we can merge now from this PR, |
I would like to merge this as a batch and not in parts. Having moved the SDK version from somewhere around 1.11 till here and picking changes that are intermediate, even though bisect-able, is preferred that we merge this in one go.
Yes it can,
We do not use this package directly, it comes in as a dependency as an indirect package, so adding it directly does not serve the purpose, for similar reasons as above (i.e if we stop using say gomega, there would be no reason to add this to the module, although quite a few packages that we depend on also depend on /x/net).
Upgrade of gomega now ends up returning status errors and compares them more correctly, causing test failures, requiring changes to this file If you run the change in the commit without those changes the error reported by the tests are visible.
The changes are incomplete only from the perspective of why KUBEBUILDER_ASSETS is an empty string when run on a fresh setup, the "other" issue due to an existing issue in the VRG tests that was not considered a failure till now, but is from here on, which hence needs a fix. I will fix these subsequently and update this PR for a merge, not spending time splitting this up. |
9309acb
to
76f824e
Compare
KUBEBUILDER_ASSETS issue in Makefile is fixed by splitting up the Makefile targets to envtest and setup-envtest, unsure why this works though. envtests failure to shutdown the instance is addressed based on All changes are updated and ready for review/merge as appropriate. |
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 | |||
kind: CustomResourceDefinition | |||
metadata: | |||
annotations: | |||
controller-gen.kubebuilder.io/version: v0.9.0 | |||
controller-gen.kubebuilder.io/version: v0.9.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? the commit message explains only about using
gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I did 2 things in one commit, this updates controller-gen version as per this, causing the CRD changes that are auto generated when running make generate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, would be nice to mention this in the commit message.
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 | |||
kind: CustomResourceDefinition | |||
metadata: | |||
annotations: | |||
controller-gen.kubebuilder.io/version: v0.9.0 | |||
controller-gen.kubebuilder.io/version: v0.9.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we can eliminate the duplication by seting this tag in the makefile and updating
the config crds sing kustomization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are auto generated during make generate
, so not changing it to kustomize as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It the files are auto generated, maybe they should not be part of git, and generated
when running make? I don't suggest to do this right now.
@@ -113,6 +113,7 @@ spec: | |||
description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' | |||
type: string | |||
type: object | |||
x-kubernetes-map-type: atomic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -38,7 +38,7 @@ IMAGE_NAME ?= ramen | |||
IMAGE_TAG ?= latest | |||
PLATFORM ?= k8s | |||
IMAGE_TAG_BASE = $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME) | |||
RBAC_PROXY_IMG ?= "gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0" | |||
RBAC_PROXY_IMG ?= "gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really work? we have kustomization replacing the version to 0.13.0 later,
which is not upadted if you use antoher RBAC_PROXY_IMG value at build time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting and changing things in the kustomize is to keep changed to committed sources to a minimum when deploying (which is where this image is used). IOW, this allows someone to use a different image, and when deployed would change that is in the deployment manifest via kustomize, if not changed then those manifests remain as is and not report any diffs when doing git diff
etc.
Or, I am missing the question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you change this in the makefile, some autogenerated files are updated automatically
or you need to do the same change in multiple files (like we see in this commit)?
@@ -338,7 +338,7 @@ ifeq (,$(shell which opm 2>/dev/null)) | |||
set -e ;\ | |||
mkdir -p $(dir $(OPM)) ;\ | |||
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \ | |||
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.15.1/$${OS}-$${ARCH}-opm ;\ | |||
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.2/$${OS}-$${ARCH}-opm ;\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nicer to extract the tag to a separate variable later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, this and other version strings within various tool downloads/use in the Makefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do this later, maybe open an isue for this? this looks like a good first change.
@@ -21,6 +21,8 @@ spec: | |||
metadata: | |||
labels: | |||
control-plane: controller-manager | |||
annotations: | |||
kubectl.kubernetes.io/default-container: manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again not clear why this is needed, and the link points to another uhelpful link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a notion of a default container, which is useful when certain commands are run that need a container to be specified to omit the same (for example kubectl logs
comes to mind). Again, a suggested practice as per the SDK, which we adopt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure it makes sense, just not explained in the commit message.
@nirs some of the changes are easier to follow if you run through a sample operator build exercise using operator-sdk. What I typically do is have a fresh sample created from the version we are moving to, to look at the changes/auto-generated files etc. and pull back changes to our code as per the upgrade documentation. For example the envtest KUBEBUILDER_ASSETTS or the CRD annotations are explained away more easily. |
ref: https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.22.0/#for-go-gov3-gov2-ansible-ansiblev1-helm-helmv1-and-helm-hybrid-hybridhelmv1-alpha-language-based-operators---bump-opm-version-from-v1191-to-v1230-more-infohttpsgithubcomoperator-frameworkoperator-registryreleases Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Ref: https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.24.0/ Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Ref: https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.17.0/#add-resource-requests-and-limits-to-kube-rbac-proxy Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Ref: https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.16.0/#add-annotation-to-specify-the-default-container Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Change as per operator-sdk current practices, - Exact change as per SDK upgrade process is not known, but has changed since 1.8.0 Also update envtest to cancel the controller context before shutdown Change triggered due to investigating: https://sdk.operatorframework.io/docs/upgrading-sdk-version/v1.14.0/#upgrade-k8s-versions-to-use-122-golangv3 Signed-off-by: Shyamsundar Ranganathan <[email protected]>
To address indirect module dependency for, - golang.org/x/net - golang.org/x/sys - golang.org/x/term - golang.org/x/text Signed-off-by: Shyamsundar Ranganathan <[email protected]>
Sounds like we need a maintainer.md document explaning this process for the next upgrade. |
@nirs Can we merge this now? |
Sure, lets merge. |
Including update to gomega for golang.org/x/net
dependency update