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 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
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 ¶ added in v0.1.10
CallCustomHandler calls the custom handler for an error if it has one
func ContainsFinalizer ¶ added in v0.1.10
ContainsFinalizer checks if the given finalizer `f` is in the given list of finalizers
func GenerateEventForResult ¶ added in v0.1.17
func GenerateEventForResult(recorder record.EventRecorder, obj runtime.Object, objInfo metav1.Object, result compv1alpha1.ComplianceScanStatusResult)
func GetComplianceOperatorName ¶ added in v0.1.47
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 HasCustomHandler ¶ added in v0.1.10
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 ¶ added in v0.1.10
RemoveFinalizer removes the given finalizer `f` from the given list of finalizers
Types ¶
type ErrorHandler ¶ added in v0.1.10
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 ¶ added in v0.1.9
func NewNonRetriableCtrlError(errorFmt string, args ...interface{}) *NonRetriableCtrlError
NewNonRetriableCtrlError creates an error with the RetriableCtrlError interface
func NewRetriableCtrlErrorWithCustomHandler ¶ added in v0.1.10
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 ¶ added in v0.1.10
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 ¶ added in v0.1.47
type RunModeType string
type SafeRecorder ¶ added in v0.1.10
type SafeRecorder struct {
// contains filtered or unexported fields
}
func NewSafeRecorder ¶ added in v0.1.10
func NewSafeRecorder(name string, mgr manager.Manager) *SafeRecorder
func (*SafeRecorder) AnnotatedEventf ¶ added in v0.1.10
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