Bug 1978691 - [4.9.0] OPENSHIFT_VERSIONS env var overrides AgentServiceConfig osImages: values
Summary: [4.9.0] OPENSHIFT_VERSIONS env var overrides AgentServiceConfig osImages: values
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: assisted-installer
Version: 4.8
Hardware: x86_64
OS: Linux
high
low
Target Milestone: ---
: 4.9.0
Assignee: David Zager
QA Contact: Chad Crum
URL:
Whiteboard: AI-Team-Platform
Depends On:
Blocks: 1979251
TreeView+ depends on / blocked
 
Reported: 2021-07-02 13:55 UTC by Chad Crum
Modified: 2021-10-18 17:38 UTC (History)
2 users (show)

Fixed In Version: OCP-Metal-v1.0.23.1
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1979251 (view as bug list)
Environment:
Last Closed: 2021-10-18 17:38:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift assisted-service pull 2184 0 None open BUG 1978691: Fix osImages reference passing 2021-07-07 20:31:11 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:38:19 UTC

Internal Links: 1979251

Description Chad Crum 2021-07-02 13:55:50 UTC
Description of problem:
The image values set in AgentServiceConfig osImages: are overridden by OPENSHIFT_VERSIONS env var in Assisted Service pod if set below 4.8. 

I understand this is on purpose, but want to get it noted to ensure it is handled before release (or documented somewhere).


Version-Release number of selected component (if applicable):
-Hub Cluster version: 4.8.0-fc.7
-ACM DS snapshot: 2.3.0-DOWNSTREAM-2021-07-01-08-39-58

How reproducible:


Steps to Reproduce:
1. Deploy hub cluster with ACM 
2. Create AgentServiceConfig with below CRD:
    apiVersion: agent-install.openshift.io/v1beta1
    kind: AgentServiceConfig
    metadata:
      name: agent
    spec:
      databaseStorage:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
      filesystemStorage:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
      osImages:
      - openshiftVersion: "4.6"
        rootFSUrl: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/rhcos-live-rootfs.x86_64.img
        url: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/rhcos-4.6.8-x86_64-live.x86_64.iso
        version: 46.82.202012051820-0
      - openshiftVersion: "4.7"
        rootFSUrl: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.7/4.7.7/rhcos-live-rootfs.x86_64.img
        url: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.7/4.7.13/rhcos-4.7.13-x86_64-live.x86_64.iso
        version: 47.83.202105220305-0
      - openshiftVersion: "4.8"
        rootFSUrl: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-live-rootfs.x86_64.img
        url: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-4.8.0-rc.1-x86_64-live.x86_64.iso
        version: 48.84.202105062123-0

3. Wait for assisted service pod to start up
4. Check OPENSHIFT_VERSIONS env var in assisted service pod and compare with AgentServiceConfig osImages: values
    oc rsh assisted-service-6fc699877-cmtr8 env | grep OPENSHIFT_VERSION | awk -F= '{print $2}' | jq


Actual results:
OPENSHIFT_VERSIONS = 
{
  "4.6": {
    "display_name": "4.6",
    "release_image": null,
    "release_version": null,
    "rhcos_image": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-4.8.0-rc.1-x86_64-live.x86_64.iso",
    "rhcos_rootfs": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-live-rootfs.x86_64.img",
    "rhcos_version": "48.84.202105062123-0",
    "support_level": null
  },
  "4.7": {
    "display_name": "4.7",
    "release_image": null,
    "release_version": null,
    "rhcos_image": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-4.8.0-rc.1-x86_64-live.x86_64.iso",
    "rhcos_rootfs": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-live-rootfs.x86_64.img",
    "rhcos_version": "48.84.202105062123-0",
    "support_level": null
  },
  "4.8": {
    "display_name": "4.8",
    "release_image": null,
    "release_version": null,
    "rhcos_image": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-4.8.0-rc.1-x86_64-live.x86_64.iso",
    "rhcos_rootfs": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.1/rhcos-live-rootfs.x86_64.img",
    "rhcos_version": "48.84.202105062123-0",
    "support_level": null
  }
}


Expected results:
OPENSHIFT_VERSIONS matches what was set in osImages:

Additional info:

Comment 1 Flavio Percoco 2021-07-06 11:41:14 UTC
@ccrum just to be clear, is this meant to be a documentation bug?

