Skip to content
Permalink
Browse files

add --set flag to postgres app

Signed-off-by: Prateek Gogia <prateekgogia42@gmail.com>
  • Loading branch information
prateekgogia authored and alexellis committed Jan 13, 2020
1 parent a1470d1 commit 6eb00839827468e184f250594105e48c1bfcc2f4
Showing with 13 additions and 1 deletion.
  1. +13 −1 cmd/postgres_app.go
@@ -8,8 +8,8 @@ import (
"strconv"
"strings"

"github.com/alexellis/k3sup/pkg/env"
"github.com/alexellis/k3sup/pkg/config"
"github.com/alexellis/k3sup/pkg/env"
"github.com/spf13/cobra"
)

@@ -27,6 +27,9 @@ func makeInstallPostgresql() *cobra.Command {

postgresql.Flags().Bool("persistence", false, "Enable persistence")

postgresql.Flags().StringArray("set", []string{},
"Use custom flags or override existing flags \n(example --set persistence.enabled=true)")

postgresql.RunE = func(command *cobra.Command, args []string) error {
kubeConfigPath := getDefaultKubeconfig()

@@ -84,6 +87,15 @@ func makeInstallPostgresql() *cobra.Command {

overrides["persistence.enabled"] = strings.ToLower(strconv.FormatBool(persistence))

customFlags, err := command.Flags().GetStringArray("set")
if err != nil {
return fmt.Errorf("error with --set usage: %s", err)
}

if err := mergeFlags(overrides, customFlags); err != nil {
return err
}

outputPath := path.Join(chartPath, "postgresql/rendered")

err = templateChart(chartPath,

0 comments on commit 6eb0083

Please sign in to comment.
You can’t perform that action at this time.