Bug 1840220

Summary: [CNV-2.4] node-maintenance-operator failing to create deployment - invalid format of manifest
Product: Container Native Virtualization (CNV) Reporter: Lukas Bednar <lbednar>
Component: SSPAssignee: Michael Moser <mmoser>
Status: CLOSED ERRATA QA Contact: zhe peng <zpeng>
Severity: medium Docs Contact:
Priority: high    
Version: 2.4.0CC: cnv-qe-bugs, ksimon, mmoser, ncredi, oyahud, stirabos, zpeng
Target Milestone: ---   
Target Release: 2.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hco-bundle-registry-container-v2.3.0-254, node-maintenance-operator-container-v2.4.0-21 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-28 19:10:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Bednar 2020-05-26 15:02:17 UTC
Description of problem:

  - lastTransitionTime: "2020-05-26T14:55:17Z"
    lastUpdateTime: "2020-05-26T14:55:17Z"
    message: 'install strategy failed: Deployment.apps "node-maintenance-operator"
      is invalid: spec.template.spec.containers[0].env[0].valueFrom: Invalid value:
      "": may not be specified when `value` is not empty'
    phase: Failed
    reason: InstallComponentFailed
  lastTransitionTime: "2020-05-26T14:55:17Z"
  lastUpdateTime: "2020-05-26T14:55:17Z"
  message: 'install strategy failed: Deployment.apps "node-maintenance-operator" is
    invalid: spec.template.spec.containers[0].env[0].valueFrom: Invalid value: "":
    may not be specified when `value` is not empty'

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


How reproducible: 100


Steps to Reproduce:
1. Deploy CNV
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Simone Tiraboschi 2020-05-26 15:06:00 UTC
This is on node-maintenance operator.

In the deployment we have:
      - name: node-maintenance-operator
        spec:
          replicas: 1
          selector:
            matchLabels:
              name: node-maintenance-operator
          strategy: {}
          template:
            metadata:
              creationTimestamp: null
              labels:
                name: node-maintenance-operator
            spec:
              affinity:
                nodeAffinity:
                  requiredDuringSchedulingIgnoredDuringExecution:
                    nodeSelectorTerms:
                    - matchExpressions:
                      - key: node-role.kubernetes.io/master
                        operator: Exists
              containers:
              - env:
                - name: WATCH_NAMESPACE
                  value: openshift-cnv
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.annotations['olm.targetNamespaces']
                - name: POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: OPERATOR_NAME
                  value: node-maintenance-operator
                image: registry-proxy.engineering.redhat.com/rh-osbs/container-native-virtualization-node-maintenance-operator@sha256:a1e3b968feca5de5e43e8ae086904cc779391385ca6867222a614dd719e448dd
                imagePullPolicy: Always
                name: node-maintenance-operator
                resources: {}
              serviceAccountName: node-maintenance-operator
              tolerations:
              - effect: NoSchedule
                key: node-role.kubernetes.io/master


and the issue is definitively here:
                - name: WATCH_NAMESPACE
                  value: openshift-cnv
                  valueFrom:

Comment 2 Simone Tiraboschi 2020-05-26 15:39:20 UTC
*** Bug 1840214 has been marked as a duplicate of this bug. ***

Comment 7 Michael Moser 2020-05-27 10:14:14 UTC
thanks, looking into it.

Comment 8 Michael Moser 2020-05-27 11:43:01 UTC
Hi,
I submitted PR to fix this bug https://github.com/kubevirt/node-maintenance-operator/pull/82 @ksimone could you please review?

Comment 9 Michael Moser 2020-05-28 03:13:23 UTC
I submitted this change to the master version, that effects version v0.6.0 of the CSV. My question is do  we need to backport this change to previous versions of the CSV as well?

Comment 10 Michael Moser 2020-05-28 03:14:24 UTC
the PR has not been approved yet.

Comment 11 Michael Moser 2020-05-30 18:07:26 UTC
the PR has been merged now. https://github.com/kubevirt/node-maintenance-operator/pull/82

Comment 13 zhe peng 2020-07-09 08:25:36 UTC
verify with build :
$ virtctl version
Server Version: version.Info{GitVersion:"v0.30.3", GitCommit:"bf49699ddf2639f5d40d8cff5db49be632a165bd", GitTreeState:"clean", BuildDate:"2020-07-01T01:28:15Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

CNV can be deployed successfully.
check node-maintenance operator:
$ oc get deployment node-maintenance-operator -n openshift-cnv -o yaml
....
 - env:
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
....
the value is removed. move to verified.

Comment 16 errata-xmlrpc 2020-07-28 19:10:07 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, 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/RHSA-2020:3194