Skip to content

Return gardener user error for unmanaged resource on cluster delete#13

Open
aniruddha2000 wants to merge 10 commits intomainfrom
graceful-delete-409
Open

Return gardener user error for unmanaged resource on cluster delete#13
aniruddha2000 wants to merge 10 commits intomainfrom
graceful-delete-409

Conversation

@aniruddha2000
Copy link
Member

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:

this PR handles graceful deletion for 409 error code returned by STACKIT IaaS API and converts it to relevent gardener error.

Special notes for your reviewer:

Breaking changes:

@ske-prow ske-prow bot added kind/enhancement Enhancement, improvement, extension size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 25, 2026
Copy link

@nschad nschad left a comment

Choose a reason for hiding this comment

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

Add the error cases like SubnetInUse to dependenciesRegexp. Don't change the the infraflow part. Don't call DetermineError multiple times.

It's already called here:

func (a *actuator) Delete(ctx context.Context, log logr.Logger, infra *extensionsv1alpha1.Infrastructure, cluster *extensionscontroller.Cluster) error {
return util.DetermineError(
a.delete(ctx, log, infra, cluster),
helper.KnownCodes,
)
}

@ske-prow
Copy link

ske-prow bot commented Feb 25, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from nschad. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ske-prow ske-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 25, 2026
@ske-prow ske-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 26, 2026
@ske-prow ske-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 26, 2026
@ske-prow ske-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 26, 2026
@aniruddha2000 aniruddha2000 requested a review from nschad February 26, 2026 11:50
@ske-prow ske-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 26, 2026
Copy link

Choose a reason for hiding this comment

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

Please do it like this

func IsNotFoundError(err error) bool {
if err == nil {
return false
}
if gophercloud.ResponseCodeIs(err, http.StatusNotFound) {
return true
}
return false
}

Just add a util function within the same file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancement, improvement, extension size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants