configmap

package
v0.0.0-...-3c42354 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(getUpdateCreator GetUpdateCreator, cm corev1.ConfigMap) error

CreateOrUpdate creates the given ConfigMap if it doesn't exist, or updates it if it does.

func Exists

func Exists(cmGetter Getter, nsName types.NamespacedName) (bool, error)

Exists return whether a configmap with the given namespaced name exists.

func ReadData

func ReadData(getter Getter, key client.ObjectKey) (map[string]string, error)

ReadData extracts the contents of the Data field in a given config map.

func ReadFileLikeField

func ReadFileLikeField(
	getter Getter,
	objectKey client.ObjectKey,
	externalKey string,
	internalKey string,
) (string, error)

ReadFileLikeField reads a ConfigMap with file-like properties and returns the value inside one of the fields.

func ReadKey

func ReadKey(getter Getter, key string, objectKey client.ObjectKey) (string, error)

ReadKey accepts a ConfigMap Getter, the object of the ConfigMap to get, and the key within the config map to read. It returns the string value, and an error if one occurred.

func UpdateField

func UpdateField(getUpdater GetUpdater, objectKey client.ObjectKey, key, value string) error

UpdateField updates the sets "key" to the given "value".

Types

type Creator

type Creator interface {
	CreateConfigMap(cm corev1.ConfigMap) error
}

type Deleter

type Deleter interface {
	DeleteConfigMap(key client.ObjectKey) error
}

type GetUpdateCreateDeleter

type GetUpdateCreateDeleter interface {
	Getter
	Updater
	Creator
	Deleter
}

type GetUpdateCreator

type GetUpdateCreator interface {
	Getter
	Updater
	Creator
}

type GetUpdater

type GetUpdater interface {
	Getter
	Updater
}

type Getter

type Getter interface {
	GetConfigMap(objectKey client.ObjectKey) (corev1.ConfigMap, error)
}

type Updater

type Updater interface {
	UpdateConfigMap(cm corev1.ConfigMap) error
}

Jump to

Keyboard shortcuts

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