Skip to content

Commit

Permalink
Credential helpers: "credHelpers" map is optional in Docker's config (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev authored Aug 29, 2022
1 parent c54b140 commit 6296df7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class HelperProgramCredentialsProvider: CredentialsProvider {
return nil
}
let config = try JSONDecoder().decode(DockerConfig.self, from: Data(contentsOf: dockerConfigURL))
if let helperProgram = config.credHelpers[host] {

if let helperProgram = config.credHelpers?[host] {
return try executeHelper(binaryName: "docker-credential-\(helperProgram)", host: host)
}

Expand Down Expand Up @@ -54,7 +54,7 @@ class HelperProgramCredentialsProvider: CredentialsProvider {
}

struct DockerConfig: Codable {
var credHelpers: Dictionary<String, String> = Dictionary()
var credHelpers: Dictionary<String, String>? = Dictionary()
}

struct DockerGetOutput: Codable {
Expand Down

0 comments on commit 6296df7

Please sign in to comment.