fix: status check lists all events #9015
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #8972
Related: #8624
Description
change the way how skaffold should detect when a deployment request was rejected by admission webhook
The original implementation repeatedly lists all events to determine if request was denied by admission webhook, there are some problems with this approach
tolerate-failure-until-deadline
is used, even worse, the failCreate event may not come from the current skaffold session, it seems that by default the retention for events is 1 hr.tolerate-failure-until-deadline
probably won't make sense, even if we assume events are reliable and in chronological order, which probably not trueThe replacement hack still sort of relies on content from a message, this is bad, but it seems that there are no other reliable way to do this kind of check at the moment, we cannot check the status of pods from a deployment when admission webhook rejects request as those pods haven't been created yet.
This implementation may be broken when message from k8s server changes, but shouldn't produce other issues
Test Plan