Skip to content

Commit

Permalink
Merge pull request #170 from pPrecel/remove-type-check
Browse files Browse the repository at this point in the history
Remove checking external registry secret type
  • Loading branch information
kwiatekus authored Jul 25, 2023
2 parents 4122afa + 92984be commit 8255b54
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions internal/registry/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package registry

import (
"context"

corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand All @@ -25,9 +26,6 @@ func GetServerlessExternalRegistrySecret(ctx context.Context, c client.Client, n
return nil, client.IgnoreNotFound(err)
}

if secret.Type != corev1.SecretTypeDockerConfigJson {
return nil, nil
}
if val, ok := secret.GetLabels()[ServerlessExternalRegistryLabelRemoteRegistryKey]; !ok || val != ServerlessExternalRegistryLabelRemoteRegistryVal {
return nil, nil
}
Expand Down
8 changes: 0 additions & 8 deletions internal/registry/secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ func Test_GetExternalRegistrySecret(t *testing.T) {
return secret
}(),
},
{
name: "bad type",
secretInEnvironment: func() *corev1.Secret {
secret := testRegistryFilledSecret.DeepCopy()
secret.Type = corev1.SecretTypeBasicAuth
return secret
}(),
},
{
name: "without label remote-registry",
secretInEnvironment: func() *corev1.Secret {
Expand Down

0 comments on commit 8255b54

Please sign in to comment.