-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/openshift-install: RunE -> logrus.Fatal
Before this commit, we had a number of callers with the following pattern: func doSomething(args) error { cleanup, err := setupFileHook(rootOpts.dir) if err != nil { return errors.Wrap(err, "failed to setup logging hook") } defer cleanup() err := someHelper() if err != nil { return err } return nil } The problem with that approach is than any errors returned by doSomething will not be logged to .openshift_install.log, and we definitely want those errors logged to the file. With this commit, I've shuffled things around to ensure we call logrus.Fatal(err) before the deferred cleanup() fires.
- Loading branch information
Showing
3 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters