Bug 2090873

Summary: HostPathProvisioner deployment creates invalid yaml
Product: Container Native Virtualization (CNV) Reporter: Chandler Wilkerson <cwilkers>
Component: InstallationAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED ERRATA QA Contact: Satyajit Bulage <sbulage>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.10.0CC: cnv-qe-bugs, dbasunag, kmajcher, stirabos
Target Milestone: ---   
Target Release: 4.10.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hco-bundle-registry-container-v4.10.3-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-20 16:01:13 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 Chandler Wilkerson 2022-05-26 18:34:31 UTC
Description of problem:
Using console to create HostPathProvisioner deployment fails on selecting "Create" with:

Error
Fix the following errors:

    Error "Invalid value: "string": spec.storagePools.pvcTemplate.accessModes in body must be of type array: "string"" for field "spec.storagePools.pvcTemplate.accessModes".

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

How reproducible:
Always

Steps to Reproduce:
1. Install OpenShift Virtualization 4.10.0
2. Instantiate OpenShift Virtualization HCO
3. Attempt to instantiate HostPathProvisioner via console

Actual results:

Error with following message and yaml generated:

Error
Fix the following errors:

    Error "Invalid value: "string": spec.storagePools.pvcTemplate.accessModes in body must be of type array: "string"" for field "spec.storagePools.pvcTemplate.accessModes".


---
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1
kind: HostPathProvisioner
metadata:
  name: hostpath-provisioner
spec:
  storagePools:
    - pvcTemplate:
        resources:
          requests:
            storage: 50Gi
        accessModes: ReadWriteOnce
      name: local
      path: /var/hpvolumes
  workload:
    nodeSelector:
      kubernetes.io/os: linux
  imagePullPolicy: IfNotPresent


Expected results:

Above steps should generate the following yaml per error message:

apiVersion: hostpathprovisioner.kubevirt.io/v1beta1
kind: HostPathProvisioner
metadata:
  name: hostpath-provisioner
spec:
  storagePools:
    - pvcTemplate:
        resources:
          requests:
            storage: 50Gi
        accessModes: 
        - ReadWriteOnce
      name: local
      path: /var/hpvolumes
  workload:
    nodeSelector:
      kubernetes.io/os: linux
  imagePullPolicy: IfNotPresent

Additional info:

Comment 1 Simone Tiraboschi 2022-06-06 08:39:15 UTC
https://github.com/kubevirt/hostpath-provisioner-operator/pull/230 should be backported also to branch

Comment 2 Simone Tiraboschi 2022-06-06 08:40:37 UTC
... to branch release-v0.12

Comment 3 Simone Tiraboschi 2022-06-13 14:14:40 UTC
Waiting for the first build for v4.10.3

Comment 4 Satyajit Bulage 2022-07-01 08:43:42 UTC
I am able to see the expected content in the yaml file.
See attached file.

Comment 12 errata-xmlrpc 2022-07-20 16:01:13 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 Virtualization 4.10.3 Images), 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/RHEA-2022:5675