-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Currently, a lifecycle hook does not set a response status when it has nothing to do, e.g., when its specific variable is not found. Example:
cluster-api-runtime-extensions-nutanix/pkg/handlers/generic/lifecycle/cni/calico/handler.go
Lines 117 to 123 in fde18b8
if variables.IsNotFoundError(err) { | |
log.V(5). | |
Info( | |
"Skipping Calico CNI handler, cluster does not specify request CNI addon deployment", | |
) | |
return | |
} |
(Otherwise, a lifecycle hook sets the response status to either success or failure.)
The topology controller that calls the lifecycle hook interprets a lack of status as success, but if we explicitly set the status, we can have a better record of what the hooks are doing.
Let's define an internal error type that the handler can return when it has nothing to do, and a higher-level wrapper can return a "successful" response with a predictable message, something along the lines of handler NAME skipped, because it has no input