util

package
v0.0.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2022 License: UPL-1.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRetry = wait.Backoff{
	Steps:    150,
	Duration: 4 * time.Second,
	Factor:   1.0,
	Jitter:   0.1,
}

DefaultRetry is the default backoff for e2e tests.

Functions

func CreateNamespace

func CreateNamespace(namespace string, kubeClient kubernetes.Interface) error

CreateNamespace creates a namespace with the specified name using the provided client.

func CreateVMO

CreateVMO creates a secret and verrazzanoMonitoringInstance k8s resources

func DeleteNamespace

func DeleteNamespace(namespace string, kubeClient kubernetes.Interface) error

DeleteNamespace deletes a namespace with the specified name using the provided client.

func DeleteVMO

func DeleteVMO(
	crClient client.VMOCR,
	clientSet kubernetes.Clientset,
	ns string,
	vmo *vmcontrollerv1.VerrazzanoMonitoringInstance,
	secret *corev1.Secret) error

DeleteVMO delete a secret and verrazzanoMonitoringInstance k8s resource

func GenerateKeys

func GenerateKeys(host string, domain string, validFrom string, validFor time.Duration, isCA bool, rsaBits int, ecdsaCurve string) error

GenerateKeys this generates keys

host  	   : string "Comma-separated hostnames and IPs to generate a certificate for"
validFrom  : string "Creation date formatted as Jan 1 15:04:05 2011"
validFor   : time.Duration 365*24*time.Hour, "Duration that certificate is valid for"
isCA       : bool "whether this cert should be its own Certificate Authority"
rsaBits    : int "Size of RSA key to generate. Ignored if --ecdsa-curve is set"
ecdsaCurve : string "ECDSA curve to use to generate a key. Valid values are P224, P256 (recommended), P384, P521")

func GetClient added in v0.0.26

func GetClient() *resty.Client

GetClient gets a client, setting the proxy if appropriate

func GetVMO

GetVMO returns a verrazzanoMonitoringInstance k8s resource

func NamespaceExists

func NamespaceExists(namespace string, kubeClient kubernetes.Interface) bool

NamespaceExists determines whether a namespace with the specified name exists using the provided client.

func NewGrafanaOnlyVMO

func NewGrafanaOnlyVMO(genName, secretName string) *vmcontrollerv1.VerrazzanoMonitoringInstance

NewGrafanaOnlyVMO VMO with Grafana Service only enabled

func NewSecret

func NewSecret(secretName, namespace string) *corev1.Secret

NewSecret creates a basic auth secret

func NewSecretWithTLS

func NewSecretWithTLS(secretName, namespace string, tlsCrt, tlsKey []byte, user string, passwd string) *corev1.Secret

NewSecretWithTLS creates an auth secret with TLS keys

func NewSecretWithTLSWithMultiUser

func NewSecretWithTLSWithMultiUser(secretName, namespace string, tlsCrt, tlsKey []byte, user string, passwd string, extraCreds []string) *corev1.Secret

NewSecretWithTLSWithMultiUser creates an auth secret with TLS keys for admin and Reporter Users

func NewVMO

func NewVMO(genName, secretName string) *vmcontrollerv1.VerrazzanoMonitoringInstance

NewVMO creates a new vmo

func Retry

func Retry(backoff wait.Backoff, fn wait.ConditionFunc) error

Retry executes the provided function repeatedly, retrying until the function returns done = true, errors, or exceeds the given timeout.

func RunAfterPhase

func RunAfterPhase(f *framework.Framework) bool

RunAfterPhase returns, based on the given framework object, whether or not to run the after phase.

func RunBeforePhase

func RunBeforePhase(f *framework.Framework) bool

RunBeforePhase returns, based on the given framework object, whether or not to run the before phase.

func SkipTeardown

func SkipTeardown(f *framework.Framework) bool

SkipTeardown returns, based on the given framework object, whether or not to skip teardown

func WaitForDeploymentAvailable

func WaitForDeploymentAvailable(namespace string, deploymentName string, availableReplicas int32, backoff wait.Backoff, kubeClient kubernetes.Interface) error

WaitForDeploymentAvailable waits for the given deployment to reach the given number of available replicas

func WaitForElasticSearchIndexDocCount

func WaitForElasticSearchIndexDocCount(ElasticSearchIndexDocCountURL string, count string, backoff wait.Backoff) (bool, error)

WaitForElasticSearchIndexDocCount waits for doc count to show up in elasticsearch

func WaitForEndpointAvailable

func WaitForEndpointAvailable(name string, externalIP string, port int32, urlPath string, expectedStatusCode int, backoff wait.Backoff) error

WaitForEndpointAvailable waits for the given endpoint to become available

func WaitForEndpointAvailableWithAuth

func WaitForEndpointAvailableWithAuth(
	component string,
	domainName string,
	useIP string,
	port int32,
	path string,
	expectedStatusCode int,
	backoff wait.Backoff,
	username string,
	password string) error

WaitForEndpointAvailableWithAuth waits for the given endpoint to become available if useIp is set, use the given worker ip to verify the endpoints/urlPath

func WaitForService

func WaitForService(namespace string, serviceName string, backoff wait.Backoff,
	kubeClient kubernetes.Interface) (*apiv1.Service, error)

WaitForService waits for the given service to become available

func WaitForStatefulSetAvailable

func WaitForStatefulSetAvailable(namespace string, statefulSetName string, availableReplicas int32, backoff wait.Backoff, kubeClient kubernetes.Interface) error

WaitForStatefulSetAvailable waits for the given statefulset to reach the given number of available replicas

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL