Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
CecileRobertMichon committed May 7, 2018
1 parent dc92cf5 commit a10d08c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ type upgradeCmd struct {
resourceGroupName string
deploymentDirectory string
upgradeVersion string
apiVersion string
location string
timeoutInMinutes int

// derived
containerService *api.ContainerService
apiVersion string
client armhelpers.ACSEngineClient
locale *gotext.Locale
nameSuffix string
Expand Down Expand Up @@ -111,7 +111,11 @@ func (uc *upgradeCmd) validate(cmd *cobra.Command) error {
cmd.Usage()
return fmt.Errorf("--deployment-dir must be specified")
}
return nil
}

func (uc *upgradeCmd) load(cmd *cobra.Command) error {
var err error
_, err = uc.client.EnsureResourceGroup(uc.resourceGroupName, uc.location, nil)
if err != nil {
return fmt.Errorf("Error ensuring resource group: %s", err)
Expand Down Expand Up @@ -200,6 +204,11 @@ func (uc *upgradeCmd) run(cmd *cobra.Command, args []string) error {
log.Fatalf("error validating upgrade command: %v", err)
}

err = uc.load(cmd)
if err != nil {
log.Fatalf("error loading existing cluster: %v", err)
}

upgradeCluster := kubernetesupgrade.UpgradeCluster{
Translator: &i18n.Translator{
Locale: uc.locale,
Expand Down

0 comments on commit a10d08c

Please sign in to comment.