Add updateable and deletable status guards for resources#685
Add updateable and deletable status guards for resources#685sapphirew wants to merge 2 commits intoaws-controllers-k8s:mainfrom
Conversation
…IsDeletable template functions Add GoCodeResourceIsUpdateable and GoCodeResourceIsDeletable entries to controllerFuncMap in controller.go, following the same signature pattern as GoCodeIsSynced. These template functions invoke the corresponding code generation functions from updateable.go.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sapphirew The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@sapphirew: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Issue #, if available:
Description of changes:
Add generator.yaml configuration and template functions that allow service controllers to declare which status field values permit update and delete operations. When a resource is not in an allowed state, the generated code requeues the operation with a configurable delay instead of attempting the API call.
New config blocks
updateableanddeletableon ResourceConfig accept a list of status field path + allowed-values conditions and an optional requeue_after_seconds override (default 30s). Template functions GoCodeResourceIsUpdateable and GoCodeResourceIsDeletable are injected into sdk_update, sdk_update_custom, sdk_update_set_attributes, and sdk_delete templates respectively.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.