Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge secretrefs and configrefs into single list #81

Merged
merged 33 commits into from
Jan 15, 2025
Merged

Conversation

fabianburth
Copy link
Contributor

What this PR does / why we need it

This PR merges config ref and secret ref into a single list and exchanges the implicit defaulting mechanism (implicitly inheriting the configuration of the previous object in the pipeline - e.g. component inherits from repository) with an explicit mechanism.

Merging into single list
The order in which the configuration is applied is relevant. This becomes confusing and cumbersome with two separate lists and additional mechanisms would be needed.

Changing the defaulting mechanism

  1. The previous defaulting mechanism would automatically inherit the referenced config maps if the config maps were empty and the secrets if the secrets are empty. This does not make too much sense (but was overseen, since originally, this was already intended as a single list). If a user would provide all his configuration data in secrets and therefore, doesn't specify any config maps, the mechanism would still have inherited the config maps and potentially overwritten some of the configs provided in the secret.
  2. The new mechanism allows to only inherit parts of the configuration. Thus, inherit the reference to config map a BUT NOT the reference to config map b. This is useful, because the e.g. the Replication needs the same credentials as the Component (since it needs to have access to the component), but it does not need other parts of the configuration such as the signing keys.

Which issue(s) this PR fixes

#80

@fabianburth fabianburth requested a review from a team as a code owner December 9, 2024 16:06
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

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

Mostly looking good, just nits. generally looking good

@fabianburth fabianburth force-pushed the ocm-config branch 2 times, most recently from 0878b2d to e6d4fd4 Compare January 13, 2025 14:17
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

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

Just one question on the Spec for the API, apart from that LGTM

# Conflicts:
#	api/v1alpha1/component_types.go

# Conflicts:
#	api/v1alpha1/common_types.go

# Conflicts:
#	api/v1alpha1/ocmrepository_types.go
#	config/crd/bases/delivery.ocm.software_ocmrepositories.yaml
The propagation policy now is defaulted through a kubebuilder directive which makes this logic redundant.
The GetEffectiveOCMConfig() is merely a getter, which is much more easy and stable to maintain in our public API.
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a comment

Choose a reason for hiding this comment

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

LGTM,
@frewilhelm PTAL

Copy link
Contributor

@frewilhelm frewilhelm left a comment

Choose a reason for hiding this comment

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

only a preliminary review..

@fabianburth fabianburth merged commit 1b31e29 into main Jan 15, 2025
4 checks passed
@fabianburth fabianburth deleted the ocm-config branch January 15, 2025 09:04
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