Skip to content

Commit

Permalink
Merge pull request #176 from kubefirst/container-registry-url
Browse files Browse the repository at this point in the history
fix: adding ability to detokenize container registry
  • Loading branch information
johndietz authored Oct 2, 2023
2 parents 6e76039 + 51beee9 commit b95b577
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controller/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ func (clctrl *ClusterController) CreateTokens(kind string) interface{} {
ExternalDNSProviderTokenEnvName: externalDNSProviderTokenEnvName,
ExternalDNSProviderSecretName: fmt.Sprintf("%s-auth", clctrl.CloudProvider),
ExternalDNSProviderSecretKey: externalDNSProviderSecretKey,

ContainerRegistryURL: fmt.Sprintf("%s/%s", clctrl.ContainerRegistryHost, clctrl.GitAuth.Owner),
}

//Handle provider specific tokens
Expand Down Expand Up @@ -260,7 +262,8 @@ func (clctrl *ClusterController) CreateTokens(kind string) interface{} {
gitopsTemplateTokens.ContainerRegistryURL = fmt.Sprintf("%s.dkr.ecr.%s.amazonaws.com", *iamCaller.Account, clctrl.CloudRegion)
log.Infof("Using ECR URL %s", gitopsTemplateTokens.ContainerRegistryURL)
} else {
gitopsTemplateTokens.ContainerRegistryURL = fmt.Sprintf("%s/%s", clctrl.ContainerRegistryHost, clctrl.GitAuth.Owner)
// moving commented line below to default behavior
// gitopsTemplateTokens.ContainerRegistryURL = fmt.Sprintf("%s/%s", clctrl.ContainerRegistryHost, clctrl.GitAuth.Owner)
log.Info("NOT using ECR but instead %s URL %s", clctrl.GitProvider, gitopsTemplateTokens.ContainerRegistryURL)
}
}
Expand Down

0 comments on commit b95b577

Please sign in to comment.