-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from kriegr/master
Add arm64 implementation for termination log
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Package terminationlog helps to fill the kubernetes termination log. | ||
// From the doc: | ||
// Termination messages provide a way for containers to write information | ||
// about fatal events to a location where it can be easily retrieved and | ||
// surfaced by tools like dashboards and monitoring software. In most | ||
// cases, information that you put in a termination message should also | ||
// be written to the general Kubernetes logs. | ||
package terminationlog | ||
|
||
import ( | ||
"os" | ||
"syscall" | ||
) | ||
|
||
// termLog default location of kubernetes termination log | ||
const termLog = "/dev/termination-log" | ||
|
||
func init() { | ||
file, err := os.OpenFile(termLog, os.O_RDWR, 0666) | ||
|
||
if err == nil { | ||
logFile = file | ||
|
||
// redirect stderr to the termLog | ||
syscall.Dup3(int(logFile.Fd()), 2, 0) // nolint: errcheck | ||
} | ||
} |