-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `exo sks`: new `upgrade` command * `exo sks create`: new flags `--service-level` and `--no-cni`
- Loading branch information
Showing
14 changed files
with
541 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
apiv2 "github.com/exoscale/egoscale/api/v2" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var sksUpgradeCmd = &cobra.Command{ | ||
Use: "upgrade <name | ID> <version>", | ||
Short: "Upgrade a SKS cluster Kubernetes version", | ||
|
||
PreRunE: func(cmd *cobra.Command, args []string) error { | ||
if len(args) != 2 { | ||
cmdExitOnUsageError(cmd, "invalid arguments") | ||
} | ||
|
||
cmdSetZoneFlagFromDefault(cmd) | ||
|
||
return cmdCheckRequiredFlags(cmd, []string{"zone"}) | ||
}, | ||
|
||
RunE: func(cmd *cobra.Command, args []string) error { | ||
var ( | ||
c = args[0] | ||
version = args[1] | ||
) | ||
|
||
zone, err := cmd.Flags().GetString("zone") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ctx := apiv2.WithEndpoint(gContext, apiv2.NewReqEndpoint(gCurrentAccount.Environment, zone)) | ||
cluster, err := lookupSKSCluster(ctx, zone, c) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
decorateAsyncOperation(fmt.Sprintf("Upgrading SKS cluster %q...", c), func() { | ||
err = cs.UpgradeSKSCluster(ctx, zone, cluster.ID, version) | ||
}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if !gQuiet { | ||
return output(showSKSCluster(zone, cluster.ID)) | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
|
||
func init() { | ||
sksUpgradeCmd.Flags().StringP("zone", "z", "", "SKS cluster zone") | ||
sksCmd.AddCommand(sksUpgradeCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
48 changes: 28 additions & 20 deletions
48
vendor/github.com/exoscale/egoscale/internal/v2/sks_cluster.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
vendor/github.com/exoscale/egoscale/internal/v2/sks_nodepool.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.