common

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package common contains shared types that are used in multiple CRDs. +kubebuilder:object:generate=true

Index

Constants

View Source
const (
	ActionCreate  = "CREATE"
	ActionObserve = "OBSERVE"
	ActionUpdate  = "UPDATE"
	ActionRemove  = "REMOVE"
)

Action constants define the CRUD operations for HTTP requests

View Source
const (
	ExpectedResponseCheckTypeDefault = "DEFAULT"
	ExpectedResponseCheckTypeCustom  = "CUSTOM"
)

ExpectedResponseCheckType constants define how response validation is performed

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyInjection

type KeyInjection struct {
	// SecretKey is the key within the Kubernetes secret where the data will be injected.
	SecretKey string `json:"secretKey"`

	// ResponseJQ is a jq filter expression representing the path in the response where the secret value will be extracted from.
	ResponseJQ string `json:"responseJQ"`

	// MissingFieldStrategy determines how to handle cases where the field is missing from the response.
	// Possible values are:
	// - "preserve": keeps the existing value in the secret
	// - "setEmpty": sets the value to the empty string
	// - "delete": removes the key from the s
	// +kubebuilder:validation:Enum=preserve;setEmpty;delete
	// +kubebuilder:default=delete
	MissingFieldStrategy MissingFieldStrategy `json:"missingFieldStrategy,omitempty"`
}

KeyInjection represents the configuration for injecting data into a specific key in a Kubernetes secret.

func (*KeyInjection) DeepCopy

func (in *KeyInjection) DeepCopy() *KeyInjection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyInjection.

func (*KeyInjection) DeepCopyInto

func (in *KeyInjection) DeepCopyInto(out *KeyInjection)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Metadata

type Metadata struct {
	// Labels contains key-value pairs to apply as labels to the Kubernetes secret.
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations contains key-value pairs to apply as annotations to the Kubernetes secret.
	Annotations map[string]string `json:"annotations,omitempty"`
}

Metadata contains labels and annotations to apply to a Kubernetes secret.

func (*Metadata) DeepCopy

func (in *Metadata) DeepCopy() *Metadata

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metadata.

func (*Metadata) DeepCopyInto

func (in *Metadata) DeepCopyInto(out *Metadata)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MissingFieldStrategy added in v1.0.10

type MissingFieldStrategy string

MissingFieldStrategy defines how to handle missing fields in the response

const (
	// PreserveMissingField keeps the existing value in the secret when the field is missing from the response
	PreserveMissingField MissingFieldStrategy = "preserve"
	// SetEmptyMissingField sets the value to the empty string when the field is missing from the response
	SetEmptyMissingField MissingFieldStrategy = "setEmpty"
	// DeleteMissingField removes the key from the secret when the field is missing from the response
	DeleteMissingField MissingFieldStrategy = "delete"
)

type SecretInjectionConfig

type SecretInjectionConfig struct {
	// SecretRef contains the name and namespace of the Kubernetes secret where the data will be injected.
	SecretRef SecretRef `json:"secretRef"`

	// SecretKey is the key within the Kubernetes secret where the data will be injected.
	// Deprecated: Use KeyMappings for injecting single or multiple keys.
	SecretKey string `json:"secretKey,omitempty"`

	// ResponsePath is a jq filter expression representing the path in the response where the secret value will be extracted from.
	// Deprecated: Use KeyMappings for injecting single or multiple keys.
	ResponsePath string `json:"responsePath,omitempty"`

	// KeyMappings allows injecting data into single or multiple keys within the same Kubernetes secret.
	KeyMappings []KeyInjection `json:"keyMappings,omitempty"`

	// Metadata contains labels and annotations to apply to the Kubernetes secret.
	Metadata Metadata `json:"metadata,omitempty"`

	// SetOwnerReference determines whether to set the owner reference on the Kubernetes secret.
	SetOwnerReference bool `json:"setOwnerReference,omitempty"`
}

SecretInjectionConfig represents the configuration for injecting secret data into a Kubernetes secret.

func (*SecretInjectionConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretInjectionConfig.

func (*SecretInjectionConfig) DeepCopyInto

func (in *SecretInjectionConfig) DeepCopyInto(out *SecretInjectionConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretRef

type SecretRef struct {
	// Name is the name of the Kubernetes secret.
	Name string `json:"name"`

	// Namespace is the namespace of the Kubernetes secret.
	Namespace string `json:"namespace"`
}

SecretRef contains the name and namespace of a Kubernetes secret.

func (*SecretRef) DeepCopy

func (in *SecretRef) DeepCopy() *SecretRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRef.

func (*SecretRef) DeepCopyInto

func (in *SecretRef) DeepCopyInto(out *SecretRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TLSConfig added in v1.0.12

type TLSConfig struct {
	// CABundle is a PEM encoded CA bundle which will be used to validate the server certificate.
	// If empty, system root CAs will be used.
	// +optional
	CABundle []byte `json:"caBundle,omitempty"`

	// CACertSecretRef is a reference to a secret containing the CA certificate(s).
	// The secret must contain a key specified in the SecretKeySelector.
	// +optional
	CACertSecretRef *xpv1.SecretKeySelector `json:"caCertSecretRef,omitempty"`

	// ClientCertSecretRef is a reference to a secret containing the client certificate.
	// The secret must contain a key specified in the SecretKeySelector.
	// +optional
	ClientCertSecretRef *xpv1.SecretKeySelector `json:"clientCertSecretRef,omitempty"`

	// ClientKeySecretRef is a reference to a secret containing the client private key.
	// The secret must contain a key specified in the SecretKeySelector.
	// +optional
	ClientKeySecretRef *xpv1.SecretKeySelector `json:"clientKeySecretRef,omitempty"`

	// InsecureSkipVerify controls whether the client verifies the server's certificate chain and host name.
	// If true, any certificate presented by the server and any host name in that certificate is accepted.
	// +optional
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}

TLSConfig contains TLS configuration for HTTPS requests.

func (*TLSConfig) DeepCopy added in v1.0.12

func (in *TLSConfig) DeepCopy() *TLSConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSConfig.

func (*TLSConfig) DeepCopyInto added in v1.0.12

func (in *TLSConfig) DeepCopyInto(out *TLSConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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