apply

package
v0.13.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply[T runtime.Object](
	ctx context.Context,
	getter Getter[T],
	client Client[T],
	compare CompareFunc[T],
	required T,
	recorder events.Recorder) (T, bool, error)

Types

type Client

type Client[T runtime.Object] interface {
	Get(ctx context.Context, name string, opts metav1.GetOptions) (T, error)

	Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error)

	Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error)
}

Client is a wrapper interface of client

type CompareFunc

type CompareFunc[T runtime.Object] func(required, existing T) (T, bool)

CompareFunc compares required and existing, returns the updated required and whether updated is needed

type Getter

type Getter[T runtime.Object] interface {
	Get(name string) (T, error)
}

Getter is a wrapper interface of lister

type PermissionApplier

type PermissionApplier struct {
	// contains filtered or unexported fields
}

func NewPermissionApplier

func NewPermissionApplier(
	client kubernetes.Interface,
	roleLister rbacv1listers.RoleLister,
	roleBindingLister rbacv1listers.RoleBindingLister,
	clusterRoleLister rbacv1listers.ClusterRoleLister,
	clusterRoleBindingLister rbacv1listers.ClusterRoleBindingLister,
) *PermissionApplier

func (*PermissionApplier) Apply

func (m *PermissionApplier) Apply(
	ctx context.Context,
	recorder events.Recorder,
	manifests resourceapply.AssetFunc,
	files ...string) []resourceapply.ApplyResult

Jump to

Keyboard shortcuts

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