Documentation ¶
Index ¶
- Constants
- func IgnoreAlreadyExists(err error) error
- func IgnoreNotFound(err error) error
- func NewEventRecorder(clientSet *kubernetes.Clientset, logf func(format string, args ...interface{})) record.EventRecorder
- type Access
- func (a *Access) CreateWithReference(ctx context.Context, object, owner metav1.Object) error
- func (a *Access) DeleteObject(ctx context.Context, object, owner metav1.Object) error
- func (a *Access) IsDeploymentReady(namespacedName types.NamespacedName) (ready bool, err error)
- func (a *Access) IsEndpointReady(namespacedName types.NamespacedName) (finished bool, err error)
- func (a *Access) IsJobFinished(namespacedName types.NamespacedName) (finished bool, err error)
- func (a *Access) RecordEventf(object metav1.Object, eventtype, reason, messageFmt string, ...) error
Constants ¶
const ( // CreateFailed is an event provided via EventRecorder CreateFailed = "CreateFailed" // CreateSucceeded is an event provided via EventRecorder CreateSucceeded = "CreateSucceeded" // DeleteSucceeded is an event provided via EventRecorder DeleteSucceeded = "DeleteSucceeded" )
Variables ¶
This section is empty.
Functions ¶
func IgnoreAlreadyExists ¶
IgnoreAlreadyExists returns nil on k8s Already Exists type of errors, but returns the error as-is otherwise
func IgnoreNotFound ¶
IgnoreNotFound returns nil on k8s Not Found type of errors, but returns the error as-is otherwise
func NewEventRecorder ¶ added in v0.3.0
func NewEventRecorder(clientSet *kubernetes.Clientset, logf func(format string, args ...interface{})) record.EventRecorder
NewEventRecorder creates a new event recorder
Types ¶
type Access ¶
type Access struct { Client client.Client Clientset *k8sclient.Clientset Scheme *runtime.Scheme EventRecorder record.EventRecorder }
Access provides client related structs to access kubernetes
func (*Access) CreateWithReference ¶
CreateWithReference method creates a kubernetes resource and sets the owner reference to a given object. It provides basic idempotency (by ignoring Already Exists errors). Successful creation of the event is logged via EventRecorder to the owner.
func (*Access) DeleteObject ¶
DeleteObject method deletes a kubernetes resource while ignores not found errors, so that it can be called multiple times. Successful deletion of the event is logged via EventRecorder to the owner.
func (*Access) IsDeploymentReady ¶ added in v0.2.1
func (a *Access) IsDeploymentReady(namespacedName types.NamespacedName) (ready bool, err error)
IsDeploymentReady returns true if the given deployment's ready replicas matching with the desired replicas
func (*Access) IsEndpointReady ¶ added in v0.2.1
func (a *Access) IsEndpointReady(namespacedName types.NamespacedName) (finished bool, err error)
IsEndpointReady returns true if the given endpoint is fully connected to at least one pod
func (*Access) IsJobFinished ¶ added in v0.2.0
func (a *Access) IsJobFinished(namespacedName types.NamespacedName) (finished bool, err error)
IsJobFinished returns true if the given job has already succeeded or failed