Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@
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 @@
"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 @@
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.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" kbcli cluster register %s --engine %s --repo %s --version <cluster-chart-version>\n", name, name, types.ClusterChartsRepoURL)))

Check failure on line 233 in pkg/cmd/addon/addon.go

View workflow job for this annotation

GitHub Actions / make-test

printf: non-constant format string in call to fmt.Fprintf (govet)
fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n")
fmt.Fprintf(o.Out, color.GreenString(fmt.Sprintf(" helm search repo kubeblocks-addons/%s-cluster --versions\n", name)))

Check failure on line 235 in pkg/cmd/addon/addon.go

View workflow job for this annotation

GitHub Actions / make-test

printf: non-constant format string in call to fmt.Fprintf (govet)
}
}
},
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 @@
"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 @@
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 @@
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.Fprintf(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)))

Check failure on line 153 in pkg/cmd/addon/install.go

View workflow job for this annotation

GitHub Actions / make-test

printf: non-constant format string in call to fmt.Fprintf (govet)
fmt.Fprintf(o.Out, "To find available cluster chart versions, run:\n")
fmt.Fprintf(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
Loading