utils

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RandStrLength        = 10
	TimeoutCapp          = 60 * time.Second
	CappCreationInterval = 2 * time.Second
)
View Source
const (
	RbacObjectSuffix = "-logs-reader"
)

Variables

This section is empty.

Functions

func CreateCapp

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

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

func CreateRole

func CreateRole(k8sClient client.Client, role *rbacv1.Role) *rbacv1.Role

CreateRole creates a rbac1.Role object and returns it

func CreateRoleBinding

func CreateRoleBinding(k8sClient client.Client, roleBinding *rbacv1.RoleBinding) *rbacv1.RoleBinding

CreateRoleBinding creates a rbacv1.RoleBinding and returns it

func CreateSecret

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

CreateSecret creates a corev1.secret object with a random suffix in its name and returns it

func CreateTlsSecret added in v0.1.6

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

CreateTlsSecret creates a tls typed corev1.secret with a random suffix in its name and returns it.

func DeleteCapp

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

DeleteCapp deletes an existing Capp instance.

func DoesFinalizerExist

func DoesFinalizerExist(k8sClient client.Client, cappName string, cappNamespace string, finalizerName string) bool

DoesFinalizerExist checks if a finalizer exists on a Capp.

func DoesResourceExist

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

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

func GenerateUniqueCappName added in v0.1.6

func GenerateUniqueCappName(baseCappName string) string

GenerateUniqueCappName generates a unique Capp name.

func GenerateUniqueSecretName added in v0.1.6

func GenerateUniqueSecretName(baseSecretName string) string

GenerateUniqueSecretName generates a unique Secret name.

func GetAddOnPlacementScore added in v0.1.4

func GetAddOnPlacementScore(k8sClient client.Client, name string, namespace string) *clusterv1alpha1.AddOnPlacementScore

GetAddOnPlacementScore fetches an existing GetAddOnPlacementScore and returns its instance.

func GetCapp

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

GetCapp fetches an existing Capp and return the instance.

func GetCappFromManifestWork

func GetCappFromManifestWork(manifestWork workv1.ManifestWork) unstructured.Unstructured

GetCappFromManifestWork returns a Capp from its corresponding ManifestWork

func IsObjInManifestWork

func IsObjInManifestWork(k8sClient client.Client, manifestWork workv1.ManifestWork, objName string, objNamespace string, object client.Object, kind string) (bool, error)

IsObjInManifestWork checks if a given object is in the ManifestWork's manifests list

func IsRbacObjInManifestWork

func IsRbacObjInManifestWork(manifestWork workv1.ManifestWork, cappName string, nsName string, kind string) bool

IsRbacObjInManifestWork checks if a given role/rolebinding object is in the ManifestWork's manifests list

func IsSiteInPlacement

func IsSiteInPlacement(k8sClient client.Client, placementName string, placementNamespace string) (bool, error)

IsSiteInPlacement checks if a given site is part of a clusterset mentioned in a placement

Types

This section is empty.

Jump to

Keyboard shortcuts

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