Conversation
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
Signed-off-by: Michel Hollands <michel.hollands@gmail.com>
bde3899 to
5e60a3c
Compare
| select { | ||
| case <-ctx.Done(): | ||
| return nil, ctx.Err() | ||
| default: | ||
| } | ||
|
|
||
| switch ar.Request.Resource.Resource { |
There was a problem hiding this comment.
Why is this needed? All the calls below have the contexts provided.
|
It is usually unneeded to add the |
| select { | ||
| case <-ctx.Done(): | ||
| return nil, ctx.Err() | ||
| default: | ||
| } |
There was a problem hiding this comment.
Also, this is shorter and equivalent:
| select { | |
| case <-ctx.Done(): | |
| return nil, ctx.Err() | |
| default: | |
| } | |
| if err := ctx.Err(); err != nil { | |
| return nil, err | |
| } |
|
@colega Sorry, I should have left this as a draft PR. We are having a problem with the prepareDownscale webhook on AWS and Azure where it returns |
This will stop the request from adding an annotation to the statefulset if the context is cancelled.