Bug 1986305 - operand container image is required
Summary: operand container image is required
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node Feature Discovery Operator
Version: 4.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.9.0
Assignee: Carlos Eduardo Arango Gutierrez
QA Contact: Walid A.
URL:
Whiteboard:
Depends On:
Blocks: 1986570
TreeView+ depends on / blocked
 
Reported: 2021-07-27 08:55 UTC by Sebastian Scheinkman
Modified: 2021-10-18 17:19 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1986570 (view as bug list)
Environment:
Last Closed: 2021-10-18 17:19:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-nfd-operator pull 187 0 None open Bug 1986305: drop operand images as required field on CRD 2021-07-27 19:37:05 UTC
Red Hat Product Errata RHBA-2021:3760 0 None None None 2021-10-18 17:19:41 UTC

Description Sebastian Scheinkman 2021-07-27 08:55:51 UTC
Description of problem:
When deploying and upgrading the nfd operator on a disconnected environment there is always a need of manually editing the operand image.

If the user remove the image from the operand section the config is applied on the cluster but the operator will failed to create the daemonset with the following error:

2021-07-26T16:15:50.238Z	ERROR	controller-runtime.manager.controller.nodefeaturediscovery	Reconciler error	{"reconciler group": "nfd.openshift.io", "reconciler kind": "NodeFeatureDiscovery", "name": "nfd-instance", "namespace": "openshift-nfd", "error": "DaemonSet.apps \"nfd-master\" is invalid: spec.template.spec.containers[0].image: Required value"}
github.com/go-logr/zapr.(*zapLogger).Error
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/github.com/go-logr/zapr/zapr.go:132
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:267
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:235
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:198
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155
k8s.io/apimachinery/pkg/util/wait.BackoffUntil
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156
k8s.io/apimachinery/pkg/util/wait.JitterUntil
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133
k8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185
k8s.io/apimachinery/pkg/util/wait.UntilWithContext
	/go/src/github.com/openshift/cluster-nfd-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99


How reproducible:
100%

Steps to Reproduce:
1. deploy nfd operator
2. deploy the nfdConfig CR without image in the operand section


Expected results:
If the image field is empty use the environment variable that exist in the nfd-operator this will use the right image of the operand that was built for the specific bundle version and was mirror from the bundle.

It will also allow switch to new images when the operator is upgraded without the request from the user to check the csv for related images and switch the config.


- name: OPERATOR_NAME
  value: cluster-nfd-operator
- name: NODE_FEATURE_DISCOVERY_IMAGE
  value: registry.redhat.io/openshift4/ose-node-feature-discovery@sha256:5d9be97edd55051934bc9129fed627ef24211e8c1758e52253f64d0eeffadf3b
- name: OPERATOR_CONDITION_NAME
  value: node-feature-discovery-operator.v4.8.
image: registry.redhat.io/openshift4/ose-cluster-nfd-operator@sha256:1d1446af00893668d34452f367914ea2f43ad93a693ee7bf58905208b558ec79

Comment 2 Walid A. 2021-08-11 22:01:46 UTC
Verified on OCP 4.9.0-0.nightly-2021-08-07-175228 on AWS IPI cluster.
NFD nodefeaturediscovery instance was created when the CR was deployed from yaml file with oc apply -f and with the image name removed.

# cat  010_namespace.yml
apiVersion: v1
kind: Namespace
metadata:
  name: openshift-nfd

# oc apply -f 010_namespace.yml

# cat 020_operatorgroup.yml 
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  generateName: openshift-nfd-
  name: openshift-nfd-ci
  namespace: openshift-nfd
spec:
  targetNamespaces:
  - openshift-nfd

# oc apply -f 020_operatorgroup.yml 

# cat 030_operator_sub.yml_qe-app-registry-nfd_channel_set_to_4.9
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: nfd
  namespace: openshift-nfd
spec:
  channel: "4.9"
  installPlanApproval: Automatic
  name: nfd
  source: qe-app-registry
  sourceNamespace: openshift-marketplace

# oc apply -f 030_operator_sub.yml_qe-app-registry-nfd_channel_set_to_4.9

# oc get clusterserviceversion.operators.coreos.com/node-feature-discovery-operator.v4.9.0 -n openshift-nfd -o json | jq -r '.metadata.annotations."alm-examples"' | jq .[0] | jq --arg ns openshift-nfd '.metadata.namespace = $ns' | jq --arg  ns openshift-nfd '.spec.namespace = $ns' > nfd_cr_4.9_080921.json

# cp nfd_cr_4.9_080921.json nfd_cr_4.9_operand_image_removed_080921.json

# edit file to remove the image from: nfd_cr_4.9_operand_image_removed_080921.json

# oc apply -f nfd_cr_4.9_operand_image_removed_080921.json
nodefeaturediscovery.nfd.openshift.io/nfd-instance created

