-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #583 from dapr/master
Merge master into release branch.
- Loading branch information
Showing
20 changed files
with
781 additions
and
202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ cli | |
*.out | ||
|
||
.vscode | ||
.idea | ||
|
||
# Visual Studio 2015/2017/2019 cache/options directory | ||
.vs/ | ||
|
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
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,48 @@ | ||
// ------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// ------------------------------------------------------------ | ||
|
||
package cmd | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/dapr/cli/pkg/kubernetes" | ||
"github.com/dapr/cli/pkg/print" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var UpgradeCmd = &cobra.Command{ | ||
Use: "upgrade", | ||
Short: "Upgrades a Dapr control plane installation in a cluster. Supported platforms: Kubernetes", | ||
Example: ` | ||
# Upgrade Dapr in Kubernetes | ||
dapr upgrade -k | ||
# See more at: https://docs.dapr.io/getting-started/ | ||
`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
err := kubernetes.Upgrade(kubernetes.UpgradeConfig{ | ||
RuntimeVersion: runtimeVersion, | ||
Args: values, | ||
}) | ||
if err != nil { | ||
print.FailureStatusEvent(os.Stdout, "Failed to upgrade Dapr: %s", err) | ||
return | ||
} | ||
print.SuccessStatusEvent(os.Stdout, "Dapr control plane successfully upgraded to version %s. Make sure your deployments are restarted to pick up the latest sidecar version.", runtimeVersion) | ||
}, | ||
} | ||
|
||
func init() { | ||
UpgradeCmd.Flags().BoolVarP(&kubernetesMode, "kubernetes", "k", false, "Upgrade Dapr in a Kubernetes cluster") | ||
UpgradeCmd.Flags().StringVarP(&runtimeVersion, "runtime-version", "", "", "The version of the Dapr runtime to upgrade to, for example: 1.0.0") | ||
UpgradeCmd.Flags().BoolP("help", "h", false, "Print this help message") | ||
UpgradeCmd.Flags().StringArrayVar(&values, "set", []string{}, "set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)") | ||
|
||
UpgradeCmd.MarkFlagRequired("runtime-version") | ||
UpgradeCmd.MarkFlagRequired("kubernetes") | ||
|
||
RootCmd.AddCommand(UpgradeCmd) | ||
} |
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
Oops, something went wrong.