utils

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeoutCapp          = 30 * time.Second
	CappCreationInterval = 2 * time.Second
)
View Source
const (
	RandStrLength  = 10
	RouteHostname  = "test.dev"
	RouteTlsSecret = "https-capp-secret"
)

Variables

This section is empty.

Functions

func CreateCapp

func CreateCapp(k8sClient client.Client, capp *rcsv1alpha1.Capp) *rcsv1alpha1.Capp

CreateCapp creates a new Capp instance with a unique name and returns it.

func CreateCappWithLogger

func CreateCappWithLogger(logType string, client client.Client) *v1alpha1.Capp

CreateCappWithLogger creates a Capp instance with the specified logger type and returns the created Capp object.

func CreateConfigMap added in v0.1.5

func CreateConfigMap(k8sClient client.Client, configMap *corev1.ConfigMap)

CreateConfigMap creates a new configMap.

func CreateCredentialsSecret

func CreateCredentialsSecret(logType string, client client.Client)

CreateCredentialsSecret creates a Kubernetes secret containing credentials for the specified logger type.

func CreateSecret

func CreateSecret(k8sClient client.Client, secret *corev1.Secret)

CreateSecret creates a new secret.

func DeleteCapp

func DeleteCapp(k8sClient client.Client, capp *rcsv1alpha1.Capp)

DeleteCapp deletes an existing Capp instance.

func DoesResourceExist

func DoesResourceExist(k8sClient client.Client, obj client.Object) bool

DoesResourceExist checks if a given Kubernetes object exists in the cluster.

func GenerateCappName

func GenerateCappName() string

GenerateCappName generates a new secret name by calling generateName with the predefined RouteTlsSecret as the baseName.

func GenerateRouteHostname

func GenerateRouteHostname() string

GenerateRouteHostname generates a new route hostname by calling generateName with the predefined RouteHostname as the baseName.

func GenerateSecretName

func GenerateSecretName() string

GenerateSecretName generates a new secret name by calling generateName with the predefined RouteTlsSecret as the baseName.

func GetCapp

func GetCapp(k8sClient client.Client, name string, namespace string) *rcsv1alpha1.Capp

GetCapp fetch existing and return an instance of Capp.

func GetDomainMapping

func GetDomainMapping(k8sClient client.Client, name string, namespace string) *knativev1beta1.DomainMapping

GetDomainMapping fetch existing and return an instance of DomainMapping.

func GetFlow

func GetFlow(k8sClient client.Client, name string, namespace string) *loggingv1beta1.Flow

GetFlow fetches existing and returns an instance of Flow.

func GetKsvc

func GetKsvc(k8sClient client.Client, name string, namespace string) *knativev1.Service

GetKsvc f retrieves existing instance of Ksvc and returns it.

func GetNextRevisionName

func GetNextRevisionName(currentRevision string) string

GetNextRevisionName generates the name for the next revision based on the current revision name.

func GetOutput

func GetOutput(k8sClient client.Client, name string, namespace string) *loggingv1beta1.Output

GetOutput fetches existing and returns an instance of Output.

func GetResource

func GetResource(k8sClient client.Client, obj client.Object, name, namespace string)

GetResource fetches an existing resource and returns an instance of it.

func GetRevision

func GetRevision(k8sClient client.Client, name string, namespace string) *knativev1.Revision

GetRevision retrieves existing instance of Revision and returns it.

func UpdateCapp

func UpdateCapp(k8sClient client.Client, capp *rcsv1alpha1.Capp)

UpdateCapp updates an existing Capp instance.

func UpdateSecret

func UpdateSecret(k8sClient client.Client, secret *corev1.Secret)

UpdateSecret updates an existing Secret instance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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