resourcemerge

package
v0.0.0-...-0597a29 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPtr

func BoolPtr(val bool) *bool

func EnsureCustomResourceDefinition

func EnsureCustomResourceDefinition(modified *bool, existing *apiextv1beta1.CustomResourceDefinition, required apiextv1beta1.CustomResourceDefinition)

EnsureCustomResourceDefinition ensures that the existing matches the required. modified is set to true when existing had to be updated with required.

func EnsureObjectMeta

func EnsureObjectMeta(modified *bool, existing *metav1.ObjectMeta, required metav1.ObjectMeta)

EnsureObjectMeta writes namespace, name, labels, and annotations. Don't set other things here. TODO finalizer support maybe?

func ExpectedDaemonSetGeneration

func ExpectedDaemonSetGeneration(required *appsv1.DaemonSet, previousGenerations []operatorsv1.GenerationStatus) int64

func ExpectedDeploymentGeneration

func ExpectedDeploymentGeneration(required *appsv1.Deployment, previousGenerations []operatorsv1.GenerationStatus) int64

func GenerationFor

func GenerationFor(generations []operatorsv1.GenerationStatus, resource schema.GroupResource, namespace, name string) *operatorsv1.GenerationStatus

func MergeConfigMap

func MergeConfigMap(configMap *corev1.ConfigMap, configKey string, specialCases map[string]MergeFunc, configYAMLs ...[]byte) (*corev1.ConfigMap, bool, error)

MergeConfigMap takes a configmap, the target key, special overlay funcs a list of config configs to overlay on top of each other It returns the resultant configmap and a bool indicating if any changes were made to the configmap

func MergeMap

func MergeMap(modified *bool, existing *map[string]string, required map[string]string)

func MergeProcessConfig

func MergeProcessConfig(specialCases map[string]MergeFunc, configYAMLs ...[]byte) ([]byte, error)

MergeProcessConfig merges a series of config yaml files together with each later one overlaying all previous

func MergePrunedConfigMap

func MergePrunedConfigMap(schema runtime.Object, configMap *corev1.ConfigMap, configKey string, specialCases map[string]MergeFunc, configYAMLs ...[]byte) (*corev1.ConfigMap, bool, error)

MergePrunedConfigMap takes a configmap, the target key, special overlay funcs a list of config configs to overlay on top of each other It returns the resultant configmap and a bool indicating if any changes were made to the configmap. It roundtrips the config through the given schema.

func MergePrunedProcessConfig

func MergePrunedProcessConfig(schema runtime.Object, specialCases map[string]MergeFunc, configYAMLs ...[]byte) ([]byte, error)

MergePrunedProcessConfig merges a series of config yaml files together with each later one overlaying all previous. The result is roundtripped through the given schema if it is non-nil.

func SetBool

func SetBool(modified *bool, existing *bool, required bool)

func SetDaemonSetGeneration

func SetDaemonSetGeneration(generations *[]operatorsv1.GenerationStatus, actual *appsv1.DaemonSet)

func SetDeploymentGeneration

func SetDeploymentGeneration(generations *[]operatorsv1.GenerationStatus, actual *appsv1.Deployment)

func SetGeneration

func SetGeneration(generations *[]operatorsv1.GenerationStatus, newGeneration operatorsv1.GenerationStatus)

func SetInt32

func SetInt32(modified *bool, existing *int32, required int32)

func SetInt32IfSet

func SetInt32IfSet(modified *bool, existing *int32, required int32)

func SetInt64

func SetInt64(modified *bool, existing *int64, required int64)

func SetMapStringString

func SetMapStringString(modified *bool, existing *map[string]string, required map[string]string)

func SetMapStringStringIfSet

func SetMapStringStringIfSet(modified *bool, existing *map[string]string, required map[string]string)

func SetString

func SetString(modified *bool, existing *string, required string)

func SetStringIfSet

func SetStringIfSet(modified *bool, existing *string, required string)

func SetStringSlice

func SetStringSlice(modified *bool, existing *[]string, required []string)

func SetStringSliceIfSet

func SetStringSliceIfSet(modified *bool, existing *[]string, required []string)

Types

type MergeFunc

type MergeFunc func(dst, src interface{}, currentPath string) (interface{}, error)

Jump to

Keyboard shortcuts

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