K8s module with Custom Resource Definition always changed

Hi,

when I use the k8s module to patch a CRD object the task is always marked as “changed: true” even if there are no changes to the object.

ok: [localhost] => { "msg": { "changed": true, "diff": [ [ "change", "metadata.resourceVersion", [ "124413", "124360" ] ] ], "failed": false, "method": "patch", "result": { ... } ...

From the output you can see that the resourceVersion is responsible for the change.

Any other non CRD objects work just fine. Did anyone experience the same?

Thanks in advance.

Hi Chris,

I think, I seen this error. How is your play looks like ? Paste the play or playbook … I will review it and let me know.

Thanks.

Regards,
kylix3511

Email : kylix3511@gmail.com

Hi, not Chris but Thomas, anyway, some more information

ansible 2.7.9

openshift-0.8.6

The task:

`

  • name: create resource
    k8s:
    host: “{{ k8s_url }}”
    api_key: “{{ k8s_token }}”
    verify_ssl: no
    definition: “{{ lookup(‘template’, ‘my-cr.yaml’) }}”
    `

The Template:

apiVersion: someapi.org/v1alpha1 kind: MyCrd metadata: name: example-obj namespace: "myproject" spec: parallelity: 2

Thanks