Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cobra.Command{ Use: "parse-k8s-secret", Short: "Parse TLS Certificate from Kubernetes Secret", Aliases: []string{"parse-k8s", "parse-secret", "parse-sec"}, Args: cobra.NoArgs, Run: func(c *cobra.Command, args []string) { clientset, defaultNamespace, _ := k8s.KubernetesClient() namespace := defaultNamespace if CmdFlagNamespace != "" { namespace = CmdFlagNamespace } secretClient := clientset.CoreV1().Secrets(namespace) secret, err := secretClient.Get( context.TODO(), CmdFlagSecretName, metav1.GetOptions{}, ) if err != nil { log.Fatal(err) } tls_utils.PrintCertificateFromBytes( secret.Data["tls.crt"], secret.Data["tls.key"], ) }, }
View Source
var CmdFlagNamespace string
View Source
var CmdFlagSecretName string
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.