Skip to content

Conversation

@christophrj
Copy link
Contributor

@christophrj christophrj commented Sep 19, 2025

What this PR does / why we need it:

This PR introduces basic api server defaulting for the data sink reference of all metric types.

Fixes #30

Special notes for your reviewer:

The empty object in the parent struct triggers the defaulting when no dataSinkRef is provided.
Note that this doesn't cover the case of a user explicitly specifying a data sink with an empty string ("") which is handled in the controller but there is no proper way to handle this in openapi. minLength=1 would be a potential workaround but this felt like such an edge case that i left it out and i definitely would not introduce a mutating webhook for this.

Release note:

reflect data sink defaulting in the spec of metric CRs

@cla-assistant
Copy link

cla-assistant bot commented Sep 19, 2025

CLA assistant check
All committers have signed the CLA.

empty object triggers nested defaulting when no dataSinkRef is provided

On-behalf-of: @SAP [email protected]
Signed-off-by: Christopher Junk <[email protected]>
@christophrj christophrj force-pushed the feat/enhance-datasinkref-defaulting branch from 2ba8729 to afce4e2 Compare September 19, 2025 13:07
Copy link
Member

@maximiliantech maximiliantech left a comment

Choose a reason for hiding this comment

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

Great work @christophrj 🚀 I really appreciate your contribution 🫶

@maximiliantech
Copy link
Member

Note that this doesn't cover the case of a user explicitly specifying a data sink with an empty string ("") which is handled in the controller but there is no proper way to handle this in openapi. minLength=1 would be a potential workaround but this felt like such an edge case that i left it out and i definitely would not introduce a mutating webhook for this.

That is totally fine by me! Thanks for putting your thoughts into this 🏋️

@christophrj christophrj merged commit d241fa5 into openmcp-project:main Sep 24, 2025
4 checks 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.

Enhance defaulting of spec.dataSinkRef

3 participants