Documentation ¶
Index ¶
- func GetCACertPEM(cert *tls.Certificate) string
- func GetKeyPEM(key *ecdsa.PrivateKey) ([]byte, error)
- func GetSessionID() string
- func IsPodFailing(pod *v1.Pod) (bool, string)
- func MakeErrorResult(resultType string, errdata map[string]interface{}, nodeName string) *plugin.Result
- func MakeTLSSecret(cert *tls.Certificate, namespace, secretName string) (*v1.Secret, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCACertPEM ¶
func GetCACertPEM(cert *tls.Certificate) string
GetCACertPEM extracts the CA cert from a tls.Certificate. If the provided Certificate has only one certificate in the chain, the CA will be the leaf cert.
func GetKeyPEM ¶
func GetKeyPEM(key *ecdsa.PrivateKey) ([]byte, error)
GetKeyPEM turns an RSA Private Key into a PEM-encoded string
func GetSessionID ¶ added in v0.10.0
func GetSessionID() string
GetSessionID generates a new session id. This is essentially an instance of a running plugin.
func IsPodFailing ¶
IsPodFailing returns whether a plugin's pod is failing and isn't likely to succeed. TODO: this may require more revisions as we get more experience with various types of failures that can occur.
func MakeErrorResult ¶
func MakeErrorResult(resultType string, errdata map[string]interface{}, nodeName string) *plugin.Result
MakeErrorResult constructs a plugin.Result given an error message and error data. errdata is a map that will be placed in the sonobuoy results tarball for this plugin as a JSON file, so it's what users will see for why the plugin failed. If errdata["error"] is not set, it will be filled in with an "Unknown error" string.
func MakeTLSSecret ¶
MakeTLSSecret makes a Kubernetes secret object for the given TLS certificate.
Types ¶
This section is empty.