Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Oct 23, 2022
1 parent eaa913e commit b3f92f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/authn/kubernetes/keychain.go
Expand Up @@ -86,7 +86,10 @@ func New(ctx context.Context, client kubernetes.Interface, opt Options) (authn.K
if sa != nil {
for _, localObj := range sa.ImagePullSecrets {
ps, err := client.CoreV1().Secrets(opt.Namespace).Get(ctx, localObj.Name, metav1.GetOptions{})
if err != nil {
if k8serrors.IsNotFound(err) {
logs.Warn.Printf("secret %s/%s not found; ignoring", opt.Namespace, localObj.Name)
continue
} else if err != nil {
return nil, err
}
pullSecrets = append(pullSecrets, *ps)
Expand Down
23 changes: 23 additions & 0 deletions pkg/name/fuzz_test.go
@@ -0,0 +1,23 @@
// Copyright 2022 Google LLC All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package name

import "testing"

func FuzzParseReference(f *testing.F) {
f.Fuzz(func(t *testing.T, s string) {
_, _ = ParseReference(s)
})
}

0 comments on commit b3f92f6

Please sign in to comment.