Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ansible operator conditions #6582

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions changelog/fragments/ansible-operator-conditions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
For ansible-based-operators, we will no longer set the status of
the failure condition to `False` when a subsequent reconcile commences.

The failure condition will however been removed when reconcile is complete
and the custom resource was successfully deployed.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "change"

# Is this a breaking change?
breaking: false

5 changes: 0 additions & 5 deletions internal/ansible/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,6 @@ func (r *AnsibleOperatorReconciler) markRunning(ctx context.Context, nn types.Na
crStatus := getStatus(u)

// If there is no current status add that we are working on this resource.
errCond := ansiblestatus.GetCondition(crStatus, ansiblestatus.FailureConditionType)
if errCond != nil {
errCond.Status = v1.ConditionFalse
ansiblestatus.SetCondition(&crStatus, *errCond)
}
successCond := ansiblestatus.GetCondition(crStatus, ansiblestatus.SuccessfulConditionType)
if successCond != nil {
successCond.Status = v1.ConditionFalse
Expand Down
20 changes: 10 additions & 10 deletions internal/ansible/controller/status/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestGetCondition(t *testing.T) {
condType: RunningConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: RunningConditionType,
},
},
Expand All @@ -110,7 +110,7 @@ func TestGetCondition(t *testing.T) {
condType: RunningConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: FailureConditionType,
},
},
Expand All @@ -122,7 +122,7 @@ func TestGetCondition(t *testing.T) {
condType: FailureConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: FailureConditionType,
},
},
Expand All @@ -136,7 +136,7 @@ func TestGetCondition(t *testing.T) {
condType: FailureConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: RunningConditionType,
},
},
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestRemoveCondition(t *testing.T) {
condType: RunningConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: RunningConditionType,
},
},
Expand All @@ -179,7 +179,7 @@ func TestRemoveCondition(t *testing.T) {
condType: RunningConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: FailureConditionType,
},
},
Expand All @@ -191,7 +191,7 @@ func TestRemoveCondition(t *testing.T) {
condType: FailureConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: FailureConditionType,
},
},
Expand All @@ -203,7 +203,7 @@ func TestRemoveCondition(t *testing.T) {
condType: FailureConditionType,
status: Status{
Conditions: []Condition{
Condition{
{
Type: RunningConditionType,
},
},
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestSetCondition(t *testing.T) {
name: "update running condition",
status: &Status{
Conditions: []Condition{
Condition{
{
Type: RunningConditionType,
Status: v1.ConditionTrue,
Reason: SuccessfulReason,
Expand All @@ -264,7 +264,7 @@ func TestSetCondition(t *testing.T) {
name: "do not update running condition",
status: &Status{
Conditions: []Condition{
Condition{
{
Type: RunningConditionType,
Status: v1.ConditionTrue,
Reason: RunningReason,
Expand Down
Loading