Skip to content

Commit 82294b4

Browse files
Merge pull request openshift#8665 from barbacbd/OCPBUGS-35382
OCPBUGS-35382: CAPG marketplace image use for control plane nodes
2 parents 23b77ca + a59746f commit 82294b4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/asset/machines/gcp/gcpmachines.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package gcp
44
import (
55
"fmt"
66

7+
"github.com/sirupsen/logrus"
78
compute "google.golang.org/api/compute/v1"
89
v1 "k8s.io/api/core/v1"
910
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -108,11 +109,10 @@ func GenerateBootstrapMachines(name string, installConfig *installconfig.Install
108109
// Create a CAPG-specific machine.
109110
func createGCPMachine(name string, installConfig *installconfig.InstallConfig, infraID string, mpool *gcptypes.MachinePool, imageName string) *capg.GCPMachine {
110111
// Use the rhcosImage as image name if not defined
111-
var osImage string
112-
if mpool.OSImage == nil {
113-
osImage = imageName
114-
} else {
115-
osImage = mpool.OSImage.Name
112+
osImage := imageName
113+
if mpool.OSImage != nil {
114+
osImage = fmt.Sprintf("projects/%s/global/images/%s", mpool.OSImage.Project, mpool.OSImage.Name)
115+
logrus.Debugf("overriding gcp machine image: %s", osImage)
116116
}
117117

118118
masterSubnet := installConfig.Config.Platform.GCP.ControlPlaneSubnet

0 commit comments

Comments
 (0)