common

package
v0.5.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// General constants
	KodeFinalizerName       = "kode.jacero.io/kode-finalizer"
	EntryPointFinalizerName = "kode.jacero.io/entrypoint-finalizer"
	PVCFinalizerName        = "kode.jacero.io/kode-pvc-finalizer"

	// Resource related constants
	KodeVolumeStorageName = "kode-storage"

	// Credential related constants
	Username = "abc"

	// These are the condition types that are used in the status of the Kode and EntryPoint resources
	// ConditionTypeReady indicates that the resource is fully operational and prepared to serve its intended purpose.
	ConditionTypeReady = "Ready"

	// ConditionTypeAvailable indicates that the resource is accessible and can actively serve requests or perform its function.
	ConditionTypeAvailable = "Available"

	// ConditionTypeProgressing indicates that the resource is actively working towards a desired state.
	ConditionTypeProgressing = "Progressing"

	// ConditionTypeDegraded indicates that the resource is operational but not functioning optimally or with full capabilities.
	ConditionTypeDegraded = "Degraded"

	// ConditionTypeError indicates that the resource has encountered an error state that requires attention.
	ConditionTypeError = "Error"

	// ConditionTypeConfigured indicates that the resource has been properly configured with all necessary settings.
	ConditionTypeConfigured = "Configured"

	// ConditionTypeHTTPRouteAvailable indicates that the HTTP route is available and can be accessed.
	ConditionTypeHTTPRouteAvailable = "HTTPRouteAvailable"

	// ConditionTypeHTTPSRouteAvailable indicates that the HTTPS route is available and can be accessed.
	ConditionTypeHTTPSRouteAvailable = "HTTPSRouteAvailable"
)

Variables

This section is empty.

Functions

func AddTypeInformationToObject added in v0.2.2

func AddTypeInformationToObject(scheme *runtime.Scheme, obj runtime.Object) error

addTypeInformationToObject adds TypeMeta information to a runtime.Object based upon the loaded scheme.Scheme taken from: https://github.com/kubernetes/kubernetes/issues/3030#issuecomment-700099699

func BoolPtr

func BoolPtr(b bool) *bool

returns a pointer to a bool

func ContextWithTimeout

func ContextWithTimeout(ctx context.Context, timeoutSeconds int64) (context.Context, context.CancelFunc)

wraps a context with a timeout

func GetCurrentTime added in v0.3.0

func GetCurrentTime() metav1.Time

func GetLatestEntryPoint added in v0.4.0

func GetLatestEntryPoint(ctx context.Context, client client.Client, name string, namespace string) (*kodev1alpha2.EntryPoint, error)

func GetLatestKode added in v0.3.0

func GetLatestKode(ctx context.Context, client client.Client, name string, namespace string) (*kodev1alpha2.Kode, error)

func GetLatestObject added in v0.5.0

func GetLatestObject(ctx context.Context, c client.Client, name, namespace string, obj client.Object) error

func GetUsernameAndPasswordFromSecret added in v0.3.0

func GetUsernameAndPasswordFromSecret(secret *corev1.Secret) (string, string, error)

func Int32Ptr

func Int32Ptr(i int32) *int32

returns a pointer to an int32

func Int64Ptr

func Int64Ptr(i int64) *int64

returns a pointer to an int64

func MaskEnvVars

func MaskEnvVars(envs []corev1.EnvVar) []corev1.EnvVar

masks sensitive environment variables

func MaskSecretData added in v0.3.0

func MaskSecretData(secret *corev1.Secret) map[string]string

masks sensitive values in a secret

func MaskSpec added in v0.2.2

func MaskSpec(spec corev1.Container) corev1.Container

masks sensitive values in a container spec

func MaskString added in v0.4.0

func MaskString(s string) string

masks sensitive string values

func MergeLabels

func MergeLabels(labelsSlice ...map[string]string) map[string]string

merges multiple sets of labels

func ObjectKeyFromConfig added in v0.3.0

func ObjectKeyFromConfig(config CommonConfig) types.NamespacedName

func StringPtr

func StringPtr(s string) *string

returns a pointer to a string

Types

type CommonConfig added in v0.4.0

type CommonConfig struct {
	Labels    map[string]string
	Name      string
	Namespace string
}

type EntryPointResourceConfig added in v0.3.0

type EntryPointResourceConfig struct {
	CommonConfig   CommonConfig
	EntryPointSpec kodev1alpha2.EntryPointSpec

	GatewayName      string
	GatewayNamespace string

	Protocol          kodev1alpha2.Protocol
	IdentityReference *kodev1alpha2.IdentityReference
}

EntryPointResourceConfig holds configuration for EntryPoint resources

func (*EntryPointResourceConfig) HasIdentityReference added in v0.5.0

func (c *EntryPointResourceConfig) HasIdentityReference() bool

func (*EntryPointResourceConfig) IsHTTPS added in v0.5.0

func (c *EntryPointResourceConfig) IsHTTPS() bool

type KodeResourceConfig added in v0.4.0

type KodeResourceConfig struct {
	CommonConfig CommonConfig
	KodeSpec     kodev1alpha2.KodeSpec
	Credentials  *kodev1alpha2.CredentialsSpec
	Port         *kodev1alpha2.Port

	SecretName      string
	StatefulSetName string
	PVCName         string
	ServiceName     string

	UserInitPlugins []kodev1alpha2.InitPluginSpec
	Containers      []corev1.Container
	InitContainers  []corev1.Container

	Template *kodev1alpha2.Template
}

KodeResourceConfig holds configuration for Kode resources

Jump to

Keyboard shortcuts

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