Skip to content

Commit 56866b3

Browse files
committed
Add warning for ExtraConfigmapsMounts deprecation
Now that test-operator supports ExtraMounts parameter, there is no need for a parameter adding extra configmap mounts. It can be directly done through ExtraMounts, so I think of it as a duplicate code. But it is not a good practice to remove parameters right away, so I am first adding warning for users who might be using extraConfigmapsMounts parameters about its deprecation. Let's remove it after this warning is old enough.
1 parent 574547d commit 56866b3

18 files changed

+208
-24
lines changed

api/bases/test.openstack.org_ansibletests.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,14 @@ spec:
106106
description: Run ansible playbook with -vvvv
107107
type: boolean
108108
extraConfigmapsMounts:
109-
description: Extra configmaps for mounting inside the pod
109+
description: |-
110+
Extra configmaps for mounting inside the pod
111+
WARNING: This parameter will be deprecated!
112+
Please use ExtraMounts parameter instead!
110113
items:
114+
description: |-
115+
WARNING: This parameter will be deprecated!
116+
Please use ExtraMounts parameter instead!
111117
properties:
112118
mountPath:
113119
description: Path within the container at which the volume should
@@ -1383,8 +1389,14 @@ spec:
13831389
description: Run ansible playbook with -vvvv
13841390
type: boolean
13851391
extraConfigmapsMounts:
1386-
description: Extra configmaps for mounting inside the pod
1392+
description: |-
1393+
Extra configmaps for mounting inside the pod
1394+
WARNING: This parameter will be deprecated!
1395+
Please use ExtraMounts parameter instead!
13871396
items:
1397+
description: |-
1398+
WARNING: This parameter will be deprecated!
1399+
Please use ExtraMounts parameter instead!
13881400
properties:
13891401
mountPath:
13901402
description: Path within the container at which the volume

api/bases/test.openstack.org_horizontests.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,14 @@ spec:
9595
This allows the user to debug any potential troubles with `oc rsh`.
9696
type: boolean
9797
extraConfigmapsMounts:
98-
description: Extra configmaps for mounting inside the pod
98+
description: |-
99+
Extra configmaps for mounting inside the pod
100+
WARNING: This parameter will be deprecated!
101+
Please use ExtraMounts parameter instead!
99102
items:
103+
description: |-
104+
WARNING: This parameter will be deprecated!
105+
Please use ExtraMounts parameter instead!
100106
properties:
101107
mountPath:
102108
description: Path within the container at which the volume should

api/bases/test.openstack.org_tempests.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,14 @@ spec:
9696
This allows the user to debug any potential troubles with `oc rsh`.
9797
type: boolean
9898
extraConfigmapsMounts:
99-
description: Extra configmaps for mounting inside the pod
99+
description: |-
100+
Extra configmaps for mounting inside the pod
101+
WARNING: This parameter will be deprecated!
102+
Please use ExtraMounts parameter instead!
100103
items:
104+
description: |-
105+
WARNING: This parameter will be deprecated!
106+
Please use ExtraMounts parameter instead!
101107
properties:
102108
mountPath:
103109
description: Path within the container at which the volume should
@@ -1721,8 +1727,14 @@ spec:
17211727
by the test-operator for tests execution.
17221728
type: string
17231729
extraConfigmapsMounts:
1724-
description: Extra configmaps for mounting inside the pod
1730+
description: |-
1731+
Extra configmaps for mounting inside the pod
1732+
WARNING: This parameter will be deprecated!
1733+
Please use ExtraMounts parameter instead!
17251734
items:
1735+
description: |-
1736+
WARNING: This parameter will be deprecated!
1737+
Please use ExtraMounts parameter instead!
17261738
properties:
17271739
mountPath:
17281740
description: Path within the container at which the volume

api/bases/test.openstack.org_tobikoes.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ spec:
7777
This allows the user to debug any potential troubles with `oc rsh`.
7878
type: boolean
7979
extraConfigmapsMounts:
80-
description: Extra configmaps for mounting inside the pod
80+
description: |-
81+
Extra configmaps for mounting inside the pod
82+
WARNING: This parameter will be deprecated!
83+
Please use ExtraMounts parameter instead!
8184
items:
85+
description: |-
86+
WARNING: This parameter will be deprecated!
87+
Please use ExtraMounts parameter instead!
8288
properties:
8389
mountPath:
8490
description: Path within the container at which the volume should
@@ -1377,8 +1383,14 @@ spec:
13771383
by the test-operator for tests execution.
13781384
type: string
13791385
extraConfigmapsMounts:
1380-
description: Extra configmaps for mounting inside the pod
1386+
description: |-
1387+
Extra configmaps for mounting inside the pod
1388+
WARNING: This parameter will be deprecated!
1389+
Please use ExtraMounts parameter instead!
13811390
items:
1391+
description: |-
1392+
WARNING: This parameter will be deprecated!
1393+
Please use ExtraMounts parameter instead!
13821394
properties:
13831395
mountPath:
13841396
description: Path within the container at which the volume

