Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Adding support for imagePullSecrets - #168

Merged
knative-prow-robot merged 5 commits into
knative:masterfrom
garron:support-for-image-pull-secrets
Sep 16, 2019
Merged

knative-prow-robot merged 5 commits into
knative:masterfrom
garron:support-for-image-pull-secrets

Conversation

@garron

@garron garron commented Sep 13, 2019

Copy link
Copy Markdown
Contributor

Fixes #124

Proposed Changes

  • Adds support for specifying imagePullSecrets for a private registry.
  • The secrets are specified in the same format they would be on a Deployment
  • The secret needs to be created in the knative-serving namespace in order to work

I attempted to minimize duplication in the tests by doing a small amount of refactoring as I was reusing examples.

Release Note

Add support for providing imagePullSecrets when using a private registry for the knative images.

This adds support for specifying imagePullSecrets for a private
registry. The secrets are specified in the same format they would
be on a Deployment and need to exist in the knative-serving namespace
in order to work.
@googlebot googlebot added the cla: yes Author(s) signed a CLA. label Sep 13, 2019

@knative-prow-robot knative-prow-robot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garron: 0 warnings.

Details

In response to this:

Fixes #124

Proposed Changes

  • Adds support for specifying imagePullSecrets for a private registry.
  • The secrets are specified in the same format they would be on a Deployment
  • The secret needs to be created in the knative-serving namespace in order to work

I attempted to minimize duplication in the tests by doing a small amount of refactoring as I was reusing examples.

Release Note

Add support for providing imagePullSecrets when using a private registry for the knative images.

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.

Comment thread pkg/reconciler/knativeserving/common/images.go Outdated
log.Debugf("Adding ImagePullSecrets: %v", registry.ImagePullSecrets)
existingSecrets := deployment.Spec.Template.Spec.ImagePullSecrets
deployment.Spec.Template.Spec.ImagePullSecrets = append(registry.ImagePullSecrets, existingSecrets...)
if len(existingSecrets) > 0 {

@houshengbo houshengbo Sep 16, 2019 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think you need to check the length of the existing secrets, you can directly use:

deployment.Spec.Template.Spec.ImagePullSecrets = append(
deployment.Spec.Template.Spec.ImagePullSecrets, registry.ImagePullSecrets...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated!

Comment thread pkg/reconciler/knativeserving/common/images_test.go
@houshengbo

Copy link
Copy Markdown

/lgtm

@knative-metrics-robot

Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-serving-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/knativeserving/common/images.go 83.1% 84.1% 1.1

@houshengbo

Copy link
Copy Markdown

/approve
/lgtm

@knative-prow-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: garron, houshengbo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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

@knative-prow-robot
knative-prow-robot merged commit bd8e321 into knative:master Sep 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for imagePullSecrets

6 participants