configmap

package
v0.0.8-prerelease Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Builder

func Builder() *builder

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 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 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 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