openshift / openshift/hypershift

Gate per-component ServiceMonitor/PodMonitor manifests behind --platform-monitoring (follow-up to #9527)

Open
#9,536 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
541
Forks
567
Avg merge
5d 13h
Merged PRs (30d)
136

Description

Follow-up to #9527 (HYPERFLEET-1557), which gated the control-plane-operator's own watches and its bootstrap PodMonitor behind --platform-monitoring flag.

However, other CPOv2 components still register their ServiceMonitor/PodMonitor manifest adapters unconditionally, e.g.:

  • control-plane-operator/controllers/hostedcontrolplane/v2/kas/component.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/etcd/component.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/cvo/component.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/kcm/component.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/oapi/component.go
  • control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/component.go
  • (and others across v2/*/component.go)

None of these pass component.WithPredicate(...) on their servicemonitor.yaml/podmonitor.yaml adapters. support/controlplane-component/generic-adapter.go only consults GVKAccessChecker inside the predicate-false branch, so components with no predicate skip that check entirely and call ApplyManifest directly.

On a management cluster without the monitoring.coreos.com CRDs, this means CPO reconciliation for these components fails with a NoKindMatchError, even with --platform-monitoring None set at install time.

Suggested fix: gate each of these manifest adapters with component.WithPredicate(...) tied to EnablePlatformMonitoring, following the pattern in control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/component.go.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with support/controlplane-component/generic-adapter.go and the pattern in control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/component.go. Review the listed v2/*/component.go files and identify ServiceMonitor and PodMonitor adapters that lack component.WithPredicate(...). Done means those adapters are gated by EnablePlatformMonitoring so reconciliation does not apply monitoring manifests when the flag is None.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.