Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

igsong
Copy link
Contributor

@igsong igsong commented Aug 28, 2019

Proposed Changes

To use NOT-YET supported expressions of ksvc, following flags, which can be set in service create or service 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 using envFrom. 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 of always, if-not-present, never or - which can be used for unsetting imagePullPolicy.

Release Note

NONE

/lint

@googlebot
Copy link

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 @googlebot I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no Indicates the PR's author has not signed the CLA. label Aug 28, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: igsong
To complete the pull request process, please assign mattmoor
You can assign the PR to them by writing /assign @mattmoor in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a 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 or service 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 using envFrom. 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 of always, 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.
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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) {
Copy link
Contributor

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.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 28, 2019
@knative-prow-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 28, 2019
@igsong
Copy link
Contributor Author

igsong commented Aug 28, 2019

@googlebot I signed it!

@googlebot
Copy link

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.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@igsong igsong closed this Aug 28, 2019
@drnic
Copy link

drnic commented Oct 7, 2019

Why did this PR get closed/not merged? Why all on the same day it was opened and without discussion?

@drnic
Copy link

drnic commented Oct 7, 2019

I found the subsequent PR, sorry #393

coryrc pushed a commit to coryrc/client that referenced this pull request May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: no Indicates the PR's author has not signed the CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants