Skip to content

Commit

Permalink
appease checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dprotaso committed Apr 14, 2022
1 parent 6f05eeb commit 589fbd9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions pkg/authn/authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type AuthConfig struct {
// JSON unmarshalling since AuthConfig methods are not inherited
type authConfig AuthConfig

// UnmarshalJSON implements json.Unmarshaler
func (a *AuthConfig) UnmarshalJSON(data []byte) error {
var shadow authConfig
err := json.Unmarshal(data, &shadow)
Expand All @@ -68,9 +69,9 @@ func (a *AuthConfig) UnmarshalJSON(data []byte) error {
return err
}

// MarshalJSON implements json.Marshaler
func (a AuthConfig) MarshalJSON() ([]byte, error) {
var shadow authConfig
shadow = (authConfig)(a)
shadow := (authConfig)(a)
shadow.Auth = encodeDockerConfigFieldAuth(shadow.Username, shadow.Password)
return json.Marshal(shadow)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/authn/kubernetes/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func NewInCluster(ctx context.Context, opt Options) (authn.Keychain, error) {
return New(ctx, client, opt)
}

type dockerConfigJson struct {
type dockerConfigJSON struct {
Auths map[string]authn.AuthConfig
}

Expand All @@ -115,7 +115,7 @@ func NewFromPullSecrets(ctx context.Context, secrets []corev1.Secret) (authn.Key
creds: make(map[string][]authn.AuthConfig),
}

var cfg dockerConfigJson
var cfg dockerConfigJSON

// From: https://github.com/kubernetes/kubernetes/blob/0dcafb1f37ee522be3c045753623138e5b907001/pkg/credentialprovider/keyring.go
for _, secret := range secrets {
Expand Down
2 changes: 1 addition & 1 deletion pkg/authn/kubernetes/keychain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var dockerConfigJSONSecretType = secretType{
name: corev1.SecretTypeDockerConfigJson,
key: corev1.DockerConfigJsonKey,
marshal: func(t *testing.T, target string, auth authn.AuthConfig) []byte {
return toJSON(t, dockerConfigJson{
return toJSON(t, dockerConfigJSON{
Auths: map[string]authn.AuthConfig{target: auth},
})
},
Expand Down

0 comments on commit 589fbd9

Please sign in to comment.