Documentation
¶
Index ¶
- Constants
- func CreateBundle(t *testing.T, kubectlOptions *k8s.KubectlOptions, ...)
- func CreateCAIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
- func CreateSelfSignedCertificate(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
- func CreateSelfSignedIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
- func DeleteBundle(t *testing.T, kubectlOptions *k8s.KubectlOptions)
- func DeleteCAIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
- func DeleteCertManager(t *testing.T, kubectlOptions *k8s.KubectlOptions)
- func DeleteSelfSignedCertificate(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
- func DeleteSelfSignedIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
- func DeleteTrustManager(t *testing.T, kubectlOptions *k8s.KubectlOptions)
- func GetGitRoot() string
- func InstallCertManager(t *testing.T, kubectlOptions *k8s.KubectlOptions)
- func InstallIngressAndMetalLB(t *testing.T)
- func InstallTrustManager(t *testing.T, kubectlOptions *k8s.KubectlOptions, trustNamespace string)
- func LoadCertificate(t *testing.T, certSecret *corev1.Secret, key string) *x509.Certificate
- func PatchHelmValues(inputValues map[string]string) map[string]string
- func PrintDebugLogs(t *testing.T, options *k8s.KubectlOptions)
- func RequireCRDBClusterToBeReadyEventuallyTimeout(t *testing.T, opts *k8s.KubectlOptions, crdbCluster CockroachCluster, ...)
- func RequireCRDBClusterToFunction(t *testing.T, crdbCluster CockroachCluster, rotate bool, podName string)
- func RequireCRDBDatabaseToFunction(t *testing.T, crdbCluster CockroachCluster, dbName string, podName string)
- func RequireCRDBToFunction(t *testing.T, crdbCluster CockroachCluster, validateExistingData bool)
- func RequireCertRotateJobToBeCompleted(t *testing.T, jobName string, crdbCluster CockroachCluster, ...)
- func RequireCertificatesToBeValid(t *testing.T, crdbCluster CockroachCluster)
- func RequireClusterToBeReadyEventuallyTimeout(t *testing.T, crdbCluster CockroachCluster, timeout time.Duration)
- func RequirePodToBeCreatedAndReady(t *testing.T, opts *k8s.KubectlOptions, podName string, timeout time.Duration)
- func RequireToRunRotateJob(t *testing.T, crdbCluster CockroachCluster, values map[string]string, ...)
- func TestIngressRoutingDirect(t *testing.T, hostName string)
- func UninstallIngressAndMetalLB(t *testing.T)
- func WaitUntilPodDeleted(t *testing.T, options *k8s.KubectlOptions, podName string, retries int, ...)
- type CockroachCluster
Constants ¶
const ( SelfSignedIssuerName = "cockroachdb-selfsigned" SelfSignedCertName = "cockroachdb-ca" CAIssuerName = "cockroachdb" CASecretName = "cockroachdb-ca-secret" CAConfigMapName = "cockroachdb-ca" CertManagerNamespace = "cert-manager" )
const (
TestDBName = "test_db"
)
Variables ¶
This section is empty.
Functions ¶
func CreateBundle ¶
func CreateBundle(t *testing.T, kubectlOptions *k8s.KubectlOptions, caSecretName, caConfigMapName string)
CreateBundle creates a bundle which transfers the CA certificate from secret to configmap in the target namespace.
func CreateCAIssuer ¶
func CreateCAIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
CreateCAIssuer creates a CA issuer using the CA certificate stored in a secret. The CA issuer is used to sign the certificates for the cockroachdb cluster.
func CreateSelfSignedCertificate ¶
func CreateSelfSignedCertificate(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
CreateSelfSignedCertificate creates a self-signed certificate which is stored in a secret.
func CreateSelfSignedIssuer ¶
func CreateSelfSignedIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
CreateSelfSignedIssuer creates a self-signed issuer which is used to sign the self signed CA certificate.
func DeleteBundle ¶
func DeleteBundle(t *testing.T, kubectlOptions *k8s.KubectlOptions)
DeleteBundle deletes the bundle.
func DeleteCAIssuer ¶
func DeleteCAIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
func DeleteCertManager ¶
func DeleteCertManager(t *testing.T, kubectlOptions *k8s.KubectlOptions)
DeleteCertManager deletes the cert-manager release.
func DeleteSelfSignedCertificate ¶
func DeleteSelfSignedCertificate(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
func DeleteSelfSignedIssuer ¶
func DeleteSelfSignedIssuer(t *testing.T, kubectlOptions *k8s.KubectlOptions, issuerNamespace string)
DeleteSelfSignedIssuer deletes the self-signed issuer.
func DeleteTrustManager ¶
func DeleteTrustManager(t *testing.T, kubectlOptions *k8s.KubectlOptions)
DeleteTrustManager deletes the trust-manager release.
func GetGitRoot ¶
func GetGitRoot() string
func InstallCertManager ¶
func InstallCertManager(t *testing.T, kubectlOptions *k8s.KubectlOptions)
InstallCertManager installs the cert-manager in cert-manager namespace with helm: https://cert-manager.io/docs/installation/helm/
func InstallTrustManager ¶
func InstallTrustManager(t *testing.T, kubectlOptions *k8s.KubectlOptions, trustNamespace string)
InstallTrustManager installs the trust-manager in cert-manager namespace with helm: https://cert-manager.io/docs/trust/trust-manager/installation/
func LoadCertificate ¶
func PrintDebugLogs ¶
func PrintDebugLogs(t *testing.T, options *k8s.KubectlOptions)
PrintDebugLogs adds the verbose logging of the cluster at the runtime.
func RequireCRDBClusterToBeReadyEventuallyTimeout ¶
func RequireCRDBClusterToBeReadyEventuallyTimeout(t *testing.T, opts *k8s.KubectlOptions, crdbCluster CockroachCluster, timeout time.Duration)
RequireCRDBClusterToBeReadyEventuallyTimeout waits for all the CockroachDB pods to come into running state.
func RequireCRDBClusterToFunction ¶
func RequireCRDBClusterToFunction(t *testing.T, crdbCluster CockroachCluster, rotate bool, podName string)
func RequireCRDBDatabaseToFunction ¶
func RequireCRDBDatabaseToFunction(t *testing.T, crdbCluster CockroachCluster, dbName string, podName string)
RequireCRDBDatabaseToFunction creates a database, a table and insert two rows.
func RequireCRDBToFunction ¶
func RequireCRDBToFunction(t *testing.T, crdbCluster CockroachCluster, validateExistingData bool)
RequireCRDBToFunction creates a database, a table and insert two rows if it is a fresh installation of the cluster. If validateExistingData is true, this will check that existing two rows are present.
func RequireCertRotateJobToBeCompleted ¶
func RequireCertRotateJobToBeCompleted(t *testing.T, jobName string, crdbCluster CockroachCluster, timeout time.Duration)
RequireCertRotateJobToBeCompleted waits for the certificate rotation job to complete.
func RequireCertificatesToBeValid ¶
func RequireCertificatesToBeValid(t *testing.T, crdbCluster CockroachCluster)
RequireCertificatesToBeValid will check the CA certificate and client certificate validity from their respective secrets. Also, it verifies that node certificates are signed by the CA certificates used in the cluster.
func RequireClusterToBeReadyEventuallyTimeout ¶
func RequireClusterToBeReadyEventuallyTimeout(t *testing.T, crdbCluster CockroachCluster, timeout time.Duration)
RequireClusterToBeReadyEventuallyTimeout waits for all the CRDB pods to come into running state.
func RequireToRunRotateJob ¶
func RequireToRunRotateJob(t *testing.T, crdbCluster CockroachCluster, values map[string]string, scheduleToTriggerRotation string, caRotate bool, )
RequireToRunRotateJob triggers the client/node or CA certificate rotation job based on next cron schedule.
func WaitUntilPodDeleted ¶
func WaitUntilPodDeleted( t *testing.T, options *k8s.KubectlOptions, podName string, retries int, sleepBetweenRetries time.Duration, )
WaitUntilPodDeleted waits until the pod is deleted, retrying the check for the specified amount of times, sleeping for the provided duration between each try.