-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: # Context Currently the kubernetes scheduler translate all the env of the role into something like this. ``` - name: FOO value: bar ``` In some cases we may also need env variables of type: ``` - name: FOO valueFrom: fieldRef: fieldPath: bar.path ``` This diff adds the ability to specify env in the role that will be translated to the second option. # Changes - Create constant placeholder to insert in the value of env in roles if we want them to be translated to the second option - If placeholder is present in the value, convert to code below stripping the placeholder ``` V1EnvVar( name=key, value_from=V1EnvVarSource( field_ref=V1ObjectFieldSelector(field_path=value) ), ) ``` if not, translate to ``` V1EnvVar(name=key, value=value) ``` - update tests Differential Revision: D59865500
- Loading branch information
1 parent
7df8ea5
commit 0706acf
Showing
2 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters