resourceapply

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyClusterRole added in v1.6.0

func ApplyClusterRoleBindingWithControl added in v1.9.0

func ApplyClusterRoleBindingWithControl(
	ctx context.Context,
	control ApplyControlInterface[*rbacv1.ClusterRoleBinding],
	recorder record.EventRecorder,
	required *rbacv1.ClusterRoleBinding,
	options ApplyOptions,
) (*rbacv1.ClusterRoleBinding, bool, error)

func ApplyClusterRoleWithControl added in v1.9.0

func ApplyClusterRoleWithControl(
	ctx context.Context,
	control ApplyControlInterface[*rbacv1.ClusterRole],
	recorder record.EventRecorder,
	required *rbacv1.ClusterRole,
	options ApplyOptions,
) (*rbacv1.ClusterRole, bool, error)

func ApplyConfigMap added in v1.6.0

func ApplyConfigMap(
	ctx context.Context,
	client corev1client.ConfigMapsGetter,
	lister corev1listers.ConfigMapLister,
	recorder record.EventRecorder,
	required *corev1.ConfigMap,
	options ApplyOptions,
) (*corev1.ConfigMap, bool, error)

func ApplyConfigMapWithControl added in v1.9.0

func ApplyConfigMapWithControl(
	ctx context.Context,
	control ApplyControlInterface[*corev1.ConfigMap],
	recorder record.EventRecorder,
	required *corev1.ConfigMap,
	options ApplyOptions,
) (*corev1.ConfigMap, bool, error)

func ApplyDaemonSet added in v1.6.0

func ApplyDaemonSet(
	ctx context.Context,
	client appsv1client.DaemonSetsGetter,
	lister appsv1listers.DaemonSetLister,
	recorder record.EventRecorder,
	required *appsv1.DaemonSet,
	options ApplyOptions,
) (*appsv1.DaemonSet, bool, error)

func ApplyDaemonSetWithControl added in v1.9.0

func ApplyDaemonSetWithControl(
	ctx context.Context,
	control ApplyControlInterface[*appsv1.DaemonSet],
	recorder record.EventRecorder,
	required *appsv1.DaemonSet,
	options ApplyOptions,
) (*appsv1.DaemonSet, bool, error)

func ApplyDeployment added in v1.9.0

func ApplyDeployment(
	ctx context.Context,
	client appsv1client.DeploymentsGetter,
	lister appsv1listers.DeploymentLister,
	recorder record.EventRecorder,
	required *appsv1.Deployment,
	options ApplyOptions,
) (*appsv1.Deployment, bool, error)

func ApplyDeploymentWithControl added in v1.9.0

func ApplyDeploymentWithControl(
	ctx context.Context,
	control ApplyControlInterface[*appsv1.Deployment],
	recorder record.EventRecorder,
	required *appsv1.Deployment,
	options ApplyOptions,
) (*appsv1.Deployment, bool, error)

func ApplyEndpointSliceWithControl added in v1.12.0

func ApplyEndpointSliceWithControl(
	ctx context.Context,
	control ApplyControlInterface[*discoveryv1.EndpointSlice],
	recorder record.EventRecorder,
	required *discoveryv1.EndpointSlice,
	options ApplyOptions,
) (*discoveryv1.EndpointSlice, bool, error)

func ApplyEndpoints added in v1.12.0

func ApplyEndpoints(
	ctx context.Context,
	client corev1client.EndpointsGetter,
	lister corev1listers.EndpointsLister,
	recorder record.EventRecorder,
	required *corev1.Endpoints,
	options ApplyOptions,
) (*corev1.Endpoints, bool, error)

func ApplyEndpointsWithControl added in v1.12.0

func ApplyEndpointsWithControl(
	ctx context.Context,
	control ApplyControlInterface[*corev1.Endpoints],
	recorder record.EventRecorder,
	required *corev1.Endpoints,
	options ApplyOptions,
) (*corev1.Endpoints, bool, error)

func ApplyFromConfig added in v1.9.0

func ApplyGeneric added in v1.9.0

func ApplyGeneric[T kubeinterfaces.ObjectInterface](
	ctx context.Context,
	control ApplyControlInterface[T],
	recorder record.EventRecorder,
	required T,
	options ApplyOptions,
) (T, bool, error)

func ApplyGenericWithHandlers added in v1.9.0

func ApplyGenericWithHandlers[T kubeinterfaces.ObjectInterface](
	ctx context.Context,
	control ApplyControlInterface[T],
	recorder record.EventRecorder,
	required T,
	options ApplyOptions,
	projectFunc func(required *T, existing T),
	getRecreateReasonFunc func(required T, existing T) (string, *metav1.DeletionPropagation, error),
) (T, bool, error)

func ApplyIngress added in v1.8.0

func ApplyIngressWithControl added in v1.9.0

func ApplyIngressWithControl(
	ctx context.Context,
	control ApplyControlInterface[*networkingv1.Ingress],
	recorder record.EventRecorder,
	required *networkingv1.Ingress,
	options ApplyOptions,
) (*networkingv1.Ingress, bool, error)

func ApplyJob added in v1.6.0

func ApplyJob(
	ctx context.Context,
	client batchv1client.JobsGetter,
	lister batchv1listers.JobLister,
	recorder record.EventRecorder,
	required *batchv1.Job,
	options ApplyOptions,
) (*batchv1.Job, bool, error)

func ApplyJobWithControl added in v1.9.0

func ApplyJobWithControl(
	ctx context.Context,
	control ApplyControlInterface[*batchv1.Job],
	recorder record.EventRecorder,
	required *batchv1.Job,
	options ApplyOptions,
) (*batchv1.Job, bool, error)

func ApplyNamespace added in v1.6.0

func ApplyNamespace(
	ctx context.Context,
	client corev1client.NamespacesGetter,
	lister corev1listers.NamespaceLister,
	recorder record.EventRecorder,
	required *corev1.Namespace,
	options ApplyOptions,
) (*corev1.Namespace, bool, error)

func ApplyNamespaceWithControl added in v1.9.0

func ApplyNamespaceWithControl(
	ctx context.Context,
	control ApplyControlInterface[*corev1.Namespace],
	recorder record.EventRecorder,
	required *corev1.Namespace,
	options ApplyOptions,
) (*corev1.Namespace, bool, error)

func ApplyPodDisruptionBudgetWithControl added in v1.9.0

func ApplyPodDisruptionBudgetWithControl(
	ctx context.Context,
	control ApplyControlInterface[*policyv1.PodDisruptionBudget],
	recorder record.EventRecorder,
	required *policyv1.PodDisruptionBudget,
	options ApplyOptions,
) (*policyv1.PodDisruptionBudget, bool, error)

func ApplyPrometheusRuleWithControl added in v1.9.0

func ApplyPrometheusRuleWithControl(
	ctx context.Context,
	control ApplyControlInterface[*monitoringv1.PrometheusRule],
	recorder record.EventRecorder,
	required *monitoringv1.PrometheusRule,
	options ApplyOptions,
) (*monitoringv1.PrometheusRule, bool, error)

func ApplyPrometheusWithControl added in v1.9.0

func ApplyPrometheusWithControl(
	ctx context.Context,
	control ApplyControlInterface[*monitoringv1.Prometheus],
	recorder record.EventRecorder,
	required *monitoringv1.Prometheus,
	options ApplyOptions,
) (*monitoringv1.Prometheus, bool, error)

func ApplyRoleBinding added in v1.8.0

func ApplyRoleBindingWithControl added in v1.9.0

func ApplyRoleBindingWithControl(
	ctx context.Context,
	control ApplyControlInterface[*rbacv1.RoleBinding],
	recorder record.EventRecorder,
	required *rbacv1.RoleBinding,
	options ApplyOptions,
) (*rbacv1.RoleBinding, bool, error)

func ApplySecret

func ApplySecret(
	ctx context.Context,
	client corev1client.SecretsGetter,
	lister corev1listers.SecretLister,
	recorder record.EventRecorder,
	required *corev1.Secret,
	options ApplyOptions,
) (*corev1.Secret, bool, error)

func ApplySecretWithControl added in v1.9.0

func ApplySecretWithControl(
	ctx context.Context,
	control ApplyControlInterface[*corev1.Secret],
	recorder record.EventRecorder,
	required *corev1.Secret,
	options ApplyOptions,
) (*corev1.Secret, bool, error)

func ApplyService

func ApplyService(
	ctx context.Context,
	client corev1client.ServicesGetter,
	lister corev1listers.ServiceLister,
	recorder record.EventRecorder,
	required *corev1.Service,
	options ApplyOptions,
) (*corev1.Service, bool, error)

func ApplyServiceAccount added in v1.6.0

func ApplyServiceAccountWithControl added in v1.9.0

func ApplyServiceAccountWithControl(
	ctx context.Context,
	control ApplyControlInterface[*corev1.ServiceAccount],
	recorder record.EventRecorder,
	required *corev1.ServiceAccount,
	options ApplyOptions,
) (*corev1.ServiceAccount, bool, error)

func ApplyServiceMonitorWithControl added in v1.9.0

func ApplyServiceMonitorWithControl(
	ctx context.Context,
	control ApplyControlInterface[*monitoringv1.ServiceMonitor],
	recorder record.EventRecorder,
	required *monitoringv1.ServiceMonitor,
	options ApplyOptions,
) (*monitoringv1.ServiceMonitor, bool, error)

func ApplyServiceWithControl added in v1.9.0

func ApplyServiceWithControl(
	ctx context.Context,
	control ApplyControlInterface[*corev1.Service],
	recorder record.EventRecorder,
	required *corev1.Service,
	options ApplyOptions,
) (*corev1.Service, bool, error)

func ApplyStatefulSetWithControl added in v1.9.0

func ApplyStatefulSetWithControl(
	ctx context.Context,
	control ApplyControlInterface[*appsv1.StatefulSet],
	recorder record.EventRecorder,
	required *appsv1.StatefulSet,
	options ApplyOptions,
) (*appsv1.StatefulSet, bool, error)

func ReportCreateEvent

func ReportCreateEvent(recorder record.EventRecorder, obj runtime.Object, operationErr error)

func ReportDeleteEvent

func ReportDeleteEvent(recorder record.EventRecorder, obj runtime.Object, operationErr error)

func ReportUpdateEvent

func ReportUpdateEvent(recorder record.EventRecorder, obj runtime.Object, operationErr error)

func SetHashAnnotation

func SetHashAnnotation(obj metav1.Object) error

Types

type ApplyConfig added in v1.9.0

type ApplyConfig[T kubeinterfaces.ObjectInterface] struct {
	Required T
	Options  ApplyOptions
	Control  ApplyControlFuncs[T]
}

func (ApplyConfig[T]) ToUntyped added in v1.9.0

func (ac ApplyConfig[T]) ToUntyped() ApplyConfigUntyped

type ApplyConfigUntyped added in v1.9.0

type ApplyConfigUntyped struct {
	Required kubeinterfaces.ObjectInterface
	Options  ApplyOptions
	Control  ApplyControlUntypedInterface
}

type ApplyControlFuncs added in v1.9.0

type ApplyControlFuncs[T kubeinterfaces.ObjectInterface] struct {
	GetCachedFunc func(name string) (T, error)
	CreateFunc    func(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error)
	UpdateFunc    func(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
	DeleteFunc    func(ctx context.Context, name string, opts metav1.DeleteOptions) error
}

func (ApplyControlFuncs[T]) Create added in v1.9.0

func (acf ApplyControlFuncs[T]) Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error)

func (ApplyControlFuncs[T]) Delete added in v1.9.0

func (acf ApplyControlFuncs[T]) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error

func (ApplyControlFuncs[T]) GetCached added in v1.9.0

func (acf ApplyControlFuncs[T]) GetCached(name string) (T, error)

func (ApplyControlFuncs[T]) ToUntyped added in v1.9.0

func (acf ApplyControlFuncs[T]) ToUntyped() ApplyControlUntypedFuncs

func (ApplyControlFuncs[T]) Update added in v1.9.0

func (acf ApplyControlFuncs[T]) Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)

type ApplyControlInterface added in v1.9.0

type ApplyControlInterface[T kubeinterfaces.ObjectInterface] interface {
	GetCached(name string) (T, error)
	Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error)
	Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
	Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
}

func TypeApplyControlInterface added in v1.9.0

type ApplyControlUntypedFuncs added in v1.9.0

type ApplyControlUntypedFuncs struct {
	GetCachedFunc func(name string) (kubeinterfaces.ObjectInterface, error)
	CreateFunc    func(ctx context.Context, obj kubeinterfaces.ObjectInterface, opts metav1.CreateOptions) (kubeinterfaces.ObjectInterface, error)
	UpdateFunc    func(ctx context.Context, obj kubeinterfaces.ObjectInterface, opts metav1.UpdateOptions) (kubeinterfaces.ObjectInterface, error)
	DeleteFunc    func(ctx context.Context, name string, opts metav1.DeleteOptions) error
}

func (ApplyControlUntypedFuncs) Create added in v1.9.0

func (ApplyControlUntypedFuncs) Delete added in v1.9.0

func (ApplyControlUntypedFuncs) GetCached added in v1.9.0

func (ApplyControlUntypedFuncs) Update added in v1.9.0

type ApplyOptions added in v1.9.0

type ApplyOptions struct {
	ForceOwnership            bool
	AllowMissingControllerRef bool
}

Jump to

Keyboard shortcuts

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