Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MULTIARCH-4777: gcp: support multi-arch nodes #8701

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
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
17 changes: 0 additions & 17 deletions pkg/asset/cluster/tfvars/tfvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

"github.com/IBM/vpc-go-sdk/vpcv1"
igntypes "github.com/coreos/ignition/v2/config/v3_2/types"
coreosarch "github.com/coreos/stream-metadata-go/arch"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"k8s.io/utils/ptr"
Expand All @@ -39,7 +38,6 @@ import (
"github.com/openshift/installer/pkg/asset/manifests"
"github.com/openshift/installer/pkg/asset/openshiftinstall"
"github.com/openshift/installer/pkg/asset/rhcos"
rhcospkg "github.com/openshift/installer/pkg/rhcos"
"github.com/openshift/installer/pkg/tfvars"
awstfvars "github.com/openshift/installer/pkg/tfvars/aws"
azuretfvars "github.com/openshift/installer/pkg/tfvars/azure"
Expand Down Expand Up @@ -538,21 +536,6 @@ func (t *TerraformVariables) Generate(ctx context.Context, parents asset.Parents
return fmt.Errorf("failed to create gcp ignition shim: %w", err)
}

archName := coreosarch.RpmArch(string(installConfig.Config.ControlPlane.Architecture))
st, err := rhcospkg.FetchCoreOSBuild(ctx)
if err != nil {
return err
}
streamArch, err := st.GetArchitecture(archName)
if err != nil {
return err
}

img := streamArch.Images.Gcp
if img == nil {
return fmt.Errorf("%s: No GCP build found", st.FormatPrefix(archName))
}

tags, err := gcpconfig.NewTagManager(client).GetUserTags(ctx,
installConfig.Config.Platform.GCP.ProjectID,
installConfig.Config.Platform.GCP.UserTags)
Expand Down
2 changes: 2 additions & 0 deletions pkg/types/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,8 @@ func MultiArchFeatureGateEnabled(platform string, fgs featuregates.FeatureGate)
switch platform {
case aws.Name:
return fgs.Enabled(features.FeatureGateMultiArchInstallAWS)
case gcp.Name:
return fgs.Enabled(features.FeatureGateMultiArchInstallGCP)
default:
return false
}
Expand Down
11 changes: 11 additions & 0 deletions pkg/types/validation/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,17 @@ func TestValidateInstallConfig(t *testing.T) {
return c
}(),
},
{
name: "gcp cluster is heteregeneous",
installConfig: func() *types.InstallConfig {
c := validInstallConfig()
c.Platform = types.Platform{GCP: validGCPPlatform()}
c.Compute[0].Architecture = types.ArchitectureARM64
c.FeatureSet = "CustomNoUpgrade"
c.FeatureGates = []string{"MultiArchInstallGCP=true"}
return c
}(),
},
{
name: "valid cloud credentials mode",
installConfig: func() *types.InstallConfig {
Expand Down