Skip to content

Commit

Permalink
* [storage]: update local pv & longhorn
Browse files Browse the repository at this point in the history
  • Loading branch information
ysicing committed Sep 11, 2024
1 parent 788f512 commit 206e0f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func local(f factory.Factory) *cobra.Command {
logpkg := f.GetLog()
cmd := &cobra.Command{
Use: "local",
Short: "deploy local storage",
Short: "deploy local pv storage",
RunE: func(cmd *cobra.Command, args []string) error {
kubeargs := []string{"experimental", "kubectl", "apply", "-f", common.GetCustomScripts("hack/manifests/storage/local-storage.yaml")}
kubeargs := []string{"experimental", "kubectl", "apply", "-f", common.GetCustomScripts("hack/manifests/storage/local.yaml")}
output, err := qcexec.Command(os.Args[0], kubeargs...).CombinedOutput()
if err != nil {
logpkg.Errorf("upgrade install local storage failed: %s", string(output))
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *Cluster) getInitFlags() []types.Flag {
P: &c.Storage,
V: c.Storage,
EnvVar: common.DefaultStorageType,
Usage: `storage, e.g: nfs,local`,
Usage: `storage, e.g: nfs,local,none`,
},
{
Name: "datastore",
Expand Down Expand Up @@ -278,10 +278,12 @@ func (c *Cluster) initMaster0(cfg *config.Config, sshClient ssh.Interface) error
return errors.Errorf("%s run install nfs script failed, reason: %v", cfg.Cluster.InitNode, err)
}
} else if c.Storage == "local" {
kubeargs := []string{"experimental", "kubectl", "apply", "-f", common.GetCustomScripts("hack/manifests/storage/local-storage.yaml")}
kubeargs := []string{"experimental", "kubectl", "apply", "-f", common.GetCustomScripts("hack/manifests/storage/local.yaml")}
if err := qcexec.CommandRun(os.Args[0], kubeargs...); err != nil {
return errors.Errorf("%s run install local storage failed, reason: %v", cfg.Cluster.InitNode, err)
}
} else if c.Storage == "none" {
c.log.Infof("skip install storage")
}
kclient, _ := k8s.NewSimpleClient()
if ns, _ := kclient.GetNamespace(context.TODO(), common.DefaultKubeSystem, metav1.GetOptions{}); ns != nil {
Expand Down

0 comments on commit 206e0f0

Please sign in to comment.