Documentation ¶
Index ¶
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
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) 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