operator-sdk
operator-sdk copied to clipboard
Updating label selector breaks olm upgrades
Type of question
Best practices
General operator-related help
Question
What did you do?
We added a new label selector to our bundle. (config/default/kustomization.yaml)
What did you expect to see?
Operator gets replaced.
What did you see instead? Under which circumstances?
Upgrading the operator was broken. https://github.com/jaegertracing/jaeger-operator/issues/1870
The Deployment "jaeger-operator" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"[app.kubernetes.io/name](http://app.kubernetes.io/name)":"jaeger-operator", "name":"jaeger-operator"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
Environment
Operator type:
/language go
Kubernetes cluster type:
$ operator-sdk version
operator-sdk version: "v1.17.0", commit: "704b02a9ba86e85f43edb1b20457859e9eedc6e6", kubernetes version: "1.21", go version: "go1.17.6", GOOS: "linux", GOARCH: "amd64"
$ go version (if language is Go)
go version go1.18 linux/amd64
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.3", GitCommit:"816c97ab8cff8a1c72eccca1026f7820e93e0d25", GitTreeState:"clean", BuildDate:"2022-01-25T21:25:17Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-11-04T09:36:56Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
Additional context
Since the last version of our productized version is based on 1.30, we have removed the label again in 1.35.0. However, this now again leads to update problems on the upstream project going from 1.34.1 to 1.35.0.
What would be the basic procedure if we want to extend the operator with label?