Skip to content

Commit

Permalink
Merge pull request #280 from kriegr/master
Browse files Browse the repository at this point in the history
Add arm64 implementation for termination log
  • Loading branch information
threez authored Oct 25, 2021
2 parents 311b27d + 74bcb0b commit a5f5d4b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
File renamed without changes.
27 changes: 27 additions & 0 deletions maintenance/terminationlog/termlog_linux_arm64.go
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
}
}

0 comments on commit a5f5d4b

Please sign in to comment.