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

Prometheus charm expects ca_file to be the file's text content instead of its path #670

Open
michaeldmitry opened this issue Jan 23, 2025 · 0 comments

Comments

@michaeldmitry
Copy link
Contributor

Bug Description

When a metrics endpoint provider charm is integrated with prometheus charm, it can set a tls_config as part of its scrape job. This config can contain a ca_file key, which, according to the config spec , should contain the path of the CA cert not the actual contents of the CA. (that usecase is for another field ca)

However, here, the prometheus charm is expecting the ca_file to hold the actual cert content.

So, a charm providing a scrape job config would configure ca_file as per the upstream's definition, but would get unexpected results.

Prometheus charm should fetch the ca key instead.

To Reproduce

  1. Deploy a charm setting "tls_config":{"ca_file": "path/to/ca/cert"}
  2. Integrate with prometheus over prometheus_scrape interface
  3. juju ssh into prometheus container
  4. cat /etc/prometheus/prometheus.yaml and grab the value of ca_file in that scrape job
  5. cat /filename/from/previous/step and you'll find invalid cert contents

Environment

juju 3.6
microk8s 1.28

Relevant log output

N/A

Additional context

No response

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

1 participant