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

Config to String does not properly convert the tlsConfig min_version #11417

Closed
tliefheid opened this issue Oct 5, 2022 · 2 comments
Closed

Comments

@tliefheid
Copy link

What did you do?

context:
we do some validations on incoming prometheus config, and then write it to a file for prometheus to pick up.
In our internal code we use config.Load this nicely imports the users config and verifies it. Later on we use cfg.String() to write it to a file.

When using the .String() method on the config, it will convert the HTTPClientConfig.TLSConfig.MinVersion on load nicely from a String to a TlsVersion. but after calling .String() it will save a number (like 772) instead of the original string value from the user. This is currently breaking our logic.

The question is: Is the .String() method failing to map back the value, or is this expected behaviour

What did you expect to see?

given:

  tls_config:
    min_version: "TLS12"

i want

  tls_config:
    min_version: "TLS12"

after calling .String()

What did you see instead? Under which circumstances?

  tls_config:
    insecure_skip_verify: false
    min_version: 771

System information

Darwin 21.6.0 arm64

Prometheus version

github.com/prometheus/common v0.37.0
github.com/prometheus/prometheus v0.38.0

Prometheus configuration file

No response

Alertmanager version

No response

Alertmanager configuration file

No response

Logs

No response

@roidelapluie
Copy link
Member

See prometheus/common#405 for a fix

@roidelapluie
Copy link
Member

Fix has been merged.

@prometheus prometheus locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants