Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: only stop kubeblocks when kubeblocks version is specified #41

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions pkg/cmd/kubeblocks/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,27 +160,27 @@ func (o *InstallOptions) Upgrade() error {
}
s.Success()

// stop the old version KubeBlocks, otherwise the old version KubeBlocks will reconcile the
// new version resources, which may not be compatible. helm will start the new version
// KubeBlocks after upgrade.
s = spinner.New(o.Out, spinnerMsg("Stop KubeBlocks "+kbVersion))
defer s.Fail()
if err = o.stopDeployment(util.GetKubeBlocksDeploy); err != nil {
return err
}
s.Success()

// stop the data protection deployment
s = spinner.New(o.Out, spinnerMsg("Stop DataProtection"))
defer s.Fail()
if err = o.stopDeployment(util.GetDataProtectionDeploy); err != nil {
return err
}
s.Success()

// it's time to upgrade
msg := ""
if o.Version != "" {
// stop the old version KubeBlocks, otherwise the old version KubeBlocks will reconcile the
// new version resources, which may not be compatible. helm will start the new version
// KubeBlocks after upgrade.
s = spinner.New(o.Out, spinnerMsg("Stop KubeBlocks "+kbVersion))
defer s.Fail()
if err = o.stopDeployment(util.GetKubeBlocksDeploy); err != nil {
return err
}
s.Success()

// stop the data protection deployment
s = spinner.New(o.Out, spinnerMsg("Stop DataProtection"))
defer s.Fail()
if err = o.stopDeployment(util.GetDataProtectionDeploy); err != nil {
return err
}
s.Success()

msg = "to " + o.Version
}
s = spinner.New(o.Out, spinnerMsg("Upgrading KubeBlocks "+msg))
Expand Down
Loading