Documentation
¶
Overview ¶
Package utils provides utility functions and helpers for Clowder providers
Index ¶
- Constants
- Variables
- func AddCertVolume(d *core.PodSpec, dnn string)
- func AppendEnvVarsFromSecret(envvars []core.EnvVar, secName string, inputs ...SecretEnvVar) []core.EnvVar
- func DebugLog(logger logr.Logger, msg string, keysAndValues ...interface{})
- func GetAPIPaths(deployment DeploymentWithWebServices, defaultPath string) []string
- func GetCACertDir() string
- func GetCaddyGatewayImage(env *crd.ClowdEnvironment) string
- func GetCaddyImage(env *crd.ClowdEnvironment) string
- func GetCaddyProxyImage(env *crd.ClowdEnvironment) string
- func GetClowderNamespace() (string, error)
- func GetDefaultDatabaseImage(version int32, cyndi bool) (string, error)
- func GetInMemoryDBImage(env *crd.ClowdEnvironment) string
- func GetKeycloakImage(env *crd.ClowdEnvironment) string
- func GetKeycloakVersion(env *crd.ClowdEnvironment) string
- func GetMockBOPImage(env *crd.ClowdEnvironment) string
- func GetMocktitlementsImage(env *crd.ClowdEnvironment) string
- func GetServiceCACertPath() *string
- func IsAnyTLSEnabled(deploymentWebConfig *crd.WebServices, envTLSConfig *crd.TLS) bool
- func IsPrivateTLSEnabled(deploymentWebConfig *crd.WebServices, envTLSConfig *crd.TLS) bool
- func IsPublicTLSEnabled(deploymentWebConfig *crd.WebServices, envTLSConfig *crd.TLS) bool
- func IsTLSConfiguredForEnv(envTLSConfig *crd.TLS) bool
- func MakeLocalDB(dd *apps.Deployment, nn types.NamespacedName, baseResource obj.ClowdObject, ...)
- func MakeLocalDBPVC(pvc *core.PersistentVolumeClaim, nn types.NamespacedName, ...)
- func MakeLocalDBService(s *core.Service, nn types.NamespacedName, baseResource obj.ClowdObject, ...)
- type DeploymentWithWebServices
- type SecretEnvVar
Constants ¶
const RCharSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
RCharSet defines the character set used for random string generation
Variables ¶
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
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
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
GetClowderNamespace returns the namespace where Clowder is running
func GetDefaultDatabaseImage ¶ added in v0.101.0
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
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
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