Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkg/infrastructure/gcp/clusterapi/ignition.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ func editIgnition(ctx context.Context, in clusterapi.IgnitionInput) (*clusterapi
}

project := in.InstallConfig.Config.GCP.ProjectID
if in.InstallConfig.Config.GCP.NetworkProjectID != "" {
project = in.InstallConfig.Config.GCP.NetworkProjectID
}

apiIntIPAddress := *gcpCluster.Status.Network.APIInternalAddress
addressIntCut := apiIntIPAddress[strings.LastIndex(apiIntIPAddress, "/")+1:]
// The LoadBalancer's IP address which is part of the frontend configuration, would be located in
// the service project even in the case of Shared VPC (XPN) installs.
computeIntAddressObj, err := svc.Addresses.Get(project, in.InstallConfig.Config.GCP.Region, addressIntCut).Context(ctx).Do()
if err != nil {
return nil, fmt.Errorf("failed to get compute address: %w", err)
Expand Down