plugins/cilium-docker: use log default exit code 1 #20612
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.
log.Fatal(err)
in line 63 will callcilium/vendor/github.com/sirupsen/logrus/entry.go
Lines 325 to 328 in c39e133
and
entry.Logger.Exit(1)
in line 327 will callcilium/vendor/github.com/sirupsen/logrus/logger.go
Lines 336 to 342 in c39e133
and we don't set
logger.ExitFunc
. So just callos.Exit(1)
.In fact, the README of the log library already points this out:
cilium/vendor/github.com/sirupsen/logrus/README.md
Lines 303 to 304 in c39e133
The line 65 of code will not be executed regardless of the exit code set.
cilium/plugins/cilium-docker/main.go
Lines 62 to 67 in c39e133