utils

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package utils provides utility functions and helpers for Clowder providers

Index

Constants

View Source
const RCharSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

RCharSet defines the character set used for random string generation

Variables

View Source
var KubeLinterAnnotations = map[string]string{
	"ignore-check.kube-linter.io/no-liveness-probe":  "probes not required on Job pods",
	"ignore-check.kube-linter.io/no-readiness-probe": "probes not required on Job pods",
}

KubeLinterAnnotations defines standard annotations to ignore specific kube-linter checks for Job pods

Functions

func AddCertVolume added in v0.61.0

func AddCertVolume(d *core.PodSpec, dnn string)

AddCertVolume adds a TLS certificate volume to the provided PodSpec

func AppendEnvVarsFromSecret added in v0.67.0

func AppendEnvVarsFromSecret(envvars []core.EnvVar, secName string, inputs ...SecretEnvVar) []core.EnvVar

AppendEnvVarsFromSecret appends environment variables from a secret to the provided slice

func DebugLog added in v0.43.0

func DebugLog(logger logr.Logger, msg string, keysAndValues ...interface{})

DebugLog logs a debug message with the provided logger and key-value pairs

func GetAPIPaths added in v0.65.0

func GetAPIPaths(deployment DeploymentWithWebServices, defaultPath string) []string

GetAPIPaths returns the API paths for a deployment with web services configuration

func GetCACertDir added in v0.101.0

func GetCACertDir() string

GetCACertDir returns the directory where CA certificates are mounted on containers

func GetCaddyGatewayImage added in v0.65.0

func GetCaddyGatewayImage(env *crd.ClowdEnvironment) string

GetCaddyGatewayImage returns the caddy gateway image to use in a given environment

func GetCaddyImage added in v0.42.0

func GetCaddyImage(env *crd.ClowdEnvironment) string

GetCaddyImage returns the caddy image to use in a given environment

func GetCaddyProxyImage added in v0.101.0

func GetCaddyProxyImage(env *crd.ClowdEnvironment) string

GetCaddyProxyImage returns the caddy image to use in a given environment

func GetClowderNamespace added in v0.43.0

func GetClowderNamespace() (string, error)

GetClowderNamespace returns the namespace where Clowder is running

func GetDefaultDatabaseImage added in v0.101.0

func GetDefaultDatabaseImage(version int32, cyndi bool) (string, error)

GetDefaultDatabaseImage returns the default image for the given PostgreSQL version

func GetInMemoryDBImage added in v0.100.0

func GetInMemoryDBImage(env *crd.ClowdEnvironment) string

GetInMemoryDBImage returns the in-memory database image for the environment

func GetKeycloakImage added in v0.42.0

func GetKeycloakImage(env *crd.ClowdEnvironment) string

GetKeycloakImage returns the keycloak image to use in a given environment

func GetKeycloakVersion added in v0.42.0

func GetKeycloakVersion(env *crd.ClowdEnvironment) string

GetKeycloakVersion returns the keycloak version to use in a given environment

func GetMockBOPImage added in v0.42.0

func GetMockBOPImage(env *crd.ClowdEnvironment) string

GetMockBOPImage returns the mock BOP image to use in a given environment

func GetMocktitlementsImage added in v0.42.0

func GetMocktitlementsImage(env *crd.ClowdEnvironment) string

GetMocktitlementsImage returns the mocktitlements image to use in a given environment

func GetServiceCACertPath added in v0.101.0

func GetServiceCACertPath() *string

GetServiceCACertPath returns the full path to the service CA certificate

func IsAnyTLSEnabled added in v0.101.0

func IsAnyTLSEnabled(deploymentWebConfig *crd.WebServices, envTLSConfig *crd.TLS) bool

IsAnyTLSEnabled returns true if public OR private TLS is enabled at the ClowdApp deployment level or at the ClowdEnvironment web provider level

func IsPrivateTLSEnabled added in v0.101.0

func IsPrivateTLSEnabled(deploymentWebConfig *crd.WebServices, envTLSConfig *crd.TLS) bool

IsPrivateTLSEnabled returns true if private TLS is enabled at the ClowdApp deployment level or at the ClowdEnvironment web provider level

func IsPublicTLSEnabled added in v0.101.0

func IsPublicTLSEnabled(deploymentWebConfig *crd.WebServices, envTLSConfig *crd.TLS) bool

IsPublicTLSEnabled returns true if public TLS is enabled at the ClowdApp deployment level or at the ClowdEnvironment web provider level

func IsTLSConfiguredForEnv added in v0.101.0

func IsTLSConfiguredForEnv(envTLSConfig *crd.TLS) bool

IsTLSConfiguredForEnv returns true if the public and private TLS ports are defined on the ClowdEnvironment

func MakeLocalDB

func MakeLocalDB(dd *apps.Deployment, nn types.NamespacedName, baseResource obj.ClowdObject, extraLabels *map[string]string, cfg *config.DatabaseConfig, image string, usePVC bool, dbName string, res *core.ResourceRequirements)

MakeLocalDB populates the given deployment object with the local DB struct.

func MakeLocalDBPVC

func MakeLocalDBPVC(pvc *core.PersistentVolumeClaim, nn types.NamespacedName, baseResource obj.ClowdObject, capacity string)

MakeLocalDBPVC populates the given PVC object with the local DB struct.

func MakeLocalDBService

func MakeLocalDBService(s *core.Service, nn types.NamespacedName, baseResource obj.ClowdObject, extraLabels *map[string]string)

MakeLocalDBService populates the given service object with the local DB struct.

Types

type DeploymentWithWebServices added in v0.101.0

type DeploymentWithWebServices interface {
	GetWebServices() crd.WebServices
}

DeploymentWithWebServices defines an interface for deployments that have web services configuration

type SecretEnvVar added in v0.67.0

type SecretEnvVar struct {
	Name string
	Key  string
}

SecretEnvVar represents an environment variable that references a secret key

func NewSecretEnvVar added in v0.67.0

func NewSecretEnvVar(name, key string) SecretEnvVar

NewSecretEnvVar creates a new SecretEnvVar with the provided name and key

Jump to

Keyboard shortcuts

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