templates

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureCRD

EnsureCRD checks does CRD already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and spec, and if they're not as expected updates the CRD.

func EnsureClusterRole

func EnsureClusterRole(clusterRoleInterface rbacv1types.ClusterRoleInterface, required *rbacv1.ClusterRole) error

EnsureClusterRole checks does RBAC ClusterRole already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and rules, and if they're not as expected updates the ClusterRole.

func EnsureClusterRoleBinding

func EnsureClusterRoleBinding(clusterRoleBindingInterface rbacv1types.ClusterRoleBindingInterface, required *rbacv1.ClusterRoleBinding) error

EnsureClusterRoleBinding checks does RBAC ClusterRoleBinding already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, role references, and subjects, and if they're not as expected updates the ClusterRoleBinding.

func EnsureConfigMap

func EnsureConfigMap(configMapInterface corev1types.ConfigMapInterface, required *corev1.ConfigMap) error

EnsureConfigMap checks does ConfigMap already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and data, and if they're not as expected updates the ConfigMap.

func EnsureDaemonSet

func EnsureDaemonSet(daemonSetInterface appsv1types.DaemonSetInterface, required *appsv1.DaemonSet) error

EnsureDaemonSet checks does DaemonSet already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and spec, and if they're not as expected updates the DaemonSet.

func EnsureDeployment

func EnsureDeployment(deploymentInterface appsv1types.DeploymentInterface, required *appsv1.Deployment) error

EnsureDeployment checks does Deployment already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and spec, and if they're not as expected updates the Deployment.

func EnsureMutatingWebhookConfiguration

func EnsureMutatingWebhookConfiguration(mutatingWebhookConfigurationInterface admissionregistrationv1beta1types.MutatingWebhookConfigurationInterface, required *admissionregistrationv1beta1.MutatingWebhookConfiguration) error

EnsureMutatingWebhookConfiguration checks does MutatingWebhookConfiguration already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and spec, and if they're not as expected updates the MutatingWebhookConfiguration.

func EnsureNamespace

func EnsureNamespace(namespaceInterface corev1types.NamespaceInterface, required *corev1.Namespace) error

EnsureNamespace checks does Namespace already exists and creates it if it doesn't. If it already exists, the function compares labels and annotations, and if they're not as expected updates the Namespace.

func EnsureRole

func EnsureRole(roleInterface rbacv1types.RoleInterface, required *rbacv1.Role) error

EnsureRole checks does RBAC Role already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and rules, and if they're not as expected updates the Role.

func EnsureRoleBinding

func EnsureRoleBinding(roleBindingInterface rbacv1types.RoleBindingInterface, required *rbacv1.RoleBinding) error

EnsureRoleBinding checks does RBAC RoleBinding already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, role references, and subjects, and if they're not as expected updates the RoleBinding.

func EnsureSecret

func EnsureSecret(secretInterface corev1types.SecretInterface, required *corev1.Secret) error

EnsureSecret checks does Secret already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and data, and if they're not as expected updates the Secret.

func EnsureService

func EnsureService(serviceInterface corev1types.ServiceInterface, required *corev1.Service) error

EnsureService checks does Service already exists and creates it if it doesn't. If it already exists, the function compares labels, annotations, and spec, and if they're not as expected updates the Service.

func EnsureServiceAccount

func EnsureServiceAccount(serviceAccountInterface corev1types.ServiceAccountInterface, required *corev1.ServiceAccount) error

EnsureServiceAccount checks does ServiceAccount already exists and creates it if it doesn't. If it already exists, the function compares labels and annotations, and if they're not as expected updates the ServiceAccount.

func KubernetesToYAML

func KubernetesToYAML(data []interface{}) (string, error)

KubernetesToYAML properly encodes a list of resources as YAML. Straight up encoding as YAML leaves us with a non-standard data structure. Going through JSON eliminates the extra fields and keys and results in what you would expect to see. This function takes a slice of items to support creating a multi-document YAML string (separated with "---" between each item).

func MergeStringMap

func MergeStringMap(modified *bool, destination *map[string]string, required map[string]string)

MergeStringMap merges two string maps into destination string map

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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