Documentation ¶
Index ¶
- Constants
- Variables
- func GetAllRemediationTemplates(healthCheck client.Object) []*v1.ObjectReference
- func GetDeploymentNamespace() (string, error)
- func GetLogWithNHC(log logr.Logger, nhc *v1alpha1.NodeHealthCheck) logr.Logger
- func GetMachineNamespaceName(node *v1.Node) (namespace, name string, err error)
- func GetRemediationDuration(nhc *v1alpha1.NodeHealthCheck, remediationCR *unstructured.Unstructured) (currentRemediationDuration, previousRemediationsDuration time.Duration)
- func IsConditionTrue(conditions []metav1.Condition, conditionType string, reason string) bool
- func IsHealthyMHC(unhealthyConditions []v1beta1.UnhealthyCondition, ...) (bool, *time.Duration)
- func IsHealthyNHC(unhealthyConditions []remediationv1alpha1.UnhealthyCondition, ...) (bool, *time.Duration)
- func MHCByFeatureGateEventMapperFunc(c client.Client, logger logr.Logger, featureGates featuregates.Accessor) handler.MapFunc
- func MHCByMachineMapperFunc(c client.Client, logger logr.Logger, featureGates featuregates.Accessor) handler.MapFunc
- func MHCByNodeMapperFunc(c client.Client, logger logr.Logger, featureGates featuregates.Accessor) handler.MapFunc
- func MinRequeueDuration(old, new *time.Duration) *time.Duration
- func NHCByMHCEventMapperFunc(c client.Client, logger logr.Logger) handler.MapFunc
- func NHCByNodeMapperFunc(c client.Client, logger logr.Logger) handler.MapFunc
- func NHCByRemediationCRMapperFunc(logger logr.Logger) handler.MapFunc
- func NHCByRemediationTemplateCRMapperFunc(c client.Client, logger logr.Logger) handler.MapFunc
- func SetMachineCondition(mhc *v1beta1.MachineHealthCheck, condition *v1beta1.Condition)
Constants ¶
const ( EventReasonDetectedUnhealthy = "DetectedUnhealthy" EventReasonRemediationCreated = "RemediationCreated" EventReasonRemediationSkipped = "RemediationSkipped" EventReasonRemediationRemoved = "RemediationRemoved" EventReasonDisabled = "Disabled" EventReasonEnabled = "Enabled" )
const (
MachineNodeNameIndex = "machineNodeNameIndex"
)
Variables ¶
var ( // DefaultRemediationDuration is used for node lease calculations for remediations without configured timeout DefaultRemediationDuration = 10 * time.Minute )
var MachineAnnotationNotFoundError = errors.New("machine annotation not found")
MachineAnnotationNotFoundError indicates that in GetMachineNsName the machine annotation wasn't found on the given node
Functions ¶
func GetAllRemediationTemplates ¶ added in v0.7.0
func GetAllRemediationTemplates(healthCheck client.Object) []*v1.ObjectReference
GetAllRemediationTemplates returns a slice of all ObjectReferences used as RemedediationTemplate in the given NodeHealthCheck
func GetDeploymentNamespace ¶
GetDeploymentNamespace returns the Namespace this operator is deployed on.
func GetLogWithNHC ¶ added in v0.3.0
GetLogWithNHC return a logger with NHC namespace and name
func GetMachineNamespaceName ¶ added in v0.7.0
GetMachineNamespaceName returns machine namespace and name of the given Node. Returns MachineAnnotationNotFoundError in case the needed annotation doesn't exist on the given node
func GetRemediationDuration ¶ added in v0.7.0
func GetRemediationDuration(nhc *v1alpha1.NodeHealthCheck, remediationCR *unstructured.Unstructured) (currentRemediationDuration, previousRemediationsDuration time.Duration)
GetRemediationDuration returns the expected remediation duration for the given CR, and all previous used templates
func IsConditionTrue ¶ added in v0.3.0
IsConditionTrue return true when the conditions contain a condition of given type and reason with status true
func IsHealthyMHC ¶ added in v0.7.0
func IsHealthyMHC(unhealthyConditions []v1beta1.UnhealthyCondition, nodeConditions []corev1.NodeCondition, now time.Time) (bool, *time.Duration)
func IsHealthyNHC ¶ added in v0.7.0
func IsHealthyNHC(unhealthyConditions []remediationv1alpha1.UnhealthyCondition, nodeConditions []corev1.NodeCondition, now time.Time) (bool, *time.Duration)
func MHCByFeatureGateEventMapperFunc ¶ added in v0.7.0
func MHCByFeatureGateEventMapperFunc(c client.Client, logger logr.Logger, featureGates featuregates.Accessor) handler.MapFunc
MHCByFeatureGateEventMapperFunc return the FeatureGateEvent-to-NHC mapper function
func MHCByMachineMapperFunc ¶ added in v0.7.0
func MHCByMachineMapperFunc(c client.Client, logger logr.Logger, featureGates featuregates.Accessor) handler.MapFunc
MHCByMachineMapperFunc return the Machine-to-MHC mapper function
func MHCByNodeMapperFunc ¶ added in v0.7.0
func MHCByNodeMapperFunc(c client.Client, logger logr.Logger, featureGates featuregates.Accessor) handler.MapFunc
MHCByNodeMapperFunc return the Node-to-MHC mapper function
func MinRequeueDuration ¶ added in v0.6.0
MinRequeueDuration returns the minimal valid requeue duration
func NHCByMHCEventMapperFunc ¶ added in v0.6.0
NHCByMHCEventMapperFunc return the MHC-event-to-NHC mapper function
func NHCByNodeMapperFunc ¶ added in v0.3.0
NHCByNodeMapperFunc return the Node-to-NHC mapper function
func NHCByRemediationCRMapperFunc ¶ added in v0.5.0
NHCByRemediationCRMapperFunc return the RemediationCR-to-NHC mapper function
func NHCByRemediationTemplateCRMapperFunc ¶ added in v0.7.0
NHCByRemediationTemplateCRMapperFunc return the RemediationTemplateCR-to-NHC mapper function
func SetMachineCondition ¶ added in v0.7.0
func SetMachineCondition(mhc *v1beta1.MachineHealthCheck, condition *v1beta1.Condition)
Types ¶
This section is empty.