-
Bug
-
Resolution: Not a Bug
-
Undefined
-
None
-
4.19
-
None
-
Quality / Stability / Reliability
-
False
-
-
None
-
Important
-
None
-
None
-
None
-
Rejected
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Description of problem
OLM does not propagate the target.workload.openshift.io/management annotation specified in Subscription.spec.config.annotations to pods.
Version-Release number of selected component (if applicable)
% oc version Client Version: 4.18.8 Kustomize Version: v5.4.2 Server Version: 4.19.0-0.ci.test-2025-04-08-214738-ci-ln-clhrhvt-latest Kubernetes Version: v1.32.3-dirty
How reproducible
100%.
Steps to Reproduce
1. Create a subscription.
oc -n openshift-operators create -f - <<EOF apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: servicemeshoperator3 namespace: openshift-operators spec: channel: stable installPlanApproval: Automatic name: servicemeshoperator3 source: redhat-operators sourceNamespace: openshift-marketplace EOF
2. Add the foo annotation.
oc -n openshift-operators patch subscriptions/servicemeshoperator3 --type=merge --patch='{"spec":{"config":{"annotations":{"foo":"bar"}}}}'
3. Verify that the foo annotation is set on the deployment and pod.
oc -n openshift-operators get deployments/servicemesh-operator3 -o yaml | grep -e foo oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o yaml | grep -e foo
4. Add the target.workload.openshift.io/management annotation.
oc -n openshift-operators patch subscriptions/servicemeshoperator3 --type=merge --patch='{"spec":{"config":{"annotations":{"target.workload.openshift.io/management":"{\"effect\": \"PreferredDuringScheduling\"}"}}}}'
5. Verify that the annotation is set on the deployment and pod.
oc -n openshift-operators get deployments/servicemesh-operator3 -o yaml | grep -e 'target\.workload' oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o yaml | grep -e 'target\.workload'
6. Add the baz annotation.
oc -n openshift-operators patch subscriptions/servicemeshoperator3 --type=merge --patch='{"spec":{"config":{"annotations":{"baz":"fooby"}}}}'
7. Verify that the annotation is set on the deployment and pod.
oc -n openshift-operators get deployments/servicemesh-operator3 -o yaml | grep -e baz oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o yaml | grep -e baz
Actual results
Steps 2 and 3 work fine:
% oc -n openshift-operators patch subscriptions/servicemeshoperator3 --type=merge --patch='{"spec":{"config":{"annotations":{"foo":"bar"}}}}'
subscription.operators.coreos.com/servicemeshoperator3 patched
% oc -n openshift-operators get deployments/servicemesh-operator3 -o yaml | grep -e foo
foo: bar
foo: bar
% oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o yaml | grep -e foo
foo: bar
Steps 4 and 5 show that the annotation gets added to the deployment but does not get added to the pod:
% oc -n openshift-operators patch subscriptions/servicemeshoperator3 --type=merge --patch='{"spec":{"config":{"annotations":{"target.workload.openshift.io/management":"{\"effect\": \"PreferredDuringScheduling\"}"}}}}'
subscription.operators.coreos.com/servicemeshoperator3 patched
% oc -n openshift-operators get deployments/servicemesh-operator3 -o yaml | grep -e 'target\.workload'
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
% oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o yaml | grep -e 'target\.workload'
zsh: done oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o |
zsh: exit 1 grep -e 'target\.workload'
Steps 6 and 7 subsequently work fine:
% oc -n openshift-operators patch subscriptions/servicemeshoperator3 --type=merge --patch='{"spec":{"config":{"annotations":{"baz":"fooby"}}}}'
subscription.operators.coreos.com/servicemeshoperator3 patched
% oc -n openshift-operators get deployments/servicemesh-operator3 -o yaml | grep -e baz
baz: fooby
baz: fooby
% oc -n openshift-operators get pods -l control-plane=servicemesh-operator3 -o yaml | grep -e baz
baz: fooby
Expected results
The target.workload.openshift.io/management annotation should be added to the pod by Step 4 and should be observable in Step 5.
Additional info
It is worth noting that the annotation value has double-quotes. Perhaps these are causing an issue.