resourceapply

package
v0.0.0-...-db72f7f Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAPIService

ApplyAPIService merges objectmeta and requires apiservice coordinates. It does not touch CA bundles, which should be managed via service CA controller.

func ApplyClusterRole

func ApplyClusterRole(client rbacclientv1.ClusterRolesGetter, recorder events.Recorder, required *rbacv1.ClusterRole) (*rbacv1.ClusterRole, bool, error)

ApplyClusterRole merges objectmeta, requires rules, aggregation rules are not allowed for now.

func ApplyClusterRoleBinding

func ApplyClusterRoleBinding(client rbacclientv1.ClusterRoleBindingsGetter, recorder events.Recorder, required *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, bool, error)

ApplyClusterRoleBinding merges objectmeta, requires subjects and role refs TODO on non-matching roleref, delete and recreate

func ApplyConfigMap

func ApplyConfigMap(client coreclientv1.ConfigMapsGetter, recorder events.Recorder, required *corev1.ConfigMap) (*corev1.ConfigMap, bool, error)

ApplyConfigMap merges objectmeta, requires data

func ApplyCustomResourceDefinition

ApplyCustomResourceDefinition applies the required CustomResourceDefinition to the cluster.

func ApplyDaemonSet

func ApplyDaemonSet(client appsclientv1.DaemonSetsGetter, recorder events.Recorder, required *appsv1.DaemonSet, expectedGeneration int64, forceRollout bool) (*appsv1.DaemonSet, bool, error)

ApplyDaemonSet merges objectmeta and requires matching generation. It returns the final Object, whether any change as made, and an error

func ApplyDeployment

func ApplyDeployment(client appsclientv1.DeploymentsGetter, recorder events.Recorder, required *appsv1.Deployment, expectedGeneration int64,
	forceRollout bool) (*appsv1.Deployment, bool, error)

ApplyDeployment merges objectmeta and requires matching generation. It returns the final Object, whether any change as made, and an error

func ApplyNamespace

func ApplyNamespace(client coreclientv1.NamespacesGetter, recorder events.Recorder, required *corev1.Namespace) (*corev1.Namespace, bool, error)

ApplyNamespace merges objectmeta, does not worry about anything else

func ApplyPod

func ApplyPod(client coreclientv1.PodsGetter, recorder events.Recorder, required *corev1.Pod) (*corev1.Pod, bool, error)

ApplyPod merges objectmeta, does not worry about anything else

func ApplyRole

func ApplyRole(client rbacclientv1.RolesGetter, recorder events.Recorder, required *rbacv1.Role) (*rbacv1.Role, bool, error)

ApplyRole merges objectmeta, requires rules

func ApplyRoleBinding

func ApplyRoleBinding(client rbacclientv1.RoleBindingsGetter, recorder events.Recorder, required *rbacv1.RoleBinding) (*rbacv1.RoleBinding, bool, error)

ApplyRoleBinding merges objectmeta, requires subjects and role refs TODO on non-matching roleref, delete and recreate

func ApplySecret

func ApplySecret(client coreclientv1.SecretsGetter, recorder events.Recorder, required *corev1.Secret) (*corev1.Secret, bool, error)

ApplySecret merges objectmeta, requires data

func ApplyService

func ApplyService(client coreclientv1.ServicesGetter, recorder events.Recorder, required *corev1.Service) (*corev1.Service, bool, error)

ApplyService merges objectmeta and requires TODO, since this cannot determine whether changes are due to legitimate actors (api server) or illegitimate ones (users), we cannot update TODO I've special cased the selector for now

func ApplyServiceAccount

func ApplyServiceAccount(client coreclientv1.ServiceAccountsGetter, recorder events.Recorder, required *corev1.ServiceAccount) (*corev1.ServiceAccount, bool, error)

ApplyServiceAccount merges objectmeta, does not worry about anything else

func ApplyServiceMonitor

func ApplyServiceMonitor(client dynamic.Interface, recorder events.Recorder, serviceMonitorBytes []byte) (bool, error)

ApplyServiceMonitor applies the Prometheus service monitor.

func ApplyStorageClass

func ApplyStorageClass(client storageclientv1.StorageClassesGetter, recorder events.Recorder, required *storagev1.StorageClass) (*storagev1.StorageClass, bool,
	error)

ApplyStorageClass merges objectmeta, tries to write everything else

func JSONPatch

func JSONPatch(original, modified runtime.Object) string

JSONPatch generates a JSON patch between original and modified objects and return the JSON as a string. In case of error, the returned string will contain the error messages.

func SyncConfigMap

func SyncConfigMap(client coreclientv1.ConfigMapsGetter, recorder events.Recorder, sourceNamespace, sourceName, targetNamespace, targetName string, ownerRefs []metav1.OwnerReference) (*corev1.ConfigMap, bool, error)

func SyncSecret

func SyncSecret(client coreclientv1.SecretsGetter, recorder events.Recorder, sourceNamespace, sourceName, targetNamespace, targetName string, ownerRefs []metav1.OwnerReference) (*corev1.Secret, bool, error)

Types

type ApplyResult

type ApplyResult struct {
	File    string
	Type    string
	Result  runtime.Object
	Changed bool
	Error   error
}

func ApplyDirectly

func ApplyDirectly(kubeClient kubernetes.Interface, recorder events.Recorder, manifests AssetFunc, files ...string) []ApplyResult

ApplyDirectly applies the given manifest files to API server.

type AssetFunc

type AssetFunc func(name string) ([]byte, error)

Jump to

Keyboard shortcuts

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