File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
kubernetes_platform/python/kfp/kubernetes Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 18
18
from kfp .dsl import PipelineTask
19
19
from kfp .kubernetes import common
20
20
from kfp .kubernetes import kubernetes_executor_config_pb2 as pb
21
-
21
+ from typing import Union
22
+ from kfp .dsl .pipeline_channel import PipelineParameterChannel
22
23
23
24
def use_secret_as_env (
24
25
task : PipelineTask ,
@@ -59,7 +60,7 @@ def use_secret_as_env(
59
60
60
61
def use_secret_as_volume (
61
62
task : PipelineTask ,
62
- secret_name : str ,
63
+ secret_name : Union [ str , PipelineParameterChannel ] ,
63
64
mount_path : str ,
64
65
optional : bool = False ,
65
66
) -> PipelineTask :
@@ -75,7 +76,9 @@ def use_secret_as_volume(
75
76
Returns:
76
77
Task object with updated secret configuration.
77
78
"""
78
-
79
+ # Extract the actual string value if secret_name is a PipelineParameterChannel
80
+ if isinstance (secret_name , PipelineParameterChannel ):
81
+ secret_name = secret_name .name
79
82
msg = common .get_existing_kubernetes_config_as_message (task )
80
83
81
84
secret_as_vol = pb .SecretAsVolume (
You can’t perform that action at this time.
0 commit comments