Documentation ¶
Index ¶
- Constants
- func CallCustomHandler(err error) (reconcile.Result, error)
- func ContainsFinalizer(slice []string, f string) bool
- func GenerateEventForResult(recorder record.EventRecorder, obj runtime.Object, objInfo metav1.Object, ...)
- func GetComplianceOperatorName() string
- func GetComplianceOperatorNamespace() string
- func GetWatchNamespace() (string, error)
- func HasCustomHandler(err error) bool
- func IsRetriable(err error) bool
- func RemoveFinalizer(slice []string, f string) (result []string)
- func ReturnWithRetriableError(log logr.Logger, err error) (reconcile.Result, error)
- type ErrorHandler
- type NonRetriableCtrlError
- type RunModeType
- type SafeRecorder
- type TimeoutError
Constants ¶
const ( // OpenSCAPExitCodeCompliant defines a success coming from OpenSCAP OpenSCAPExitCodeCompliant string = "0" // OpenSCAPExitCodeNonCompliant defines a non-compliance error coming from OpenSCAP OpenSCAPExitCodeNonCompliant string = "2" // PodUnschedulableExitCode is a custom error that indicates that we couldn't schedule the pod PodUnschedulableExitCode string = "unschedulable" // taken from k8sutil ForceRunModeEnv = "OSDK_FORCE_RUN_MODE" LocalRunMode RunModeType = "local" ClusterRunMode RunModeType = "cluster" )
Variables ¶
This section is empty.
Functions ¶
func CallCustomHandler ¶
CallCustomHandler calls the custom handler for an error if it has one
func ContainsFinalizer ¶
ContainsFinalizer checks if the given finalizer `f` is in the given list of finalizers
func GenerateEventForResult ¶
func GenerateEventForResult(recorder record.EventRecorder, obj runtime.Object, objInfo metav1.Object, result compv1alpha1.ComplianceScanStatusResult)
func GetComplianceOperatorName ¶
func GetComplianceOperatorName() string
GetComplianceOperatorName gets the name that the operator is currently running with.
func GetComplianceOperatorNamespace ¶
func GetComplianceOperatorNamespace() string
GetComplianceOperatorNamespace gets the namespace that the operator is currently running on.
func GetWatchNamespace ¶
GetWatchNamespace returns the Namespace the operator should be watching for changes. Eventually the watch namespace will not be used when OLM begins to support only the AllNamespaces install type. To support AllNamespaces initially, GetWatchNamespace will return the operator namespace if WATCH_NAMESPACE is empty.
func HasCustomHandler ¶
HasCustomHandler returns whether the error has a custom handler or not
func IsRetriable ¶
IsRetriable returns whether the error is retriable or not using the NonRetriableCtrlError interface
func RemoveFinalizer ¶
RemoveFinalizer removes the given finalizer `f` from the given list of finalizers
Types ¶
type ErrorHandler ¶
ErrorHandler defines a function that handles errors It can be used in a non retriable or a retriable error.
type NonRetriableCtrlError ¶
type NonRetriableCtrlError struct {
// contains filtered or unexported fields
}
NonRetriableCtrlError wraps errors with the addition of having the information for the error being non-retriable
func NewNonRetriableCtrlError ¶
func NewNonRetriableCtrlError(errorFmt string, args ...interface{}) *NonRetriableCtrlError
NewNonRetriableCtrlError creates an error with the RetriableCtrlError interface
func NewRetriableCtrlErrorWithCustomHandler ¶
func NewRetriableCtrlErrorWithCustomHandler(customHandler ErrorHandler, errorFmt string, args ...interface{}) *NonRetriableCtrlError
NewRetriableCtrlErrorWithCustomHandler creates an error with the RetriableCtrlError interface This error is retriable has a custom handler
func WrapNonRetriableCtrlError ¶
func WrapNonRetriableCtrlError(err error) *NonRetriableCtrlError
WrapNonRetriableCtrlError wraps an error with the RetriableCtrlError interface
func (NonRetriableCtrlError) Error ¶
func (cerr NonRetriableCtrlError) Error() string
func (NonRetriableCtrlError) HasCustomHandler ¶
func (cerr NonRetriableCtrlError) HasCustomHandler() bool
HasCustomHandler checks whether an error has a custom handler
func (NonRetriableCtrlError) IsRetriable ¶
func (cerr NonRetriableCtrlError) IsRetriable() bool
IsRetriable exposes if the error is retriable or not
type RunModeType ¶
type RunModeType string
type SafeRecorder ¶
type SafeRecorder struct {
// contains filtered or unexported fields
}
func NewSafeRecorder ¶
func NewSafeRecorder(name string, mgr manager.Manager) *SafeRecorder
func (*SafeRecorder) AnnotatedEventf ¶
func (sr *SafeRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})
AnnotatedEventf is just like eventf, but with annotations attached
type TimeoutError ¶ added in v0.1.60
type TimeoutError struct {
// contains filtered or unexported fields
}
Timeout Error
func NewTimeoutError ¶ added in v0.1.60
func NewTimeoutError(errorFmt string, args ...interface{}) *TimeoutError
NewTimeoutError creates an error with the RetriableCtrlError interface
func (TimeoutError) Error ¶ added in v0.1.60
func (t TimeoutError) Error() string