Bug 2084635

Summary: PipelineRun creation from the GUI for a Pipeline with 2 workspaces hardcode the PVC storageclass
Product: OpenShift Container Platform Reporter: Pablo Rodriguez Guillamon <parodrig>
Component: Dev ConsoleAssignee: Mohammed Saud <msaud>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: high    
Version: 4.9CC: divgupta, jakumar, msaud, nmukherj
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Pipeline start form was always using a hardcoded value (gp2) as the default storageclass. Consequence: The gp2 storageclass was always used, even if it did not exist on the cluster. Fix: Use the default specified storageclass name instead of a hardcoded value. Result: Starting a pipeline with VolumeClaimTemplate uses the correct default storageclass.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:11:30 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:
Bug Depends On:    
Bug Blocks: 2092140    
Attachments:
Description Flags
PipelineYAML none

Description Pablo Rodriguez Guillamon 2022-05-12 14:46:16 UTC
Created attachment 1878965 [details]
PipelineYAML

Description of problem:

The StorageClass assigned to the VolumeClaimTemplates on PipelineRuns created using the GUI pick GP2 storageclass starting from the second workspace.


Version-Release number of selected component (if applicable):
* OpenShift 4.9.25
* OpenShift Pipelines 1.7.0


How reproducible: Always


Steps to Reproduce:
1. Apply the attached YAML to create a Pipeline
~~~
oc new-project bz-pipelinerun-issue
oc apply -f pipeline.yaml -n
~~~
2. Go to  "Developer Console > Pipelines > new-pipeline" and click on "Actions" and select **Start**
3. Select "VolumeClaimTemplate" for all the 4 workspaces.
4. Start the Pipeline
5. After the PipelineRun fails, click on YAML to check its definition

Actual results:

Even if all the workspaces are showing the default SC as the one to create the claim in:

The workspace1 gets assigned your default StorageClass
Workspaces from 2 to 4 get assigned GP2 StorageClass even if that SC does not exist on the cluster.

If you click on "Show VolumeClaimTemplate options" and select the expected StorageClass multiple times, it eventually picks the right one.

Expected results:

The Workspaces should be picking the StorageClass showing on the dropdown by default without human intervention.

GP2 storageclass should not be hardcoded to Workspaces 2+

Additional info:

It has been tested in vSphere with Thin storage and a different environment with Trident storage.

Comment 1 Pablo Rodriguez Guillamon 2022-05-12 14:48:43 UTC
Comment on attachment 1878965 [details]
PipelineYAML

>apiVersion: tekton.dev/v1beta1
>kind: Pipeline
>metadata:
>  name: new-pipeline
>  namespace: bz-pipelinerun-issue
>spec:
>  params: []
>  resources: []
>  workspaces:
>    - name: workspace1
>      optional: false
>    - name: workspace2
>      optional: false
>    - name: workspace3
>      optional: false
>    - name: workspace4
>      optional: false
>  tasks:
>    - name: git-cli
>      taskRef:
>        kind: Task
>        name: git-cli
>  finally: []
>

Comment 2 Pablo Rodriguez Guillamon 2022-05-12 14:48:46 UTC
Comment on attachment 1878965 [details]
PipelineYAML

>apiVersion: tekton.dev/v1beta1
>kind: Pipeline
>metadata:
>  name: new-pipeline
>  namespace: bz-pipelinerun-issue
>spec:
>  params: []
>  resources: []
>  workspaces:
>    - name: workspace1
>      optional: false
>    - name: workspace2
>      optional: false
>    - name: workspace3
>      optional: false
>    - name: workspace4
>      optional: false
>  tasks:
>    - name: git-cli
>      taskRef:
>        kind: Task
>        name: git-cli
>  finally: []
>

Comment 3 Pablo Rodriguez Guillamon 2022-05-12 14:49:31 UTC
Comment on attachment 1878965 [details]
PipelineYAML

>apiVersion: tekton.dev/v1beta1
>kind: Pipeline
>metadata:
>  name: new-pipeline
>  namespace: bz-pipelinerun-issue
>spec:
>  params: []
>  resources: []
>  workspaces:
>    - name: workspace1
>      optional: false
>    - name: workspace2
>      optional: false
>    - name: workspace3
>      optional: false
>    - name: workspace4
>      optional: false
>  tasks:
>    - name: git-cli
>      taskRef:
>        kind: Task
>        name: git-cli
>  finally: []
>

Comment 5 Pablo Rodriguez Guillamon 2022-05-17 10:41:06 UTC
I've reproduced this issue on 4.8 on a cluster that has GP2 as the default storageclass.

I was expecting to get GP2 on all the 4 workspaces but I got GP2 for the first workspace and "Gi" for the rest of them:

~~~

workspaces:
    - name: workspace1
      volumeClaimTemplate:
        metadata:
          creationTimestamp: null
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
          storageClassName: gp2
          volumeMode: Filesystem
        status: {}
    - name: workspace2
      volumeClaimTemplate:
        metadata:
          creationTimestamp: null
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
          storageClassName: Gi
          volumeMode: Filesystem
        status: {}
    - name: workspace3
      volumeClaimTemplate:
        metadata:
          creationTimestamp: null
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
          storageClassName: Gi
          volumeMode: Filesystem
        status: {}
    - name: workspace4
      volumeClaimTemplate:
        metadata:
          creationTimestamp: null
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 1Gi
          storageClassName: Gi
          volumeMode: Filesystem
        status: {}
~~~

Comment 8 Jaivardhan Kumar 2022-06-13 09:22:38 UTC
Verified on 4.11.0-0.nightly-2022-06-06-201913 works, storage class was picked based on default one present on Cluster and user can change it if needed

Comment 10 errata-xmlrpc 2022-08-10 11:11:30 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 (Important: OpenShift Container Platform 4.11.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-2022:5069