feat(go-traefik-certmanager): initial commit
This commit is contained in:
parent
913eaceaa4
commit
c10b760c0b
14 changed files with 835 additions and 0 deletions
36
internal/cmd/cli.go
Normal file
36
internal/cmd/cli.go
Normal file
|
@ -0,0 +1,36 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"git.ar21.de/yolokube/go-traefik-certmanager/internal/config"
|
||||
"github.com/alecthomas/kong"
|
||||
)
|
||||
|
||||
//nolint:lll // ignore line length
|
||||
type CLI struct {
|
||||
CertIssuerName string `name:"cert-issuer-name" env:"CERT_ISSUER_NAME" help:"Name for the certificate issuer" default:"${default_cert_issuer_name}"`
|
||||
CertIssuerKind string `name:"cert-issuer-kind" env:"CERT_ISSUER_KIND" help:"Kind for the certificate issuer" default:"${default_cert_issuer_kind}"`
|
||||
CertCleanup bool `name:"cert-cleanup" env:"CERT_CLEANUP" help:"Delete outdated / removed certificates" default:"${default_cert_cleanup}"`
|
||||
PatchSecretName bool `name:"patch-secret-name" env:"PATCH_SECRET_NAME" help:"Adjust secret names" default:"${default_patch_secret_name}"`
|
||||
}
|
||||
|
||||
func (c *CLI) Parse() *config.AppSettings {
|
||||
_ = kong.Parse(
|
||||
c,
|
||||
kong.Vars{
|
||||
"default_cert_issuer_name": "letsencrypt",
|
||||
"default_cert_issuer_kind": "ClusterIssuer",
|
||||
"default_cert_cleanup": "false",
|
||||
"default_patch_secret_name": "false",
|
||||
},
|
||||
kong.Name("go-traefik-certmanager"),
|
||||
kong.Description("🚀 Start a simple service to sync certificates for traefik CRs"),
|
||||
kong.UsageOnError(),
|
||||
)
|
||||
|
||||
return &config.AppSettings{
|
||||
CertIssuerName: c.CertIssuerName,
|
||||
CertIssuerKind: c.CertIssuerKind,
|
||||
CertCleanup: c.CertCleanup,
|
||||
PatchSecretName: c.PatchSecretName,
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue