From c2fbf93365ab327cb6dee7533954dee45c42147f Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 10 Nov 2021 18:43:08 +0100 Subject: [PATCH] daemon: provide os.Environ() in zrepl status Useful for debugging. fixes https://github.com/zrepl/zrepl/issues/534 --- daemon/control.go | 6 ++++-- daemon/daemon.go | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/daemon/control.go b/daemon/control.go index edd1624..81362ee 100644 --- a/daemon/control.go +++ b/daemon/control.go @@ -8,6 +8,7 @@ import ( "io" "net" "net/http" + "os" "time" "github.com/pkg/errors" @@ -124,8 +125,9 @@ func (j *controlJob) Run(ctx context.Context) { s := Status{ Jobs: jobs, Global: GlobalStatus{ - ZFSCmds: globalZFS, - Envconst: envconstReport, + ZFSCmds: globalZFS, + Envconst: envconstReport, + OsEnviron: os.Environ(), }} return s, nil }}) diff --git a/daemon/daemon.go b/daemon/daemon.go index 144d0c4..c5399f1 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -160,8 +160,9 @@ type Status struct { } type GlobalStatus struct { - ZFSCmds *zfscmd.Report - Envconst *envconst.Report + ZFSCmds *zfscmd.Report + Envconst *envconst.Report + OsEnviron []string } func (s *jobs) status() map[string]*job.Status {