Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Carael committed Aug 28, 2024
1 parent 359be69 commit c759fb0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
13 changes: 11 additions & 2 deletions src/Core/ContainerResourceOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,22 @@ private static void AddLocalDockerAuthentication(DockerConfiguration containerCo
{
continue;
}

var decryptedToken = Convert.FromBase64String(auth.Value.Auth);
var token = System.Text.Encoding.UTF8.GetString(decryptedToken);
var parts = token.Split(':');

if (parts.Length != 2)
{
continue;
}

containerConfig.Registries.Add(new DockerRegistryConfiguration
{
Name = address.Host,
Address = address.ToString(),
Auth = auth.Value.Auth,
Email = auth.Value.Email
Username = parts[0],
Password = parts[1]
});
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/Core/DockerContainerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ private AuthConfig GetAuthConfig(DockerRegistryConfiguration registryConfig)
{
Username = string.IsNullOrEmpty(registryConfig.Username)?null:registryConfig.Username,
Password = string.IsNullOrEmpty(registryConfig.Password)?null:registryConfig.Password,
ServerAddress = registryConfig.Address,
Email = string.IsNullOrEmpty(registryConfig.Email)?null:registryConfig.Email,
Auth = string.IsNullOrEmpty(registryConfig.Auth)?null:registryConfig.Auth
ServerAddress = registryConfig.Address
};
}

Expand Down
17 changes: 0 additions & 17 deletions src/Core/DockerRegistryConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,5 @@ public class DockerRegistryConfiguration
/// The password.
/// </value>
public string Password { get; set; }

/// <summary>
/// Gets or sets the registry token
/// </summary>
/// <value>
/// The password.
/// </value>
public string Auth { get; set; }

/// <summary>
/// Gets or sets the email.
/// </summary>
/// <value>
/// The password.
/// </value>
public string Email { get; set; }

}
}

0 comments on commit c759fb0

Please sign in to comment.