Documentation ¶
Index ¶
- type CreateOption
- type DeleteOption
- type ListOption
- type PatchOption
- type Resources
- func (r *Resources) Annotate(obj k8s.Object, annotation map[string]string)
- func (r *Resources) Create(ctx context.Context, obj k8s.Object, opts ...CreateOption) error
- func (r *Resources) Delete(ctx context.Context, obj k8s.Object, opts ...DeleteOption) error
- func (r *Resources) ExecInPod(ctx context.Context, namespaceName, podName, containerName string, ...) error
- func (r *Resources) Get(ctx context.Context, name, namespace string, obj k8s.Object) error
- func (r *Resources) GetConfig() *rest.Config
- func (r *Resources) GetControllerRuntimeClient() cr.Client
- func (r *Resources) GetScheme() *runtime.Scheme
- func (r *Resources) Label(obj k8s.Object, label map[string]string)
- func (r *Resources) List(ctx context.Context, objs k8s.ObjectList, opts ...ListOption) error
- func (r *Resources) Patch(ctx context.Context, obj k8s.Object, patch k8s.Patch, opts ...PatchOption) error
- func (r *Resources) PatchStatus(ctx context.Context, objs k8s.Object, patch k8s.Patch, opts ...PatchOption) error
- func (r *Resources) PatchSubresource(ctx context.Context, obj k8s.Object, subresource string, patch k8s.Patch, ...) error
- func (r *Resources) Update(ctx context.Context, obj k8s.Object, opts ...UpdateOption) error
- func (r *Resources) UpdateStatus(ctx context.Context, obj k8s.Object, opts ...UpdateOption) error
- func (r *Resources) UpdateSubresource(ctx context.Context, obj k8s.Object, subresource string, opts ...UpdateOption) error
- func (r *Resources) Watch(object k8s.ObjectList, opts ...ListOption) *watcher.EventHandlerFuncs
- func (r *Resources) WithNamespace(ns string) *Resources
- type UpdateOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateOption ¶
type CreateOption func(*metav1.CreateOptions)
type DeleteOption ¶
type DeleteOption func(*metav1.DeleteOptions)
func WithDeletePropagation ¶ added in v0.0.3
func WithDeletePropagation(prop string) DeleteOption
func WithGracePeriod ¶ added in v0.0.3
func WithGracePeriod(gpt time.Duration) DeleteOption
type ListOption ¶
type ListOption func(*metav1.ListOptions)
func WithFieldSelector ¶ added in v0.0.3
func WithFieldSelector(sel string) ListOption
func WithLabelSelector ¶ added in v0.0.3
func WithLabelSelector(sel string) ListOption
func WithTimeout ¶ added in v0.0.3
func WithTimeout(to time.Duration) ListOption
type PatchOption ¶ added in v0.0.3
type PatchOption func(*metav1.PatchOptions)
PatchOption is used to provide additional arguments to the Patch call.
type Resources ¶
type Resources struct {
// contains filtered or unexported fields
}
func New ¶
New instantiates the controller runtime client object. User can get panic for belopw scenarios. 1. if user does not provide k8s config 2. if controller runtime client instantiation fails.
func (*Resources) Annotate ¶ added in v0.0.3
Annotate attach annotations to an existing resource objec
func (*Resources) GetControllerRuntimeClient ¶ added in v0.1.0
GetControllerRuntimeClient return the controller-runtime client instance
func (*Resources) List ¶
func (r *Resources) List(ctx context.Context, objs k8s.ObjectList, opts ...ListOption) error
func (*Resources) Patch ¶ added in v0.0.3
func (r *Resources) Patch(ctx context.Context, obj k8s.Object, patch k8s.Patch, opts ...PatchOption) error
Patch patches portion of object `obj` with data from object `patch`
func (*Resources) PatchStatus ¶ added in v0.3.0
func (r *Resources) PatchStatus(ctx context.Context, objs k8s.Object, patch k8s.Patch, opts ...PatchOption) error
PatchStatus patches portion of object `obj` with data from object `patch`
func (*Resources) PatchSubresource ¶ added in v0.3.0
func (r *Resources) PatchSubresource(ctx context.Context, obj k8s.Object, subresource string, patch k8s.Patch, opts ...PatchOption) error
PatchSubresource patches portion of object `obj` with data from object `patch`
func (*Resources) UpdateStatus ¶ added in v0.3.0
UpdateStatus updates the status of the object
func (*Resources) UpdateSubresource ¶ added in v0.3.0
func (r *Resources) UpdateSubresource(ctx context.Context, obj k8s.Object, subresource string, opts ...UpdateOption) error
UpdateSubresource updates the subresource of the object
func (*Resources) Watch ¶ added in v0.0.7
func (r *Resources) Watch(object k8s.ObjectList, opts ...ListOption) *watcher.EventHandlerFuncs
func (*Resources) WithNamespace ¶
type UpdateOption ¶
type UpdateOption func(*metav1.UpdateOptions)