api/v1beta1/ansibletest_webhook.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ func (r *AnsibleTest) ValidateCreate() (admission.Warnings, error) {
8888
},
8989
)
9090
}
91+
92+
if workflowStep.ExtraConfigmapsMounts != nil {
93+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
94+
"deprecated! Please use ExtraMounts parameter instead!")
95+
}
96+
}
97+
98+
if len(r.Spec.ExtraConfigmapsMounts) > 0 {
99+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
100+
"deprecated! Please use ExtraMounts parameter instead!")
91101
}
92102

93103
if r.Spec.Privileged {

api/v1beta1/common.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import (
2222
corev1 "k8s.io/api/core/v1"
2323
)
2424

25+
// WARNING: This parameter will be deprecated!
26+
// Please use ExtraMounts parameter instead!
2527
type ExtraConfigmapsMounts struct {
2628
// +operator-sdk:csv:customresourcedefinitions:type=spec
2729
// +kubebuilder:validation:Required
@@ -84,6 +86,8 @@ type CommonOptions struct {
8486
// +operator-sdk:csv:customresourcedefinitions:type=spec
8587
// +kubebuilder:validation:Optional
8688
// Extra configmaps for mounting inside the pod
89+
// WARNING: This parameter will be deprecated!
90+
// Please use ExtraMounts parameter instead!
8791
ExtraConfigmapsMounts []ExtraConfigmapsMounts `json:"extraConfigmapsMounts,omitempty"`
8892

8993
// +operator-sdk:csv:customresourcedefinitions:type=spec
@@ -172,6 +176,8 @@ type WorkflowCommonOptions struct {
172176
// +operator-sdk:csv:customresourcedefinitions:type=spec
173177
// +kubebuilder:validation:Optional
174178
// Extra configmaps for mounting inside the pod
179+
// WARNING: This parameter will be deprecated!
180+
// Please use ExtraMounts parameter instead!
175181
ExtraConfigmapsMounts *[]ExtraConfigmapsMounts `json:"extraConfigmapsMounts,omitempty"`
176182

177183
// +kubebuilder:validation:Optional

api/v1beta1/horizontest_webhook.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ func (r *HorizonTest) ValidateCreate() (admission.Warnings, error) {
6363

6464
var allWarnings admission.Warnings
6565

66+
if len(r.Spec.ExtraConfigmapsMounts) > 0 {
67+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
68+
"deprecated! Please use ExtraMounts parameter instead!")
69+
}
70+
6671
if r.Spec.Privileged {
6772
allWarnings = append(allWarnings, fmt.Sprintf(WarnPrivilegedModeOn, "HorizonTest"))
6873
}

api/v1beta1/tempest_webhook.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ func (r *Tempest) ValidateCreate() (admission.Warnings, error) {
129129
},
130130
)
131131
}
132+
133+
if workflowStep.ExtraConfigmapsMounts != nil {
134+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
135+
"deprecated! Please use ExtraMounts parameter instead!")
136+
}
137+
}
138+
139+
if len(r.Spec.ExtraConfigmapsMounts) > 0 {
140+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
141+
"deprecated! Please use ExtraMounts parameter instead!")
132142
}
133143

134144
if r.Spec.Privileged {

api/v1beta1/tobiko_webhook.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ func (r *Tobiko) ValidateCreate() (admission.Warnings, error) {
9696
},
9797
)
9898
}
99+
100+
if workflowStep.ExtraConfigmapsMounts != nil {
101+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
102+
"deprecated! Please use ExtraMounts parameter instead!")
103+
}
104+
}
105+
106+
if len(r.Spec.ExtraConfigmapsMounts) > 0 {
107+
allWarnings = append(allWarnings, "The ExtraConfigmapsMounts parameter will be" +
108+
"deprecated! Please use ExtraMounts parameter instead!")
99109
}
100110

101111
if r.Spec.Privileged {

config/crd/bases/test.openstack.org_ansibletests.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,14 @@ spec:
106106
description: Run ansible playbook with -vvvv
107107
type: boolean
108108
extraConfigmapsMounts:
109-
description: Extra configmaps for mounting inside the pod
109+
description: |-
110+
Extra configmaps for mounting inside the pod
111+
WARNING: This parameter will be deprecated!
112+
Please use ExtraMounts parameter instead!
110113
items:
114+
description: |-
115+
WARNING: This parameter will be deprecated!
116+
Please use ExtraMounts parameter instead!
111117
properties:
112118
mountPath:
113119
description: Path within the container at which the volume should
@@ -1383,8 +1389,14 @@ spec:
13831389
description: Run ansible playbook with -vvvv
13841390
type: boolean
13851391
extraConfigmapsMounts:
1386-
description: Extra configmaps for mounting inside the pod
1392+
description: |-
1393+
Extra configmaps for mounting inside the pod
1394+
WARNING: This parameter will be deprecated!
1395+
Please use ExtraMounts parameter instead!
13871396
items:
1397+
description: |-
1398+
WARNING: This parameter will be deprecated!
1399+
Please use ExtraMounts parameter instead!
13881400
properties:
13891401
mountPath:
13901402
description: Path within the container at which the volume

0 commit comments

Comments
 (0)