-
Notifications
You must be signed in to change notification settings - Fork 135
Allow field path env variables #935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request was exported from Phabricator. Differential Revision: D59865500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - let's add a comment above the constant value
Summary: Pull Request resolved: pytorch#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
This pull request was exported from Phabricator. Differential Revision: D59865500 |
0706acf
to
1e7dae9
Compare
Summary: Pull Request resolved: pytorch#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
1e7dae9
to
590f829
Compare
This pull request was exported from Phabricator. Differential Revision: D59865500 |
Summary: Pull Request resolved: pytorch#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
This pull request was exported from Phabricator. Differential Revision: D59865500 |
590f829
to
dc8eefd
Compare
Summary:
Context
Currently the kubernetes scheduler translate all the env of the role into something like this.
In some cases we may also need env variables of type:
This diff adds the ability to specify env in the role that will be translated to the second option.
Changes
if not, translate to
Differential Revision: D59865500