-
Notifications
You must be signed in to change notification settings - Fork 978
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
Future of Composition Environment
#3770
Comments
We are using it successfully as-is. Some clarity around the patch ordering in documentation and validation that a patch is just not going to work rather than having it fail silently would be great beta criteria. For example if attempting to patch a composed resource and then trying to use that same field elsewhere as if it were a composite field maybe a validatingAdmissionWebhook could deny it as invalid? |
I agree, #3454 behavior should be documented. Otherwise it is totally unclear why construction like https://github.com/ytsarev/composition-environment-example/blob/main/xvpc/composition.yaml#L36-L38 does not work. It's not the best UX in general so if there is chance to change the order for ToEnvironment patches, we should try to do it. @plumbis where are old doc snippets are living now? E.g. I'm failing to find https://github.com/crossplane/crossplane/pull/3007/files#diff-57c8cd7167236fac0edefa6b72c183bb0fdbd21bdc8ec0a521407eaf436ebc0e in the current state of repos. It is generally useful to have snippets close to the code as they represent the working samples of the various functionality right in the crossplane repo. |
I've added working(aka not affected by ordering situation) examples of |
crossplane/docs#380 related concern |
@ytsarev all snippets are still under their versions (v1.10, v1.9). They are being removed in v1.11 and future versions. Docs that still reference snippets need to be updated. (Happy to discuss why we're removing snippets but it's beyond the scope of this issue) |
hi, is it intended that if we select env config by some label in composition and there are multiple configs with that label, only one config is selected per matchLabels list item:
would be nice to be able to select and aggregate all configs with matching labels. these could be necessary changes to enable it: P0t4T0o@cf8ee8e |
@P0t4T0o that makes total sense to me and also looks matching original design by @MisterMX . @P0t4T0o why don't you create PR from the changes you demonstrated? It already looks functional, just some unit test coverage to extend. |
I agree with that. Documentation should be adjusted accordingly. We were facing the same issue as mentioned above when we were trying to use the |
I added the following comment to #3931 but I'll mention it here as well - it seems like it should be valid for an EnvironmentConfig Selector to return no results, just as it is valid for a CompositionSelector to return no results and fallback to the defaultComposition. In this case the environment may be constructed of a variety of named and selected EnvironmentConfigs, as well as patches from the Composite, and the absence of one or more selectors may not be a problem, and may even be expected. I view it as creating a runtime context from a number of sources, where different sources may exist in different scenarios and the absence of a given source is not necessarily an error condition. I'm also thinking it might be helpful to have a "default" or "init" section under spec.environment which can contain a hard-coded set of "defaults" for the environment, which may or may not be overridden by selected/named environments or patches. This would also help with the If there is interest in that I can open a separate issue and see about implementation for 1.13 |
I have wanted exactly this functionality many times. I've ended up creating "cluster-wide" defaults, and then creating free-form status fields to do |
@MisterMX @phisco do you think we should reframe this issue to reflect the decision taken in #5061?
Here's my understanding of the state of the feature:
Is that correct? |
I'd rather deprecate them first for one release, at least. Otherwise we are forcing people using this alpha, but really widely used,feature to also migrate to functions, while native compositions are not deprecated yet. Given that the migration is not seamless, I'd prefer not rushing it. |
Deprecation sounds great to me, as long as we're making forward progress in some direction. 😄 Do we have an example of deprecating a field (as opposed to a whole type)? How would we deprecate it? Probably:
Anything else? |
We can emit a deprecation warning from the webhook too if marking the field deprecated is not doing that already, I don't think it does, I have to check 🤔 |
Composition Environment
to betaComposition Environment
I'm fine promoting the EnvironmentConfig resource to beta as is, the other option would be to move it out of tree, e.g. provider-environment-configs. |
I maybe have a slight preference for moving it out of tree? Not sure. My thinking is that it'd be unusual to have a type installed by core that wasn't actually used by core - only by functions. On the other hand it's also a bit unusual to have a "provider" that installs a type but doesn't actually reconcile it, so I don't feel super strongly. If/when we bump it to beta can we make sure the "old" env config machinery is explicitly marked deprecated. I want to make it clear that we're only promoting the type (for use with functions) and that we still plan to remove the "built in" env config support. |
@phisco @negz I'd like to get the I think the thing that pushes me toward keeping it in-tree is the desire to be able to include it in a Thoughts? Do we need a new issue for promoting the resource? Or can we treat the promotion/deprecation as one thing and deal with it here? |
@bobh66, I'm fine keeping this issue. I'm fine just promoting EnvironmentConfig and leaving the environment machinery to be deprecated with the rest of the native patch and transform composition. I think it would add a lot of useless pain for users to move it out of Crossplane. |
Thanks @phisco - is there any additional effort required to deprecate the machinery, or does deprecating the native P&T cover it? |
I feel okay leaving the By that I mean:
I'm assuming by "it" here you mean the things I listed above - it's unclear if you meant that or the EnvironmentConfig type. If so, I empathize, but the flipside is that we must maintain the code for this alpha feature indefinitely. We're committed to maintain most of the in-tree Composition code because it shipped as a GA feature, but EnvironmentConfigs never left alpha. I know EnvironmentConfigs are popular and widely used, but everyone using them has opted into an alpha feature with plenty of warning that it might be dropped or changed in future. I think it's reasonable to ask them to migrate to the beta iteration of the feature (i.e. using functions). |
I meant dropping the EnvironmentConfig resource would be painful. Sounds good to me dropping the machinery around them though, the migration path is as easy as pushing the configuration down to function-environment-config/function-patch-and-transform. If we start making people aware now, it should be fine. |
As discussed we'll have to:
|
@phisco i've taken your task list in the comment above and merged them into the main task list for this epic, along with current status. Thanks for driving this in v1.18! 🙇♂️ |
Ok, we finally managed to execute on the plan above, so we can close this! TL;DR: We've promoted the |
What problem are you facing?
Support for
EnvironmentConfigs
was added in Crossplane v1.11.0.How could Crossplane help solve your problem?
We need a plan to promote it to v1beta1, which may include accepting it as is, changing it, or dropping the feature. Community feedback would help here.
Tracked issues
EnvironmentConfig
to v1beta1, but remove native support #5938FromEnvironmentFieldPath
patch type inspec.environment.patches
#4080environment.environmentConfigs
toenvironment.configs
#4591The text was updated successfully, but these errors were encountered: