Skip to content

Commit

Permalink
chore: slog dev deploy (#3176)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 authored Nov 4, 2024
1 parent 3b873c8 commit 115f4f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pkg/packager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/pkg/packager/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.Debug("dev deployment complete", "package", p.cfg.Pkg.Metadata.Name, "duration", time.Since(start))

message.HorizontalRule()
message.Title("Next steps:", "")
Expand Down

0 comments on commit 115f4f2

Please sign in to comment.