Documentation
¶
Overview ¶
Package object provides a set of functions to work with the kubernetes objects
Index ¶
- Variables
- func CreatePatch(newObject, oldObject runtime.Object) ([]byte, error)
- func GetKind(definition []byte) (string, error)
- func InjectPluginInitContainerSidecarSpec(spec *corev1.PodSpec, sidecar *corev1.Container, ...) error
- func InjectPluginSidecar(pod *corev1.Pod, sidecar *corev1.Container, injectPostgresVolumeMounts bool) errordeprecated
- func InjectPluginSidecarInitContainer(pod *corev1.Pod, sidecar *corev1.Container, injectPostgresVolumeMounts bool) error
- func InjectPluginSidecarSpec(spec *corev1.PodSpec, sidecar *corev1.Container, ...) errordeprecated
- func InjectPluginVolume(pod *corev1.Pod)
- func InjectPluginVolumeSpec(spec *corev1.PodSpec)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoPostgresContainerFound is raised when there's no PostgreSQL container // in the passed instance Pod. ErrNoPostgresContainerFound = errors.New("no postgres container into instance Pod") // ErrNilPodPassed is raised when a nil Pod is passed to a function requiring it. ErrNilPodPassed = errors.New("nil pod passed") )
Functions ¶
func CreatePatch ¶
CreatePatch creates a JSON patch from the diff between the old and new object.
func InjectPluginInitContainerSidecarSpec ¶ added in v0.4.0
func InjectPluginInitContainerSidecarSpec( spec *corev1.PodSpec, sidecar *corev1.Container, injectPostgresVolumeMounts bool, ) error
InjectPluginInitContainerSidecarSpec injects a plugin sidecar into a CNPG Pod spec as an InitContainer. This requires the SidecarContainers feature gate to be enabled, which is the default for kubernetes versions >= 1.29.
If the "injectPostgresVolumeMount" flag is true, this will append all the volume mounts that are used in the instance manager Pod to the passed sidecar container, granting it superuser access to the PostgreSQL instance.
Besides the value of "injectPostgresVolumeMount", the plugin volume will always be injected in the PostgreSQL container.
func InjectPluginSidecar
deprecated
func InjectPluginSidecar(pod *corev1.Pod, sidecar *corev1.Container, injectPostgresVolumeMounts bool) error
InjectPluginSidecar refer to InjectPluginSidecarSpec.
Deprecated: Kubernetes versions >= 1.29 support sidecars as InitContainers by default, so this function should not be used anymore. Use InjectPluginInitContainerSidecarSpec instead.
func InjectPluginSidecarInitContainer ¶ added in v0.4.0
func InjectPluginSidecarInitContainer(pod *corev1.Pod, sidecar *corev1.Container, injectPostgresVolumeMounts bool, ) error
InjectPluginSidecarInitContainer refer to InjectPluginSidecarInitContainerSpec.
func InjectPluginSidecarSpec
deprecated
func InjectPluginSidecarSpec(spec *corev1.PodSpec, sidecar *corev1.Container, injectPostgresVolumeMounts bool) error
InjectPluginSidecarSpec injects a plugin sidecar into a CNPG Pod spec.
If the "injectPostgresVolumeMount" flag is true, this will append all the volume mounts that are used in the instance manager Pod to the passed sidecar container, granting it superuser access to the PostgreSQL instance.
Besides the value of "injectPostgresVolumeMount", the plugin volume will always be injected in the PostgreSQL container.
Deprecated: Kubernetes versions >= 1.29 support sidecars as InitContainers by default, so this function should not be used anymore. Use InjectPluginInitContainerSidecarSpec instead.
func InjectPluginVolume ¶
InjectPluginVolume injects the plugin volume into a CNPG Pod.
func InjectPluginVolumeSpec ¶
InjectPluginVolumeSpec injects the plugin volume into a CNPG Pod spec.
Types ¶
This section is empty.