Skip to content

Handle namespaced ExtraResources properly#537

Open
bobh66 wants to merge 1 commit intocrossplane-contrib:mainfrom
bobh66:fix_namespaced_requirements
Open

Handle namespaced ExtraResources properly#537
bobh66 wants to merge 1 commit 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:

Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
@doxsch
Copy link

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

@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

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.

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

3 participants