Documentation
¶
Index ¶
- Variables
- func CreateEnvTestSecret(client client.Client, cfg *rest.Config, cluster *clusterv1.Cluster) errordeprecated
- func CreateSecret(ctx context.Context, c client.Client, cluster *clusterv1.Cluster) error
- func CreateSecretWithOwner(ctx context.Context, c client.Client, clusterName client.ObjectKey, ...) error
- func FromEnvTestConfig(cfg *rest.Config, cluster *clusterv1.Cluster) []byte
- func FromSecret(ctx context.Context, c client.Reader, cluster client.ObjectKey) ([]byte, error)
- func GenerateSecret(cluster *clusterv1.Cluster, data []byte) *corev1.Secret
- func GenerateSecretWithOwner(clusterName client.ObjectKey, data []byte, owner metav1.OwnerReference) *corev1.Secret
- func NeedsClientCertRotation(configSecret *corev1.Secret, threshold time.Duration) (bool, error)
- func New(clusterName, endpoint string, caCert *x509.Certificate, caKey crypto.Signer) (*api.Config, error)
- func RegenerateSecret(ctx context.Context, c client.Client, configSecret *corev1.Secret) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrDependentCertificateNotFound = errors.New("could not find secret ca")
)
Functions ¶
func CreateEnvTestSecret
deprecated
added in
v0.3.0
func CreateEnvTestSecret(client client.Client, cfg *rest.Config, cluster *clusterv1.Cluster) error
Deprecated: use test/helpers/envtest
func CreateSecret ¶
func CreateSecret(ctx context.Context, c client.Client, cluster *clusterv1.Cluster) error
CreateSecret creates the Kubeconfig secret for the given cluster.
func CreateSecretWithOwner ¶ added in v0.3.0
func CreateSecretWithOwner(ctx context.Context, c client.Client, clusterName client.ObjectKey, endpoint string, owner metav1.OwnerReference) error
CreateSecretWithOwner creates the Kubeconfig secret for the given cluster name, namespace, endpoint, and owner reference.
func FromEnvTestConfig ¶ added in v0.3.0
func FromEnvTestConfig(cfg *rest.Config, cluster *clusterv1.Cluster) []byte
func FromSecret ¶
func FromSecret(ctx context.Context, c client.Reader, cluster client.ObjectKey) ([]byte, error)
FromSecret fetches the Kubeconfig for a Cluster.
func GenerateSecret ¶ added in v0.3.0
func GenerateSecret(cluster *clusterv1.Cluster, data []byte) *corev1.Secret
GenerateSecret returns a Kubernetes secret for the given Cluster and kubeconfig data.
func GenerateSecretWithOwner ¶ added in v0.3.0
func GenerateSecretWithOwner(clusterName client.ObjectKey, data []byte, owner metav1.OwnerReference) *corev1.Secret
GenerateSecretWithOwner returns a Kubernetes secret for the given Cluster name, namespace, kubeconfig data, and ownerReference.
func NeedsClientCertRotation ¶ added in v0.3.7
func NeedsClientCertRotation(configSecret *corev1.Secret, threshold time.Duration) (bool, error)
NeedsClientCertRotation returns whether any of the Kubeconfig secret's client certificates will expire before the given threshold.
func New ¶
func New(clusterName, endpoint string, caCert *x509.Certificate, caKey crypto.Signer) (*api.Config, error)
New creates a new Kubeconfig using the cluster name and specified endpoint.
func RegenerateSecret ¶ added in v0.3.7
func RegenerateSecret(ctx context.Context, c client.Client, configSecret *corev1.Secret) error
RegenerateSecret creates and stores a new Kubeconfig in the given secret.
Types ¶
This section is empty.