Skip to content

When a lifecycle hook is called, but has nothing to do, return a "successful" response  #758

@dlipovetsky

Description

@dlipovetsky

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions