Skip to content

Fixes #36355: [2.0] apply metadata to Kubernetes pipeline resources - #37047

Merged
pmbrull merged 2 commits into
2.0from
backport/2.0/pr-36354
Nov 4, 2026
Merged

pmbrull merged 2 commits into
2.0from
backport/2.0/pr-36354

Conversation

@pmbrull

@pmbrull pmbrull commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #36355

Backports #36354 to 2.0. Kubernetes ingestion, application, and automation resources receive configured podLabels and podAnnotations, allowing GitOps controllers to track resources created by the pipeline client. Built-in client labels retain precedence.

Includes prerequisite #35513 because 2.0 still selects pods using the server-overridden managed-by label and permits supplied labels to replace operator identity labels. The prerequisite protects those identity labels and restores pod lookup and TTL cleanup. Both upstream changes were applied without conflicts.

The only release-specific adaptation changes two existing bot-token unit-test setups to skipInit(true). Their JWT assertions remain intact; the tests no longer depend on the developer's Kubernetes namespace. The original failures were reproduced on clean origin/2.0.

Type of change:

  • New feature

High-level design:

  • Reuses the original feature/test commits 5a317d08e82720371fd613bdb0f555f6f97f70d1 and eb8484e1246087a84bad7143394cb4f5bdb7b3a1, preceded by the operator prerequisite 263d76371fd7a28f9c7f11913e7274179978f3c5.
  • Label builders merge configured values before built-in values; resource and pod-template metadata receive the configured annotations.
  • The operator selects pods using operator-owned identity labels and preserves those labels after merging supplied labels. Cleanup also handles recorded pod names when label lookup misses.
  • Configuration defaults are empty. Existing pipelines receive new metadata when redeployed. Release the server and operator changes together.
  • The label/annotation and operator identity contracts are recorded in the two backported decision records. No schema or database migration is needed.
  • Companion chart configuration: openmetadata: add k8s.podLabels for resources spawned by the pipeline client openmetadata-helm-charts#552.

Tests:

Use cases covered

  • Labels and annotations on CronOMJobs, main/exit-handler specs, ConfigMaps, Secrets, CronJobs, Jobs, and pod templates.
  • Application and automation Jobs retain built-in labels on collisions.
  • Operator selectors find server-labelled pods, supplied labels cannot change operator identity, TTL cleanup removes the expected pods, repeat cleanup emits no deletion event, and other OMJobs remain isolated.
  • Existing JWT token assertions run without contacting a live Kubernetes cluster.

Unit tests

  • Backported the upstream regression tests and corrected the existing release test fixture.
  • 152 service tests passed, zero failures/errors/skips: EnvVarEndToEndTest (4), K8sPipelineClientBotTokenBugTest (2), K8sPipelineClientConfigTest (25), K8sPipelineClientTest (73), PipelineTaskKeyTest (48).
  • All 77 operator unit tests passed, zero failures/errors/skips, including LabelBuilderTest, PodManagerLabelSelectionTest, and OMJobReconcilerTtlCleanupTest.
  • Regression sensitivity: the upstream label tests fail in 4 of 12 cases against the original 2.0 label builder; all pass after the prerequisite fix.
  • Coverage of added executable production lines: 99/110 (90.0%). Whole-class line coverage: client 87.3%, config 89.9%, label builder 98.1%, pod manager 75.0%, reconciler 47.3%; the whole-class 90% target is not met for the legacy classes listed below it.
  • mvn -B -pl openmetadata-service,openmetadata-k8s-operator spotless:apply passed; commit hooks passed.

Backend integration tests

  • No REST endpoint changes. Release-specific planning selects 295 IT classes across the existing MySQL/Elasticsearch, PostgreSQL/OpenSearch, and Redis profiles.
  • LiveSearchSettingsChangeIT passed on PostgreSQL/OpenSearch: 1 test, zero failures/errors/skips.

IN PROGRESS — release integration suites are running locally on 5226219843e7e9ecf94f069a57829d9684d7fcd8. The MySQL/Elasticsearch parallel run has reported failures in PutKeepsTagsInSearchIT.apiEndpointBulkPutWithoutFieldTags_keepsThemInSearchDoc (60-second search-document timeout), DataContractResourceIT.testODCSExportIncludesTheContractsOwnTestCasesOnce (expected 7, got 6), and DataContractResourceIT.testODCSImportTurnsQualityRulesIntoTestCases (missing odcs_email_format), and GlossaryTermMoveApprovalIT.test_approveApprovalTaskAfterMovingParentTerm_drivesMovedTermToApproved (five-minute workflow timeout); baseline classification is pending. This suite is not green. Unit and search results above are from this backport. The original PR's main-branch integration runs are not counted as release evidence.

Ingestion integration tests

Not applicable — no Python ingestion changes.

Playwright (UI) tests

Not applicable — no UI changes.

Manual testing performed

  1. Ran the operator label regressions against the original release label builder, observed four assertion failures, restored the prerequisite, and ran the complete operator unit suite successfully.
  2. Reproduced the two bot-token setup errors on a separate clean origin/2.0 checkout, enabled skipInit in those unit tests, and verified both JWT assertions pass in the final combined suite.
  3. Verified both upstream patch IDs match the backported changes; checked the decision records and whitespace; the fresh review of 5226219843e7e9ecf94f069a57829d9684d7fcd8 found no actionable findings.

Live ArgoCD tracking and operator deployment were not exercised. Existing operator lifecycle ITs requiring a deployed operator retain their upstream disabled status.

UI screen recording:

Not applicable — backend-only backport.

Checklist:

  • Linked issue exists and is referenced above.
  • Title identifies the issue and the 2.0 backport.
  • Non-obvious behavior is explained by the upstream comments and decision records.
  • Schema/migration requirements: not applicable; no schema changes.
  • UI recording requirement: not applicable; no UI changes.
  • Tests and actual coverage measurements are listed above.
  • Self-review against REVIEW.md: fresh review of 5226219843e7e9ecf94f069a57829d9684d7fcd8; no actionable findings.
  • Decision check: both upstream decision records are included and introduce no new citation problems.
  • Release integration test plan has passed; keep draft until the pending runs finish.

Required by the Kubernetes resource metadata backport (#36354).

Backport of #35513, commit 263d763.
Backport #36354 to 2.0 using the original feature and test commits:

5a317d0
eb8484e

Skip Kubernetes initialization in the existing bot-token unit tests so JWT assertions do not depend on a local cluster.
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Nov 4, 2026
@gitar-bot

gitar-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Changing operator pod selection and TTL cleanup to delete status-recorded pods could remove unintended workloads if recorded names are stale or wrong.

Adds configured podLabels and podAnnotations to Kubernetes ingestion, application, and automation resources so GitOps controllers can track pipeline-created pods, with built-in client labels retaining precedence. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@pmbrull
pmbrull marked this pull request as ready for review November 4, 2026 11:34
@pmbrull
pmbrull requested a review from a team as a code owner November 4, 2026 11:34
@pmbrull
pmbrull requested review from mohityadav766 and removed request for a team November 4, 2026 11:34
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant