Skip to content

Conversation

@bobh66
Copy link
Collaborator

@bobh66 bobh66 commented Dec 20, 2025

Description of your changes

Added support for sequencing of resource deletion using the resource dependency graph. Usage and/or ClusterUsage resources are created based on the dependencies used for resource creation. Supports both Crossplane v1 Usage.apiextension.crossplane.io and Crossplane v2 Usage.protection.crossplane.io/ClusterUsage.protection.crossplane.io resources.

Fixes #79

I have:

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

@negz negz left a comment

Choose a reason for hiding this comment

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

I've been thinking about how we might tackle creation/deletion ordering more generally in functions. I don't have a good solution yet, but that doesn't need to block this. I feel okay with this approach in this function.

Note: I'm not a maintainer on this function, and don't have any experience using it. So take this as my informed bystander opinion and not a binding approval.

}

// GenerateUsage determines whether to return a v1 or v2 Crossplane usage.
func GenerateUsage(of *unstructured.Unstructured, by *unstructured.Unstructured, rd bool, usageVersion v1beta1.UsageVersion) map[string]any {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func GenerateUsage(of *unstructured.Unstructured, by *unstructured.Unstructured, rd bool, usageVersion v1beta1.UsageVersion) map[string]any {
func GenerateUsage(of, by *unstructured.Unstructured, rd bool, usageVersion v1beta1.UsageVersion) map[string]any {

Nit: You only need the type once when they're repeated in Go.

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.

Deletion Sequencing - Create Usage resources based on dependency tree

2 participants