Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit eb7e692

Browse files
author
Ian Campbell
committed
Use credential.Set type
Signed-off-by: Ian Campbell <[email protected]>
1 parent 886e79c commit eb7e692

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/commands/cnab.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ type bindMount struct {
3939

4040
const defaultSocketPath string = "/var/run/docker.sock"
4141

42-
type credentialSetOpt func(b *bundle.Bundle, creds map[string]string) error
42+
type credentialSetOpt func(b *bundle.Bundle, creds credentials.Set) error
4343

4444
func addNamedCredentialSets(namedCredentialsets []string) credentialSetOpt {
45-
return func(_ *bundle.Bundle, creds map[string]string) error {
45+
return func(_ *bundle.Bundle, creds credentials.Set) error {
4646
for _, file := range namedCredentialsets {
4747
if _, err := os.Stat(file); err != nil {
4848
file = filepath.Join(duffleHome().Credentials(), file+".yaml")
@@ -69,7 +69,7 @@ func addNamedCredentialSets(namedCredentialsets []string) credentialSetOpt {
6969
func addDockerCredentials(contextName string, contextStore store.Store) credentialSetOpt {
7070
// docker desktop contexts require some rewriting for being used within a container
7171
contextStore = dockerDesktopAwareStore{Store: contextStore}
72-
return func(_ *bundle.Bundle, creds map[string]string) error {
72+
return func(_ *bundle.Bundle, creds credentials.Set) error {
7373
if contextName != "" {
7474
data, err := ioutil.ReadAll(store.Export(contextName, contextStore))
7575
if err != nil {
@@ -82,7 +82,7 @@ func addDockerCredentials(contextName string, contextStore store.Store) credenti
8282
}
8383

8484
func addRegistryCredentials(shouldPopulate bool, dockerCli command.Cli) credentialSetOpt {
85-
return func(b *bundle.Bundle, creds map[string]string) error {
85+
return func(b *bundle.Bundle, creds credentials.Set) error {
8686
if _, ok := b.Credentials[internal.CredentialRegistryName]; !ok {
8787
return nil
8888
}

0 commit comments

Comments
 (0)