Compare commits

..

2 Commits

Author SHA1 Message Date
Jeff McCune
1369338f3c (#50) Add -n shorthand for --namespace for secrets
It's annoying holos get secret -n foo doesn't work like kubectl get
secret -n foo works.

Closes: #50
2024-03-10 10:45:49 -07:00
Jeff McCune
ac03f64724 (#45) Configure ZITADEL to use pgbouncer 2024-03-09 09:44:33 -08:00
7 changed files with 22 additions and 9 deletions

View File

@@ -9,12 +9,12 @@ package holos
{
name: "ZITADEL_DATABASE_POSTGRES_HOST"
valueFrom: secretKeyRef: name: "\(_DBName)-pguser-\(_DBName)"
valueFrom: secretKeyRef: key: "host"
valueFrom: secretKeyRef: key: "pgbouncer-host"
},
{
name: "ZITADEL_DATABASE_POSTGRES_PORT"
valueFrom: secretKeyRef: name: "\(_DBName)-pguser-\(_DBName)"
valueFrom: secretKeyRef: key: "port"
valueFrom: secretKeyRef: key: "pgbouncer-port"
},
{
name: "ZITADEL_DATABASE_POSTGRES_DATABASE"

View File

@@ -243,10 +243,18 @@ _apiVersion: "holos.run/v1alpha1"
#Platform: {
// org holds user defined values scoped organization wide. A platform has one and only one organization.
org: {
// e.g. "example"
name: string
// e.g. "example.com"
domain: string
// e.g. "Example"
displayName: string
// e.g. "platform@example.com"
contact: email: string
// e.g. "platform@example.com"
cloudflare: email: string
// e.g. "example"
github: orgs: primary: name: string
}
clusters: [ID=_]: #ClusterSpec & {
name: string & ID

View File

@@ -33,7 +33,7 @@ func NewCreateCmd(hc *holos.Config) *cobra.Command {
cfg.trimTrailingNewlines = flagSet.Bool("trim-trailing-newlines", true, "trim trailing newlines if true")
cmd.Flags().SortFlags = false
cmd.Flags().AddGoFlagSet(flagSet)
cmd.Flags().AddFlagSet(flagSet)
cmd.RunE = makeCreateRunFunc(hc, cfg)
return cmd

View File

@@ -31,7 +31,7 @@ func NewGetCmd(hc *holos.Config) *cobra.Command {
cfg.extractTo = flagSet.String("extract-to", ".", "extract to directory")
cmd.Flags().SortFlags = false
cmd.Flags().AddGoFlagSet(flagSet)
cmd.Flags().AddFlagSet(flagSet)
cmd.RunE = makeGetRunFunc(hc, cfg)
return cmd
}

View File

@@ -1,8 +1,8 @@
package secret
import (
"flag"
"github.com/holos-run/holos/pkg/holos"
"github.com/spf13/pflag"
)
const NameLabel = "holos.run/secret.name"
@@ -24,10 +24,10 @@ type config struct {
extractTo *string
}
func newConfig() (*config, *flag.FlagSet) {
func newConfig() (*config, *pflag.FlagSet) {
cfg := &config{}
flagSet := flag.NewFlagSet("", flag.ContinueOnError)
cfg.namespace = flagSet.String("namespace", holos.DefaultProvisionerNamespace, "namespace in the provisioner cluster")
flagSet := pflag.NewFlagSet("", pflag.ContinueOnError)
cfg.namespace = flagSet.StringP("namespace", "n", holos.DefaultProvisionerNamespace, "namespace in the provisioner cluster")
cfg.cluster = flagSet.String("cluster-name", "", "cluster name selector")
return cfg, flagSet
}

View File

@@ -13,6 +13,11 @@ func (i *StringSlice) String() string {
return fmt.Sprint(*i)
}
// Type implements the pflag.Value interface and describes the type.
func (i *StringSlice) Type() string {
return "[]string"
}
// Set implements the flag.Value interface.
func (i *StringSlice) Set(value string) error {
for _, str := range strings.Split(value, ",") {

View File

@@ -1 +1 @@
2
3