Skip to content
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

Add a descriptive message for an invalid Patch delete #2111

Merged
merged 2 commits into from Aug 9, 2022

Conversation

lblackstone
Copy link
Member

@lblackstone lblackstone commented Jul 29, 2022

Proposed changes

With this change, the error message looks like this:

  kubernetes:apps/v1:DeploymentPatch (example):
    error: this Patch resource is currently managing a required field, so it can't be deleted directly. Either set the `retainOnDelete` resource option, or transfer ownership of the field before deleting: spec.template.spec.containers[0].image

Related issues (optional)

Fix #2107

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

awaitErr = fmt.Errorf(
"this Patch resource is currently managing a required field, so it can't be deleted "+
"directly. Either set the `retainOnDelete` resource option, or transfer ownership of the "+
"field before deleting: %s", cause.Field)
Copy link
Contributor

Choose a reason for hiding this comment

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

Did we want to add a link to some tutorial for this once we have one?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm planning to update the message once we have some better docs online

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@lblackstone lblackstone merged commit 01d3ce0 into master Aug 9, 2022
@pulumi-bot pulumi-bot deleted the lblackstone/patch-delete-msg branch August 9, 2022 00:50
@github-actions
Copy link

github-actions bot commented Aug 9, 2022

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

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.

Add descriptive error message for SSA Patch delete for required fields
2 participants