Bug 1998207

Summary: Helm upgrade on OpenShift 4.9 failing with schema errors
Product: OpenShift Container Platform Reporter: Rohit Rai <rorai>
Component: Dev ConsoleAssignee: Rohit Rai <rorai>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.9CC: aos-bugs, nmukherj
Target Milestone: ---   
Target Release: 4.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-18 17:49:21 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:

Description Rohit Rai 2021-08-26 15:19:49 UTC
Description of problem:
In 4.8 when we upgrade a helm release without changing the version we get back the values file that was sent during install. Then we could change a parameter like replicas and send the update. However with latest version of 4.9 I see a problem while getting back the values file installed. In addition to the initial values sent during install I get a new section we empty objects. For example:
I sent this env vars:
env: 
  - name: ARTIFACT_DIR
    value: microprofile-config/target
But then get back these:
env: 
    - valueFrom: 
        configMapKeyRef: {}
        fieldRef: {}
        resourceFieldRef: {}
        secretKeyRef: {}
      name: ARTIFACT_DIR
The error I get is this:
Failed to upgrade helm release: values don't meet the specifications of the schema(s) in the following chart(s):
wildfly: 
- build.env.0.valueFrom.fieldRef: fieldPath is required
- build.env.0.valueFrom.resourceFieldRef: resource is required
- build.env.0.valueFrom.secretKeyRef: key is required
- build.env.0.valueFrom.configMapKeyRef: key is required
- build.env.1.valueFrom.fieldRef: fieldPath is required
- build.env.1.valueFrom.resourceFieldRef: resource is required
- build.env.1.valueFrom.secretKeyRef: key is required
- build.env.1.valueFrom.configMapKeyRef: key is required
- build.env.2.valueFrom.fieldRef: fieldPath is required
- build.env.2.valueFrom.resourceFieldRef: resource is required
- build.env.2.valueFrom.secretKeyRef: key is required
- build.env.2.valueFrom.configMapKeyRef: key is required
- deploy.env.0.valueFrom.configMapKeyRef: key is required
- deploy.env.0.valueFrom.fieldRef: fieldPath is required
- deploy.env.0.valueFrom.resourceFieldRef: resource is required
- deploy.env.0.valueFrom.secretKeyRef: key is required
Prerequisites (if any, like setup, operators/versions):
Steps to Reproduce
Install wildfly chart using values file below
Upgrade the release and change replicas from 2 to 1
Values File:
build: 
  uri: https://github.com/wildfly/quickstart.git
  ref: 23.0.0.Final
  mode: bootable-jar
  env: 
  - name: ARTIFACT_DIR
    value: microprofile-config/target
  - name: MAVEN_ARGS_APPEND
    # Use the bootable-jar-openshift profile to ensure that the application
    # can be deployed on OpenShift but disable JKube as the image will be 
    # built and deployed by this chart.
    value: -am -pl microprofile-config -Pbootable-jar-openshift -Djkube.skip=true
  - name: MAVEN_OPTS
    value: '-XX:MetaspaceSize=251m -XX:MaxMetaspaceSize=256m'
deploy: 
  replicas: 2
  env: 
  - name: CONFIG_PROP
    value: Hello from OpenShift
Actual results:
Error as indicated in description
Expected results:
Deployment replicas updated
Reproducibility (Always/Intermittent/Only Once):
Always
Build Details:
4.9.0-0.nightly-2021-08-02-044755
Additional info:
To workaround user can remove all the valueFrom section through out the values file and it will work like in 4.8.

Comment 5 spathak@redhat.com 2021-09-06 13:07:32 UTC
Verified on build version: 4.9.0-0.nightly-2021-09-05-204238
Browser: Google Chrome 89

Comment 8 errata-xmlrpc 2021-10-18 17:49:21 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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and security 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/RHSA-2021:3759