# oc get pods -n openshift-nfd
NAME                                      READY   STATUS    RESTARTS   AGE
nfd-controller-manager-7946d664dd-g94zv   2/2     Running   0          33m
nfd-master-86kmj                          1/1     Running   0          9s
nfd-master-8jxvf                          1/1     Running   0          9s
nfd-master-nltgj                          1/1     Running   0          9s
nfd-worker-28f6z                          1/1     Running   0          9s
nfd-worker-nscqx                          1/1     Running   0          9s
nfd-worker-w5lj8                          1/1     Running   0          9s

# cat nfd_cr_4.9_operand_image_removed_080921.json
{
  "apiVersion": "nfd.openshift.io/v1",
  "kind": "NodeFeatureDiscovery",
  "metadata": {
    "name": "nfd-instance",
    "namespace": "openshift-nfd"
  },
  "spec": {
    "customConfig": {
      "configData": "#    - name: \"more.kernel.features\"\n#      matchOn:\n#      - loadedKMod: [\"example_kmod3\"]\n#    - name: \"more.features.by.nodename\"\n#      value: customValue\n#      matchOn:\n#      - nodename: [\"special-.*-node-.*\"]\n"
    },
    "operand": {
      "imagePullPolicy": "Always",
      "namespace": "openshift-nfd"
    },
    "workerConfig": {
      "configData": "core:\n#  labelWhiteList:\n#  noPublish: false\n  sleepInterval: 60s\n#  sources: [all]\n#  klog:\n#    addDirHeader: false\n#    alsologtostderr: false\n#    logBacktraceAt:\n#    logtostderr: true\n#    skipHeaders: false\n#    stderrthreshold: 2\n#    v: 0\n#    vmodule:\n##   NOTE: the following options are not dynamically run-time configurable\n##         and require a nfd-worker restart to take effect after being changed\n#    logDir:\n#    logFile:\n#    logFileMaxSize: 1800\n#    skipLogHeaders: false\nsources:\n#  cpu:\n#    cpuid:\n##     NOTE: whitelist has priority over blacklist\n#      attributeBlacklist:\n#        - \"BMI1\"\n#        - \"BMI2\"\n#        - \"CLMUL\"\n#        - \"CMOV\"\n#        - \"CX16\"\n#        - \"ERMS\"\n#        - \"F16C\"\n#        - \"HTT\"\n#        - \"LZCNT\"\n#        - \"MMX\"\n#        - \"MMXEXT\"\n#        - \"NX\"\n#        - \"POPCNT\"\n#        - \"RDRAND\"\n#        - \"RDSEED\"\n#        - \"RDTSCP\"\n#        - \"SGX\"\n#        - \"SSE\"\n#        - \"SSE2\"\n#        - \"SSE3\"\n#        - \"SSE4.1\"\n#        - \"SSE4.2\"\n#        - \"SSSE3\"\n#      attributeWhitelist:\n#  kernel:\n#    kconfigFile: \"/path/to/kconfig\"\n#    configOpts:\n#      - \"NO_HZ\"\n#      - \"X86\"\n#      - \"DMI\"\n  pci:\n    deviceClassWhitelist:\n      - \"0200\"\n      - \"03\"\n      - \"12\"\n    deviceLabelFields:\n#      - \"class\"\n      - \"vendor\"\n#      - \"device\"\n#      - \"subsystem_vendor\"\n#      - \"subsystem_device\"\n#  usb:\n#    deviceClassWhitelist:\n#      - \"0e\"\n#      - \"ef\"\n#      - \"fe\"\n#      - \"ff\"\n#    deviceLabelFields:\n#      - \"class\"\n#      - \"vendor\"\n#      - \"device\"\n#  custom:\n#    - name: \"my.kernel.feature\"\n#      matchOn:\n#        - loadedKMod: [\"example_kmod1\", \"example_kmod2\"]\n#    - name: \"my.pci.feature\"\n#      matchOn:\n#        - pciId:\n#            class: [\"0200\"]\n#            vendor: [\"15b3\"]\n#            device: [\"1014\", \"1017\"]\n#        - pciId :\n#            vendor: [\"8086\"]\n#            device: [\"1000\", \"1100\"]\n#    - name: \"my.usb.feature\"\n#      matchOn:\n#        - usbId:\n#          class: [\"ff\"]\n#          vendor: [\"03e7\"]\n#          device: [\"2485\"]\n#        - usbId:\n#          class: [\"fe\"]\n#          vendor: [\"1a6e\"]\n#          device: [\"089a\"]\n#    - name: \"my.combined.feature\"\n#      matchOn:\n#        - pciId:\n#            vendor: [\"15b3\"]\n#            device: [\"1014\", \"1017\"]\n#          loadedKMod : [\"vendor_kmod1\", \"vendor_kmod2\"]\n"
    },
    "namespace": "openshift-nfd"
  }
}

Comment 5 errata-xmlrpc 2021-10-18 17:19:23 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.9 extras update), 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-2021:3760


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