Closes #75. Properly set the conditions when call to applyOutputs fails.#101
Conversation
|
Created a draft PR that I will get tested tomorrow hopefully and opened for actual review |
kdorosh
left a comment
There was a problem hiding this comment.
one question for my own understanding
|
|
||
| if err := r.applyOutputs(ctx, log, obj, out); err != nil { | ||
| // Mark the state's condition as failed since outputs couldn't be applied | ||
| if !condition.IsEmpty() { |
There was a problem hiding this comment.
should we do this even if the condition isn't empty?
There was a problem hiding this comment.
good question, let me think about it. The only weird part of that would be what is the condition type since we are overriding other fields here? Should it just be empty? 🤔
The IsEmpty returns true only if all fields are empty - https://github.com/reddit/achilles-sdk-api/blob/main/api/condition.go#L115
There was a problem hiding this comment.
We also seem to do this same check when setting any other fields for the condition too -
achilles-sdk/pkg/fsm/internal/reconciler.go
Line 276 in 04c816e
There was a problem hiding this comment.
yeah, I think the change as you have it is safer / less intrusive
|
|
||
| if err := r.applyOutputs(ctx, log, obj, out); err != nil { | ||
| // Mark the state's condition as failed since outputs couldn't be applied | ||
| if !condition.IsEmpty() { |
There was a problem hiding this comment.
yeah, I think the change as you have it is safer / less intrusive
Closes #75
Managing the PR process for @dansawyer73
💸 TL;DR
ApplyOutputsfails. This ensures that the resource is not marked ready when status conditions fail🧪 Testing Steps / Validation
If anyone has ideas on how best to test this in env/unit tests let me know
✅ Checks