Skip to content

Commit

Permalink
Add support storage class
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed May 24, 2024
1 parent 3d778c4 commit 4f48eab
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
30 changes: 30 additions & 0 deletions cmd/cluster_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ var clusterInstallCmd = &cobra.Command{
}

configureRegistry(client, cluster)
configureStorageClass(client, cluster)

// Email selection for certificate
email := func() string {
Expand Down Expand Up @@ -520,6 +521,35 @@ func createCredentials(client *qovery.APIClient, orgaId string, providerType qov
panic("Unhandled cloudprovider type during credentials creation")
}

func configureStorageClass(client *qovery.APIClient, cluster *qovery.Cluster) {
if cluster.CloudProvider != qovery.CLOUDPROVIDERENUM_ON_PREMISE {
return
}

utils.Println("We need to know the storage class name that your kubernetes cluster use in order to deploy app with network storage.")
storageClassUI := promptui.Select{
Label: "Storage class name",
}
_, storageClassName, err := storageClassUI.Run()
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
}

settings, _, err := client.ClustersAPI.GetClusterAdvancedSettings(context.Background(), cluster.Organization.Id, cluster.Id).Execute()
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
}

settings.StorageclassFastSsd = &storageClassName
_, _, err = client.ClustersAPI.EditClusterAdvancedSettings(context.Background(), cluster.Organization.Id, cluster.Id).ClusterAdvancedSettings(*settings).Execute()
if err != nil {
utils.PrintlnError(err)
os.Exit(1)
}
}

func configureRegistry(client *qovery.APIClient, cluster *qovery.Cluster) {
if cluster.CloudProvider != qovery.CLOUDPROVIDERENUM_ON_PREMISE {
return
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/posthog/posthog-go v0.0.0-20240327112532-87b23fe11103
github.com/pterm/pterm v0.12.79
github.com/qovery/qovery-client-go v0.0.0-20240522104951-0ce3587cfad8
github.com/qovery/qovery-client-go v0.0.0-20240524132028-e0b85fd106b2
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ github.com/qovery/qovery-client-go v0.0.0-20240502151902-f587b6db6b9c h1:KPnMyVZ
github.com/qovery/qovery-client-go v0.0.0-20240502151902-f587b6db6b9c/go.mod h1:9eHj5a4EtXGIyfbvVL3HVYW9k7Xmiwi00OqHrP4dc10=
github.com/qovery/qovery-client-go v0.0.0-20240522104951-0ce3587cfad8 h1:jAP6hIgypi7ioveABW2sJ+OrBJDSlHDVQ7oj2J5O4ZI=
github.com/qovery/qovery-client-go v0.0.0-20240522104951-0ce3587cfad8/go.mod h1:9eHj5a4EtXGIyfbvVL3HVYW9k7Xmiwi00OqHrP4dc10=
github.com/qovery/qovery-client-go v0.0.0-20240524132028-e0b85fd106b2 h1:k/rKfLXHXAu53k9CAwEVZCv3NN7zrHdnQ0wuxEguQSs=
github.com/qovery/qovery-client-go v0.0.0-20240524132028-e0b85fd106b2/go.mod h1:9eHj5a4EtXGIyfbvVL3HVYW9k7Xmiwi00OqHrP4dc10=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
Expand Down
2 changes: 1 addition & 1 deletion pkg/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func GetCurrentVersion() string {
return "0.93.0" // ci-version-check
return "0.93.1" // ci-version-check
}

func GetLatestOnlineVersionUrl() (string, error) {
Expand Down

0 comments on commit 4f48eab

Please sign in to comment.