diff --git a/kubetest2-gke/deployer/deployer.go b/kubetest2-gke/deployer/deployer.go index 698d8f5c..afefeb96 100644 --- a/kubetest2-gke/deployer/deployer.go +++ b/kubetest2-gke/deployer/deployer.go @@ -42,8 +42,6 @@ var GitTag string const ( defaultFirewallRuleAllow = "tcp:22,tcp:80,tcp:8080,tcp:30000-32767,udp:30000-32767" - defaultImage = "cos" - defaultWindowsImage = WindowsImageTypeLTSC ) const ( @@ -197,14 +195,12 @@ func NewDeployer(opts types.Options) *Deployer { NumClusters: 1, NumNodes: defaultNodePool.Nodes, MachineType: defaultNodePool.MachineType, - ImageType: defaultImage, // Leave ClusterVersion as empty to use the default cluster version. ClusterVersion: "", FirewallRuleAllow: defaultFirewallRuleAllow, WindowsNumNodes: defaultWindowsNodePool.Nodes, WindowsMachineType: defaultWindowsNodePool.MachineType, - WindowsImageType: defaultWindowsImage, RetryableErrorPatterns: []string{gceStockoutErrorPattern}, }, diff --git a/kubetest2-gke/deployer/up.go b/kubetest2-gke/deployer/up.go index 5e81a1f0..07907122 100644 --- a/kubetest2-gke/deployer/up.go +++ b/kubetest2-gke/deployer/up.go @@ -33,14 +33,6 @@ import ( "sigs.k8s.io/kubetest2/pkg/metadata" ) -const ( - // WindowsImageTypeLTSC is a gcloud --image-type option for Windows LTSC image - WindowsImageTypeLTSC = "WINDOWS_LTSC" - - // WindowsImageTypeSAC is a gcloud --image-type opotion for Windows SAC image - WindowsImageTypeSAC = "WINDOWS_SAC" -) - // Deployer implementation methods below func (d *Deployer) Up() error { if err := d.Init(); err != nil { @@ -158,7 +150,9 @@ func (d *Deployer) CreateCluster(project string, cluster cluster, subNetworkArgs if !d.Autopilot { args = append(args, "--machine-type="+d.MachineType) args = append(args, "--num-nodes="+strconv.Itoa(d.NumNodes)) - args = append(args, "--image-type="+d.ImageType) + if d.ImageType != "" { + args = append(args, "--image-type="+d.ImageType) + } if d.WorkloadIdentityEnabled { args = append(args, fmt.Sprintf("--workload-pool=%s.svc.id.goog", project)) } @@ -234,7 +228,9 @@ func (d *Deployer) createWindowsNodePoolCommand(project string, cluster cluster, fs = append(fs, "--cluster="+cluster.name) fs = append(fs, "--project="+project) fs = append(fs, locationArg) - fs = append(fs, "--image-type="+imageType) + if imageType != "" { + fs = append(fs, "--image-type="+imageType) + } fs = append(fs, "--machine-type="+d.WindowsMachineType) fs = append(fs, "--num-nodes="+strconv.Itoa(d.WindowsNumNodes))