File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
kubernetes_platform/python/test/unit Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,35 @@ 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
+ pipeline_spec = my_pipeline (platform_spec = True )
161
+ assert json_format .MessageToDict (pipeline_spec ) == {
162
+ 'platforms' : {
163
+ 'kubernetes' : {
164
+ 'deploymentSpec' : {
165
+ 'executors' : {
166
+ 'exec-comp' : {
167
+ 'secretAsVolume' : [{
168
+ 'secretName' : 'my-secret' ,
169
+ 'mountPath' : 'secretpath' ,
170
+ 'optional' : False
171
+ }]
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+
150
179
def test_preserves_secret_as_env (self ):
151
180
# checks that use_secret_as_volume respects previously set secrets as env
152
181
You can’t perform that action at this time.
0 commit comments