Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#171 from bobbypage/default-containerd
Browse files Browse the repository at this point in the history
gke: Avoid hardcoding COS as default image type
  • Loading branch information
k8s-ci-robot authored Nov 4, 2021
2 parents 7d44340 + b93d2a7 commit c745651
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
4 changes: 0 additions & 4 deletions kubetest2-gke/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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},
},
Expand Down
16 changes: 6 additions & 10 deletions kubetest2-gke/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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))
}
Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit c745651

Please sign in to comment.