Bug 1860035 - spec.config.nodeSelector on the subscription is not propagated to pods
Summary: spec.config.nodeSelector on the subscription is not propagated to pods
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.6.0
Assignee: Alexander Greene
QA Contact: yhui
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-23 15:25 UTC by Simone Tiraboschi
Modified: 2020-10-27 16:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: OLM exposed the subscription.spec.config.nodeSelector field in the subscription CRD but did not apply nodeSelectors to the deployments defined in the CSV. Consequence: Users could not set nodeSelectors on their CSV deployments. Fix: Update OLM so it will propagate nodeSelector labels defined in the subscription.spec.config.nodeSelector field to deployments in the CSV. Result: The subscription.spec.config.nodeSelector field now works as expected.
Clone Of:
Environment:
Last Closed: 2020-10-27 16:16:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1716 0 None closed Bug 1860035: Fix SubscriptionConfig NodeSelector field 2020-11-26 07:42:01 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:17:06 UTC

Description Simone Tiraboschi 2020-07-23 15:25:07 UTC
Description of problem:
According to:
https://github.com/operator-framework/api/blob/master/pkg/operators/subscription_types.go#L46..L50

I'd expect to be able to define a NodeSelector for my operator at subscription level and get it propagated to my pods.

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. create a subscription with something like:
    spec:
      config:
        nodeSelector:
          kubernetes.io/os: linux

2. check the operator pod for nodeSelector

Actual results:
I'm able to define spec.config.nodeSelector on the subscription (new or editing) but nothing got propagated to my operator

Expected results:
spec.config.nodeSelector got propagated from the subscription to operator pod.


Additional info:

Comment 5 yhui 2020-08-13 09:28:11 UTC
Version:
[root@preserve-olm-env daily-test]# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-0.nightly-2020-08-12-155346   True        False         89m     Cluster version is 4.6.0-0.nightly-2020-08-12-155346
[root@preserve-olm-env daily-test]# oc exec catalog-operator-69976d7cf6-pwxqc -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.16.0
git commit: 63a809b03d27e5e00ec14249d629ecd65e53b7aa


Steps to Reproduce:
1. create a subscription with nodeSelector:
[root@preserve-olm-env daily-test]# cat sub-new.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd-etcdoperator.v0.9.2
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: etcd-update
  source: installed-community-global-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.2
  config:
    nodeSelector:
      kubernetes.io/os: linux
[root@preserve-olm-env daily-test]# oc create -f sub-new.yaml 
subscription.operators.coreos.com/etcd-etcdoperator.v0.9.2 created
[root@preserve-olm-env daily-test]# oc get sub
NAME                       PACKAGE       SOURCE                                 CHANNEL
etcd-etcdoperator.v0.9.2   etcd-update   installed-community-global-operators   alpha

2. check the operator pod for nodeSelector
[root@preserve-olm-env daily-test]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES   PHASE
etcdoperator.v0.9.2   etcd      0.9.2                Succeeded
[root@preserve-olm-env daily-test]# oc get pods
NAME                             READY   STATUS    RESTARTS   AGE
etcd-operator-6d8c556957-7b5hd   3/3     Running   0          10s
[root@preserve-olm-env daily-test]# oc get pods -o yaml
apiVersion: v1
...
    nodeSelector:
      kubernetes.io/os: linux
...

spec.config.nodeSelector got propagated from the subscription to operator pod.
Verify the bug.

Comment 7 errata-xmlrpc 2020-10-27 16:16:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.