File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
kubernetes_platform/python/test/unit Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,34 @@ def my_pipeline():
147
147
}
148
148
}
149
149
150
+ def test_with_secret_name_param (self ):
151
+ @dsl .pipeline
152
+ def my_pipeline (secret_name : str = 'my-secret' ):
153
+ task = comp ()
154
+ kubernetes .use_secret_as_volume (
155
+ task ,
156
+ secret_name = secret_name ,
157
+ mount_path = 'secretpath' ,
158
+ )
159
+
160
+ assert json_format .MessageToDict (my_pipeline .platform_spec ) == {
161
+ 'platforms' : {
162
+ 'kubernetes' : {
163
+ 'deploymentSpec' : {
164
+ 'executors' : {
165
+ 'exec-comp' : {
166
+ 'secretAsVolume' : [{
167
+ 'secretName' : 'secret_name' ,
168
+ 'mountPath' : 'secretpath' ,
169
+ 'optional' : False
170
+ }]
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+
150
178
def test_preserves_secret_as_env (self ):
151
179
# checks that use_secret_as_volume respects previously set secrets as env
152
180
You can’t perform that action at this time.
0 commit comments