utils

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Domain = cappv1alpha1.GroupVersion.Group
)

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 CreateCappWithHTTPHostname added in v0.3.0

func CreateCappWithHTTPHostname(k8sClient client.Client) (*cappv1alpha1.Capp, string)

CreateCappWithHTTPHostname creates a Capp with a Hostname.

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

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 CreateHTTPSCapp added in v0.3.0

func CreateHTTPSCapp(k8sClient client.Client) (*cappv1alpha1.Capp, string)

CreateHTTPSCapp creates a Capp with a Hostname, TLS Enabled and TLSSecret.

func CreateSecret

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

CreateSecret creates a new secret.

func DeleteCapp

func DeleteCapp(k8sClient client.Client, capp *cappv1alpha1.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 name for Capp.

func GenerateCertSecretName added in v0.3.0

func GenerateCertSecretName(cappName string) string

GenerateCertSecretName generates a capp cert secret name.

func GenerateResourceName added in v0.3.0

func GenerateResourceName(hostname, suffix string) string

GenerateResourceName generates the hostname based on the provided suffix and a dot (".") trailing character. It returns the adjusted hostname, where the suffix (minus the trailing character) is added if not already present.

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) *cappv1alpha1.Capp

GetCapp fetches and returns an existing instance of a Capp.

func GetCappRevision added in v0.3.1

func GetCappRevision(k8sClient client.Client, cappRevisionName, namespace string) *cappv1alpha1.CappRevision

GetCappRevision retrieves a CappRevision by name.

func GetCappRevisions added in v0.2.0

func GetCappRevisions(ctx context.Context, k8sClient client.Client, capp cappv1alpha1.Capp) ([]cappv1alpha1.CappRevision, error)

GetCappRevisions retrieves a list of CappRevision resources filtered by labels matching a specific Capp, returning the list and any error encountered.

func GetCertificate added in v0.3.0

func GetCertificate(k8sClient client.Client, name string, namespace string) *cmapi.Certificate

GetCertificate fetches and returns an existing instance of a Certificate.

func GetClusterResource added in v0.3.0

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

GetClusterResource fetches an existing Cluster resource and returns an instance of it.

func GetDNSRecord added in v0.3.0

func GetDNSRecord(k8sClient client.Client, name string) *dnsrecordv1alpha1.CNAMERecord

GetDNSRecord fetches and returns an existing instance of an CNAMERecord.

func GetDomainMapping

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

GetDomainMapping fetches and returns an existing instance of a DomainMapping.

func GetKSVC added in v0.3.0

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

GetKSVC fetches and returns an existing instance of a Knative Serving.

func GetNFSPVC added in v0.3.0

func GetNFSPVC(k8sClient client.Client, name string, namespace string) *nfspvcv1alpha1.NfsPvc

GetNFSPVC fetches and returns an existing instance of a NFSPVC.

func GetNextRevisionName

func GetNextRevisionName(currentRevision string) string

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

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 fetches and returns an existing instance of a Knative Revision.

func GetSecret added in v0.3.1

func GetSecret(k8sClient client.Client, name string, namespace string) *corev1.Secret

GetSecret fetches and returns an existing instance of a Secret.

func GetSyslogNGFlow added in v0.2.0

func GetSyslogNGFlow(k8sClient client.Client, name string, namespace string) *loggingv1beta1.SyslogNGFlow

GetSyslogNGFlow fetches existing and returns an instance of a SyslogNGFlow.

func GetSyslogNGOutput added in v0.2.0

func GetSyslogNGOutput(k8sClient client.Client, name string, namespace string) *loggingv1beta1.SyslogNGOutput

GetSyslogNGOutput fetches existing and returns an instance of a SyslogNGOutput.

func UpdateResource added in v0.3.1

func UpdateResource(k8sClient client.Client, object client.Object) error

UpdateResource updates an existing resource.

Types

This section is empty.

Jump to

Keyboard shortcuts

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