K8s module with Custom Resource Definition always changed

16 views
Skip to first unread message

Thms Hmm

unread,
Mar 24, 2019, 6:14:24 PM3/24/19
to Ansible Project
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.

i Kylix

unread,
Mar 24, 2019, 6:52:26 PM3/24/19
to 'Chris Bidwell - NOAA Federal' via Ansible Project
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 


Sent from  iPhone 




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ea01c353-ff7d-48c7-80b3-2020a5ed8576%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thms Hmm

unread,
Mar 25, 2019, 2:09:20 PM3/25/19
to Ansible Project
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

Am Sonntag, 24. März 2019 23:52:26 UTC+1 schrieb Kylix3511:
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 


Sent from  iPhone 
Reply all
Reply to author
Forward
0 new messages