Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UpdateCmd = &cobra.Command{ Use: "update", Short: "Prepare all the pki stuff", Long: `Prepare all the pki stuff`, Run: func(cmd *cobra.Command, args []string) { myca := new(pki.CA) myca.SetupCA() if caname == "" { caname = utils.GetEnv("CA_SECRET_NAME", "micropki-ca") } if certname == "" { certname = utils.GetEnv("CERT_SECRET_NAME", "micropki-cert") } caNamespace, err := vars.ValidateNamespace(caNamespace) if err != nil { panic(err.Error()) } namespace, err := vars.ValidateNamespace(namespace) if err != nil { panic(err.Error()) } err = myca.NeedInitialization(caname, caNamespace) if err != nil { if err.Error() != "need update" { panic(err.Error()) } else { err = myca.NewCA() if err != nil { panic(err.Error()) } err = myca.UpdateSecret(caname, caNamespace) if err != nil { panic(err.Error()) } } } mycert := new(pki.CERT) mycert.SetupCERT(client, strings.Split(fqdns, ","), commonname) err = mycert.NeedInitialization(certname, namespace) if err != nil { if err.Error() != "need update" { panic(err.Error()) } else { err = mycert.NewCERT(caname, caNamespace) if err != nil { panic(err.Error()) } err = mycert.UpdateSecret(certname, namespace) if err != nil { panic(err.Error()) } err = mycert.UpdateValidatingWebhookConfiguration(webhook) if err != nil { panic(err.Error()) } } } }}
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.