Comment 2 Chad Crum 2021-07-07 16:48:07 UTC
If the plan is to keep the images hardcoded to 4.8 and there is no explanation why (log message or other), then yes I would like this to be a doc bug. I can see an end user getting confused when the images they choose are overridden.

Comment 4 Chad Crum 2021-07-13 14:09:03 UTC
I have validated that the changes work on 2.3.0-DOWNSTREAM-2021-07-12-15-34-40: 

[root@sealusa12 auth]# oc rsh assisted-service-549cb88686-jwvhf env | grep OPENSHIFT_VERSIONS | awk -F= '{print $2}' | jq                                                                                           
Defaulted container "assisted-service" out of: assisted-service, postgres                                                                                                                                           
{                                                                                                                                                                                                                   
  "4.6": {                                                                                                                                                                                                          
    "display_name": "4.6",                                                                                                                                                                                          
    "release_image": null,                                                                                                                                                                                          
    "release_version": null,                                                                                                                                                                                        
    "rhcos_image": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-4.8.0-rc.3-x86_64-live.x86_64.iso",                                                               
    "rhcos_rootfs": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-live-rootfs.x86_64.img",                                                                         
    "rhcos_version": "48.84.202107040900-0",                                                                                                                                                                        
    "support_level": null                                                                                                                                                                                           
  },                                                                                                                                                                                                                
  "4.7": {                                                                                                                                                                                                          
    "display_name": "4.7",                                                                                                                                                                                          
    "release_image": null,                                                                                                                                                                                          
    "release_version": null,                                                                                                                                                                                        
    "rhcos_image": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-4.8.0-rc.3-x86_64-live.x86_64.iso",                                                               
    "rhcos_rootfs": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-live-rootfs.x86_64.img",                                                                         
    "rhcos_version": "48.84.202107040900-0",                                                                                                                                                                        
    "support_level": null                                                                                                                                                                                           
  },                                                                                                                                                                                                                
  "4.8": {                                                                                                                                                                                                          
    "display_name": "4.8",                                                                                                                                                                                          
    "release_image": null,                                                                                                                                                                                          
    "release_version": null,                                                                                                                                                                                        
    "rhcos_image": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-4.8.0-rc.3-x86_64-live.x86_64.iso",                                                               
    "rhcos_rootfs": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-live-rootfs.x86_64.img",                                                                         
    "rhcos_version": "48.84.202107040900-0",                                                                                                                                                                        
    "support_level": null                                                                                                                                                                                           
  }                                                                                                                                                                                                                 
}                       

oc get agentserviceconfigs.agent-install.openshift.io  agent -o json | jq '.spec.osImages'
[
  {
    "openshiftVersion": "4.6",
    "rootFSUrl": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/rhcos-live-rootfs.x86_64.img",
    "url": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.6/4.6.8/rhcos-4.6.8-x86_64-live.x86_64.iso",
    "version": "46.82.202012051820-0"
  },
  {
    "openshiftVersion": "4.7",
    "rootFSUrl": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.7/4.7.13/rhcos-live-rootfs.x86_64.img",
    "url": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.7/4.7.13/rhcos-4.7.13-x86_64-live.x86_64.iso",
    "version": "47.83.202105220305-0"
  },
  {
    "openshiftVersion": "4.8",
    "rootFSUrl": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-live-rootfs.x86_64.img",
    "url": "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/pre-release/4.8.0-rc.3/rhcos-4.8.0-rc.3-x86_64-live.x86_64.iso",
    "version": "48.84.202107040900-0"
  }
]

Comment 5 Chad Crum 2021-07-13 14:29:15 UTC
Ignore my previous comment - this is NOT validated and has not been back backported.

Comment 6 Chad Crum 2021-08-05 13:53:34 UTC
@dzager - I don't see that this made it into ACM 2.3 / OCP 4.8 - Should it be targeted for 2.4/4.9 ?

Comment 7 David Zager 2021-08-16 13:47:03 UTC
@ccrum This is targeted for 4.9 and it should be tested with ACM 2.4.

https://bugzilla.redhat.com/show_bug.cgi?id=1979251 depends on this bug to be verified so that https://github.com/openshift/assisted-service/pull/2188 can be merged (to address ACM 2.3).

Comment 8 Chad Crum 2021-08-25 23:09:42 UTC
Verified with latest assisted build.

Comment 12 errata-xmlrpc 2021-10-18 17:38:00 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


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