ansible / awx-resource-operator

41 stars 34 forks source link

use the k8s_status module to perform status update for ansiblejob result #5

Closed mikeshng closed 4 years ago

mikeshng commented 4 years ago

Signed-off-by: Mike Ng ming@redhat.com

Move the statusAnsibleJob into the proper status field. Now it looks like this

  status:
    ansibleJobResult:
      elapsed: "6.056"
      finished: "2020-08-20T19:43:44.699370Z"
      started: "2020-08-20T19:43:38.642954Z"
      status: successful
    conditions:
    - ansibleResult:
        changed: 1
        completion: 2020-08-20T19:42:56.679398
        failures: 0
        ok: 6
        skipped: 0
      lastTransitionTime: "2020-08-20T19:42:51Z"
      message: Awaiting next reconciliation
      reason: Successful
      status: "True"
      type: Running

The ansibleJobResult is the actual tower job result we are launching. The ansibleResult is the status that operator-sdk stamps for reporting the status of kicking off the k8s job that launches the ansible job.

Please note that:

        elapsed:
        finished:
        started:

it's an intentional change. This is for clearing the values when AnsibleJob CR updates and it reconciles again (which spawns another job) so while it's in pending status, these values should be blanked instead of the previous job result values.

mikeshng commented 4 years ago

@maxamillion could you please take a look if you have some cycles? Thanks.

@matburt could you please add Adam to this repo so I can easily pick him as a reviewer. Thanks.

matburt commented 4 years ago

@mikeshng I've added @maxamillion and @shanemcd so we can get them to review.

mikeshng commented 4 years ago

for https://github.com/open-cluster-management/backlog/issues/4228