Skip to content

The operator should validate the "url" field in the Probe resource #4476

@simonpasquier

Description

@simonpasquier

What happened?

From openshift/runbooks#33 (comment)

Create a probe resource like the following:

apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
  name: example
spec:
  interval: 10s
  jobName: httpstat-test
  module: http_2xx
  prober:
    path: /probe
    scheme: https
    url: https://blackbox-exporter.example.com
  targets:
    staticConfig:
      relabelingConfigs:
        - replacement: test-app
          targetLabel: app
        - replacement: endpoint-name
          targetLabel: name
        - action: labeldrop
          regex: namespace
      static:
        - 'https://httpstat.us/200'

Prometheus will fail to load the generated scrape configuration because the url contains the https:// prefix. The value should be formatted like host:port or host.

Did you expect to see something different?

The operator should prevent the invalid input from getting into the generated configuration.

How to reproduce it (as minimally and precisely as possible):

See above.

Environment

  • Prometheus Operator version:

main branch.

  • Kubernetes version information:

N/A

  • Kubernetes cluster kind:

N/A

  • Manifests:

See above.

  • Prometheus Operator Logs:

N/A

Anything else we need to know?:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions