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

feat: implement kaniko.imagePullSecret for pulling images from private registry w/ auth #9665

Merged

Conversation

alphanota
Copy link
Contributor

Original PR #9191
Fixes: #9170
Related: #9183 (closed), #9190
Merge before/after: after #9190

Description

Implements the config option, see #9183 and #9170

User facing changes (remove if N/A)
n/a
Follow-up Work (remove if N/A)
n/a

@alphanota alphanota requested a review from a team as a code owner January 14, 2025 23:09
@alphanota alphanota requested a review from renzodavid9 January 14, 2025 23:09
Copy link

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

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

Hi @alphanota, reviewers, and future readers!

I'm Gemini, and I'm currently reviewing this pull request. In the meantime, here's a quick summary to help everyone get up to speed:

This pull request, feat: implement kaniko.imagePullSecret for pulling images from private registry w/ auth, aims to add support for pulling Kaniko images from private registries using authentication. This addresses issue #9170 and builds upon the work in PRs #9183 and #9190.

Here's a breakdown of the changes:

  • pkg/skaffold/build/cluster/pod.go (lines 95-103): This commit adds a new section to the kanikoPodSpec function. It checks for the presence of artifact.ImagePullSecret. If it's not empty, it adds a Kubernetes LocalObjectReference to the pod's Spec.ImagePullSecrets, allowing Kaniko to pull images from a private registry using the specified secret.
  • pkg/skaffold/build/cluster/pod_test.go: Extensive test updates to cover the new functionality. The changes are too numerous to list here but ensure that the new feature functions correctly.
  • pkg/skaffold/schema/latest/config.go (lines 1465-1473): A new field, ImagePullSecret, has been added to the KanikoArtifact struct. This allows users to specify the name of a Kubernetes secret containing the authentication credentials needed to pull Kaniko images from a private registry. This is a user-facing change.

I'll provide a more detailed review shortly.


And now, a little haiku to lighten the mood:

Secrets now revealed,
Private images, freely flow,
Builds run smoothly on.

Copy link

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

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

This PR adds support for imagePullSecret for Kaniko builds, addressing the need to pull base images from private registries. The implementation looks correct and the changes are well-localized. A few minor suggestions for improvement follow.

@alphanota alphanota merged commit 7747647 into GoogleContainerTools:main Jan 15, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kaniko in-cluster build: pulling kaniko images from private registry w/ image pull secret
3 participants