Bug 1903055 - [OSP] Validation should fail when no any IaaS flavor or type related field are given
Summary: [OSP] Validation should fail when no any IaaS flavor or type related field ar...
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.7
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.8.0
Assignee: Mike Fedosin
QA Contact: Gaoyun Pei
: 1931814 (view as bug list)
Depends On:
Blocks: 1938426
TreeView+ depends on / blocked
Reported: 2020-12-01 08:47 UTC by weiwei jiang
Modified: 2021-07-27 22:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: the installer didn't take into account defaultMachineSet values in the install config during its validation, which caused it to fail. To workaround this the installer didn't validate empty values for some parameters. Consequence: since there was no validation for empty fields, sometimes we saw false positive validation results. Fix: apply default provided values to the install config and start validating empty fields. Result: install config validation is now always correct.
Clone Of:
Last Closed: 2021-07-27 22:34:25 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github openshift installer pull 4695 0 None open Bug 1903055: Set default values to machine pools before validation 2021-02-25 19:08:45 UTC
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 22:34:49 UTC

Description weiwei jiang 2020-12-01 08:47:29 UTC

$ ./openshift-install-4.7 version
./openshift-install-4.7 4.7.0-0.nightly-2020-11-29-133728
built from commit 64ec239bc596635b50dd82485c9932cdf10c861e
release image registry.svc.ci.openshift.org/ocp/release@sha256:d851f13cc12933e303a932ba100ea6737e62d619049e16e9ba830d46f90fd3e3

Platform: OSP

Please specify:
Both IPI and UPI

What happened?

when no flavor or type given in install-config, validation passed:
# install-config.yaml 
- architecture: amd64
  hyperthreading: Enabled
  name: worker
  platform: {}
  replicas: 2
  architecture: amd64
  hyperthreading: Enabled
  name: master
  platform: {}
  replicas: 3
    cloud: upshift
    externalNetwork: provider_net_cci_8
    octaviaSupport: '0'
    region: regionOne
    trunkSupport: '1'

$ ./openshift-install-4.7 create manifests --dir .                                                                                                                                                                                       INFO Credentials loaded from file "/home/wjiang/osp_remover/46123/clouds.yaml"                                                                                                                                                                                                  INFO Consuming Install Config from target directory                                                                                                                                                                                                                             INFO Manifests created in: manifests and openshift      

What did you expect to happen?
Validation should prompt user to give a flavor or type for the cluster

How to reproduce it (as minimally and precisely as possible)?

1. create manifests with install-config.yaml which have no flavor and type fields

Anything else we need to know?
1 when checked the manifests it generated, there are no flavor applied to machine
$ cat openshift/99_openshift-cluster-api_master-machines-0.yaml 
apiVersion: machine.openshift.io/v1beta1
kind: Machine
  creationTimestamp: null
    machine.openshift.io/cluster-api-cluster: wj45ios1019a-b8zsm
    machine.openshift.io/cluster-api-machine-role: master
    machine.openshift.io/cluster-api-machine-type: master
  name: wj45ios1019a-b8zsm-master-0
  namespace: openshift-machine-api
    creationTimestamp: null
      apiVersion: openstackproviderconfig.openshift.io/v1alpha1
      cloudName: openstack
        name: openstack-cloud-credentials
        namespace: openshift-machine-api
      flavor: ""
      image: wj45ios1019a-b8zsm-rhcos
      kind: OpenstackProviderSpec
        creationTimestamp: null
      - filter: {}
        - filter:
            name: wj45ios1019a-b8zsm-nodes
            tags: openshiftClusterID=wj45ios1019a-b8zsm
      - filter: {}
        name: wj45ios1019a-b8zsm-master
      serverGroupName: wj45ios1019a-b8zsm-master
        Name: wj45ios1019a-b8zsm-master
        openshiftClusterID: wj45ios1019a-b8zsm
      - openshiftClusterID=wj45ios1019a-b8zsm
      trunk: true
        name: master-user-data
status: {}

Comment 2 Patrick Dillon 2021-01-27 20:08:58 UTC
> What did you expect to happen?
> Validation should prompt user to give a flavor or type for the cluster

This sounds like it would be a new required field. Generally we don't allow new required fields without an API bump. Instead, you should infer or provide a sane default.

Comment 3 Pierre Prinetti 2021-02-03 16:25:21 UTC
Changing the severity to LOW because IIUC it's not going to impede any legit install.

Comment 5 weiwei jiang 2021-03-15 07:54:11 UTC
Checked with 4.8.0-0.nightly-2021-03-14-134919 and it's fixed.

$ ./openshift-install-4.8 create manifests --dir bz1903055 --log-level debug
DEBUG OpenShift Installer 4.8.0-0.nightly-2021-03-14-134919 
DEBUG Built from commit f6893c869a8ff20bbdc66707643f08ff4f61c7c0 
DEBUG Fetching Master Machines...                  
DEBUG Loading Master Machines...                   
DEBUG   Loading Cluster ID...                      
DEBUG     Loading Install Config...                
DEBUG       Loading SSH Key...                     
DEBUG       Loading Base Domain...                 
DEBUG         Loading Platform...                  
DEBUG       Loading Cluster Name...                
DEBUG         Loading Base Domain...               
DEBUG         Loading Platform...                  
DEBUG       Loading Networking...                  
DEBUG         Loading Platform...                  
DEBUG       Loading Pull Secret...                 
DEBUG       Loading Platform...                    
FATAL failed to fetch Master Machines: failed to load asset "Install Config": [controlPlane.platform.openstack.type: Required value: Flavor name must be provided, compute[0].platform.openstack.type: Required value: Flavor name must be provided]

Comment 6 Mike Fedosin 2021-03-17 16:33:41 UTC
*** Bug 1931814 has been marked as a duplicate of this bug. ***

Comment 10 errata-xmlrpc 2021-07-27 22:34:25 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.8.2 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.


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