Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json merge_type is not applying #54

Closed
rgordill opened this issue Apr 12, 2021 · 3 comments · Fixed by #83
Closed

Json merge_type is not applying #54

rgordill opened this issue Apr 12, 2021 · 3 comments · Fixed by #83
Assignees
Labels
type/bug Something isn't working verified The issue is reproduced

Comments

@rgordill
Copy link

SUMMARY

When using json merge, the playbook is running ok but not doing anything. It is the same as ansible/ansible#65897 that was automatically closed by the repo migration.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

k8s

ANSIBLE VERSION
ansible 2.9.18
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/rgordill/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.2 (default, Feb 20 2021, 00:00:00) [GCC 10.2.1 20201125 (Red Hat 10.2.1-9)]
CONFIGURATION

OS / ENVIRONMENT

Fedora release 33 (Thirty Three)
Linux musashi 5.11.11-200.fc33.x86_64 ansible-collections/community.kubernetes#1 SMP Tue Mar 30 16:53:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

STEPS TO REPRODUCE
  1. Start a simple minikube with:
    minikube start -addons ingress
  2. See the configuration of the ingress deployment with
    kubectl get deployments.apps -n kube-system ingress-nginx-controller -o yaml
  3. Execute the following ansible tasks
- name: Patch Nginx to support ssl-passthough
  community.kubernetes.k8s:
    state: present
    kind: deployment
    api_version: apps/v1
    name: ingress-nginx-controller
    namespace: kube-system
    merge_type: 
    - json
    definition:
    - op: add
      path: '/spec/template/spec/containers/0/args/-'
      value: '--enable-ssl-passthrough'
  1. Check with the same kubectlcommand, that the deployment is exactly the same
  2. Try to do it manually with
kubectl patch deployment \
  ingress-nginx-controller \
  --namespace kube-system \
  --type='json' \
  -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--enable-ssl-passthrough"}]'
  1. Again get the deployment, now the merge has been applied.
EXPECTED RESULTS

Merge patch successfully applied as in kubectl.

ACTUAL RESULTS

result.txt

@gravesm gravesm transferred this issue from ansible-collections/community.kubernetes Apr 13, 2021
@navodissa
Copy link

I was able to recreate the same issue, using the same ansible version (2.9.18).

@abikouo abikouo self-assigned this Apr 22, 2021
@abikouo
Copy link
Contributor

abikouo commented Apr 23, 2021

@rgordill could you please test using the PR ?

@abikouo abikouo added type/bug Something isn't working verified The issue is reproduced and removed needs_verify labels Apr 23, 2021
@gravesm
Copy link
Member

gravesm commented Apr 26, 2021

This appears to actually be a duplicate of #37. We should be able to close out both.

goneri pushed a commit that referenced this issue Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working verified The issue is reproduced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants