operator-sdk: Don't override relatedImages in config CSV.
Bug Report
Looks like https://github.com/operator-framework/operator-sdk/issues/5000 has reappeared after related image discovery features were added. This has caused us to change how we specify relatedImages in our operator https://github.com/openshift/oadp-operator/pull/694
Seems to be sideeffect from related image discovery feature. Not sure which was the first PR for that.
Related PRs: https://github.com/operator-framework/operator-sdk/pull/5567
What did you do?
operatorsdk generate bundle.
What did you expect to see?
relatedImages in config CSV preserved
What did you see instead? Under which circumstances?
relatedImages in config CSV removed from generated bundle
Environment
Operator type:
/language go
$ operator-sdk version
operator-sdk version: “v1.20.0”, commit: “deb3531ae20a5805b7ee30b71f13792b80bd49b1”, kubernetes version: “v1.23”, go version: “go1.18.1”, GOOS: “darwin”, GOARCH: “amd64”
$ go version
(if language is Go)
go version go1.18.1 darwin/amd64
$ kubectl version
Possible Solution
Don’t override but append to existing relatedImages.
Additional context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (7 by maintainers)
Commits related to this issue
- Fix Don't override relatedImages in config CSV. #5763 — committed to kaovilai/operator-sdk by kaovilai 2 years ago
- Fix Don't override relatedImages in config CSV. #5763 — committed to kaovilai/operator-sdk by kaovilai 2 years ago
- Fix Don't override relatedImages in config CSV. #5763 Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> — committed to kaovilai/operator-sdk by kaovilai 2 years ago
- Fix Don't override relatedImages in config CSV. #5763 Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> — committed to kaovilai/operator-sdk by kaovilai 2 years ago
- updated version to 3.24.0 for CS 3.22.0 updated make bundle to properly generate x-kubernetes-preserve-unknown-fields: true field for CRD and add in relatedImages field because of this issue from com... — committed to bitscuit/ibm-cert-manager-operator by bitscuit 2 years ago
- version bump and doc change (#280) * updated version to 3.24.0 for CS 3.22.0 updated make bundle to properly generate x-kubernetes-preserve-unknown-fields: true field for CRD and add in relatedImage... — committed to IBM/ibm-cert-manager-operator by bitscuit 2 years ago
@ryantking - Yeah makes sense to me. I hadn’t considered backcompat issue with the name changing. In all likelihood, there’s nothing that actually depends on that name since I know OLM and mirroring tooling ignore it. But there could be some operator author tooling that uses it.
So I’m plus +1 to that tweak, though I still think it makes sense to issue a warning about the statically defined related images. If we want to be more vague about why you shouldn’t do that, we could just say that specifying static related images is deprecated, that you should start using
RELATED_IMAGE_
envs, and we’ll remove persistence of static related images is OSDK v2.I think we should specifically recommend only the env-based related image detection. If there are
csv.spec.relatedImages
in the base CSV manifest, I think we should:So I think that logic would look like the following when comparing discovered vs base:
static-
orbase-
or something along those lines).I need @tlwu2013 to check my math on item 2, but it seems like you need a RELATED_IMAGE_* environment variable for each other image you expect to use so that when your bundle is built, the pipeline can correctly inject digest-based image references for every image your operator uses.