Skip to content

Commit

Permalink
chore: check driver load status
Browse files Browse the repository at this point in the history
  • Loading branch information
acid-chicken committed May 21, 2024
1 parent c8bfa31 commit 702433e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hariko/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/bwmarrin/discordgo"
"github.com/go-playground/webhooks/v6/github"
"github.com/spf13/cobra"
"helm.sh/helm/pkg/storage/driver"
"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/chart/loader"
"helm.sh/helm/v3/pkg/cli"
Expand Down Expand Up @@ -223,6 +224,9 @@ func deploy(packageName string, repositoryName string, repositoryURL string, log
actionConfig.Init(settings.RESTClientGetter(), settings.Namespace(), "configmap", func(format string, v ...interface{}) {
fmt.Fprintf(log, format+"\n", v...)
})
if _, ok := actionConfig.Releases.Driver.(*driver.Memory); ok {
return nil, fmt.Errorf("storage driver could not be initialized")
}
client := action.NewUpgrade(actionConfig)
client.Namespace = settings.Namespace()
chartPath, err := client.LocateChart(repositoryName+"/"+packageName, settings)
Expand Down

0 comments on commit 702433e

Please sign in to comment.