-
Notifications
You must be signed in to change notification settings - Fork 162
Description
SUMMARY
I am running my ansible operator in Openshift with a read only filesystem where only /tmp has read and write access due to specific demand. I have limited the size of the volume for /tmp to 100Mi. In ansible.cfg I have set system_tmpdirs = /tmp. I noticed that it gets filled up very quickly with discovery cache files leading to constant eviction of my operator pod.
Whilst going through the kubernetes.core code I saw that it creates a Discovery object with a cache_file in the format of k8srcp-{0}.json and then we pass this on the kubernetes client. By default the kubernetes client would use osrcp-{0}.json if no cache file was passed on. However, what I am observing is that both cache files are created. I am wondering if this is by design or a bug/duplicate? I have attached a snapshot of the /tmp directory below.
This may not completely solve my problem of not going over 100Mi but if these are indeed duplicates and I can get rid of half of these caches that would be a good start for me.
ISSUE TYPE
- Bug Report
COMPONENT NAME
ANSIBLE VERSION
sh-5.1$ ansible --version
ansible [core 2.18.9]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/opt/ansible/library']
ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
ansible collection location = /opt/ansible/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.12.11 (main, Aug 14 2025, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-11)] (/usr/local/bin/python3)
jinja version = 3.1.6
libyaml = True
COLLECTION VERSION
# /opt/ansible/.ansible/collections/ansible_collections
Collection Version
--------------- -------
kubernetes.core 2.4.2
CONFIGURATION
I can't run "ansible-config dump --only-changed" because I don't have the less command installed due to a restrictive image
OS / ENVIRONMENT
quay.io/operator-framework/ansible-operator:v1.41.0
STEPS TO REPRODUCE
EXPECTED RESULTS
I am expecting only k8srcp-{0}.json cache files
ACTUAL RESULTS
I am getting both, k8srcp-{0}.json and osrcp-{0}.json cache files
sh-5.1$ ls -la
total 2204
drwxrwsrwx. 7 root 1000870000 20480 Dec 31 14:31 .
dr-xr-xr-x. 1 root root 4096 Dec 31 14:27 ..
drwxr-sr-x. 3 1000870000 1000870000 4096 Dec 31 14:27 ansible-operator
drwx--S---. 2 1000870000 1000870000 4096 Dec 31 14:31 ansible_kubernetes.core.k8s_info_payload_57v237h6
drwx--S---. 2 1000870000 1000870000 4096 Dec 31 14:31 ansible_kubernetes.core.k8s_info_payload_i1bbkl_x
drwx--S---. 2 1000870000 1000870000 4096 Dec 31 14:31 ansible_operator_sdk.util.k8s_status_payload_casztknm
srwxr-xr-x. 1 1000870000 1000870000 0 Dec 31 14:31 ansibleoperator-2637406203862907664
srwxr-xr-x. 1 1000870000 1000870000 0 Dec 31 14:31 ansibleoperator-3767147899161902982
srwxr-xr-x. 1 1000870000 1000870000 0 Dec 31 14:31 ansibleoperator-5282054833217131406
srwxr-xr-x. 1 1000870000 1000870000 0 Dec 31 14:31 ansibleoperator-6859900008814962403
srwxr-xr-x. 1 1000870000 1000870000 0 Dec 31 14:31 ansibleoperator-8669920589535940892
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-072ca5675cd5eb4f91dca30c3dd83881a79e1f862d6b16bd37cab42455ca102e.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-15c1da0a0bd5b3d16a540bbbce919626250a1aae3ae22fdac2de3ab91ba37f4c.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-36d1698e4eb06df7fa930ee851b1ec4f68389bc1c3b1c2d311c6bc8c777ea2e3.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-4b6371acf58f82c6ed9aed51013d03943b2f3321a4f804342ef9713f9cec8ee2.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-74640fd18641216752f6481a64761ce05dba173e0e8d8bdb8c7d5fe690868f4e.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-9f329770db134f6c286653b5396c59317f2c06c76aed87e1713cba5600717670.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-a1e30018bc78f7dd8cb7c0637491aec7407ea6eabaed16417d6b9406ad47f038.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-a7bf3871b063c134188bd3972486acb6e462e06c6ebd263c1cfc1c9d5b3e04d2.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-a8e640de57a00f0c33f9b0e04764f45fa8206a906573cf6e6f1214f752884511.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-aecad65a71761408f745671c0e33ddc0e95a23e666b7d9e970b906bad1d9df4a.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-b67bb4a1774219f566fb7f48f7d4a267e490c2eb16d969d401b96501f7216715.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-b8c6d4875ab622434ddfb3a6db5dfa526a884760dadd853a0c50d9ee678e1821.json
-rw-r--r--. 1 1000870000 1000870000 15861 Dec 31 14:31 k8srcp-dc1c6aa84ad2f01ef4a0cf75d9a9318c6443d21c35156b4c889c7b3e3c28639c.json
-rw-------. 1 1000870000 1000870000 821 Dec 31 14:31 kubeconfig1657698435
-rw-------. 1 1000870000 1000870000 813 Dec 31 14:31 kubeconfig2530990468
-rw-------. 1 1000870000 1000870000 813 Dec 31 14:31 kubeconfig2874020799
-rw-------. 1 1000870000 1000870000 813 Dec 31 14:31 kubeconfig3749291681
-rw-------. 1 1000870000 1000870000 813 Dec 31 14:31 kubeconfig3798010158
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-01a9eac5629eca48b8b4573104e3083e.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-0937b6f3e67290214bff8330e55e0217.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-0f3d53e46ceb29f52513912b43891b0a.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-4f9b58007843acbd00c668be7980fa8f.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-56d289c46354a5690537c1d067e04a22.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-6015dacb3b0529555b48d4e76a3413fd.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-612179039c939092f0241ad3a474ccd4.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-8d2596210b17e41aff665e4dae53424f.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-98036eb8c0a368c09e90b2de7d920769.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-a32ea5f17549de9e71c4fdb5ea845225.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-b48f2dcffd0fd0a266425f62f33e57e3.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-b8f1e07d96502ae56ae405b08f5b05f9.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-d2dcbcba93e27e98cfa8041c4fff7c4f.json
-rw-r--r--. 1 1000870000 1000870000 15579 Dec 31 14:31 osrcp-fbeb2024d68d5531c26e0bbf6854bc1c.json