From 76bc4b6f0dce88182c6572df03f5a48a3c4a1071 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Mon, 4 Nov 2024 16:37:06 +0000 Subject: [PATCH 1/2] slog dev deploy Signed-off-by: Austin Abro --- src/pkg/packager/deploy.go | 2 ++ src/pkg/packager/dev.go | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/pkg/packager/deploy.go b/src/pkg/packager/deploy.go index 6ecf6cc229..133dba9e8d 100644 --- a/src/pkg/packager/deploy.go +++ b/src/pkg/packager/deploy.go @@ -48,9 +48,11 @@ var ( ) func (p *Packager) resetRegistryHPA(ctx context.Context) { + l := logger.From(ctx) if p.isConnectedToCluster() && p.hpaModified { if err := p.cluster.EnableRegHPAScaleDown(ctx); err != nil { message.Debugf("unable to reenable the registry HPA scale down: %s", err.Error()) + l.Debug("unable to reenable the registry HPA scale down", "error", err.Error()) } } } diff --git a/src/pkg/packager/dev.go b/src/pkg/packager/dev.go index 1985edb655..1a75d1fd1d 100644 --- a/src/pkg/packager/dev.go +++ b/src/pkg/packager/dev.go @@ -9,10 +9,12 @@ import ( "fmt" "os" "runtime" + "time" "github.com/defenseunicorns/pkg/helpers/v2" "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/layout" + "github.com/zarf-dev/zarf/src/pkg/logger" "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager/creator" "github.com/zarf-dev/zarf/src/pkg/packager/filters" @@ -21,6 +23,8 @@ import ( // DevDeploy creates + deploys a package in one shot func (p *Packager) DevDeploy(ctx context.Context) error { + l := logger.From(ctx) + start := time.Now() config.CommonOptions.Confirm = true p.cfg.CreateOpts.SkipSBOM = !p.cfg.CreateOpts.NoYOLO @@ -74,6 +78,7 @@ func (p *Packager) DevDeploy(ctx context.Context) error { } message.HeaderInfof("📦 PACKAGE DEPLOY %s", p.cfg.Pkg.Metadata.Name) + l.Info("starting package deploy", "name", p.cfg.Pkg.Metadata.Name) if !p.cfg.CreateOpts.NoYOLO { p.cfg.Pkg.Metadata.YOLO = true @@ -108,10 +113,12 @@ func (p *Packager) DevDeploy(ctx context.Context) error { } if len(deployedComponents) == 0 { message.Warn("No components were selected for deployment. Inspect the package to view the available components and select components interactively or by name with \"--components\"") + l.Warn("No components were selected for deployment. Inspect the package to view the available components and select components interactively or by name with \"--components\"") } // Notify all the things about the successful deployment message.Successf("Zarf dev deployment complete") + l.Info("dev deployment complete", "package", p.cfg.Pkg.Metadata.Name, "duration", time.Since(start)) message.HorizontalRule() message.Title("Next steps:", "") From 8baede3ee0e0b3393dca19e1142ac277c7489efc Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Mon, 4 Nov 2024 16:54:40 +0000 Subject: [PATCH 2/2] info->debug Signed-off-by: Austin Abro --- src/pkg/packager/dev.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/packager/dev.go b/src/pkg/packager/dev.go index 1a75d1fd1d..589eedb5be 100644 --- a/src/pkg/packager/dev.go +++ b/src/pkg/packager/dev.go @@ -118,7 +118,7 @@ func (p *Packager) DevDeploy(ctx context.Context) error { // Notify all the things about the successful deployment message.Successf("Zarf dev deployment complete") - l.Info("dev deployment complete", "package", p.cfg.Pkg.Metadata.Name, "duration", time.Since(start)) + l.Debug("dev deployment complete", "package", p.cfg.Pkg.Metadata.Name, "duration", time.Since(start)) message.HorizontalRule() message.Title("Next steps:", "")