templates

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: Apache-2.0 Imports: 19 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(clusterRolesClient 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(clusterRoleBindingsClient 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(configMapsClient 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(daemonSetsClient 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(deploymentsClient 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(mutatingWebhookConfigurationsClient 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(namespacesClient 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 EnsurePodSecurityPolicy added in v0.3.0

func EnsurePodSecurityPolicy(podSecurityPolicyClient policyv1beta1types.PodSecurityPolicyInterface, required *policyv1beta1.PodSecurityPolicy) error

EnsurePodSecurityPolicy checks does PodSecurityPolicy 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 PodSecurityPolicy.

func EnsureRole

func EnsureRole(rolesClient 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(roleBindingsClient 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(secretsClient 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(servicesClient 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(serviceAccountsClient 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