Skip to content

Conversation

@konrad-ohms
Copy link
Contributor

@konrad-ohms konrad-ohms commented Sep 5, 2025

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

  • Backwards compatible?
  • Release notes in public docs updated?
  • unit/e2e test coverage added or updated? n/a

Note: Remember to run a helm chart release after the the operator release to make the changes available thru helm.

@konrad-ohms konrad-ohms requested a review from a team as a code owner September 5, 2025 10:01
@konrad-ohms konrad-ohms changed the title chore: Migrate to go.kubebuilder.io/v4 chore: Migrate to go.kubebuilder.io/v4 and operator-sdk v1.41.1 Sep 9, 2025
| 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
Copy link
Contributor Author

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.

Comment on lines -396 to -400
relatedImages:
- image: icr.io/instana/instana-agent-operator:0.0.0
name: instana-agent-operator
- image: icr.io/instana/agent:latest
name: instana-agent
Copy link
Contributor Author

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
konrad-ohms and others added 2 commits September 22, 2025 11:09
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants