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

Double escape backward slash with HELMFILE_V1MODE=true #1079

Open
z0rc opened this issue Oct 18, 2023 · 11 comments
Open

Double escape backward slash with HELMFILE_V1MODE=true #1079

z0rc opened this issue Oct 18, 2023 · 11 comments

Comments

@z0rc
Copy link

z0rc commented Oct 18, 2023

Operating system

MacOS 14.0

Helmfile Version

v0.157.0

Helm Version

v3.13.1

Bug description

With HELMFILE_V1MODE=true HELMFILE_GOCCY_GOYAML=false helmfile template | grep css -A5 -B5 result is okay:

          string_attribute:
            enabled_regex_matching: true
            invert_match: true
            key: http.url
            values:
            - \.(js|css|json)
          type: string_attribute
    receivers:
      jaeger:
        protocols:
          grpc:

With HELMFILE_V1MODE=true HELMFILE_GOCCY_GOYAML=true helmfile template | grep css -A5 -B5 result is not okay, double escape \\. is generated:

          string_attribute:
            enabled_regex_matching: true
            invert_match: true
            key: http.url
            values:
            - \\.(js|css|json)
          type: string_attribute
    receivers:
      jaeger:
        protocols:
          grpc:

I wasn't able to find how wrap or escape this string to avoid double escaping and preserve single slash. I tried single quotes, double quotes and go template literals like:

{{` \.(js|css|json) `}}

to no avail.

Example helmfile.yaml

It's helmfile.yaml.gotmpl

repositories:
- name: open-telemetry
  url: https://open-telemetry.github.io/opentelemetry-helm-charts

releases:
- name: opentelemetry-collector
  namespace: opentelemetry
  chart: open-telemetry/opentelemetry-collector
  version: 0.72.0
  disableValidationOnInstall: true
  values:
  - mode: deployment
    config:
      processors:
        tail_sampling:
          policies:
          - name: drop_noisy_traces_by_url
            type: string_attribute
            string_attribute:
              key: http.url
              values:
              - \.(js|css|json) # <--- this line is problematic
              enabled_regex_matching: true
              invert_match: true

Error message you've seen (if any)

None

Steps to reproduce

See Bug description example helmfile

Working Helmfile Version

v0

Relevant discussion

#656

@z0rc
Copy link
Author

z0rc commented Oct 19, 2023

I guess helmfile does some unmarshall-marshal process with yaml. I kinda reproduced this here https://go.dev/play/p/bHQbbYDBBo-. It isn't clear, if this is something of expected goccy/go-yaml behavior and whether it can be adjusted on helmfile side.

Copy link

stale bot commented Nov 2, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 2, 2023
@z0rc
Copy link
Author

z0rc commented Nov 2, 2023

Not stale. (i hate this bot)

@stale stale bot removed the wontfix This will not be worked on label Nov 2, 2023
Copy link

stale bot commented Nov 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 16, 2023
@yxxhero yxxhero removed the wontfix This will not be worked on label Nov 20, 2023
Copy link

stale bot commented Dec 5, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 5, 2023
@z0rc
Copy link
Author

z0rc commented Dec 5, 2023

Not stale.

@stale stale bot removed the wontfix This will not be worked on label Dec 5, 2023
Copy link

stale bot commented Dec 19, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 19, 2023
@z0rc
Copy link
Author

z0rc commented Dec 20, 2023

Not stale.

@stale stale bot removed the wontfix This will not be worked on label Dec 20, 2023
Copy link

stale bot commented Jan 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jan 3, 2024
@z0rc
Copy link
Author

z0rc commented Jan 3, 2024

Not stale.

@stale stale bot removed the wontfix This will not be worked on label Jan 3, 2024
@MaksimAniskov
Copy link

I hit this bump too. +1 Really appreciate someone's addressing this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants