Documentation
¶
Overview ¶
Copyright 2026 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstanceIsBeingDeleted ¶
func InstanceIsBeingDeleted(s commonParams.InstanceStatus) bool
InstanceIsBeingDeleted reports whether an instance status is on the deletion lane, meaning the runner is already on its way out. Note that the lane is not strictly monotonic: a failed provider delete moves the instance from deleting to error. Tolerating a status observed here is still safe because reconciliation re-drives error back to pending_delete until the delete succeeds — the system converges by retry, and the intent behind a rejected transition to pending_delete (the runner should be removed) remains satisfied. Pair it with InstanceTransitionError.From.
func InstanceIsProvisioning ¶
func InstanceIsProvisioning(s commonParams.InstanceStatus) bool
InstanceIsProvisioning reports whether an instance status indicates the provider is still creating the instance (or is about to). The provider worker owns this stage of the lifecycle: deletion cannot be requested until the create call returns (creating only transitions to error or running). Pair it with InstanceTransitionError.From to decide whether a rejected transition to pending_delete should be deferred to a later reconciliation pass instead of being treated as fatal.
func NewRunnerTransitionError ¶
func NewRunnerTransitionError(from, to params.RunnerStatus) error
NewRunnerTransitionError returns a RunnerTransitionError describing an invalid runner status state machine transition.
func RunnerIsTerminal ¶
func RunnerIsTerminal(s params.RunnerStatus) bool
RunnerIsTerminal reports whether a runner status is terminal, meaning a transition to active can no longer succeed and a late "started" message for the runner is moot. Pair it with RunnerTransitionError.From.
Types ¶
type RunnerTransitionError ¶
type RunnerTransitionError struct {
From params.RunnerStatus
To params.RunnerStatus
}
RunnerTransitionError is returned when a requested runner status transition is rejected by the state machine. It carries the current (From) and requested (To) statuses as their proper type, so callers can compare them directly (via errors.As) without casting through strings. It also reports as a BadRequestError, so it maps to an HTTP 400.
func (*RunnerTransitionError) Error ¶
func (e *RunnerTransitionError) Error() string
func (*RunnerTransitionError) Is ¶
func (e *RunnerTransitionError) Is(target error) bool