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

Support Resolve Policy IfNotPresent #6

Open
phisco opened this issue Feb 15, 2024 · 0 comments
Open

Support Resolve Policy IfNotPresent #6

phisco opened this issue Feb 15, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@phisco
Copy link
Collaborator

phisco commented Feb 15, 2024

What problem are you facing?

We currently don't support Resolve Policy IfNotPresent, but only Always, we could think of implementing it if needed.

Resolve Policy IfNotPresent was originally implemented by writing to the XR's spec.environmentConfigRefs, Functions can only write to the status of the XR, so we can't do the same here, but at the end of the day, all we need is a way to "store" the EnvironmentConfigs returned the first time and only request those in subsequent calls, so we could think of some alternatives.

The status would be the most natural option, but usually that's not restored in case of Backup/Restores, so we should try thinking of another option.

We could output as part of the desired state an EnvironmentConfig containing the references to these resources, so that on subsequent reconciliations we could get it back as input and only request those back.

If Crossplane was to implement caching in some way, we can assume this function will get every time the same EnvironmentConfigs requested on the first run, so by trusting them we could effectively have Always resolve policy implemented with little effort.Invalidating these references in case of changes in the composition was an issue also in the original implementation AFAIR, but deleting the references from the resource spec was enough to manually invalidate it, how could we handle it here? this would probably be something to be defined at the Crossplane level though.

How could this Function help solve your problem?

Support Resolve Policy IfNotPresent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants