Skip to content

Commit

Permalink
Rename Keychain() to Init()
Browse files Browse the repository at this point in the history
  • Loading branch information
iain-macdonald committed Aug 28, 2023
1 parent 5a4dbb7 commit 03ff06d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/soci-store/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func main() {
}

// Prepare kubeconfig-based keychain if required
credsFuncs := []resolver.Credential{local_keychain.Keychain(ctx, *localKeychainPort).GetCredentials}
credsFuncs := []resolver.Credential{local_keychain.Init(ctx, *localKeychainPort).GetCredentials}
credsFuncs = append(credsFuncs, dockerconfig.NewDockerConfigKeychain(ctx))
if config.KubeconfigKeychainConfig.EnableKeychain {
var opts []kubeconfig.Option
Expand Down
4 changes: 2 additions & 2 deletions service/keychain/local_keychain/local_keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (kc *keychain) GetCredentials(host string, refspec reference.Spec) (string,
return "", "", nil
}

func Keychain(ctx context.Context, port int) *keychain {
func Init(ctx context.Context, port int) *keychain {
lock.Lock()
defer lock.Unlock()
if singleton == nil {
Expand All @@ -135,7 +135,7 @@ func Get() (*keychain, error) {
lock.Lock()
defer lock.Unlock()
if singleton == nil {
return nil, fmt.Errorf("local keychain must be initialized (with Keychain()) before being gotten (with Get())")
return nil, fmt.Errorf("local keychain must be initialized (with Init()) before being gotten (with Get())")
}
return singleton, nil
}

0 comments on commit 03ff06d

Please sign in to comment.