-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow field path env variables (#935)
Summary: Pull Request resolved: #935 # 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 Reviewed By: Sanjay-Ganeshan Differential Revision: D59865500
- Loading branch information
1 parent
6112e03
commit dc8eefd
Showing
2 changed files
with
44 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