Skip to content

Commit

Permalink
pkg/ansible/controller: reconciler needs to get the resource
Browse files Browse the repository at this point in the history
after the ansible has finished.
  • Loading branch information
Shawn Hurley committed Feb 1, 2019
1 parent 7ef94d6 commit ba3a718
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ansible/controller/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/operator-framework/operator-sdk/pkg/ansible/runner"
"github.com/operator-framework/operator-sdk/pkg/ansible/runner/eventapi"

"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
Expand Down Expand Up @@ -176,6 +176,11 @@ func (r *AnsibleOperatorReconciler) Reconcile(request reconcile.Request) (reconc
return reconcileResult, eventErr
}

err = r.Client.Get(context.TODO(), request.NamespacedName, u)
if err != nil {
return reconcile.Result{}, err
}

// We only want to update the CustomResource once, so we'll track changes and do it at the end
runSuccessful := len(failureMessages) == 0
// The finalizer has run successfully, time to remove it
Expand Down

0 comments on commit ba3a718

Please sign in to comment.