Skip to content

feat: find component pods by the selectors in status.components - #3

Merged
recharte merged 1 commit into
mainfrom
feat/component-selectors
Oct 7, 2026
Merged

recharte merged 1 commit into
mainfrom
feat/component-selectors

Conversation

@recharte

@recharte recharte commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Finds an instance's pods through the per-component selectors the provider runtime now reports in status.components (openeverest/openeverest#3335). status.components[].podRefs no longer exist, so the podRefs path was dead code against current core.

  • Listing: each component's pods are listed with its selector. Every selector is narrowed with core.openeverest.io/instance=<instance>, so a broad or wrong selector in the status can never reach another instance's pods.
  • Logs and describe: a pod is part of the instance only if one of those selectors matches it. The behaviour is unchanged: any other pod gets a 404.
  • Type column: shows the runtime's component name (engine, proxy, configServer) when the pod has it, falling back to app.kubernetes.io/component as before.
  • Fallback: instances whose provider doesn't label its pods yet keep using app.kubernetes.io/instance.

Providers: PSMDB already labels its pods (openeverest/provider-percona-server-mongodb#117). PXC and PG follow in openeverest/provider-percona-xtradb-cluster#38 and openeverest/provider-percona-postgresql#45.

Testing

  • go vet and go test -race ./... in backend.
  • New tests cover listing by selector (pods that only carry the operator label are left out), narrowing a broad selector to the instance, and logs for pods inside and outside the components.
  • The tests I touched use testify, which this adds to backend/go.mod; that also moves go.yaml.in/yaml/v3 to v3.0.5.
  • The frontend is unchanged.

status.components[].podRefs are gone from the Instance API; each
component now reports a pod selector instead.

Signed-off-by: Diogo Recharte <diogo.recharte@solanica.io>
@recharte
recharte merged commit 17c13ee into main Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant