From e7b325259e067255c5703d129fa4287b0f31d432 Mon Sep 17 00:00:00 2001 From: Eslam-Nawara Date: Wed, 6 Nov 2024 15:04:55 +0200 Subject: [PATCH] add current zos version to zos logs on upgrades --- pkg/upgrade/upgrade.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index e226425dd..db1a0f912 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -231,7 +231,7 @@ func (u *Upgrader) Version() semver.Version { func (u *Upgrader) nextUpdate() time.Duration { jitter := rand.Intn(checkJitter) next := checkForUpdateEvery + (time.Duration(jitter) * time.Minute) - log.Info().Str("after", next.String()).Msg("checking for update after") + log.Info().Str("after", next.String()).Msg("checking for update") return next } @@ -295,7 +295,7 @@ func (u *Upgrader) update() error { } } - log.Info().Str("version", filepath.Base(remote.Target)).Msg("updating system...") + log.Info().Str("running version", u.Version().String()).Str("updating to version", filepath.Base(remote.Target)).Msg("updating system...") if err := u.updateTo(remote, ¤t); err != nil { return errors.Wrapf(err, "failed to update to new tag '%s'", remote.Target) } @@ -436,9 +436,11 @@ func newInMemoryCache() (*inMemoryCache, error) { func (c *inMemoryCache) flistCache() string { return c.flist } + func (c *inMemoryCache) fileCache() string { return c.file } + func (c *inMemoryCache) clean() { os.RemoveAll(c.root) }