utils

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopySecretToRemoteCluster

func CopySecretToRemoteCluster(
	ctx context.Context,
	cl ctrlclient.Client,
	srcSecretName string,
	dstSecretKey ctrlclient.ObjectKey,
	cluster *clusterv1.Cluster,
) error

CopySecretToRemoteCluster will get the Secret from srcSecretName and create it on the remote cluster, copying Data and StringData to dstSecretKey Secret.

func EnsureCRSForClusterFromObjects

func EnsureCRSForClusterFromObjects(
	ctx context.Context,
	crsName string,
	c ctrlclient.Client,
	cluster *clusterv1.Cluster,
	opts EnsureCRSForClusterFromObjectsOptions,
	objects ...runtime.Object,
) error

func EnsureNamespace

func EnsureNamespace(ctx context.Context, c ctrlclient.Client, ns *corev1.Namespace) error

EnsureNamespace will create the namespace if it does not exist.

func EnsureNamespaceWithMetadata

func EnsureNamespaceWithMetadata(ctx context.Context,
	c ctrlclient.Client,
	name string,
	labels, annotations map[string]string,
) error

EnsureNamespaceWithMetadata will create the namespace with the specified name, labels, and/or annotations, if it does not exist.

func EnsureNamespaceWithName

func EnsureNamespaceWithName(ctx context.Context, c ctrlclient.Client, name string) error

EnsureNamespaceWithName will create the namespace with the specified name if it does not exist.

func EnsureOwnerReferenceForSecret

func EnsureOwnerReferenceForSecret(
	ctx context.Context,
	cl ctrlclient.Client,
	secretName string,
	cluster *clusterv1.Cluster,
) error

EnsureOwnerReferenceForSecret will ensure that the secretName Secret has an OwnerReference of the cluster.

func RetrieveValuesTemplate

func RetrieveValuesTemplate(
	ctx context.Context,
	c ctrlclient.Client,
	configMapName,
	namespace string,
) (string, error)

func RetrieveValuesTemplateConfigMap

func RetrieveValuesTemplateConfigMap(
	ctx context.Context,
	c ctrlclient.Client,
	configMapName,
	namespace string,
) (*corev1.ConfigMap, error)

func SecretForImageRegistryCredentials

func SecretForImageRegistryCredentials(
	ctx context.Context,
	c ctrlclient.Reader,
	credentials *v1alpha1.RegistryCredentials,
	objectNamespace string,
) (*corev1.Secret, error)

SecretForImageRegistryCredentials returns the Secret for the given ImageRegistryCredentials. Returns nil if the secret field is empty.

func SecretNameForImageRegistryCredentials

func SecretNameForImageRegistryCredentials(credentials *v1alpha1.RegistryCredentials) string

SecretNameForImageRegistryCredentials returns the name of the Secret for the given RegistryCredentials. Returns an empty string if the credentials or secret field is empty.

func SetTLSConfigForHelmChartProxyIfNeeded

func SetTLSConfigForHelmChartProxyIfNeeded(hcp *caaphv1.HelmChartProxy)

Types

type EnsureCRSForClusterFromObjectsOptions added in v0.13.0

type EnsureCRSForClusterFromObjectsOptions struct {
	// OwnerCluster holds the owning cluster for the ClusterResourceSet.
	// This allows setting the owner to something other than the workload cluster, which is
	// needed specifically for the ClusterAutoscaler addon which can be deployed in a different
	// namespace to the target cluster as it must exist in the management cluster.
	OwnerCluster *clusterv1.Cluster
}

func DefaultEnsureCRSForClusterFromObjectsOptions added in v0.13.0

func DefaultEnsureCRSForClusterFromObjectsOptions() EnsureCRSForClusterFromObjectsOptions

func (EnsureCRSForClusterFromObjectsOptions) WithOwnerCluster added in v0.13.4

Jump to

Keyboard shortcuts

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