Skip to content

Commit 49b7be0

Browse files
authored
Merge pull request #6745 from thaJeztah/cleanup_RetrieveAuthTokenFromImage
cli/command: RetrieveAuthTokenFromImage: remove redundant conditions
2 parents 533934c + d6cdb71 commit 49b7be0

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cli/command/registry.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func RetrieveAuthTokenFromImage(cfg *configfile.ConfigFile, image string) (strin
200200
return "", err
201201
}
202202

203-
encodedAuth, err := authconfig.Encode(registrytypes.AuthConfig{
203+
return authconfig.Encode(registrytypes.AuthConfig{
204204
Username: authConfig.Username,
205205
Password: authConfig.Password,
206206
ServerAddress: authConfig.ServerAddress,
@@ -210,10 +210,6 @@ func RetrieveAuthTokenFromImage(cfg *configfile.ConfigFile, image string) (strin
210210
IdentityToken: authConfig.IdentityToken,
211211
RegistryToken: authConfig.RegistryToken,
212212
})
213-
if err != nil {
214-
return "", err
215-
}
216-
return encodedAuth, nil
217213
}
218214

219215
// getAuthConfigKey special-cases using the full index address of the official

0 commit comments

Comments
 (0)