Documentation ¶
Index ¶
Constants ¶
const ( // RunningReason - Condition is running RunningReason = "Running" // SuccessfulReason - Condition is running due to reconcile being successful SuccessfulReason = "Successful" // FailedReason - Condition is failed due to ansible failure FailedReason = "Failed" // UnknownFailedReason - Condition is unknown UnknownFailedReason = "Unknown" )
const ( // RunningMessage - message for running reason. RunningMessage = "Running reconciliation" // SuccessfulMessage - message for successful reason. AwaitingMessage = "Awaiting next reconciliation" // SuccessfulMessage - message for successful condition. SuccessfulMessage = "Last reconciliation succeeded" )
Variables ¶
This section is empty.
Functions ¶
func RemoveCondition ¶
func RemoveCondition(status *Status, condType ConditionType)
RemoveCondition removes the scheduledReport condition with the provided type.
func SetCondition ¶
SetCondition updates the scheduledReport to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
Types ¶
type AnsibleResult ¶
type AnsibleResult struct { Ok int `json:"ok"` Changed int `json:"changed"` Skipped int `json:"skipped"` Failures int `json:"failures"` TimeOfCompletion eventapi.EventTime `json:"completion"` }
AnsibleResult - encapsulation of the ansible result.
func NewAnsibleResultFromMap ¶
func NewAnsibleResultFromMap(sm map[string]interface{}) *AnsibleResult
NewAnsibleResultFromMap - creates a Ansible status from a job event.
func NewAnsibleResultFromStatusJobEvent ¶
func NewAnsibleResultFromStatusJobEvent(je eventapi.StatusJobEvent) *AnsibleResult
NewAnsibleResultFromStatusJobEvent - creates a Ansible status from job event.
type Condition ¶
type Condition struct { Type ConditionType `json:"type"` Status v1.ConditionStatus `json:"status"` LastTransitionTime metav1.Time `json:"lastTransitionTime"` AnsibleResult *AnsibleResult `json:"ansibleResult,omitempty"` Reason string `json:"reason"` Message string `json:"message"` }
Condition - the condition for the ansible operator.
func GetCondition ¶
func GetCondition(status Status, condType ConditionType) *Condition
GetCondition returns the condition with the provided type.
func NewCondition ¶
func NewCondition(condType ConditionType, status v1.ConditionStatus, ansibleResult *AnsibleResult, reason, message string) *Condition
NewCondition - condition
type ConditionType ¶
type ConditionType string
ConditionType - type of condition
const ( // RunningConditionType - condition type of running. RunningConditionType ConditionType = "Running" // FailureConditionType - condition type of failure. FailureConditionType ConditionType = "Failure" // SuccessfulConditionType - condition type of success. SuccessfulConditionType ConditionType = "Successful" )
type Status ¶
type Status struct { Conditions []Condition `json:"conditions"` CustomStatus map[string]interface{} `json:"-"` }
Status - The status for custom resources managed by the operator-sdk.
func CreateFromMap ¶
CreateFromMap - create a status from the map
func (*Status) GetJSONMap ¶
GetJSONMap - gets the map value for the status object. This is used to set the status on the CR. This is needed because the unstructured type has special rules around DeepCopy. If you do not convert the status to the map, then DeepCopy for the unstructured will fail and throw runtime exceptions. Please note that this will return an empty map on error.