Skip to content

Commit

Permalink
chore: add more tests csi
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzzzzzzz authored and tekton-robot committed Jan 15, 2024
1 parent 8689210 commit 9b73f61
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions pkg/reconciler/pipelinerun/resources/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5287,6 +5287,76 @@ func TestApplyResultsToWorkspaceBindings(t *testing.T) {
},
},
},
{
name: "csi-driver",
trResults: map[string][]v1.TaskRunResult{
"task6": {
{
Name: "driver-name",
Type: v1.ResultsTypeString,
Value: v1.ResultValue{StringVal: "driver-value"},
},
},
},
pr: &v1.PipelineRun{
Spec: v1.PipelineRunSpec{
Workspaces: []v1.WorkspaceBinding{
{
CSI: &corev1.CSIVolumeSource{
Driver: "$(tasks.task6.results.driver-name)",
},
},
},
},
},
expectedPr: &v1.PipelineRun{
Spec: v1.PipelineRunSpec{
Workspaces: []v1.WorkspaceBinding{
{
CSI: &corev1.CSIVolumeSource{
Driver: "driver-value",
},
},
},
},
},
},
{
name: "csi-NodePublishSecretRef-name",
trResults: map[string][]v1.TaskRunResult{
"task6": {
{
Name: "ref-name",
Type: v1.ResultsTypeString,
Value: v1.ResultValue{StringVal: "ref-value"},
},
},
},
pr: &v1.PipelineRun{
Spec: v1.PipelineRunSpec{
Workspaces: []v1.WorkspaceBinding{
{
CSI: &corev1.CSIVolumeSource{
Driver: "driver",
NodePublishSecretRef: &corev1.LocalObjectReference{Name: "$(tasks.task6.results.ref-name)"},
},
},
},
},
},
expectedPr: &v1.PipelineRun{
Spec: v1.PipelineRunSpec{
Workspaces: []v1.WorkspaceBinding{
{
CSI: &corev1.CSIVolumeSource{
Driver: "driver",
NodePublishSecretRef: &corev1.LocalObjectReference{Name: "ref-value"},
},
},
},
},
},
},
{
name: "pvc object-result",
trResults: map[string][]v1.TaskRunResult{
Expand Down

0 comments on commit 9b73f61

Please sign in to comment.