Skip to content

Handle namespaced ExtraResources properly#537

Merged
bobh66 merged 2 commits intocrossplane-contrib:mainfrom
bobh66:fix_namespaced_requirements
Mar 9, 2026
Merged

Handle namespaced ExtraResources properly#537
bobh66 merged 2 commits intocrossplane-contrib:mainfrom
bobh66:fix_namespaced_requirements

Conversation

@bobh66
Copy link
Collaborator

@bobh66 bobh66 commented Feb 3, 2026

Description of your changes

Use requirements.Resources for namespaced ExtraResources.

Fixes #483

I have:

@doxsch
Copy link
Contributor

doxsch commented Feb 20, 2026

Thank you very much for creating this PR. Do you happen to have an approximate release timeline for this change? We would greatly appreciate it, as we are depending on this update.

Copy link
Member

@adamwg adamwg left a comment

Choose a reason for hiding this comment

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

One thought on future-proofing, but no objection to merging this as-is either. Not sure if I'm an approver on this repo.

requirements.Resources[k] = v.ToResourceSelector()
} else {
requirements.ExtraResources[k] = v.ToResourceSelector() //nolint:staticcheck // need to support Crossplane v1
}
Copy link
Member

Choose a reason for hiding this comment

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

Would there be any harm in adding all required resources to Resources, but additionally including cluster-scoped resources in ExtraResources? I.e.:

Suggested change
}
requirements.Resources[k] = v.ToResourceSelector()
if v.Namespace == "" {
requirements.ExtraResources[k] = v.ToResourceSelector() //nolint:staticcheck // need to support Crossplane v1
}

This would future-proof against ExtraResources support being dropped in some future Crossplane release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did consider that, but I was afraid (maybe unnecessarily) that the GRPC message might get too big if the resource request was duplicated. But maybe that's not possible given the way the resource responses are processed. I'll take a quick look and probably just accept the suggestion.

@peimanja
Copy link

peimanja commented Mar 1, 2026

Thanks for working on this, Would be great to get this rolled out as blocking some of our configuration package development

@dmitrykuleshov-goreel
Copy link

@sergenyalcin, @turkenf, @negz any chances you can approve this? We kinda rely on this also and have to use additional function as a workaround.
Thanks!

bobh66 added 2 commits March 3, 2026 21:36
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
@bobh66 bobh66 force-pushed the fix_namespaced_requirements branch from b95823e to 1b443e8 Compare March 4, 2026 03:52
@bobh66 bobh66 requested a review from ulucinar as a code owner March 4, 2026 03:52
@bobh66 bobh66 requested a review from adamwg March 6, 2026 17:09
Copy link
Collaborator

@ezgidemirel ezgidemirel left a comment

Choose a reason for hiding this comment

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

Thanks @bobh66 for the PR, LGTM

@bobh66 bobh66 merged commit 4c5b000 into crossplane-contrib:main Mar 9, 2026
6 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.

Support namespaced resources in ExtraResources

6 participants