object

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package object provides a set of functions to work with the kubernetes objects

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPostgresContainerFound = errors.New("no postgres container into instance Pod")

ErrNoPostgresContainerFound is raised when there's no PostgreSQL container in the passed instance Pod.

Functions

func CreatePatch

func CreatePatch(newObject, oldObject runtime.Object) ([]byte, error)

CreatePatch creates a JSON patch from the diff between the old and new object.

func GetKind

func GetKind(definition []byte) (string, error)

GetKind gets the Kubernetes object kind from its JSON representation.

func InjectPluginSidecar

func InjectPluginSidecar(pod *corev1.Pod, sidecar *corev1.Container, injectPostgresVolumeMounts bool) error

InjectPluginSidecar refer to InjectPluginSidecarSpec.

func InjectPluginSidecarSpec

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.

func InjectPluginVolume

func InjectPluginVolume(pod *corev1.Pod)

InjectPluginVolume injects the plugin volume into a CNPG Pod.

func InjectPluginVolumeSpec

func InjectPluginVolumeSpec(spec *corev1.PodSpec)

InjectPluginVolumeSpec injects the plugin volume into a CNPG Pod spec.

Types

This section is empty.

Jump to

Keyboard shortcuts

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