Skip to content

feat: add owners support to OpenMetadata CRDs#3

Merged
berimbolo13 merged 1 commit into
masterfrom
feat/owners-support
Apr 22, 2026
Merged

feat: add owners support to OpenMetadata CRDs#3
berimbolo13 merged 1 commit into
masterfrom
feat/owners-support

Conversation

@berimbolo13

Copy link
Copy Markdown
Collaborator

Summary

Adds optional owners field to all three OM CRDs (OpenMetadataService, IngestionPipeline, OpenMetadataTestCase) so users can declare which user(s) or team(s) own each registered entity.

What changed

  • CRD schema: New owners field on each spec, accepting a list of EntityReference (fullyQualifiedName + type). The EntityType enum is extended to include user and team.
  • Reconciliation: The operator resolves each owner FQN to an OM UUID via GET /v1/{users|teams}/name/{fqn} and forwards the resolved {id, type} list in the upsert payload.
  • Error handling: New ReasonOwnerResolutionFailed condition. Unsupported owner type -> permanent spec error (no requeue). Not-found / other API errors -> transient (requeue), matching the existing pipeline service-ref pattern.
  • Internal cleanup: Introduced typed omclient.EntityRef struct used for both Owners and the pipeline Service field (replaces map[string]any with compile-time safety).

Example usage

spec:
  forOpenMetadata:
    serviceType: Postgres
    owners:
      - fullyQualifiedName: data-engineering
        type: team
      - fullyQualifiedName: alice
        type: user
    connection:
      config: ...

Add an optional owners field to OpenMetadataService, IngestionPipeline,
and OpenMetadataTestCase CRs so users can declare which users or teams
own each registered entity.

The CRD field accepts a list of EntityReference (fullyQualifiedName +
type), with the EntityType enum extended to include "user" and "team".
At reconcile time, the operator resolves each FQN to an OpenMetadata
UUID via GET /v1/{users|teams}/name/{fqn} and forwards the resolved
{id, type} list in the upsert payload.

Resolution failures surface via the new ReasonOwnerResolutionFailed
condition. Unsupported owner types are treated as permanent spec errors
(no requeue), while not-found and other API errors trigger requeue,
matching the existing pipeline service-ref pattern.
Copilot AI review requested due to automatic review settings April 20, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class owners support across the OpenMetadata operator CRDs and reconciliation flow, allowing users to declare user/team ownership and have the operator resolve and upsert the corresponding OpenMetadata entity references.

Changes:

  • Extend CRD/API types to include spec.forOpenMetadata.owners for Service, Pipeline, and TestCase.
  • Add owner resolution logic (resolveOwners) and wire it into all three handlers with a new OwnerResolutionFailed condition reason.
  • Introduce a typed omclient.EntityRef and use it for both owners payloads and ingestion pipeline service payloads.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/omclient/types.go Adds EntityRef and includes Owners fields in request payloads; makes pipeline Service typed.
internal/omclient/pipeline_client_test.go Updates pipeline upsert test to use typed EntityRef for Service.
internal/omclient/interface.go Adds GetEntityByName to Service/TestCase client interfaces for owner resolution.
internal/handler/owner.go Adds shared resolveOwners helper + unsupported-type sentinel error.
internal/handler/owner_test.go Unit tests for owner resolution behavior and error cases.
internal/handler/service_handler.go Resolves owners and forwards them in service upsert payload; sets new condition reason on failure.
internal/handler/service_handler_test.go Adds tests verifying resolved owners are included; verifies requeue vs permanent error behavior.
internal/handler/pipeline_handler.go Resolves owners during upsert and forwards them; uses typed EntityRef for service payload.
internal/handler/pipeline_handler_test.go Updates stubs for GetEntityByName and adds tests verifying owner resolution behavior.
internal/handler/testcase_handler.go Resolves owners and forwards them in test case upsert payload; sets new condition reason on failure.
internal/handler/testcase_handler_test.go Adds tests verifying resolved owners are included and unsupported types don’t requeue.
internal/controller/openmetadataservice_controller_test.go Updates controller test stub to satisfy new ServiceClient interface method.
internal/controller/openmetadatatestcase_controller_test.go Updates controller test stub to satisfy new TestCaseClient interface method.
config/crd/bases/openmetadata.vortexa.com_openmetadataservices.yaml Adds owners OpenAPI schema to OpenMetadataService CRD.
config/crd/bases/openmetadata.vortexa.com_ingestionpipelines.yaml Adds owners OpenAPI schema to IngestionPipeline CRD and updates entity type enums.
config/crd/bases/openmetadata.vortexa.com_openmetadatatestcases.yaml Adds owners OpenAPI schema to OpenMetadataTestCase CRD.
api/v1alpha1/ingestionpipeline_types.go Adds owners field, extends EntityType enum with user/team.
api/v1alpha1/openmetadataservice_types.go Adds owners field to Service OM spec.
api/v1alpha1/openmetadatatestcase_types.go Adds owners field to TestCase OM spec.
api/v1alpha1/zz_generated.deepcopy.go Updates deepcopy generation for newly added owners slices.
api/v1alpha1/conditions.go Adds ReasonOwnerResolutionFailed condition reason.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/crd/bases/openmetadata.vortexa.com_openmetadataservices.yaml
Comment thread api/v1alpha1/ingestionpipeline_types.go
Comment thread config/crd/bases/openmetadata.vortexa.com_ingestionpipelines.yaml
Comment thread config/crd/bases/openmetadata.vortexa.com_ingestionpipelines.yaml
Comment thread internal/omclient/types.go
@berimbolo13 berimbolo13 merged commit fe75975 into master Apr 22, 2026
8 checks passed
@berimbolo13 berimbolo13 deleted the feat/owners-support branch April 22, 2026 09:19
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.

3 participants