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

Update engine to call delete for resources that don't support _exist directly #382

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Apr 4, 2024

PR Summary

  • A configuration set operation will now call delete on a resource (if it supports it) if _exist = false is one of the properties and the resource doesn't have the SetHandlesExist capability.
  • If the resource has the SetHandlesExist capability, then it will get the raw properties
  • Updated Test/Exist resource to better validate case that _exist is passed through
  • Added Test/Delete resource to validate delete gets called
  • Group/Adapter resources are not supported for the delete path as all resources would need to support delete (you'll get an error message if the resource returns a group response).
  • Since delete is a synthetic set with _exist, had to write code to convert the get response into a set response
  • Added synthetic test during configuration set operation if the resource doesn't directly implement it

PR Context

Fix #290

@SteveL-MSFT SteveL-MSFT marked this pull request as draft April 5, 2024 00:15
@SteveL-MSFT SteveL-MSFT marked this pull request as ready for review April 5, 2024 03:54
Copy link
Collaborator

@anmenaga anmenaga left a comment

Choose a reason for hiding this comment

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

LGTM

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Apr 5, 2024
Merged via the queue into PowerShell:main with commit b44699e Apr 5, 2024
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the delete-exist branch April 5, 2024 20:41
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Apr 15, 2024
This change updates guidance for resources that implement the `delete`
method to always define the `_exist` property in the JSON schema for
the resource's properties, now that DSC can automatically determine
whether to delete an instance as implemented in PowerShell#382.

This change updates both the source and composed schemas.
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Apr 16, 2024
This change updates guidance for resources that implement the `delete`
method to always define the `_exist` property in the JSON schema for
the resource's properties, now that DSC can automatically determine
whether to delete an instance as implemented in PowerShell#382.

This change updates both the source and composed schemas.
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Apr 18, 2024
This change updates guidance for resources that implement the `delete`
method to always define the `_exist` property in the JSON schema for
the resource's properties, now that DSC can automatically determine
whether to delete an instance as implemented in PowerShell#382.

This change updates both the source and composed schemas.
michaeltlombardi added a commit to michaeltlombardi/DSC that referenced this pull request Apr 18, 2024
This change updates guidance for resources that implement the `delete`
method to always define the `_exist` property in the JSON schema for
the resource's properties, now that DSC can automatically determine
whether to delete an instance as implemented in PowerShell#382.

This change updates both the source and composed schemas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose delete as a direct dsc resource operation
2 participants