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

SUP-2813: correct logic for pausing/resuming Dispatch on Queues and remove error with Default Cluster Queues #593

Merged
merged 13 commits into from
Dec 20, 2024

Conversation

tomowatt
Copy link
Member

@tomowatt tomowatt commented Dec 12, 2024

  • removed isPausible as it would trigger Pausing when the Description was updated and State DispatchedPaused = false
  • compare Plan and State values to pause/resume dispatch else do nothing, which stops changes to the Description causing the Queue to be paused
  • r.ClusterQueueUpdate.ClusterQueue.DispatchPaused is nil at the time of the original logic resulting in panic: runtime error: invalid memory address or nil pointer dereference so changed to the Plan Value to be used for clarity else could be hardcoded as state.DispatchPaused = types.BoolValue(true) or state.DispatchPaused = types.BoolValue(false) (where appropritate)
  • Remove error raised when a Cluster Queue doesn't have a Default Queue defined as there is an error with the API when updating a Queue resulting it in being removed as Default. But Clusters do not require a Default Queue being set so error not required.
  • Add Warning as Queues cannot be created with dispatch_paused = true due to limitation with API.

Includes fixes for #591 though there is a API issue resulting in the changes of Default Queues during updates to the Cluster Queue

@tomowatt tomowatt requested a review from a team as a code owner December 12, 2024 11:26
@tomowatt tomowatt marked this pull request as draft December 12, 2024 15:13
lizrabuya
lizrabuya previously approved these changes Dec 13, 2024
@lizrabuya lizrabuya dismissed their stale review December 13, 2024 01:02

remove review

@tomowatt tomowatt marked this pull request as ready for review December 16, 2024 11:49
@tomowatt tomowatt changed the title SUP-2813: correct logic for pausing/resuming Dispatch on Queues SUP-2813: correct logic for pausing/resuming Dispatch on Queues and remove error with Default Cluster Queues Dec 16, 2024
tomowatt and others added 9 commits December 16, 2024 11:56
* removed isPausible as it would trigger Pausing when the Description was updated and State DispatchedPaused = false
* compare Plan and State values to pause/resume dispatch else do nothing

Signed-off-by: Tom Watt <[email protected]>
Currently, a cluster is allowed to:
* Have no queues
* Have queues, with none of them set to default queue

Having this check doesn't make sense.
* State might be nil if Description not set on creation resulting in nil in response after update call

Signed-off-by: Tom Watt <[email protected]>
mcncl
mcncl previously approved these changes Dec 16, 2024
…arity and re-use

* used "diag *diag.Diagnostics" instead of "resp *resource.UpdateResponse" so helper functions can be used in different operations e.g., Create

Signed-off-by: Tom Watt <[email protected]>
@mcncl mcncl merged commit 27a34b7 into main Dec 20, 2024
1 check passed
@mcncl mcncl deleted the SUP-2813 branch December 20, 2024 04:31
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.

4 participants