Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion addons
Submodule addons updated 3039 files
8 changes: 6 additions & 2 deletions pkg/cmd/addon/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
extensionsv1alpha1 "github.com/apecloud/kubeblocks/apis/extensions/v1alpha1"
"github.com/apecloud/kubeblocks/pkg/constant"
viper "github.com/apecloud/kubeblocks/pkg/viperx"
"github.com/fatih/color"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand All @@ -49,7 +50,6 @@ import (
"k8s.io/utils/strings/slices"

"github.com/apecloud/kbcli/pkg/action"
clusterCmd "github.com/apecloud/kbcli/pkg/cmd/cluster"
"github.com/apecloud/kbcli/pkg/cmd/plugin"
"github.com/apecloud/kbcli/pkg/printer"
"github.com/apecloud/kbcli/pkg/types"
Expand Down Expand Up @@ -228,7 +228,11 @@ func newEnableCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.
util.CheckErr(o.PatchOptions.CmdComplete(cmd))
util.CheckErr(o.PatchOptions.Run())
if isEngineAddon(&o.addon) {
util.CheckErr(clusterCmd.RegisterClusterChart(f, streams, "", name, getAddonVersion(&o.addon), types.ClusterChartsRepoURL))
fmt.Fprintf(o.Out, "addon %s enabled successfully\n", name)
fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n")
fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version <cluster-chart-version>\n", name, name, types.ClusterChartsRepoURL)))
fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n")
fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name)))
}
}
},
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/addon/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/Masterminds/semver/v3"
kbappsv1 "github.com/apecloud/kubeblocks/apis/apps/v1"
"github.com/apecloud/kubeblocks/pkg/constant"
"github.com/fatih/color"
"github.com/spf13/cobra"
helmaction "helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart/loader"
Expand All @@ -48,7 +49,6 @@ import (
extensionsv1alpha1 "github.com/apecloud/kubeblocks/apis/extensions/v1alpha1"

"github.com/apecloud/kbcli/pkg/cluster"
clusterCmd "github.com/apecloud/kbcli/pkg/cmd/cluster"
"github.com/apecloud/kbcli/pkg/printer"
"github.com/apecloud/kbcli/pkg/types"
"github.com/apecloud/kbcli/pkg/util"
Expand Down Expand Up @@ -149,9 +149,10 @@ func newInstallCmd(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra
util.CheckErr(o.Run(f, streams))
// avoid unnecessary messages for upgrade
fmt.Fprintf(o.Out, "addon %s installed successfully\n", o.name)
if err := clusterCmd.RegisterClusterChart(f, streams, "", o.name, o.clusterChartVersion, o.clusterChartRepo); err != nil {
util.CheckErr(err)
}
fmt.Fprintf(o.Out, "You can run the following command to register a cluster:\n")
fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version <cluster-chart-version>\n", o.name, o.name, o.clusterChartRepo)))
fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n")
fmt.Fprint(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", o.name)))
},
}
cmd.Flags().BoolVar(&o.force, "force", false, "force install the addon and ignore the version check")
Expand Down