Skip to content

Commit 29b53ce

Browse files
committed
cleanup: use better names for the credentials interfaces
1 parent 9e090f3 commit 29b53ce

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

cmd/entrypoint/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func main() {
9696
// from secret volume mounts to /tekton/creds. This is done to support the expansion
9797
// of a variable, $(credentials.path), that resolves to a single place with all the
9898
// stored credentials.
99-
builders := []credwriter.Builder{dockercreds.NewBuilder(), gitcreds.NewBuilder()}
99+
builders := []credwriter.Writer{dockercreds.NewBuilder(), gitcreds.NewBuilder()}
100100
for _, c := range builders {
101101
if err := c.Write(pipeline.CredsDir); err != nil {
102102
log.Printf("Error initializing credentials: %s", err)

pkg/credentials/dockercreds/creds.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ type basicDockerBuilder struct{}
145145

146146
// NewBuilder returns a new builder for Docker credentials.
147147
func NewBuilder() interface {
148-
credmatcher.Builder
149-
credwriter.Builder
148+
credmatcher.Matcher
149+
credwriter.Writer
150150
} {
151151
return &basicDockerBuilder{}
152152
}

pkg/credentials/gitcreds/creds.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ type gitBuilder struct{}
5353

5454
// NewBuilder returns a new builder for Git credentials.
5555
func NewBuilder() interface {
56-
credmatcher.Builder
57-
credwriter.Builder
56+
credmatcher.Matcher
57+
credwriter.Writer
5858
} {
5959
return &gitBuilder{}
6060
}

pkg/credentials/matcher/matcher.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
// It is mutable and exported for testing.
2727
var VolumePath = "/tekton/creds-secrets"
2828

29-
// Builder is the interface for a credential initializer of any type.
30-
type Builder interface {
29+
// Matcher is the interface for a credential initializer of any type.
30+
type Matcher interface {
3131
// MatchingAnnotations extracts flags for the credential
3232
// helper from the supplied secret and returns a slice (of
3333
// length 0 or greater) of applicable domains.

pkg/credentials/writer/writer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const (
4343
// helper (aka "creds-init") can write to /tekton/creds.
4444
var CredsInitCredentials = []string{".docker", ".gitconfig", ".git-credentials", ".ssh"}
4545

46-
// Builder is the interface for a credential initializer of any type.
47-
type Builder interface {
46+
// Writer is the interface for a credential initializer of any type.
47+
type Writer interface {
4848
// Write writes the credentials to the provided directory.
4949
Write(folder string) error
5050
}

pkg/pod/creds_init.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ func credsInit(ctx context.Context, obj runtime.Object, serviceAccountName, name
7676
}
7777

7878
builders := []interface {
79-
credmatcher.Builder
80-
credwriter.Builder
79+
credmatcher.Matcher
80+
credwriter.Writer
8181
}{dockercreds.NewBuilder(), gitcreds.NewBuilder()}
8282

8383
var volumeMounts []corev1.VolumeMount

0 commit comments

Comments
 (0)