Skip to content

Commit

Permalink
fix preserveUnknownFields upgrade (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaron2 authored Feb 15, 2021
1 parent 180499e commit f045249
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dapr init -s
err := kubernetes.Init(config)
if err != nil {
print.FailureStatusEvent(os.Stdout, err.Error())
return
os.Exit(1)
}
print.SuccessStatusEvent(os.Stdout, fmt.Sprintf("Success! Dapr has been installed to namespace %s. To verify, run `dapr status -k' in your terminal. To get started, go here: https://aka.ms/dapr-getting-started", config.Namespace))
} else {
Expand All @@ -78,7 +78,7 @@ dapr init -s
err := standalone.Init(runtimeVersion, dashboardVersion, dockerNetwork, slimMode)
if err != nil {
print.FailureStatusEvent(os.Stdout, err.Error())
return
os.Exit(1)
}
print.SuccessStatusEvent(os.Stdout, "Success! Dapr is up and running. To get started, go here: https://aka.ms/dapr-getting-started")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dapr upgrade -k
})
if err != nil {
print.FailureStatusEvent(os.Stdout, "Failed to upgrade Dapr: %s", err)
return
os.Exit(1)
}
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.", upgradeRuntimeVersion)
},
Expand Down
13 changes: 13 additions & 0 deletions pkg/kubernetes/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@ func highAvailabilityEnabled(status []StatusOutput) bool {
}

func applyCRDs(version string) error {
l := []string{
"components.dapr.io",
"configurations.dapr.io",
"subscriptions.dapr.io",
}

for _, c := range l {
_, err := utils.RunCmdAndWait("kubectl", "delete", "crd", c)
if err != nil {
return err
}
}

for _, crd := range crds {
url := fmt.Sprintf("https://raw.githubusercontent.com/dapr/dapr/%s/charts/dapr/crds/%s.yaml", version, crd)
_, err := utils.RunCmdAndWait("kubectl", "apply", "-f", url)
Expand Down

0 comments on commit f045249

Please sign in to comment.