Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#63 from chizhg/add-release-channel
Browse files Browse the repository at this point in the history
Add --release-channel flag for kubetest2 gke deployer
  • Loading branch information
k8s-ci-robot authored Sep 28, 2020
2 parents 6e6ad4b + 5040d4f commit 537175f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions kubetest2-gke/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ type deployer struct {

BuildOptions *options.BuildOptions

RepoRoot string `desc:"Path to root of the kubernetes repo. Used with --build and for dumping cluster logs."`
Version string `desc:"Use a specific GKE version e.g. 1.16.13.gke-400 or 'latest'. If --build is specified it will default to building kubernetes from source."`
RepoRoot string `desc:"Path to root of the kubernetes repo. Used with --build and for dumping cluster logs."`
ReleaseChannel string `desc:"Use a GKE release channel, could be one of empty, rapid, regular and stable - https://cloud.google.com/kubernetes-engine/docs/concepts/release-channels"`
Version string `desc:"Use a specific GKE version e.g. 1.16.13.gke-400 or 'latest'. If --build is specified it will default to building kubernetes from source."`

// doInit helps to make sure the initialization is performed only once
doInit sync.Once
Expand Down
10 changes: 9 additions & 1 deletion kubetest2-gke/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,19 @@ func (d *deployer) Up() error {
"--image-type="+image,
"--num-nodes="+strconv.Itoa(d.nodes),
"--network="+transformNetworkName(d.projects, d.network),
"--cluster-version="+d.Version,
)
if d.workloadIdentityEnabled {
args = append(args, fmt.Sprintf("--workload-pool=%s.svc.id.goog", project))
}
if d.ReleaseChannel != "" {
args = append(args, "--release-channel="+d.ReleaseChannel)
// --cluster-version must be a specific valid version if --release-channel is not empty.
if d.Version != "latest" {
args = append(args, "--cluster-version="+d.Version)
}
} else {
args = append(args, "--cluster-version="+d.Version)
}
args = append(args, subNetworkArgs...)
args = append(args, privateClusterArgs...)
args = append(args, cluster)
Expand Down

0 comments on commit 537175f

Please sign in to comment.