-
Notifications
You must be signed in to change notification settings - Fork 263
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
Supporting envFrom
, volumeMount
, serviceAccountName
, and imagePullPolicy
feature
#392
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: igsong The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
@igsong: 5 warnings.
In response to this:
Proposed Changes
To use NOT-YET supported expressions of ksvc, following flags, which can be set in
service create
orservice update
, are added.
- Support
envFrom
expression. By giving the flag--env-from (config-map | secret):CONFIG_MAP_OR_SECRET_NAME
, a config map or secret is embedded usingenvFrom
. To unset, a-
suffix can be used like--env
or--label
.- Support
volumeMount
expression. By giving the flag--volume-mount VOLUME_NAME=(config-map|secret):CONFIG_MAP_OR_SECRET_NAME@/mount/here
, a config map or secret is mounted on the user-container. To unset, a-
suffix can be used like--env
or--label
.- Support
serviceAccountName
expression. By giving the flag--service-account-name=SERVICE_ACCOUNT_NAME
, a user can set a service account for a ksvc.- Support
imagePullPolicy
expression. By giving the flag--image-pull-policy=POLICY
, a user can set a image pull policy for a ksvc. POLICY should be one ofalways
,if-not-present
,never
or-
which can be used for unsetting imagePullPolicy.Release Note
NONE
/lint
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
return err | ||
} | ||
|
||
// UpdateVolumeMount updates the configuration for mounting with config maps or secrets. |
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.
Golint comments: comment on exported function UpdateVolumeMounts should be of the form "UpdateVolumeMounts ...". More info.
return nil | ||
} | ||
|
||
func UpdateImagePullPolicy(template *servingv1alpha1.RevisionTemplateSpec, imagePullPolicy string) error { |
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.
Golint comments: exported function UpdateImagePullPolicy should have comment or be unexported. More info.
@@ -42,6 +51,35 @@ func UpdateEnvVars(template *servingv1alpha1.RevisionTemplateSpec, toUpdate map[ | |||
return nil | |||
} | |||
|
|||
func UpdateEnvFrom(template *servingv1alpha1.RevisionTemplateSpec, toUpdate []string, toRemove []string) error { |
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.
Golint comments: exported function UpdateEnvFrom should have comment or be unexported. More info.
@@ -233,6 +271,40 @@ func UpdateLabels(service *servingv1alpha1.Service, template *servingv1alpha1.Re | |||
return nil | |||
} | |||
|
|||
func UpdateServiceAccountName(template *servingv1alpha1.RevisionTemplateSpec, serviceAccountName string) error { |
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.
Golint comments: exported function UpdateServiceAccountName should have comment or be unexported. More info.
@@ -19,6 +19,23 @@ import ( | |||
"strings" | |||
) | |||
|
|||
func MapAndRemovalListFromArray(arr []string, delimiter string) (map[string]string, []string, error) { |
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.
Golint comments: exported function MapAndRemovalListFromArray should have comment or be unexported. More info.
Hi @igsong. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@googlebot I signed it! |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
Why did this PR get closed/not merged? Why all on the same day it was opened and without discussion? |
I found the subsequent PR, sorry #393 |
Less boilerplate code, more control. Bonuses: * Fixes knative#371.
Proposed Changes
To use NOT-YET supported expressions of ksvc, following flags, which can be set in
service create
orservice update
, are added.envFrom
expression. By giving the flag--env-from (config-map | secret):CONFIG_MAP_OR_SECRET_NAME
, a config map or secret is embedded usingenvFrom
. To unset, a-
suffix can be used like--env
or--label
.volumeMount
expression. By giving the flag--volume-mount VOLUME_NAME=(config-map|secret):CONFIG_MAP_OR_SECRET_NAME@/mount/here
, a config map or secret is mounted on the user-container. To unset, a-
suffix can be used like--env
or--label
.serviceAccountName
expression. By giving the flag--service-account-name=SERVICE_ACCOUNT_NAME
, a user can set a service account for a ksvc.imagePullPolicy
expression. By giving the flag--image-pull-policy=POLICY
, a user can set a image pull policy for a ksvc. POLICY should be one ofalways
,if-not-present
,never
or-
which can be used for unsetting imagePullPolicy.Release Note
/lint