From 372d1b6020a3fffc8e443751cad0754c0c8d199e Mon Sep 17 00:00:00 2001 From: Joe Finney Date: Tue, 23 Feb 2016 17:45:44 -0800 Subject: [PATCH] Remove check for rolling-updates gcloud subgroup. --- cluster/gce/upgrade.sh | 9 +-------- test/e2e/cluster_upgrade.go | 27 ++++----------------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/cluster/gce/upgrade.sh b/cluster/gce/upgrade.sh index 08fbfd55bf3..94e4c37d799 100755 --- a/cluster/gce/upgrade.sh +++ b/cluster/gce/upgrade.sh @@ -224,16 +224,9 @@ function do-node-upgrade() { # Do the actual upgrade. # NOTE(zmerlynn): If you are changing this gcloud command, update # test/e2e/cluster_upgrade.go to match this EXACTLY. - # TODO(zmerlynn): Remove this hack on July 29, 2015, when the migration to - # `gcloud alpha compute rolling-updates` is complete. - local subgroup="preview" - local exists=$(gcloud ${subgroup} rolling-updates -h &>/dev/null; echo $?) || true - if [[ "${exists}" != "0" ]]; then - subgroup="alpha compute" - fi local template_name=$(get-template-name-from-version ${SANITIZED_VERSION}) for group in ${INSTANCE_GROUPS[@]}; do - gcloud ${subgroup} rolling-updates \ + gcloud alpha compute rolling-updates \ --project="${PROJECT}" \ --zone="${ZONE}" \ start \ diff --git a/test/e2e/cluster_upgrade.go b/test/e2e/cluster_upgrade.go index 54a1d422909..0461c803a58 100644 --- a/test/e2e/cluster_upgrade.go +++ b/test/e2e/cluster_upgrade.go @@ -510,7 +510,7 @@ func migRollingUpdateStart(templ string, nt time.Duration) (string, error) { // NOTE(mikedanese): If you are changing this gcloud command, update // cluster/gce/upgrade.sh to match this EXACTLY. // A `rolling-updates start` call outputs what we want to stderr. - _, output, err := retryCmd("gcloud", append(migUpdateCmdBase(), + _, output, err := retryCmd("gcloud", "alpha", "compute", "rolling-updates", fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID), fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone), @@ -524,7 +524,7 @@ func migRollingUpdateStart(templ string, nt time.Duration) (string, error) { // --max-num-concurrent-instances. fmt.Sprintf("--max-num-concurrent-instances=%d", 1), fmt.Sprintf("--max-num-failed-instances=%d", 0), - fmt.Sprintf("--min-instance-update-time=%ds", 0))...) + fmt.Sprintf("--min-instance-update-time=%ds", 0)) if err != nil { errLast = fmt.Errorf("rolling-updates call failed with err: %v", err) return false, nil @@ -552,25 +552,6 @@ func migRollingUpdateStart(templ string, nt time.Duration) (string, error) { return id, nil } -// migUpdateCmdBase gets the base of the MIG rolling update command--i.e., all -// pieces of the gcloud command that come after "gcloud" but before -// "rolling-updates". Examples of returned values are: -// -// {preview"} -// -// {"alpha", "compute"} -// -// TODO(mikedanese): Remove this hack on July 29, 2015 when the migration to -// `gcloud alpha compute rolling-updates` is complete. -func migUpdateCmdBase() []string { - b := []string{"preview"} - a := []string{"rolling-updates", "-h"} - if err := exec.Command("gcloud", append(b, a...)...).Run(); err != nil { - b = []string{"alpha", "compute"} - } - return b -} - // migRollingUpdatePoll (CKE/GKE-only) polls the progress of the MIG rolling // update with ID id until it is complete. It returns an error if this takes // longer than nt times the number of nodes. @@ -582,12 +563,12 @@ func migRollingUpdatePoll(id string, nt time.Duration) error { Logf("Waiting up to %v for MIG rolling update to complete.", timeout) if wait.Poll(restartPoll, timeout, func() (bool, error) { // A `rolling-updates describe` call outputs what we want to stdout. - output, _, err := retryCmd("gcloud", append(migUpdateCmdBase(), + output, _, err := retryCmd("gcloud", "alpha", "compute", "rolling-updates", fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID), fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone), "describe", - id)...) + id) if err != nil { errLast = fmt.Errorf("Error calling rolling-updates describe %s: %v", id, err) Logf("%v", errLast)