Skip to content

Commit

Permalink
Temporarily remove credential provider in worker image client (#240)
Browse files Browse the repository at this point in the history
- Remove image credential provider since we're storing base images in
public repos
  • Loading branch information
luke-lombardi authored May 21, 2024
1 parent 4082cbf commit 9048804
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions pkg/worker/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,6 @@ type ImageClient struct {
}

func NewImageClient(config types.ImageServiceConfig, workerId string, workerRepo repository.WorkerRepository) (*ImageClient, error) {
var provider CredentialProvider // Configure image registry credentials

switch config.RegistryCredentialProviderName {
case "aws":
provider = &AWSCredentialProvider{
Region: config.Registries.S3.Region,
AccessKey: config.Registries.S3.AccessKey,
SecretKey: config.Registries.S3.SecretKey,
}
case "docker":
provider = &DockerCredentialProvider{
Username: config.Registries.Docker.Username,
Password: config.Registries.Docker.Password,
}
default:
return nil, fmt.Errorf("invalid credential provider name: %s", config.RegistryCredentialProviderName)
}

registry, err := common.NewImageRegistry(config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -131,15 +113,6 @@ func NewImageClient(config types.ImageServiceConfig, workerId string, workerRepo
return nil, err
}

// TODO: refactor credentials logic for base image registries
// Right now, the aws credential provider is not actually being used
// because the base image is stored in a public registry
// We will probably need to adjust the config to make more sense here
_, err = provider.GetAuthString()
if err != nil {
return nil, err
}

return c, nil
}

Expand Down

0 comments on commit 9048804

Please sign in to comment.