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

Unexpected behavior Processing >- block #144

Open
ICHx opened this issue Sep 3, 2024 · 0 comments
Open

Unexpected behavior Processing >- block #144

ICHx opened this issue Sep 3, 2024 · 0 comments

Comments

@ICHx
Copy link

ICHx commented Sep 3, 2024

For scanFoldedAsLiteral to preserve linebreak
Currently the plugin can handle > correctly, but not >-

  • linebreaks becomes quoted string and with \n added, which is not expected.

Input

- name: kube patch
  command: >
    {{ kubectl_command | default('kubectl') }} -n={{k8s_namespace}} patch service {{ lb_name }}
    --type=merge --patch-file="{{role_path}}/files/clb2nlb.yaml" --dry-run=client -o yaml
  register: patch_lb_yaml

Output

- name: kube patch {{ lb_name }} with clb2nlb.yaml
  command: >
    {{ kubectl_command | default('kubectl') }} -n={{k8s_namespace}} patch service {{ lb_name }}
    --type=merge --patch-file="{{role_path}}/files/clb2nlb.yaml" --dry-run=client -o yaml
  register: patch_lb_yaml

The >- case

Input

- name: query load balancer service
  shell: >-
    {{ kubectl_command | default('kubectl') }} get service {{ lb_name }} --namespace={{k8s_namespace}} 
    -o=jsonpath='{.status.loadBalancer.ingress[0].{% if not eks_provisioner %}ip{% else %}hostname{% endif %}}'
    {% if eks_provisioner %}; 
    {{ kubectl_command | default('kubectl') }} describe service {{ lb_name }} --namespace={{k8s_namespace}} >&2 
    {% endif %}

Current behavior

- name: query load balancer service
  shell: "{{ kubectl_command | default('kubectl') }} get service {{ lb_name }} --namespace={{k8s_namespace}}
    \n-o=jsonpath='{.status.loadBalancer.ingress[0].{% if not eks_provisioner %}ip{% else %}hostname{%
    endif %}}'\n{% if eks_provisioner %}; \n{{ kubectl_command | default('kubectl') }} describe service
    {{ lb_name }} --namespace={{k8s_namespace}} >&2 \n{% endif %}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant