Documentation ¶
Index ¶
- Constants
- func AddCredentialsRequestHash(cr *unstructured.Unstructured) error
- func ApplyAPIService(ctx context.Context, client apiregistrationv1client.APIServicesGetter, ...) (*apiregistrationv1.APIService, bool, error)
- func ApplyAlertmanager(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyCSIDriver(ctx context.Context, client storageclientv1.CSIDriversGetter, ...) (*storagev1.CSIDriver, bool, error)
- func ApplyClusterRole(ctx context.Context, client rbacclientv1.ClusterRolesGetter, ...) (*rbacv1.ClusterRole, bool, error)
- func ApplyClusterRoleBinding(ctx context.Context, client rbacclientv1.ClusterRoleBindingsGetter, ...) (*rbacv1.ClusterRoleBinding, bool, error)
- func ApplyConfigMap(ctx context.Context, client coreclientv1.ConfigMapsGetter, ...) (*corev1.ConfigMap, bool, error)
- func ApplyConfigMapImproved(ctx context.Context, client coreclientv1.ConfigMapsGetter, ...) (*corev1.ConfigMap, bool, error)
- func ApplyCredentialsRequest(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyCustomResourceDefinitionV1(ctx context.Context, client apiextclientv1.CustomResourceDefinitionsGetter, ...) (*apiextensionsv1.CustomResourceDefinition, bool, error)
- func ApplyDaemonSet(ctx context.Context, client appsclientv1.DaemonSetsGetter, ...) (*appsv1.DaemonSet, bool, error)
- func ApplyDaemonSetWithForce(ctx context.Context, client appsclientv1.DaemonSetsGetter, ...) (*appsv1.DaemonSet, bool, error)
- func ApplyDeployment(ctx context.Context, client appsclientv1.DeploymentsGetter, ...) (*appsv1.Deployment, bool, error)
- func ApplyDeploymentWithForce(ctx context.Context, client appsclientv1.DeploymentsGetter, ...) (*appsv1.Deployment, bool, error)
- func ApplyKnownUnstructured(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyMutatingWebhookConfigurationImproved(ctx context.Context, ...) (*admissionregistrationv1.MutatingWebhookConfiguration, bool, error)
- func ApplyNamespace(ctx context.Context, client coreclientv1.NamespacesGetter, ...) (*corev1.Namespace, bool, error)
- func ApplyNamespaceImproved(ctx context.Context, client coreclientv1.NamespacesGetter, ...) (*corev1.Namespace, bool, error)
- func ApplyPod(ctx context.Context, client coreclientv1.PodsGetter, recorder events.Recorder, ...) (*corev1.Pod, bool, error)
- func ApplyPodDisruptionBudget(ctx context.Context, client policyclientv1.PodDisruptionBudgetsGetter, ...) (*policyv1.PodDisruptionBudget, bool, error)
- func ApplyPodImproved(ctx context.Context, client coreclientv1.PodsGetter, recorder events.Recorder, ...) (*corev1.Pod, bool, error)
- func ApplyPrometheus(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyPrometheusRule(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyRole(ctx context.Context, client rbacclientv1.RolesGetter, recorder events.Recorder, ...) (*rbacv1.Role, bool, error)
- func ApplyRoleBinding(ctx context.Context, client rbacclientv1.RoleBindingsGetter, ...) (*rbacv1.RoleBinding, bool, error)
- func ApplySecret(ctx context.Context, client coreclientv1.SecretsGetter, ...) (*corev1.Secret, bool, error)
- func ApplySecretImproved(ctx context.Context, client coreclientv1.SecretsGetter, ...) (*corev1.Secret, bool, error)
- func ApplyService(ctx context.Context, client coreclientv1.ServicesGetter, ...) (*corev1.Service, bool, error)
- func ApplyServiceAccount(ctx context.Context, client coreclientv1.ServiceAccountsGetter, ...) (*corev1.ServiceAccount, bool, error)
- func ApplyServiceAccountImproved(ctx context.Context, client coreclientv1.ServiceAccountsGetter, ...) (*corev1.ServiceAccount, bool, error)
- func ApplyServiceImproved(ctx context.Context, client coreclientv1.ServicesGetter, ...) (*corev1.Service, bool, error)
- func ApplyServiceMonitor(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyStorageClass(ctx context.Context, client storageclientv1.StorageClassesGetter, ...) (*storagev1.StorageClass, bool, error)
- func ApplyStorageVersionMigration(ctx context.Context, client migrationclientv1alpha1.Interface, ...) (*migrationv1alpha1.StorageVersionMigration, bool, error)
- func ApplyUnstructuredResourceImproved(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func ApplyValidatingAdmissionPolicyBindingV1(ctx context.Context, ...) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, bool, error)
- func ApplyValidatingAdmissionPolicyBindingV1beta1(ctx context.Context, ...) (*admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, bool, error)
- func ApplyValidatingAdmissionPolicyV1(ctx context.Context, ...) (*admissionregistrationv1.ValidatingAdmissionPolicy, bool, error)
- func ApplyValidatingAdmissionPolicyV1beta1(ctx context.Context, ...) (*admissionregistrationv1beta1.ValidatingAdmissionPolicy, bool, error)
- func ApplyValidatingWebhookConfigurationImproved(ctx context.Context, ...) (*admissionregistrationv1.ValidatingWebhookConfiguration, bool, error)
- func ApplyVolumeSnapshotClass(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeleteAlertmanager(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeleteCSIDriver(ctx context.Context, client storageclientv1.CSIDriversGetter, ...) (*storagev1.CSIDriver, bool, error)
- func DeleteClusterRole(ctx context.Context, client rbacclientv1.ClusterRolesGetter, ...) (*rbacv1.ClusterRole, bool, error)
- func DeleteClusterRoleBinding(ctx context.Context, client rbacclientv1.ClusterRoleBindingsGetter, ...) (*rbacv1.ClusterRoleBinding, bool, error)
- func DeleteConfigMap(ctx context.Context, client coreclientv1.ConfigMapsGetter, ...) (*corev1.ConfigMap, bool, error)
- func DeleteCustomResourceDefinitionV1(ctx context.Context, client apiextclientv1.CustomResourceDefinitionsGetter, ...) (*apiextensionsv1.CustomResourceDefinition, bool, error)
- func DeleteDaemonSet(ctx context.Context, client appsclientv1.DaemonSetsGetter, ...) (*appsv1.DaemonSet, bool, error)
- func DeleteDeployment(ctx context.Context, client appsclientv1.DeploymentsGetter, ...) (*appsv1.Deployment, bool, error)
- func DeleteKnownUnstructured(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeleteNamespace(ctx context.Context, client coreclientv1.NamespacesGetter, ...) (*corev1.Namespace, bool, error)
- func DeletePod(ctx context.Context, client coreclientv1.PodsGetter, recorder events.Recorder, ...) (*corev1.Pod, bool, error)
- func DeletePodDisruptionBudget(ctx context.Context, client policyclientv1.PodDisruptionBudgetsGetter, ...) (*policyv1.PodDisruptionBudget, bool, error)
- func DeletePrometheus(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeletePrometheusRule(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeleteRole(ctx context.Context, client rbacclientv1.RolesGetter, recorder events.Recorder, ...) (*rbacv1.Role, bool, error)
- func DeleteRoleBinding(ctx context.Context, client rbacclientv1.RoleBindingsGetter, ...) (*rbacv1.RoleBinding, bool, error)
- func DeleteSecret(ctx context.Context, client coreclientv1.SecretsGetter, ...) (*corev1.Secret, bool, error)
- func DeleteService(ctx context.Context, client coreclientv1.ServicesGetter, ...) (*corev1.Service, bool, error)
- func DeleteServiceAccount(ctx context.Context, client coreclientv1.ServiceAccountsGetter, ...) (*corev1.ServiceAccount, bool, error)
- func DeleteServiceMonitor(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeleteStorageClass(ctx context.Context, client storageclientv1.StorageClassesGetter, ...) (*storagev1.StorageClass, bool, error)
- func DeleteStorageVersionMigration(ctx context.Context, client migrationclientv1alpha1.Interface, ...) (*migrationv1alpha1.StorageVersionMigration, bool, error)
- func DeleteUnstructuredResource(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func DeleteValidatingWebhookConfiguration(ctx context.Context, ...) (*admissionregistrationv1.ValidatingWebhookConfiguration, bool, error)
- func DeleteVolumeSnapshotClass(ctx context.Context, client dynamic.Interface, recorder events.Recorder, ...) (*unstructured.Unstructured, bool, error)
- func JSONPatchNoError(original, modified runtime.Object) string
- func JSONPatchSecretNoError(original, modified *corev1.Secret) string
- func NewResourceCache() *resourceCache
- func SetSpecHashAnnotation(objMeta *metav1.ObjectMeta, spec interface{}) error
- func SyncConfigMap(ctx context.Context, client coreclientv1.ConfigMapsGetter, ...) (*corev1.ConfigMap, bool, error)
- func SyncPartialConfigMap(ctx context.Context, client coreclientv1.ConfigMapsGetter, ...) (*corev1.ConfigMap, bool, error)
- func SyncPartialSecret(ctx context.Context, client coreclientv1.SecretsGetter, ...) (*corev1.Secret, bool, error)
- func SyncSecret(ctx context.Context, client coreclientv1.SecretsGetter, ...) (*corev1.Secret, bool, error)
- type ApplyResult
- type AssetFunc
- type ClientHolder
- func (c *ClientHolder) WithAPIExtensionsClient(client apiextensionsclient.Interface) *ClientHolder
- func (c *ClientHolder) WithDynamicClient(client dynamic.Interface) *ClientHolder
- func (c *ClientHolder) WithKubernetes(client kubernetes.Interface) *ClientHolder
- func (c *ClientHolder) WithKubernetesInformers(kubeInformers v1helpers.KubeInformersForNamespaces) *ClientHolder
- func (c *ClientHolder) WithMigrationClient(client migrationclient.Interface) *ClientHolder
- type ConditionalFunction
- type ResourceCache
Constants ¶
const ( CredentialsRequestGroup = "cloudcredential.openshift.io" CredentialsRequestVersion = "v1" CredentialsRequestResource = "credentialsrequests" )
const ( VolumeSnapshotClassGroup = "snapshot.storage.k8s.io" VolumeSnapshotClassVersion = "v1" VolumeSnapshotClassResource = "volumesnapshotclasses" )
Variables ¶
This section is empty.
Functions ¶
func AddCredentialsRequestHash ¶
func AddCredentialsRequestHash(cr *unstructured.Unstructured) error
func ApplyAPIService ¶
func ApplyAPIService(ctx context.Context, client apiregistrationv1client.APIServicesGetter, recorder events.Recorder, required *apiregistrationv1.APIService) (*apiregistrationv1.APIService, bool, error)
ApplyAPIService merges objectmeta and requires apiservice coordinates. It does not touch CA bundles, which should be managed via service CA controller.
func ApplyAlertmanager ¶
func ApplyAlertmanager(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
ApplyAlertmanager applies the Alertmanager.
func ApplyCSIDriver ¶
func ApplyCSIDriver(ctx context.Context, client storageclientv1.CSIDriversGetter, recorder events.Recorder, requiredOriginal *storagev1.CSIDriver) (*storagev1.CSIDriver, bool, error)
ApplyCSIDriver merges objectmeta, does not worry about anything else
func ApplyClusterRole ¶
func ApplyClusterRole(ctx context.Context, client rbacclientv1.ClusterRolesGetter, recorder events.Recorder, required *rbacv1.ClusterRole) (*rbacv1.ClusterRole, bool, error)
ApplyClusterRole merges objectmeta, requires rules.
func ApplyClusterRoleBinding ¶
func ApplyClusterRoleBinding(ctx context.Context, 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(ctx context.Context, client coreclientv1.ConfigMapsGetter, recorder events.Recorder, required *corev1.ConfigMap) (*corev1.ConfigMap, bool, error)
ApplyConfigMap merges objectmeta, requires data
func ApplyConfigMapImproved ¶
func ApplyConfigMapImproved(ctx context.Context, client coreclientv1.ConfigMapsGetter, recorder events.Recorder, required *corev1.ConfigMap, cache ResourceCache) (*corev1.ConfigMap, bool, error)
ApplyConfigMap merges objectmeta, requires data
func ApplyCredentialsRequest ¶
func ApplyCredentialsRequest( ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured, expectedGeneration int64, ) (*unstructured.Unstructured, bool, error)
func ApplyCustomResourceDefinitionV1 ¶
func ApplyCustomResourceDefinitionV1(ctx context.Context, client apiextclientv1.CustomResourceDefinitionsGetter, recorder events.Recorder, required *apiextensionsv1.CustomResourceDefinition) (*apiextensionsv1.CustomResourceDefinition, bool, error)
ApplyCustomResourceDefinitionV1 applies the required CustomResourceDefinition to the cluster.
func ApplyDaemonSet ¶
func ApplyDaemonSet(ctx context.Context, client appsclientv1.DaemonSetsGetter, recorder events.Recorder, requiredOriginal *appsv1.DaemonSet, expectedGeneration int64) (*appsv1.DaemonSet, bool, error)
ApplyDaemonSet ensures the form of the specified daemonset is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required daemonset will be merged with the existing daemonset and an update performed if the daemonset spec and metadata differ from the previously required spec and metadata. For further detail, check the top-level comment.
NOTE: The previous implementation of this method was renamed to ApplyDaemonSetWithForce. If are reading this in response to a compile error due to the change in signature, you have the following options:
- Update the calling code to rely on the spec comparison provided by the new implementation. If the code in question was specifying the force parameter to ensure rollout in response to changes in resources external to the daemonset, it will need to be revised to set that external state as an annotation e.g.
myoperator.openshift.io/my-resource: <resourceVersion>
- Update the call to use ApplyDaemonSetWithForce. This is available as a temporary measure but the method is deprecated and will be removed in 4.6.
func ApplyDaemonSetWithForce ¶
func ApplyDaemonSetWithForce(ctx context.Context, client appsclientv1.DaemonSetsGetter, recorder events.Recorder, requiredOriginal *appsv1.DaemonSet, expectedGeneration int64, forceRollout bool) (*appsv1.DaemonSet, bool, error)
ApplyDaemonSetWithForce merges objectmeta and requires matching generation. It returns the final Object, whether any change as made, and an error DEPRECATED - This method will be removed in 4.6 and callers will need to migrate to ApplyDaemonSet before then.
func ApplyDeployment ¶
func ApplyDeployment(ctx context.Context, client appsclientv1.DeploymentsGetter, recorder events.Recorder, requiredOriginal *appsv1.Deployment, expectedGeneration int64) (*appsv1.Deployment, bool, error)
ApplyDeployment ensures the form of the specified deployment is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required deployment will be merged with the existing deployment and an update performed if the deployment spec and metadata differ from the previously required spec and metadata. For further detail, check the top-level comment.
NOTE: The previous implementation of this method was renamed to ApplyDeploymentWithForce. If are reading this in response to a compile error due to the change in signature, you have the following options:
- Update the calling code to rely on the spec comparison provided by the new implementation. If the code in question was specifying the force parameter to ensure rollout in response to changes in resources external to the deployment, it will need to be revised to set that external state as an annotation e.g.
myoperator.openshift.io/my-resource: <resourceVersion>
- Update the call to use ApplyDeploymentWithForce. This is available as a temporary measure but the method is deprecated and will be removed in 4.6.
func ApplyDeploymentWithForce ¶
func ApplyDeploymentWithForce(ctx context.Context, client appsclientv1.DeploymentsGetter, recorder events.Recorder, requiredOriginal *appsv1.Deployment, expectedGeneration int64, forceRollout bool) (*appsv1.Deployment, bool, error)
ApplyDeploymentWithForce merges objectmeta and requires matching generation. It returns the final Object, whether any change as made, and an error.
DEPRECATED - This method will be removed in 4.6 and callers will need to migrate to ApplyDeployment before then.
func ApplyKnownUnstructured ¶
func ApplyKnownUnstructured(ctx context.Context, client dynamic.Interface, recorder events.Recorder, obj *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
ApplyKnownUnstructured applies few selected Unstructured types, where it semantic knowledge to merge existing & required objects intelligently. Feel free to add more.
func ApplyMutatingWebhookConfigurationImproved ¶
func ApplyMutatingWebhookConfigurationImproved(ctx context.Context, client admissionregistrationclientv1.MutatingWebhookConfigurationsGetter, recorder events.Recorder, requiredOriginal *admissionregistrationv1.MutatingWebhookConfiguration, cache ResourceCache) (*admissionregistrationv1.MutatingWebhookConfiguration, bool, error)
ApplyMutatingWebhookConfigurationImproved ensures the form of the specified mutatingwebhookconfiguration is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required mutatingwebhookconfiguration will be merged with the existing mutatingwebhookconfiguration and an update performed if the mutatingwebhookconfiguration spec and metadata differ from the previously required spec and metadata based on generation change.
func ApplyNamespace ¶
func ApplyNamespace(ctx context.Context, client coreclientv1.NamespacesGetter, recorder events.Recorder, required *corev1.Namespace) (*corev1.Namespace, bool, error)
ApplyNamespace merges objectmeta, does not worry about anything else
func ApplyNamespaceImproved ¶
func ApplyNamespaceImproved(ctx context.Context, client coreclientv1.NamespacesGetter, recorder events.Recorder, required *corev1.Namespace, cache ResourceCache) (*corev1.Namespace, bool, error)
ApplyNamespace merges objectmeta, does not worry about anything else
func ApplyPod ¶
func ApplyPod(ctx context.Context, client coreclientv1.PodsGetter, recorder events.Recorder, required *corev1.Pod) (*corev1.Pod, bool, error)
ApplyPod merges objectmeta, does not worry about anything else
func ApplyPodDisruptionBudget ¶
func ApplyPodDisruptionBudget(ctx context.Context, client policyclientv1.PodDisruptionBudgetsGetter, recorder events.Recorder, required *policyv1.PodDisruptionBudget) (*policyv1.PodDisruptionBudget, bool, error)
func ApplyPodImproved ¶
func ApplyPodImproved(ctx context.Context, client coreclientv1.PodsGetter, recorder events.Recorder, required *corev1.Pod, cache ResourceCache) (*corev1.Pod, bool, error)
ApplyPod merges objectmeta, does not worry about anything else
func ApplyPrometheus ¶
func ApplyPrometheus(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
ApplyPrometheus applies the Prometheus.
func ApplyPrometheusRule ¶
func ApplyPrometheusRule(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
ApplyPrometheusRule applies the PrometheusRule.
func ApplyRole ¶
func ApplyRole(ctx context.Context, client rbacclientv1.RolesGetter, recorder events.Recorder, required *rbacv1.Role) (*rbacv1.Role, bool, error)
ApplyRole merges objectmeta, requires rules
func ApplyRoleBinding ¶
func ApplyRoleBinding(ctx context.Context, 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(ctx context.Context, client coreclientv1.SecretsGetter, recorder events.Recorder, required *corev1.Secret) (*corev1.Secret, bool, error)
ApplySecret merges objectmeta, requires data
func ApplySecretImproved ¶
func ApplySecretImproved(ctx context.Context, client coreclientv1.SecretsGetter, recorder events.Recorder, requiredInput *corev1.Secret, cache ResourceCache) (*corev1.Secret, bool, error)
ApplySecret merges objectmeta, requires data
func ApplyService ¶
func ApplyService(ctx context.Context, 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(ctx context.Context, client coreclientv1.ServiceAccountsGetter, recorder events.Recorder, required *corev1.ServiceAccount) (*corev1.ServiceAccount, bool, error)
ApplyServiceAccount merges objectmeta, does not worry about anything else
func ApplyServiceAccountImproved ¶
func ApplyServiceAccountImproved(ctx context.Context, client coreclientv1.ServiceAccountsGetter, recorder events.Recorder, required *corev1.ServiceAccount, cache ResourceCache) (*corev1.ServiceAccount, bool, error)
ApplyServiceAccount merges objectmeta, does not worry about anything else
func ApplyServiceImproved ¶
func ApplyServiceImproved(ctx context.Context, client coreclientv1.ServicesGetter, recorder events.Recorder, requiredOriginal *corev1.Service, cache ResourceCache) (*corev1.Service, bool, error)
ApplyService merges objectmeta and requires. It detects changes in `required`, i.e. an operator needs .spec changes and overwrites existing .spec with those. TODO, since this cannot determine whether changes in `existing` are due to legitimate actors (api server) or illegitimate ones (users), we cannot update. TODO I've special cased the selector for now
func ApplyServiceMonitor ¶
func ApplyServiceMonitor(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
ApplyServiceMonitor applies the ServiceMonitor.
func ApplyStorageClass ¶
func ApplyStorageClass(ctx context.Context, client storageclientv1.StorageClassesGetter, recorder events.Recorder, required *storagev1.StorageClass) (*storagev1.StorageClass, bool, error)
ApplyStorageClass merges objectmeta, tries to write everything else
func ApplyStorageVersionMigration ¶
func ApplyStorageVersionMigration(ctx context.Context, client migrationclientv1alpha1.Interface, recorder events.Recorder, required *migrationv1alpha1.StorageVersionMigration) (*migrationv1alpha1.StorageVersionMigration, bool, error)
ApplyStorageVersionMigration merges objectmeta and required data.
func ApplyUnstructuredResourceImproved ¶
func ApplyUnstructuredResourceImproved( ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured, cache ResourceCache, resourceGVR schema.GroupVersionResource, defaultingFunc mimicDefaultingFunc, equalityChecker equalityChecker, ) (*unstructured.Unstructured, bool, error)
ApplyUnstructuredResourceImproved can utilize the cache to reconcile the existing resource to the desired state. NOTE: A `nil` defaultingFunc and equalityChecker are assigned resourceapply.noDefaulting and equality.Semantic, respectively. Users are recommended to instantiate a cache to benefit from the memoization machinery.
func ApplyValidatingAdmissionPolicyBindingV1 ¶
func ApplyValidatingAdmissionPolicyBindingV1(ctx context.Context, client admissionregistrationclientv1.ValidatingAdmissionPolicyBindingsGetter, recorder events.Recorder, requiredOriginal *admissionregistrationv1.ValidatingAdmissionPolicyBinding, cache ResourceCache) (*admissionregistrationv1.ValidatingAdmissionPolicyBinding, bool, error)
ApplyValidatingAdmissionPolicyBindingV1 ensures the form of the specified validatingadmissionpolicybindingconfiguration is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required validatingadmissionpolicybindingconfiguration will be merged with the existing validatingadmissionpolicybindingconfiguration and an update performed if the validatingadmissionpolicybindingconfiguration spec and metadata differ from the previously required spec and metadata based on generation change.
func ApplyValidatingAdmissionPolicyBindingV1beta1 ¶
func ApplyValidatingAdmissionPolicyBindingV1beta1(ctx context.Context, client admissionregistrationclientv1beta1.ValidatingAdmissionPolicyBindingsGetter, recorder events.Recorder, requiredOriginal *admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, cache ResourceCache) (*admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding, bool, error)
ApplyValidatingAdmissionPolicyBindingV1beta1 ensures the form of the specified validatingadmissionpolicybindingconfiguration is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required validatingadmissionpolicybindingconfiguration will be merged with the existing validatingadmissionpolicybindingconfiguration and an update performed if the validatingadmissionpolicybindingconfiguration spec and metadata differ from the previously required spec and metadata based on generation change.
func ApplyValidatingAdmissionPolicyV1 ¶
func ApplyValidatingAdmissionPolicyV1(ctx context.Context, client admissionregistrationclientv1.ValidatingAdmissionPoliciesGetter, recorder events.Recorder, requiredOriginal *admissionregistrationv1.ValidatingAdmissionPolicy, cache ResourceCache) (*admissionregistrationv1.ValidatingAdmissionPolicy, bool, error)
ApplyValidatingAdmissionPolicyV1 ensures the form of the specified validatingadmissionpolicyconfiguration is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required validatingadmissionpolicyconfiguration will be merged with the existing validatingadmissionpolicyconfiguration and an update performed if the validatingadmissionpolicyconfiguration spec and metadata differ from the previously required spec and metadata based on generation change.
func ApplyValidatingAdmissionPolicyV1beta1 ¶
func ApplyValidatingAdmissionPolicyV1beta1(ctx context.Context, client admissionregistrationclientv1beta1.ValidatingAdmissionPoliciesGetter, recorder events.Recorder, requiredOriginal *admissionregistrationv1beta1.ValidatingAdmissionPolicy, cache ResourceCache) (*admissionregistrationv1beta1.ValidatingAdmissionPolicy, bool, error)
ApplyValidatingAdmissionPolicyV1beta1 ensures the form of the specified validatingadmissionpolicyconfiguration is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required validatingadmissionpolicyconfiguration will be merged with the existing validatingadmissionpolicyconfiguration and an update performed if the validatingadmissionpolicyconfiguration spec and metadata differ from the previously required spec and metadata based on generation change.
func ApplyValidatingWebhookConfigurationImproved ¶
func ApplyValidatingWebhookConfigurationImproved(ctx context.Context, client admissionregistrationclientv1.ValidatingWebhookConfigurationsGetter, recorder events.Recorder, requiredOriginal *admissionregistrationv1.ValidatingWebhookConfiguration, cache ResourceCache) (*admissionregistrationv1.ValidatingWebhookConfiguration, bool, error)
ApplyValidatingWebhookConfigurationImproved ensures the form of the specified validatingwebhookconfiguration is present in the API. If it does not exist, it will be created. If it does exist, the metadata of the required validatingwebhookconfiguration will be merged with the existing validatingwebhookconfiguration and an update performed if the validatingwebhookconfiguration spec and metadata differ from the previously required spec and metadata based on generation change.
func ApplyVolumeSnapshotClass ¶
func ApplyVolumeSnapshotClass(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
ApplyVolumeSnapshotClass applies Volume Snapshot Class.
func DeleteAlertmanager ¶
func DeleteAlertmanager(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
DeleteAlertmanager deletes the Alertmanager.
func DeleteCSIDriver ¶
func DeleteClusterRole ¶
func DeleteClusterRole(ctx context.Context, client rbacclientv1.ClusterRolesGetter, recorder events.Recorder, required *rbacv1.ClusterRole) (*rbacv1.ClusterRole, bool, error)
func DeleteClusterRoleBinding ¶
func DeleteClusterRoleBinding(ctx context.Context, client rbacclientv1.ClusterRoleBindingsGetter, recorder events.Recorder, required *rbacv1.ClusterRoleBinding) (*rbacv1.ClusterRoleBinding, bool, error)
func DeleteConfigMap ¶
func DeleteCustomResourceDefinitionV1 ¶
func DeleteCustomResourceDefinitionV1(ctx context.Context, client apiextclientv1.CustomResourceDefinitionsGetter, recorder events.Recorder, required *apiextensionsv1.CustomResourceDefinition) (*apiextensionsv1.CustomResourceDefinition, bool, error)
func DeleteDaemonSet ¶
func DeleteDeployment ¶
func DeleteDeployment(ctx context.Context, client appsclientv1.DeploymentsGetter, recorder events.Recorder, required *appsv1.Deployment) (*appsv1.Deployment, bool, error)
func DeleteKnownUnstructured ¶
func DeleteKnownUnstructured(ctx context.Context, client dynamic.Interface, recorder events.Recorder, obj *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
DeleteKnownUnstructured deletes few selected Unstructured types
func DeleteNamespace ¶
func DeletePodDisruptionBudget ¶
func DeletePodDisruptionBudget(ctx context.Context, client policyclientv1.PodDisruptionBudgetsGetter, recorder events.Recorder, required *policyv1.PodDisruptionBudget) (*policyv1.PodDisruptionBudget, bool, error)
func DeletePrometheus ¶
func DeletePrometheus(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
DeletePrometheus deletes the Prometheus.
func DeletePrometheusRule ¶
func DeletePrometheusRule(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
DeletePrometheusRule deletes the PrometheusRule.
func DeleteRole ¶
func DeleteRoleBinding ¶
func DeleteRoleBinding(ctx context.Context, client rbacclientv1.RoleBindingsGetter, recorder events.Recorder, required *rbacv1.RoleBinding) (*rbacv1.RoleBinding, bool, error)
func DeleteSecret ¶
func DeleteService ¶
func DeleteServiceAccount ¶
func DeleteServiceAccount(ctx context.Context, client coreclientv1.ServiceAccountsGetter, recorder events.Recorder, required *corev1.ServiceAccount) (*corev1.ServiceAccount, bool, error)
func DeleteServiceMonitor ¶
func DeleteServiceMonitor(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
DeleteServiceMonitor deletes the ServiceMonitor.
func DeleteStorageClass ¶
func DeleteStorageClass(ctx context.Context, client storageclientv1.StorageClassesGetter, recorder events.Recorder, required *storagev1.StorageClass) (*storagev1.StorageClass, bool, error)
func DeleteStorageVersionMigration ¶
func DeleteStorageVersionMigration(ctx context.Context, client migrationclientv1alpha1.Interface, recorder events.Recorder, required *migrationv1alpha1.StorageVersionMigration) (*migrationv1alpha1.StorageVersionMigration, bool, error)
func DeleteUnstructuredResource ¶
func DeleteUnstructuredResource(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured, resourceGVR schema.GroupVersionResource) (*unstructured.Unstructured, bool, error)
DeleteUnstructuredResource deletes the unstructured resource.
func DeleteValidatingWebhookConfiguration ¶
func DeleteValidatingWebhookConfiguration(ctx context.Context, client admissionregistrationclientv1.ValidatingWebhookConfigurationsGetter, recorder events.Recorder, required *admissionregistrationv1.ValidatingWebhookConfiguration) (*admissionregistrationv1.ValidatingWebhookConfiguration, bool, error)
func DeleteVolumeSnapshotClass ¶
func DeleteVolumeSnapshotClass(ctx context.Context, client dynamic.Interface, recorder events.Recorder, required *unstructured.Unstructured) (*unstructured.Unstructured, bool, error)
func JSONPatchNoError ¶
JSONPatchNoError generates a JSON patch between original and modified objects and return the JSON as a string. Note:
In case of error, the returned string will contain the error messages.
func JSONPatchSecretNoError ¶
JSONPatchSecretNoError generates a JSON patch between original and modified secrets, hiding its data, and return the JSON as a string.
Note: In case of error, the returned string will contain the error messages.
func NewResourceCache ¶
func NewResourceCache() *resourceCache
func SetSpecHashAnnotation ¶
func SetSpecHashAnnotation(objMeta *metav1.ObjectMeta, spec interface{}) error
SetSpecHashAnnotation computes the hash of the provided spec and sets an annotation of the hash on the provided ObjectMeta. This method is used internally by Apply<type> methods, and is exposed to support testing with fake clients that need to know the mutated form of the resource resulting from an Apply<type> call.
func SyncConfigMap ¶
func SyncConfigMap(ctx context.Context, client coreclientv1.ConfigMapsGetter, recorder events.Recorder, sourceNamespace, sourceName, targetNamespace, targetName string, ownerRefs []metav1.OwnerReference) (*corev1.ConfigMap, bool, error)
SyncConfigMap applies a ConfigMap from a location `sourceNamespace/sourceName` to `targetNamespace/targetName`
func SyncPartialConfigMap ¶
func SyncPartialConfigMap(ctx context.Context, client coreclientv1.ConfigMapsGetter, recorder events.Recorder, sourceNamespace, sourceName, targetNamespace, targetName string, syncedKeys sets.Set[string], ownerRefs []metav1.OwnerReference) (*corev1.ConfigMap, bool, error)
SyncPartialConfigMap does what SyncConfigMap does but it only synchronizes a subset of keys given by `syncedKeys`. SyncPartialConfigMap will delete the target if `syncedKeys` are set but the source does not contain any of these keys.
func SyncPartialSecret ¶
func SyncPartialSecret(ctx context.Context, client coreclientv1.SecretsGetter, recorder events.Recorder, sourceNamespace, sourceName, targetNamespace, targetName string, syncedKeys sets.Set[string], ownerRefs []metav1.OwnerReference) (*corev1.Secret, bool, error)
SyncPartialSecret does what SyncSecret does but it only synchronizes a subset of keys given by `syncedKeys`. SyncPartialSecret will delete the target if `syncedKeys` are set but the source does not contain any of these keys.
func SyncSecret ¶
func SyncSecret(ctx context.Context, client coreclientv1.SecretsGetter, recorder events.Recorder, sourceNamespace, sourceName, targetNamespace, targetName string, ownerRefs []metav1.OwnerReference) (*corev1.Secret, bool, error)
SyncSecret applies a Secret from a location `sourceNamespace/sourceName` to `targetNamespace/targetName`
Types ¶
type ApplyResult ¶
func ApplyDirectly ¶
func ApplyDirectly(ctx context.Context, clients *ClientHolder, recorder events.Recorder, cache ResourceCache, manifests AssetFunc, files ...string) []ApplyResult
ApplyDirectly applies the given manifest files to API server.
func DeleteAll ¶
func DeleteAll(ctx context.Context, clients *ClientHolder, recorder events.Recorder, manifests AssetFunc, files ...string) []ApplyResult
type ClientHolder ¶
type ClientHolder struct {
// contains filtered or unexported fields
}
func NewClientHolder ¶
func NewClientHolder() *ClientHolder
func NewKubeClientHolder ¶
func NewKubeClientHolder(client kubernetes.Interface) *ClientHolder
func (*ClientHolder) WithAPIExtensionsClient ¶
func (c *ClientHolder) WithAPIExtensionsClient(client apiextensionsclient.Interface) *ClientHolder
func (*ClientHolder) WithDynamicClient ¶
func (c *ClientHolder) WithDynamicClient(client dynamic.Interface) *ClientHolder
func (*ClientHolder) WithKubernetes ¶
func (c *ClientHolder) WithKubernetes(client kubernetes.Interface) *ClientHolder
func (*ClientHolder) WithKubernetesInformers ¶
func (c *ClientHolder) WithKubernetesInformers(kubeInformers v1helpers.KubeInformersForNamespaces) *ClientHolder
func (*ClientHolder) WithMigrationClient ¶
func (c *ClientHolder) WithMigrationClient(client migrationclient.Interface) *ClientHolder
type ConditionalFunction ¶
type ConditionalFunction func() bool
ConditionalFunction provides needed dependency for a resource on another condition instead of blindly creating a resource. This conditional function can also be used to delete the resource when not needed