Documentation ¶
Index ¶
- func CheckVersionReached(t *testing.T, kubeClient kubernetes.Interface, version string, retries int, ...) error
- func CreateCluster(t *testing.T, crClient versioned.Interface, vs *api.VaultService) (*api.VaultService, error)
- func DeleteCluster(t *testing.T, crClient versioned.Interface, vs *api.VaultService) error
- func InitializeVault(t *testing.T, vaultsCRClient versioned.Interface, vault *api.VaultService, ...) (*api.VaultService, *vaultapi.InitResponse)
- func LogfWithTimestamp(t *testing.T, format string, args ...interface{})
- func MapObjectToArbitraryData(obj interface{}) (map[string]interface{}, error)
- func NewCluster(genName, namespace string, size int) *api.VaultService
- func PodLabelForOperator(name string) map[string]string
- func ResizeCluster(t *testing.T, crClient versioned.Interface, vs *api.VaultService, size int) (*api.VaultService, error)
- func SetupUnsealedVaultCluster(t *testing.T, kubeClient kubernetes.Interface, ...) (*api.VaultService, *vaultapi.TLSConfig, string)
- func SetupVaultClient(t *testing.T, kubeClient kubernetes.Interface, namespace string, ...) *vaultapi.Client
- func UnsealVaultNode(unsealKey string, vClient *vaultapi.Client) error
- func UpdateVersion(t *testing.T, crClient versioned.Interface, vs *api.VaultService, ...) (*api.VaultService, error)
- func VerifySecretData(t *testing.T, vClient *vaultapi.Client, secretData map[string]interface{}, ...)
- func WaitActiveVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, retries int, ...) (*api.VaultService, error)
- func WaitAvailableVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, size, retries int, ...) (*api.VaultService, error)
- func WaitForCluster(t *testing.T, kubeClient kubernetes.Interface, ...) (*api.VaultService, *vaultapi.TLSConfig)
- func WaitPodsDeletedCompletely(kubecli kubernetes.Interface, namespace string, retries int, ...) ([]*v1.Pod, error)
- func WaitPodsWithImageDeleted(kubecli kubernetes.Interface, namespace, image string, retries int, ...) ([]*v1.Pod, error)
- func WaitSealedVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, size, retries int, ...) (*api.VaultService, error)
- func WaitStandbyVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, size, retries int, ...) (*api.VaultService, error)
- func WaitUntilActiveIsFrom(t *testing.T, vaultsCRClient versioned.Interface, retries int, ...) (*api.VaultService, error)
- func WaitUntilAvailableAreFrom(t *testing.T, vaultsCRClient versioned.Interface, retries int, ...) (*api.VaultService, error)
- func WaitUntilOperatorReady(kubecli kubernetes.Interface, namespace, name string) error
- func WaitUntilStandbyAreFrom(t *testing.T, vaultsCRClient versioned.Interface, retries int, ...) (*api.VaultService, error)
- func WaitUntilVaultConditionTrue(t *testing.T, vaultsCRClient versioned.Interface, retries int, ...) (*api.VaultService, error)
- func WriteSecretData(t *testing.T, vaultCR *api.VaultService, kubeClient kubernetes.Interface, ...) (*vaultapi.Client, string, map[string]interface{}, string)
- type SampleSecret
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersionReached ¶
func CheckVersionReached(t *testing.T, kubeClient kubernetes.Interface, version string, retries int, vs *api.VaultService, targetVaultPods ...string) error
CheckVersionReached checks if all the targetVaultPods are of the specified version
func CreateCluster ¶
func CreateCluster(t *testing.T, crClient versioned.Interface, vs *api.VaultService) (*api.VaultService, error)
CreateCluster creates a vault CR with the desired spec
func DeleteCluster ¶
DeleteCluster deletes the vault CR specified by cluster spec
func InitializeVault ¶
func InitializeVault(t *testing.T, vaultsCRClient versioned.Interface, vault *api.VaultService, vClient *vaultapi.Client) (*api.VaultService, *vaultapi.InitResponse)
InitializeVault initializes the specified vault cluster and waits for all available nodes to appear as sealed. Requires established portforwarded connections to the vault pods Returns the updated vault cluster and the initialization response which includes the unseal key
func LogfWithTimestamp ¶
LogfWithTimestamp is used for formatted test logs with the timestamp appended
func MapObjectToArbitraryData ¶
MapSecretToArbitraryData converts the obj(custom data type) to the arbitrary data format (map[string]interface{}) that is used as the data in a vault secret. See https://github.com/hashicorp/vault/blob/master/api/secret.go#L19-L21
func NewCluster ¶
func NewCluster(genName, namespace string, size int) *api.VaultService
NewCluster returns a minimal vault cluster CR
func PodLabelForOperator ¶
PodLabelForOperator returns a label of the form name=<name>
func ResizeCluster ¶
func ResizeCluster(t *testing.T, crClient versioned.Interface, vs *api.VaultService, size int) (*api.VaultService, error)
ResizeCluster updates the Nodes field of the vault CR
func SetupUnsealedVaultCluster ¶
func SetupUnsealedVaultCluster(t *testing.T, kubeClient kubernetes.Interface, vaultsCRClient versioned.Interface, namespace string) (*api.VaultService, *vaultapi.TLSConfig, string)
SetupUnsealedVaultCluster initializes a vault cluster and unseals the 1st vault node.
func SetupVaultClient ¶
func SetupVaultClient(t *testing.T, kubeClient kubernetes.Interface, namespace string, tlsConfig *vaultapi.TLSConfig, podName string) *vaultapi.Client
SetupVaultClient creates a vault client for the specified pod
func UnsealVaultNode ¶
UnsealVaultNode unseals the specified vault pod by portforwarding to it via its vault client
func UpdateVersion ¶
func UpdateVersion(t *testing.T, crClient versioned.Interface, vs *api.VaultService, version string) (*api.VaultService, error)
UpdateVersion updates the Version field of the vault CR
func VerifySecretData ¶
func VerifySecretData(t *testing.T, vClient *vaultapi.Client, secretData map[string]interface{}, keyPath, podName string)
VerifySecretData gets secret of the "keyPath" and compares it against the given secretData.
func WaitActiveVaultsUp ¶
func WaitActiveVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, retries int, vs *api.VaultService) (*api.VaultService, error)
WaitActiveVaultsUp retries until there is 1 active node in the CR status
func WaitAvailableVaultsUp ¶
func WaitAvailableVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, size, retries int, vs *api.VaultService) (*api.VaultService, error)
WaitAvailableVaultsUp retries until the desired number of vault nodes are shown as available in the CR status
func WaitForCluster ¶
func WaitForCluster(t *testing.T, kubeClient kubernetes.Interface, vaultsCRClient versioned.Interface, vaultCR *api.VaultService) (*api.VaultService, *vaultapi.TLSConfig)
WaitForCluster waits for all available nodes of a cluster to appear in the vault CR status Returns the updated vault cluster and the TLS configuration to use for vault clients interacting with the cluster
func WaitPodsDeletedCompletely ¶
func WaitPodsDeletedCompletely(kubecli kubernetes.Interface, namespace string, retries int, lo metav1.ListOptions) ([]*v1.Pod, error)
WaitPodsDeletedCompletely waits until the pods are completely removed(not just terminating) for the given label selector
func WaitPodsWithImageDeleted ¶
func WaitPodsWithImageDeleted(kubecli kubernetes.Interface, namespace, image string, retries int, lo metav1.ListOptions) ([]*v1.Pod, error)
WaitPodsWithImageDeleted waits until the pods with the specified image and labels are removed
func WaitSealedVaultsUp ¶
func WaitSealedVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, size, retries int, vs *api.VaultService) (*api.VaultService, error)
WaitSealedVaultsUp retries until the desired number of vault nodes are shown as sealed in the CR status
func WaitStandbyVaultsUp ¶
func WaitStandbyVaultsUp(t *testing.T, vaultsCRClient versioned.Interface, size, retries int, vs *api.VaultService) (*api.VaultService, error)
WaitStandbyVaultsUp retries until the desired number of vault nodes are shown as standby in the CR status
func WaitUntilActiveIsFrom ¶
func WaitUntilActiveIsFrom(t *testing.T, vaultsCRClient versioned.Interface, retries int, vs *api.VaultService, targetVaultPods ...string) (*api.VaultService, error)
WaitUntilActiveIsFrom waits until the active node is from one of the target pods
func WaitUntilAvailableAreFrom ¶
func WaitUntilAvailableAreFrom(t *testing.T, vaultsCRClient versioned.Interface, retries int, vs *api.VaultService, targetVaultPods ...string) (*api.VaultService, error)
WaitUntilAvailableAreFrom waits until all the available nodes are from the target pods
func WaitUntilOperatorReady ¶
func WaitUntilOperatorReady(kubecli kubernetes.Interface, namespace, name string) error
WaitUntilOperatorReady will wait until the first pod with the label name=<name> is ready.
func WaitUntilStandbyAreFrom ¶
func WaitUntilStandbyAreFrom(t *testing.T, vaultsCRClient versioned.Interface, retries int, vs *api.VaultService, targetVaultPods ...string) (*api.VaultService, error)
WaitUntilStandbyAreFrom waits until all the standby nodes are from the target pods
func WaitUntilVaultConditionTrue ¶
func WaitUntilVaultConditionTrue(t *testing.T, vaultsCRClient versioned.Interface, retries int, vs *api.VaultService, checkCondition checkConditionFunc) (*api.VaultService, error)
WaitUntilVaultConditionTrue retries until the specified condition check becomes true for the vault CR