-
Notifications
You must be signed in to change notification settings - Fork 30
chore: Migrate to go.kubebuilder.io/v4 and operator-sdk v1.41.1 #325
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
base: main
Are you sure you want to change the base?
Conversation
176882c to
177bf56
Compare
| | sed -e 's|\(image:[[:space:]]*\).*agent:latest|\1$(AGENT_IMG)|' \ | ||
| | $(OPERATOR_SDK) generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) | ||
| ./hack/patch-bundle.sh | ||
| $(OPERATOR_MANIFEST_TOOLS) pinning pin ./bundle/manifests |
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 is a crucial change, otherwise the relatedImages section is missing in the clusterserviceversion and the promotion to red hat catalogs will fail.
| relatedImages: | ||
| - image: icr.io/instana/instana-agent-operator:0.0.0 | ||
| name: instana-agent-operator | ||
| - image: icr.io/instana/agent:latest | ||
| name: instana-agent |
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 section is no longer evaluated by the operator-sdk.
Instead operator-manifest-tools pinning pin ./bundle/manifests will read for any container image references found somewhere in the clusterserviceversion.yaml and will add them with digest to the relatedImages section.
The operator-sdk cannot be updated to latest, if we are still using go.kubebuilder.io/v3 in our project. I applied the manual migration steps as outlined here: https://book.kubebuilder.io/migration/manually_migration_guide_gov3_to_gov4#update-kustomize-manifests-with-the-changes-made-so-far With these changes, the relatedImages section is rendered correctly again in the olm bundle.
Newer operator-sdk versions will not automatically pin the digests in the ./bundle/manifests/instana-agent-operator.clusterserviceversion.yaml file. This is required in Red Hat certifications. We must run an additional tool call to add those information.
The new operator-manifest-tools will search for all image references automatically and pins them. It will not detect if tag and image name are split, therefore adding an annotation to refer to k8s_sensor and agent images. The relatedImages section seem no longer to be manually maintained in the yaml, therefore removing it. Also, removing the agent image annotation, as the operator-manifest-tools tool will detect the deployed image from the deployment automatically and will introduce duplicated images in the relatedImages section otherwise
177bf56 to
bb66513
Compare
* ci: Fix e2e test image ref to deploy correct image The e2e logic deployed an incorrect image and therefore tested not the right image. * If make e2e fails set step as failure Signed-off-by: nagarajkandoor <[email protected]> --------- Signed-off-by: nagarajkandoor <[email protected]> Co-authored-by: nagarajkandoor <[email protected]>
Why
The operator-sdk cannot be updated to latest, if we are still using go.kubebuilder.io/v3 in our project.
I applied the manual migration steps as outlined here: https://book.kubebuilder.io/migration/manually_migration_guide_gov3_to_gov4#update-kustomize-manifests-with-the-changes-made-so-far
With these changes, the relatedImages section is rendered correctly again in the olm bundle.
What
References
Checklist
Note: Remember to run a helm chart release after the the operator release to make the changes available thru helm.