Skip to content
Prev Previous commit
Next Next commit
fix: enable GCP deployments
  • Loading branch information
julienmancuso committed Jun 11, 2025
commit 785d68a780d0afd994d68db9be6efdb34adc5f5f
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,13 @@ echo "Done"

if dockerConfigJSONSecretName == "" {
// if no explicit docker config is provided, we need to provide the docker config to the image builder
dockerRegistry := strings.Split(imageName, "/")[0]
var ref name.Reference
ref, err = name.ParseReference(imageName)
if err != nil {
err = errors.Wrap(err, "failed to parse reference")
return
}
dockerRegistry := ref.Context().RegistryStr()
if isGoogleRegistry(dockerRegistry) {
// for GCP, we use the google cloud sdk to get the docker config.
initContainers = append(initContainers, corev1.Container{
Expand All @@ -1016,8 +1022,8 @@ echo "Done"
"/bin/bash",
"-c",
fmt.Sprintf(`set -e
gcloud config get-value account
TOKEN=$(gcloud auth print-access-token)
gcloud --quiet config get-value account
TOKEN=$(gcloud --quietauth print-access-token)
cat > %s/config.json <<EOL
{
"auths": {
Expand Down
Loading