@@ -13,8 +13,6 @@ import (
1313 "strings"
1414
1515 "github.com/containerd/containerd/archive"
16- "github.com/google/go-containerregistry/pkg/authn/k8schain"
17- gcrkube "github.com/google/go-containerregistry/pkg/authn/kubernetes"
1816 "github.com/google/go-containerregistry/pkg/name"
1917 "github.com/google/go-containerregistry/pkg/v1/remote"
2018 apimacherrors "k8s.io/apimachinery/pkg/util/errors"
@@ -29,8 +27,6 @@ const SourceTypeImage SourceType = "image"
2927type ImageSource struct {
3028 // Ref contains the reference to a container image containing Bundle contents.
3129 Ref string
32- // ImagePullSecretName contains the name of the image pull secret in the namespace that the provisioner is deployed.
33- ImagePullSecretName string
3430 // InsecureSkipTLSVerify indicates that TLS certificate validation should be skipped.
3531 // If this option is specified, the HTTPS protocol will still be used to
3632 // fetch the specified image reference.
@@ -53,7 +49,6 @@ func NewUnrecoverable(err error) *Unrecoverable {
5349
5450type ImageRegistry struct {
5551 BaseCachePath string
56- AuthNamespace string
5752 CertPoolWatcher * httputil.CertPoolWatcher
5853}
5954
@@ -72,24 +67,6 @@ func (i *ImageRegistry) Unpack(ctx context.Context, bundle *BundleSource) (*Resu
7267 return nil , NewUnrecoverable (fmt .Errorf ("error parsing image reference: %w" , err ))
7368 }
7469
75- remoteOpts := []remote.Option {}
76- if bundle .Image .ImagePullSecretName != "" {
77- chainOpts := k8schain.Options {
78- ImagePullSecrets : []string {bundle .Image .ImagePullSecretName },
79- Namespace : i .AuthNamespace ,
80- // TODO: Do we want to use any secrets that are included in the rukpak service account?
81- // If so, we will need to add the permission to get service accounts and specify
82- // the rukpak service account name here.
83- ServiceAccountName : gcrkube .NoServiceAccount ,
84- }
85- authChain , err := k8schain .NewInCluster (ctx , chainOpts )
86- if err != nil {
87- return nil , fmt .Errorf ("error getting auth keychain: %w" , err )
88- }
89-
90- remoteOpts = append (remoteOpts , remote .WithAuthFromKeychain (authChain ))
91- }
92-
9370 transport := remote .DefaultTransport .(* http.Transport ).Clone ()
9471 if transport .TLSClientConfig == nil {
9572 transport .TLSClientConfig = & tls.Config {
@@ -107,6 +84,8 @@ func (i *ImageRegistry) Unpack(ctx context.Context, bundle *BundleSource) (*Resu
10784 }
10885 transport .TLSClientConfig .RootCAs = pool
10986 }
87+
88+ remoteOpts := []remote.Option {}
11089 remoteOpts = append (remoteOpts , remote .WithTransport (transport ))
11190
11291 digest , isDigest := imgRef .(name.Digest )
@@ -175,7 +154,6 @@ func unpackedResult(fsys fs.FS, bundle *BundleSource, ref string) *Result {
175154 Type : SourceTypeImage ,
176155 Image : & ImageSource {
177156 Ref : ref ,
178- ImagePullSecretName : bundle .Image .ImagePullSecretName ,
179157 InsecureSkipTLSVerify : bundle .Image .InsecureSkipTLSVerify ,
180158 },
181159 },
0 commit comments