Documentation ¶
Index ¶
- Constants
- Variables
- func ClearInvalidTransitionStatusConditions(ibu *ibuv1.ImageBasedUpgrade)
- func GetCompletedCondition(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) *metav1.Condition
- func GetInProgressCondition(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) *metav1.Condition
- func GetInProgressStage(ibu *ibuv1.ImageBasedUpgrade) ibuv1.ImageBasedUpgradeStage
- func IsStageCompleted(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
- func IsStageCompletedOrFailed(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
- func IsStageFailed(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
- func IsStageInProgress(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
- func ResetHistory(client client.Client, log logr.Logger, ibu *ibuv1.ImageBasedUpgrade)
- func ResetStatusConditions(existingConditions *[]metav1.Condition, generation int64)
- func SetIdleStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, reason ConditionReason, msg string)
- func SetPrepStatusCompleted(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetPrepStatusFailed(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetPrepStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetRollbackStatusCompleted(ibu *ibuv1.ImageBasedUpgrade)
- func SetRollbackStatusFailed(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetRollbackStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetStatusCondition(existingConditions *[]metav1.Condition, conditionType ConditionType, ...)
- func SetStatusInvalidTransition(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetUpgradeStatusCompleted(ibu *ibuv1.ImageBasedUpgrade)
- func SetUpgradeStatusFailed(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetUpgradeStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, msg string)
- func SetUpgradeStatusRollbackRequested(ibu *ibuv1.ImageBasedUpgrade)
- func StartPhase(client client.Client, log logr.Logger, ibu *ibuv1.ImageBasedUpgrade, ...)
- func StartStageHistory(client client.Client, log logr.Logger, ibu *ibuv1.ImageBasedUpgrade)
- func StopPhase(client client.Client, log logr.Logger, ibu *ibuv1.ImageBasedUpgrade, ...)
- func StopStageHistory(client client.Client, log logr.Logger, ibu *ibuv1.ImageBasedUpgrade)
- func UpdateIBUStatus(ctx context.Context, c client.Client, ibu *ibuv1.ImageBasedUpgrade) error
- type ConditionReason
- type ConditionType
Constants ¶
const ( InProgress = "In progress" Finalizing = "Finalizing" Aborting = "Aborting" PrepCompleted = "Prep completed" PrepFailed = "Prep failed" UpgradeCompleted = "Upgrade completed" UpgradeFailed = "Upgrade failed" RollbackCompleted = "Rollback completed" RollbackFailed = "Rollback failed" RollbackRequested = "Rollback requested" )
Common condition messages Note: This is not a complete list and does not include the custom messages
const ( IBUWorkspacePath string = common.LCAConfigDir + "/workspace" // IBUName defines the valid name of the CR for the controller to reconcile IBUName string = "upgrade" IBUFilePath string = common.LCAConfigDir + "/ibu.json" ManualCleanupAnnotation string = "lca.openshift.io/manual-cleanup-done" TriggerReconcileAnnotation string = "lca.openshift.io/trigger-reconcile" // SeedGenName defines the valid name of the CR for the controller to reconcile SeedGenName string = "seedimage" SeedGenSecretName string = "seedgen" SeedgenWorkspacePath string = common.LCAConfigDir + "/ibu-seedgen-orch" // The LCAConfigDir folder is excluded from the var.tgz backup in seed image creation )
Variables ¶
var ( SeedGenStoredCR = filepath.Join(SeedgenWorkspacePath, "seedgen-cr.json") SeedGenStoredSecretCR = filepath.Join(SeedgenWorkspacePath, "seedgen-secret.json") StoredPullSecret = filepath.Join(SeedgenWorkspacePath, "pull-secret.json") )
var ConditionReasons = struct { Idle ConditionReason Completed ConditionReason Failed ConditionReason TimedOut ConditionReason InProgress ConditionReason Aborting ConditionReason AbortCompleted ConditionReason AbortFailed ConditionReason Finalizing ConditionReason FinalizeCompleted ConditionReason FinalizeFailed ConditionReason InvalidTransition ConditionReason }{ Idle: "Idle", Completed: "Completed", Failed: "Failed", TimedOut: "TimedOut", InProgress: "InProgress", Aborting: "Aborting", AbortCompleted: "AbortCompleted", AbortFailed: "AbortFailed", Finalizing: "Finalizing", FinalizeCompleted: "FinalizeCompleted", FinalizeFailed: "FinalizeFailed", InvalidTransition: "InvalidTransition", }
ConditionReasons define the different reasons that conditions will be set for
var ConditionTypes = struct { Idle ConditionType PrepInProgress ConditionType PrepCompleted ConditionType UpgradeInProgress ConditionType UpgradeCompleted ConditionType RollbackInProgress ConditionType RollbackCompleted ConditionType SeedGenInProgress ConditionType SeedGenCompleted ConditionType }{ Idle: "Idle", PrepInProgress: "PrepInProgress", PrepCompleted: "PrepCompleted", UpgradeInProgress: "UpgradeInProgress", UpgradeCompleted: "UpgradeCompleted", RollbackInProgress: "RollbackInProgress", RollbackCompleted: "RollbackCompleted", SeedGenInProgress: "SeedGenInProgress", SeedGenCompleted: "SeedGenCompleted", }
ConditionTypes define the different types of conditions that will be set
var FinalConditionTypes = []ConditionType{ConditionTypes.UpgradeCompleted, ConditionTypes.RollbackCompleted}
FinalConditionTypes defines the valid conditions for transitioning back to idle
var SeedGenConditionReasons = struct { Completed ConditionReason Failed ConditionReason InProgress ConditionReason }{ Completed: "Completed", Failed: "Failed", InProgress: "InProgress", }
var SeedGenConditionTypes = struct { SeedGenInProgress ConditionType SeedGenCompleted ConditionType }{ SeedGenInProgress: "SeedGenInProgress", SeedGenCompleted: "SeedGenCompleted", }
Functions ¶
func ClearInvalidTransitionStatusConditions ¶
func ClearInvalidTransitionStatusConditions(ibu *ibuv1.ImageBasedUpgrade)
ClearInvalidTransitionStatusConditions clears any invalid transitions if exist
func GetCompletedCondition ¶
func GetCompletedCondition(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) *metav1.Condition
GetCompletedCondition returns the completed condition based on the stage
func GetInProgressCondition ¶
func GetInProgressCondition(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) *metav1.Condition
GetInProgressCondition returns the in progress condition based on the stage
func GetInProgressStage ¶
func GetInProgressStage(ibu *ibuv1.ImageBasedUpgrade) ibuv1.ImageBasedUpgradeStage
GetInProgressStage returns the stage that is currently in progress
func IsStageCompleted ¶
func IsStageCompleted(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
IsStageCompleted checks if the completed condition status for the stage is true
func IsStageCompletedOrFailed ¶
func IsStageCompletedOrFailed(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
IsStageCompletedOrFailed checks if the completed condition for the stage is present
func IsStageFailed ¶
func IsStageFailed(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
IsStageFailed checks if the completed condition status for the stage is false
func IsStageInProgress ¶
func IsStageInProgress(ibu *ibuv1.ImageBasedUpgrade, stage ibuv1.ImageBasedUpgradeStage) bool
IsStageInProgress checks if ibu is working on the stage
func ResetHistory ¶
ResetHistory reset the .status.history by setting the list to empty
func ResetStatusConditions ¶
ResetStatusConditions remove all other conditions and sets idle to true
func SetIdleStatusInProgress ¶
func SetIdleStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, reason ConditionReason, msg string)
SetIdleStatusInProgress updates the Idle status to in progress with message
func SetPrepStatusCompleted ¶
func SetPrepStatusCompleted(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetPrepStatusCompleted updates the prep status to completed
func SetPrepStatusFailed ¶
func SetPrepStatusFailed(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetPrepStatusFailed updates the prep status to failed with message
func SetPrepStatusInProgress ¶
func SetPrepStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetPrepStatusInProgress updates the prep status to in progress with message
func SetRollbackStatusCompleted ¶
func SetRollbackStatusCompleted(ibu *ibuv1.ImageBasedUpgrade)
SetUpgradeStatusCompleted updates the Rollback status to completed
func SetRollbackStatusFailed ¶
func SetRollbackStatusFailed(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetRollbackStatusFailed updates the Rollback status to failed with message
func SetRollbackStatusInProgress ¶
func SetRollbackStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetRollbackStatusInProgress updates the Rollback status to in progress with message
func SetStatusCondition ¶
func SetStatusCondition(existingConditions *[]metav1.Condition, conditionType ConditionType, conditionReason ConditionReason, conditionStatus metav1.ConditionStatus, message string, generation int64)
SetStatusCondition is a convenience wrapper for meta.SetStatusCondition that takes in the types defined here and converts them to strings
func SetStatusInvalidTransition ¶
func SetStatusInvalidTransition(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetStatusInvalidTransition updates the given stage status to invalid transition with message
func SetUpgradeStatusCompleted ¶
func SetUpgradeStatusCompleted(ibu *ibuv1.ImageBasedUpgrade)
SetUpgradeStatusCompleted updates the upgrade status to completed
func SetUpgradeStatusFailed ¶
func SetUpgradeStatusFailed(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetUpgradeStatusFailed updates the upgrade status to failed with message
func SetUpgradeStatusInProgress ¶
func SetUpgradeStatusInProgress(ibu *ibuv1.ImageBasedUpgrade, msg string)
SetUpgradeStatusInProgress updates the upgrade status to in progress with message
func SetUpgradeStatusRollbackRequested ¶
func SetUpgradeStatusRollbackRequested(ibu *ibuv1.ImageBasedUpgrade)
SetUpgradeStatusRollbackRequested updates the upgrade status to failed with rollback requested message
func StartPhase ¶
StartPhase This can be called after StartStageHistory to allow for a more granular view of the important phases that are performed when moving a desired Stage. Phase timer is stopped when the phase completes successfully using StopPhase
func StartStageHistory ¶
StartStageHistory this is called before a stage handler is called for the first time, which starts a timer know how long a stage took to complete. Time timer stopped when the stage completes successfully using StopStageHistory
func StopPhase ¶
StopPhase call when a phase completes successfully. This is a no op unless StartPhase is called first
func StopStageHistory ¶
StopStageHistory call when a stage completes successfully. This is a no op unless StartStageHistory is called first
func UpdateIBUStatus ¶
Types ¶
type ConditionReason ¶
type ConditionReason string
ConditionReason is a string representing the condition's reason
type ConditionType ¶
type ConditionType string
ConditionType is a string representing the condition's type
func GetCompletedConditionType ¶
func GetCompletedConditionType(stage ibuv1.ImageBasedUpgradeStage) (conditionType ConditionType)
GetCompletedConditionType returns the completed condition type based on the stage
func GetInProgressConditionType ¶
func GetInProgressConditionType(stage ibuv1.ImageBasedUpgradeStage) (conditionType ConditionType)
GetInProgressConditionType returns the in progress condition type based on the stage