Skip to content

Commit 2023081

Browse files
committed
misc: address duplicate imports
Signed-off-by: Hidde Beydals <[email protected]>
1 parent a74eb57 commit 2023081

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

internal/controller/ocirepository_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import (
3434
"github.com/google/go-containerregistry/pkg/authn/k8schain"
3535
"github.com/google/go-containerregistry/pkg/name"
3636
gcrv1 "github.com/google/go-containerregistry/pkg/v1"
37-
v1 "github.com/google/go-containerregistry/pkg/v1"
3837
"github.com/google/go-containerregistry/pkg/v1/remote"
3938
corev1 "k8s.io/api/core/v1"
4039
"k8s.io/apimachinery/pkg/runtime"
@@ -578,13 +577,13 @@ func (r *OCIRepositoryReconciler) selectLayer(obj *ociv1.OCIRepository, image gc
578577
func (r *OCIRepositoryReconciler) getRevision(ref name.Reference, options []remote.Option) (string, error) {
579578
switch ref := ref.(type) {
580579
case name.Digest:
581-
digest, err := v1.NewHash(ref.DigestStr())
580+
digest, err := gcrv1.NewHash(ref.DigestStr())
582581
if err != nil {
583582
return "", err
584583
}
585584
return digest.String(), nil
586585
case name.Tag:
587-
var digest v1.Hash
586+
var digest gcrv1.Hash
588587

589588
desc, err := remote.Head(ref, options...)
590589
if err == nil {

internal/controller/ocirepository_controller_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package controller
1919
import (
2020
"crypto/rand"
2121
"crypto/tls"
22-
cryptotls "crypto/tls"
2322
"crypto/x509"
2423
"crypto/x509/pkix"
2524
"encoding/pem"
@@ -830,7 +829,7 @@ func TestOCIRepository_reconcileSource_authStrategy(t *testing.T) {
830829
func makeTransport(insecure bool) http.RoundTripper {
831830
transport := remote.DefaultTransport.(*http.Transport).Clone()
832831
if insecure {
833-
transport.TLSClientConfig = &cryptotls.Config{
832+
transport.TLSClientConfig = &tls.Config{
834833
InsecureSkipVerify: true,
835834
}
836835
}

internal/helm/registry/auth.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"github.com/fluxcd/source-controller/internal/oci"
2727
"github.com/google/go-containerregistry/pkg/authn"
2828
"helm.sh/helm/v3/pkg/registry"
29-
helmreg "helm.sh/helm/v3/pkg/registry"
3029
corev1 "k8s.io/api/core/v1"
3130
)
3231

@@ -143,7 +142,7 @@ func (r stringResource) RegistryStr() string {
143142

144143
// NewLoginOption returns a registry login option for the given HelmRepository.
145144
// If the HelmRepository does not specify a secretRef, a nil login option is returned.
146-
func NewLoginOption(auth authn.Authenticator, keychain authn.Keychain, registryURL string) (helmreg.LoginOption, error) {
145+
func NewLoginOption(auth authn.Authenticator, keychain authn.Keychain, registryURL string) (registry.LoginOption, error) {
147146
if auth != nil {
148147
return AuthAdaptHelper(auth)
149148
}

pkg/azure/blob.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import (
3131
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
3232
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
3333
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
34-
_ "github.com/Azure/azure-sdk-for-go/sdk/azidentity"
3534
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
3635
"github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/bloberror"
3736
corev1 "k8s.io/api/core/v1"

0 commit comments

Comments
 (0)