From d0aa278a2262ac49be0d3656c497dffbe38b621c Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Wed, 26 Feb 2025 11:35:31 -0800 Subject: [PATCH 1/4] wip. remove log-format legacy. need to ensure message stdout logging still works Signed-off-by: Kit Patella --- src/cmd/package.go | 3 +- src/internal/packager/helm/chart.go | 30 ++++---------------- src/internal/packager/helm/destroy.go | 13 ++------- src/internal/packager/helm/utils.go | 10 ++----- src/internal/packager/helm/zarf.go | 9 +----- src/internal/packager/template/template.go | 6 +--- src/internal/packager2/layout/oci.go | 7 +---- src/pkg/layout/component.go | 11 ++++---- src/pkg/logger/logger.go | 33 +--------------------- src/pkg/packager/remove.go | 2 +- src/pkg/packager/sources/oci.go | 2 +- src/pkg/packager/sources/tarball.go | 5 +--- src/pkg/zoci/common.go | 8 +----- 13 files changed, 25 insertions(+), 114 deletions(-) diff --git a/src/cmd/package.go b/src/cmd/package.go index 9b1f3173ef..4d4c9d0b27 100644 --- a/src/cmd/package.go +++ b/src/cmd/package.go @@ -127,8 +127,6 @@ func (o *packageCreateOptions) run(cmd *cobra.Command, args []string) error { var isCleanPathRegex = regexp.MustCompile(`^[a-zA-Z0-9\_\-\/\.\~\\:]+$`) if !isCleanPathRegex.MatchString(config.CommonOptions.CachePath) { - // TODO(mkcp): Remove message on logger release - message.Warnf(lang.CmdPackageCreateCleanPathErr, config.ZarfDefaultCachePath) l.Warn("invalid characters in Zarf cache path, using default", "cfg", config.ZarfDefaultCachePath, "default", config.ZarfDefaultCachePath) config.CommonOptions.CachePath = config.ZarfDefaultCachePath } @@ -562,6 +560,7 @@ func newPackageListOptions() *packageListOptions { return &packageListOptions{ outputFormat: outputTable, // TODO accept output writer as a parameter to the root Zarf command and pass it through here + // FIXME(mkcp): fully remove message in zarf critical path outputWriter: message.OutputWriter, } } diff --git a/src/internal/packager/helm/chart.go b/src/internal/packager/helm/chart.go index cc8a42b5dc..2a32402eb7 100644 --- a/src/internal/packager/helm/chart.go +++ b/src/internal/packager/helm/chart.go @@ -45,11 +45,6 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, if source == "" { source = "Zarf-generated" } - spinner := message.NewProgressSpinner("Processing helm chart %s:%s source: %s", - h.chart.Name, - h.chart.Version, - source) - defer spinner.Stop() l.Info("processing Helm chart", "name", h.chart.Name, "version", h.chart.Version, "source", source) // If no release name is specified, use the chart name. @@ -58,7 +53,7 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, } // Setup K8s connection. - err := h.createActionConfig(ctx, h.chart.Namespace, spinner) + err := h.createActionConfig(ctx, h.chart.Namespace) if err != nil { return nil, "", fmt.Errorf("unable to initialize the K8s client: %w", err) } @@ -79,18 +74,15 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, releases, histErr := histClient.Run(h.chart.ReleaseName) - spinner.Updatef("Checking for existing helm deployment") l.Debug("checking for existing helm deployment") if errors.Is(histErr, driver.ErrReleaseNotFound) { // No prior release, try to install it. - spinner.Updatef("Attempting chart installation") l.Info("performing Helm install", "chart", h.chart.Name) release, err = h.installChart(helmCtx, postRender) } else if histErr == nil && len(releases) > 0 { // Otherwise, there is a prior release so upgrade it. - spinner.Updatef("Attempting chart upgrade") l.Info("performing Helm upgrade", "chart", h.chart.Name) lastRelease := releases[len(releases)-1] @@ -104,7 +96,6 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, return err } - spinner.Success() return nil }, retry.Context(ctx), retry.Attempts(uint(h.retries)), retry.Delay(500*time.Millisecond)) if err != nil { @@ -127,7 +118,6 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, } // Attempt to rollback on a failed upgrade. - spinner.Updatef("Performing chart rollback") l.Info("performing Helm rollback", "chart", h.chart.Name) err = h.rollbackChart(h.chart.ReleaseName, previouslyDeployedVersion) if err != nil { @@ -147,13 +137,11 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, } if !h.chart.NoWait { // Ensure we don't go past the timeout by using a context initialized with the helm timeout - spinner.Updatef("Running health checks") l.Info("running health checks", "chart", h.chart.Name) if err := healthchecks.WaitForReadyRuntime(helmCtx, h.cluster.Watcher, runtimeObjs); err != nil { return nil, "", err } } - spinner.Success() l.Debug("done processing Helm chart", "name", h.chart.Name, "duration", time.Since(start)) // return any collected connect strings for zarf connect. @@ -163,11 +151,9 @@ func (h *Helm) InstallOrUpgradeChart(ctx context.Context) (types.ConnectStrings, // TemplateChart generates a helm template from a given chart. func (h *Helm) TemplateChart(ctx context.Context) (manifest string, chartValues chartutil.Values, err error) { l := logger.From(ctx) - spinner := message.NewProgressSpinner("Templating helm chart %s", h.chart.Name) - defer spinner.Stop() l.Debug("templating helm chart", "name", h.chart.Name) - err = h.createActionConfig(ctx, h.chart.Namespace, spinner) + err = h.createActionConfig(ctx, h.chart.Namespace) // Setup K8s connection. if err != nil { @@ -223,15 +209,13 @@ func (h *Helm) TemplateChart(ctx context.Context) (manifest string, chartValues manifest += fmt.Sprintf("\n---\n%s", hook.Manifest) } - spinner.Success() - return manifest, chartValues, nil } // RemoveChart removes a chart from the cluster. -func (h *Helm) RemoveChart(ctx context.Context, namespace string, name string, spinner *message.Spinner) error { +func (h *Helm) RemoveChart(ctx context.Context, namespace string, name string) error { // Establish a new actionConfig for the namespace. - _ = h.createActionConfig(ctx, namespace, spinner) + _ = h.createActionConfig(ctx, namespace) // Perform the uninstall. response, err := h.uninstallChart(name) message.Debug(response) @@ -243,11 +227,9 @@ func (h *Helm) RemoveChart(ctx context.Context, namespace string, name string, s // (note: this only works on single-deep charts, charts with dependencies (like loki-stack) will not work) func (h *Helm) UpdateReleaseValues(ctx context.Context, updatedValues map[string]interface{}) error { l := logger.From(ctx) - spinner := message.NewProgressSpinner("Updating values for helm release %s", h.chart.ReleaseName) - defer spinner.Stop() l.Debug("updating values for helm release", "name", h.chart.ReleaseName) - err := h.createActionConfig(ctx, h.chart.Namespace, spinner) + err := h.createActionConfig(ctx, h.chart.Namespace) if err != nil { return fmt.Errorf("unable to initialize the K8s client: %w", err) } @@ -289,8 +271,6 @@ func (h *Helm) UpdateReleaseValues(ctx context.Context, updatedValues map[string return err } - spinner.Success() - return nil } diff --git a/src/internal/packager/helm/destroy.go b/src/internal/packager/helm/destroy.go index 86e0b63ce6..7349668af8 100644 --- a/src/internal/packager/helm/destroy.go +++ b/src/internal/packager/helm/destroy.go @@ -11,7 +11,6 @@ import ( "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/action" ) @@ -19,17 +18,14 @@ import ( func Destroy(ctx context.Context, purgeAllZarfInstallations bool) { start := time.Now() l := logger.From(ctx) - spinner := message.NewProgressSpinner("Removing Zarf-installed charts") - defer spinner.Stop() l.Info("removing Zarf-installed charts") h := Helm{} // Initially load the actionConfig without a namespace - err := h.createActionConfig(ctx, "", spinner) + err := h.createActionConfig(ctx, "") if err != nil { // Don't fatal since this is a removal action - spinner.Errorf(err, "Unable to initialize the K8s client") l.Error("unable to initialize the K8s client", "error", err.Error()) return } @@ -48,7 +44,6 @@ func Destroy(ctx context.Context, purgeAllZarfInstallations bool) { releases, err := list.Run() if err != nil { // Don't fatal since this is a removal action - spinner.Errorf(err, "Unable to get the list of installed charts") l.Error("unable to get the list of installed charts", "error", err.Error()) } @@ -60,16 +55,12 @@ func Destroy(ctx context.Context, purgeAllZarfInstallations bool) { } // Filter on zarf releases if zarfPrefix.MatchString(release.Name) { - spinner.Updatef("Uninstalling helm chart %s/%s", release.Namespace, release.Name) l.Info("uninstalling helm chart", "namespace", release.Namespace, "name", release.Name) - if err = h.RemoveChart(ctx, release.Namespace, release.Name, spinner); err != nil { + if err = h.RemoveChart(ctx, release.Namespace, release.Name); err != nil { // Don't fatal since this is a removal action - spinner.Errorf(err, "Unable to uninstall the chart") l.Error("unable to uninstall the chart", "error", err.Error()) } } } - - spinner.Success() l.Debug("done uninstalling charts", "duration", time.Since(start)) } diff --git a/src/internal/packager/helm/utils.go b/src/internal/packager/helm/utils.go index 38b9e1f889..3ad1466d94 100644 --- a/src/internal/packager/helm/utils.go +++ b/src/internal/packager/helm/utils.go @@ -11,7 +11,6 @@ import ( "github.com/defenseunicorns/pkg/helpers/v2" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" @@ -63,7 +62,7 @@ func (h *Helm) parseChartValues() (chartutil.Values, error) { return helpers.MergeMapRecursive(chartValues, h.valuesOverrides), nil } -func (h *Helm) createActionConfig(ctx context.Context, namespace string, spinner *message.Spinner) error { +func (h *Helm) createActionConfig(ctx context.Context, namespace string) error { // Initialize helm SDK actionConfig := new(action.Configuration) // Set the settings for the helm SDK @@ -73,11 +72,8 @@ func (h *Helm) createActionConfig(ctx context.Context, namespace string, spinner h.settings.SetNamespace(namespace) // Setup K8s connection - helmLogger := spinner.Updatef - if logger.Enabled(ctx) { - l := logger.From(ctx) - helmLogger = slog.NewLogLogger(l.Handler(), slog.LevelDebug).Printf - } + l := logger.From(ctx) + helmLogger := slog.NewLogLogger(l.Handler(), slog.LevelDebug).Printf err := actionConfig.Init(h.settings.RESTClientGetter(), namespace, "", helmLogger) // Set the actionConfig is the received Helm pointer diff --git a/src/internal/packager/helm/zarf.go b/src/internal/packager/helm/zarf.go index 76ac55c90c..a42d6f03e6 100644 --- a/src/internal/packager/helm/zarf.go +++ b/src/internal/packager/helm/zarf.go @@ -20,7 +20,6 @@ import ( "github.com/zarf-dev/zarf/src/internal/packager/template" "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" ) @@ -71,8 +70,6 @@ func (h *Helm) UpdateZarfRegistryValues(ctx context.Context) error { // UpdateZarfAgentValues updates the Zarf agent deployment with the new state values func (h *Helm) UpdateZarfAgentValues(ctx context.Context) error { l := logger.From(ctx) - spinner := message.NewProgressSpinner("Gathering information to update Zarf Agent TLS") - defer spinner.Stop() deployment, err := h.cluster.Clientset.AppsV1().Deployments(cluster.ZarfNamespaceName).Get(ctx, "agent-hook", metav1.GetOptions{}) if err != nil { @@ -83,7 +80,7 @@ func (h *Helm) UpdateZarfAgentValues(ctx context.Context) error { return err } - err = h.createActionConfig(ctx, cluster.ZarfNamespaceName, spinner) + err = h.createActionConfig(ctx, cluster.ZarfNamespaceName) if err != nil { return err } @@ -94,7 +91,6 @@ func (h *Helm) UpdateZarfAgentValues(ctx context.Context) error { if err != nil { return fmt.Errorf("unable to list helm releases: %w", err) } - spinner.Success() for _, release := range releases { // Update the Zarf Agent release with the new values @@ -128,8 +124,6 @@ func (h *Helm) UpdateZarfAgentValues(ctx context.Context) error { // Trigger a rolling update for the TLS secret update to take effect. // https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment - spinner = message.NewProgressSpinner("Performing a rolling update for the Zarf Agent deployment") - defer spinner.Stop() l.Info("performing a rolling update for the Zarf Agent deployment") // Re-fetch the agent deployment before we update since the resourceVersion has changed after updating the Helm release values. @@ -164,6 +158,5 @@ func (h *Helm) UpdateZarfAgentValues(ctx context.Context) error { return err } - spinner.Success() return nil } diff --git a/src/internal/packager/template/template.go b/src/internal/packager/template/template.go index 37de2bc444..12f1eedd34 100644 --- a/src/internal/packager/template/template.go +++ b/src/internal/packager/template/template.go @@ -9,7 +9,6 @@ import ( "encoding/base64" "encoding/json" "fmt" - "log/slog" "strings" "github.com/zarf-dev/zarf/src/api/v1alpha1" @@ -37,10 +36,7 @@ func GetZarfVariableConfig(ctx context.Context) *variables.VariableConfig { return interactive.PromptVariable(ctx, variable) } - if logger.Enabled(ctx) { - return variables.New("zarf", prompt, logger.From(ctx)) - } - return variables.New("zarf", prompt, slog.New(message.ZarfHandler{})) + return variables.New("zarf", prompt, logger.From(ctx)) } // GetZarfTemplates returns the template keys and values to be used for templating. diff --git a/src/internal/packager2/layout/oci.go b/src/internal/packager2/layout/oci.go index ec4f43042b..d36b6c178c 100644 --- a/src/internal/packager2/layout/oci.go +++ b/src/internal/packager2/layout/oci.go @@ -7,7 +7,6 @@ import ( "context" "errors" "fmt" - "log/slog" "maps" "strings" @@ -21,7 +20,6 @@ import ( "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" ) const ( @@ -38,10 +36,7 @@ type Remote struct { // NewRemote returns an oras remote repository client and context for the given url with zarf opination embedded. func NewRemote(ctx context.Context, url string, platform ocispec.Platform, mods ...oci.Modifier) (*Remote, error) { - l := slog.New(message.ZarfHandler{}) - if logger.Enabled(ctx) { - l = logger.From(ctx) - } + l := logger.From(ctx) modifiers := append([]oci.Modifier{ oci.WithPlainHTTP(config.CommonOptions.PlainHTTP), oci.WithInsecureSkipVerify(config.CommonOptions.InsecureSkipTLSVerify), diff --git a/src/pkg/layout/component.go b/src/pkg/layout/component.go index 3e524852fe..4d55629030 100644 --- a/src/pkg/layout/component.go +++ b/src/pkg/layout/component.go @@ -64,8 +64,6 @@ func (c *Components) Archive(ctx context.Context, component v1alpha1.ZarfCompone } if size > 0 { tb := fmt.Sprintf("%s.tar", base) - // TODO(mkcp): Remove message on logger release - message.Debugf("Archiving %q", name) l.Debug("archiving component", "name", name) if err := helpers.CreateReproducibleTarballFromDir(base, name, tb); err != nil { return err @@ -75,8 +73,6 @@ func (c *Components) Archive(ctx context.Context, component v1alpha1.ZarfCompone } c.Tarballs[name] = tb } else { - // TODO(mkcp): Remove message on logger release - message.Debugf("Component %q is empty, skipping archiving", name) l.Debug("component is empty, skipping archiving", "name", name) } @@ -85,7 +81,8 @@ func (c *Components) Archive(ctx context.Context, component v1alpha1.ZarfCompone } // Unarchive unarchives a component. -func (c *Components) Unarchive(component v1alpha1.ZarfComponent) error { +func (c *Components) Unarchive(ctx context.Context, component v1alpha1.ZarfComponent) error { + l := logger.From(ctx) name := component.Name tb, ok := c.Tarballs[name] if !ok { @@ -136,10 +133,14 @@ func (c *Components) Unarchive(component v1alpha1.ZarfComponent) error { // if the component is already unarchived, skip if !helpers.InvalidPath(cs.Base) { + // TODO(mkcp): Bring in context and port to logger + l.Debug("component already unarchived", "component", name) message.Debugf("Component %q already unarchived", name) return nil } + // TODO(mkcp): Bring in context and port to logger + l.Debug("unarchiving %q", filepath.Base(tb)) message.Debugf("Unarchiving %q", filepath.Base(tb)) if err := archiver.Unarchive(tb, c.Base); err != nil { return err diff --git a/src/pkg/logger/logger.go b/src/pkg/logger/logger.go index ae5d020b59..9bf325a534 100644 --- a/src/pkg/logger/logger.go +++ b/src/pkg/logger/logger.go @@ -99,9 +99,6 @@ var ( FormatConsole Format = "console" // FormatDev uses a verbose and pretty printing devslog handler FormatDev Format = "dev" - // FormatLegacy indicates that the user is continuing to use the legacy logger. The same as FormatNone. - // This option will be removed in a coming release - FormatLegacy Format = "legacy" // FormatNone sends log writes to DestinationNone / io.Discard FormatNone Format = "none" ) @@ -185,10 +182,6 @@ func New(cfg Config) (*slog.Logger, error) { }) case FormatJSON: handler = slog.NewJSONHandler(cfg.Destination, &opts) - case FormatConsole: - handler = console.NewHandler(cfg.Destination, &console.HandlerOptions{ - Level: slog.Level(cfg.Level), - }) case FormatDev: opts.AddSource = true handler = devslog.NewHandler(cfg.Destination, &devslog.Options{ @@ -197,7 +190,7 @@ func New(cfg Config) (*slog.Logger, error) { NoColor: !bool(cfg.Color), }) // Use discard handler if no format provided - case "", FormatNone, FormatLegacy: + case "", FormatNone: handler = slog.NewTextHandler(DestinationNone, &slog.HandlerOptions{}) // Format not found, let's error out default: @@ -218,30 +211,6 @@ func WithContext(ctx context.Context, logger *slog.Logger) context.Context { return context.WithValue(ctx, defaultCtxKey, logger) } -// TODO (@austinabro321) once we switch over to the new logger completely the enabled key & logic should be deleted -type ctxKeyEnabled struct{} - -var defaultCtxKeyEnabled = ctxKeyEnabled{} - -// WithLoggingEnabled allows stores a value to determine whether or not slog logging is enabled -func WithLoggingEnabled(ctx context.Context, enabled bool) context.Context { - return context.WithValue(ctx, defaultCtxKeyEnabled, enabled) -} - -// Enabled returns true if slog logging is enabled -func Enabled(ctx context.Context) bool { - if ctx == nil { - return false - } - enabled := ctx.Value(defaultCtxKeyEnabled) - switch v := enabled.(type) { - case bool: - return v - default: - return false - } -} - // From takes a context and reads out a *slog.Logger. If From does not find a value it will return a discarding logger // similar to log-format "none". func From(ctx context.Context) *slog.Logger { diff --git a/src/pkg/packager/remove.go b/src/pkg/packager/remove.go index 68e72df76d..c6bfd4ce49 100644 --- a/src/pkg/packager/remove.go +++ b/src/pkg/packager/remove.go @@ -158,7 +158,7 @@ func (p *Packager) removeComponent(ctx context.Context, deployedPackage *types.D spinner.Updatef("Uninstalling chart '%s' from the '%s' component", chart.ChartName, deployedComponent.Name) helmCfg := helm.NewClusterOnly(p.cfg, p.variableConfig, p.state, p.cluster) - if err := helmCfg.RemoveChart(ctx, chart.Namespace, chart.ChartName, spinner); err != nil { + if err := helmCfg.RemoveChart(ctx, chart.Namespace, chart.ChartName); err != nil { if !errors.Is(err, driver.ErrReleaseNotFound) { onFailure() return deployedPackage, fmt.Errorf("unable to uninstall the helm chart %s in the namespace %s: %w", diff --git a/src/pkg/packager/sources/oci.go b/src/pkg/packager/sources/oci.go index 6d8b809f74..a4947830b6 100644 --- a/src/pkg/packager/sources/oci.go +++ b/src/pkg/packager/sources/oci.go @@ -89,7 +89,7 @@ func (s *OCISource) LoadPackage(ctx context.Context, dst *layout.PackagePaths, f if unarchiveAll { for _, component := range pkg.Components { - if err := dst.Components.Unarchive(component); err != nil { + if err := dst.Components.Unarchive(ctx, component); err != nil { if errors.Is(err, layout.ErrNotLoaded) { _, err := dst.Components.Create(component) if err != nil { diff --git a/src/pkg/packager/sources/tarball.go b/src/pkg/packager/sources/tarball.go index 73ef522c82..839a979755 100644 --- a/src/pkg/packager/sources/tarball.go +++ b/src/pkg/packager/sources/tarball.go @@ -38,8 +38,6 @@ type TarballSource struct { // LoadPackage loads a package from a tarball. func (s *TarballSource) LoadPackage(ctx context.Context, dst *layout.PackagePaths, filter filters.ComponentFilterStrategy, unarchiveAll bool) (pkg v1alpha1.ZarfPackage, warnings []string, err error) { l := logger.From(ctx) - spinner := message.NewProgressSpinner("Loading package from %q", s.PackageSource) - defer spinner.Stop() start := time.Now() l.Info("loading package", "source", s.PackageSource) @@ -123,7 +121,7 @@ func (s *TarballSource) LoadPackage(ctx context.Context, dst *layout.PackagePath if unarchiveAll { for _, component := range pkg.Components { - if err := dst.Components.Unarchive(component); err != nil { + if err := dst.Components.Unarchive(ctx, component); err != nil { if errors.Is(err, layout.ErrNotLoaded) { _, err := dst.Components.Create(component) if err != nil { @@ -142,7 +140,6 @@ func (s *TarballSource) LoadPackage(ctx context.Context, dst *layout.PackagePath } } - spinner.Success() l.Debug("done loading package", "source", s.PackageSource, "duration", time.Since(start)) return pkg, warnings, nil diff --git a/src/pkg/zoci/common.go b/src/pkg/zoci/common.go index ab8f92f3bf..e3d01a181d 100644 --- a/src/pkg/zoci/common.go +++ b/src/pkg/zoci/common.go @@ -6,13 +6,10 @@ package zoci import ( "context" - "log/slog" - "github.com/defenseunicorns/pkg/oci" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" ) const ( @@ -32,10 +29,7 @@ type Remote struct { // NewRemote returns an oras remote repository client and context for the given url // with zarf opination embedded func NewRemote(ctx context.Context, url string, platform ocispec.Platform, mods ...oci.Modifier) (*Remote, error) { - l := slog.New(message.ZarfHandler{}) - if logger.Enabled(ctx) { - l = logger.From(ctx) - } + l := logger.From(ctx) modifiers := append([]oci.Modifier{ oci.WithPlainHTTP(config.CommonOptions.PlainHTTP), oci.WithInsecureSkipVerify(config.CommonOptions.InsecureSkipTLSVerify), From ed4621a50ae05c508a2740e2ca8f239f0a656a5d Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Wed, 26 Feb 2025 12:41:51 -0800 Subject: [PATCH 2/4] get project compiling, fix linting. chase down some message logging Signed-off-by: Kit Patella --- src/cmd/connect.go | 6 -- src/cmd/package.go | 3 +- src/cmd/root.go | 108 +--------------------------------- src/cmd/viper.go | 7 +-- src/pkg/layout/component.go | 6 +- src/pkg/logger/logger_test.go | 4 -- src/pkg/zoci/common.go | 1 + 7 files changed, 6 insertions(+), 129 deletions(-) diff --git a/src/cmd/connect.go b/src/cmd/connect.go index 83ed0584dc..f1f7b38718 100644 --- a/src/cmd/connect.go +++ b/src/cmd/connect.go @@ -54,9 +54,6 @@ func (o *connectOptions) run(cmd *cobra.Command, args []string) error { target = args[0] } - spinner := message.NewProgressSpinner(lang.CmdConnectPreparingTunnel, target) - defer spinner.Stop() - c, err := cluster.NewCluster() if err != nil { return err @@ -84,20 +81,17 @@ func (o *connectOptions) run(cmd *cobra.Command, args []string) error { defer tunnel.Close() if o.open { - spinner.Updatef(lang.CmdConnectEstablishedWeb, tunnel.FullURL()) l.Info("Tunnel established, opening your default web browser (ctrl-c to end)", "url", tunnel.FullURL()) if err := exec.LaunchURL(tunnel.FullURL()); err != nil { return err } } else { - spinner.Updatef(lang.CmdConnectEstablishedCLI, tunnel.FullURL()) l.Info("Tunnel established, waiting for user to interrupt (ctrl-c to end)", "url", tunnel.FullURL()) } // Wait for the interrupt signal or an error. select { case <-ctx.Done(): - spinner.Successf(lang.CmdConnectTunnelClosed, tunnel.FullURL()) return nil case err = <-tunnel.ErrChan(): return fmt.Errorf("lost connection to the service: %w", err) diff --git a/src/cmd/package.go b/src/cmd/package.go index 4d4c9d0b27..852623842a 100644 --- a/src/cmd/package.go +++ b/src/cmd/package.go @@ -9,6 +9,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/zarf-dev/zarf/src/pkg/message" "io" "os" "path/filepath" @@ -30,7 +31,6 @@ import ( "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/lint" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager" "github.com/zarf-dev/zarf/src/pkg/packager/filters" "github.com/zarf-dev/zarf/src/pkg/utils" @@ -860,7 +860,6 @@ func getPackageCompletionArgs(cmd *cobra.Command, _ []string, _ string) ([]strin deployedZarfPackages, err := c.GetDeployedZarfPackages(ctx) if err != nil { - message.Debug("Unable to get deployed zarf packages for package completion args", "error", err) logger.From(cmd.Context()).Debug("unable to get deployed zarf packages for package completion args", "error", err) } // Populate list of package names diff --git a/src/cmd/root.go b/src/cmd/root.go index 29eab1e48b..71b4d306c3 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -6,14 +6,11 @@ package cmd import ( "context" - "errors" "fmt" - "io" "log/slog" "os" "slices" "strings" - "time" "github.com/zarf-dev/zarf/src/pkg/logger" @@ -85,23 +82,6 @@ func preRun(cmd *cobra.Command, _ []string) error { return nil } - // Setup message - skipLogFile := SkipLogFile - - // Don't write tool commands to file. - comps := strings.Split(cmd.CommandPath(), " ") - if len(comps) > 1 && comps[1] == "tools" { - skipLogFile = true - } - if len(comps) > 1 && comps[1] == "version" { - skipLogFile = true - } - - // Dont write help command to file. - if cmd.Parent() == nil { - skipLogFile = true - } - // Configure logger and add it to cmd context. l, err := setupLogger(LogLevelCLI, LogFormat, !NoColor) if err != nil { @@ -110,24 +90,6 @@ func preRun(cmd *cobra.Command, _ []string) error { ctx := logger.WithContext(cmd.Context(), l) cmd.SetContext(ctx) - // Configure the global message instance. - var disableMessage bool - if LogFormat != string(logger.FormatLegacy) { - disableMessage = true - skipLogFile = true - ctx := logger.WithLoggingEnabled(ctx, true) - cmd.SetContext(ctx) - } - err = SetupMessage(MessageCfg{ - Level: LogLevelCLI, - SkipLogFile: skipLogFile, - NoColor: NoColor, - FeatureDisabled: disableMessage, - }) - if err != nil { - return err - } - // Print out config location err = PrintViperConfigUsed(cmd.Context()) if err != nil { @@ -213,10 +175,7 @@ func init() { // Logs rootCmd.PersistentFlags().StringVarP(&LogLevelCLI, "log-level", "l", v.GetString(VLogLevel), lang.RootCmdFlagLogLevel) - rootCmd.PersistentFlags().StringVar(&LogFormat, "log-format", v.GetString(VLogFormat), "[beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release") - rootCmd.PersistentFlags().BoolVar(&SkipLogFile, "no-log-file", v.GetBool(VNoLogFile), lang.RootCmdFlagSkipLogFile) - rootCmd.PersistentFlags().BoolVar(&message.NoProgress, "no-progress", v.GetBool(VNoProgress), lang.RootCmdFlagNoProgress) - rootCmd.PersistentFlags().BoolVar(&NoColor, "no-color", v.GetBool(VNoColor), lang.RootCmdFlagNoColor) + rootCmd.PersistentFlags().StringVar(&LogFormat, "log-format", v.GetString(VLogFormat), "Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'.") rootCmd.PersistentFlags().StringVarP(&config.CLIArch, "architecture", "a", v.GetString(VArchitecture), lang.RootCmdFlagArch) rootCmd.PersistentFlags().StringVar(&config.CommonOptions.CachePath, "zarf-cache", v.GetString(VZarfCache), lang.RootCmdFlagCachePath) @@ -256,68 +215,3 @@ func setupLogger(level, format string, color bool) (*slog.Logger, error) { l.Debug("logger successfully initialized", "cfg", cfg) return l, nil } - -// MessageCfg is used to configure the Message package output options. -type MessageCfg struct { - Level string - SkipLogFile bool - NoColor bool - // FeatureDisabled is a feature flag that disables it - FeatureDisabled bool -} - -// SetupMessage configures message while we migrate over to logger. -func SetupMessage(cfg MessageCfg) error { - // HACK(mkcp): Discard message logs if feature is disabled. message calls InitializePTerm once in its init() fn so - // this ends up being a messy solution. - if cfg.FeatureDisabled { - // Discard all* PTerm messages. *see below - message.InitializePTerm(io.Discard) - // Disable all progress bars and spinners - message.NoProgress = true - return nil - } - - if cfg.NoColor { - message.DisableColor() - } - - level := cfg.Level - if cfg.Level != "" { - match := map[string]message.LogLevel{ - // NOTE(mkcp): Add error for forwards compatibility with logger - "error": message.WarnLevel, - "warn": message.WarnLevel, - "info": message.InfoLevel, - "debug": message.DebugLevel, - "trace": message.TraceLevel, - } - lvl, ok := match[level] - if !ok { - return errors.New("invalid log level, valid options are warn, info, debug, error, and trace") - } - message.SetLogLevel(lvl) - message.Debug("Log level set to " + level) - } - - // Disable progress bars for CI envs - if os.Getenv("CI") == "true" { - message.Debug("CI environment detected, disabling progress bars") - message.NoProgress = true - } - - if !cfg.SkipLogFile { - ts := time.Now().Format("2006-01-02-15-04-05") - f, err := os.CreateTemp("", fmt.Sprintf("zarf-%s-*.log", ts)) - if err != nil { - return fmt.Errorf("could not create a log file in a the temporary directory: %w", err) - } - logFile, err := message.UseLogFile(f) - if err != nil { - return fmt.Errorf("could not save a log file to the temporary directory: %w", err) - } - pterm.SetDefaultOutput(io.MultiWriter(os.Stderr, logFile)) - message.Notef("Saving log file to %s", f.Name()) - } - return nil -} diff --git a/src/cmd/viper.go b/src/cmd/viper.go index 85e1afe6a3..50fea5d57c 100644 --- a/src/cmd/viper.go +++ b/src/cmd/viper.go @@ -32,11 +32,8 @@ const ( // Root config, Logging - VLogLevel = "log_level" - VLogFormat = "log_format" - VNoLogFile = "no_log_file" - VNoProgress = "no_progress" - VNoColor = "no_color" + VLogLevel = "log_level" + VLogFormat = "log_format" // Init config keys diff --git a/src/pkg/layout/component.go b/src/pkg/layout/component.go index 4d55629030..b2faca1e91 100644 --- a/src/pkg/layout/component.go +++ b/src/pkg/layout/component.go @@ -15,7 +15,6 @@ import ( "github.com/mholt/archiver/v3" "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" ) // ComponentPaths contains paths for a component. @@ -133,15 +132,12 @@ func (c *Components) Unarchive(ctx context.Context, component v1alpha1.ZarfCompo // if the component is already unarchived, skip if !helpers.InvalidPath(cs.Base) { - // TODO(mkcp): Bring in context and port to logger l.Debug("component already unarchived", "component", name) - message.Debugf("Component %q already unarchived", name) return nil } // TODO(mkcp): Bring in context and port to logger - l.Debug("unarchiving %q", filepath.Base(tb)) - message.Debugf("Unarchiving %q", filepath.Base(tb)) + l.Debug("unarchiving", "component", filepath.Base(tb)) if err := archiver.Unarchive(tb, c.Base); err != nil { return err } diff --git a/src/pkg/logger/logger_test.go b/src/pkg/logger/logger_test.go index 4aab4d73db..ad4615ac2e 100644 --- a/src/pkg/logger/logger_test.go +++ b/src/pkg/logger/logger_test.go @@ -224,8 +224,4 @@ func TestContext(t *testing.T) { res := From(ctx) require.NotNil(t, res) }) - t.Run("can add a flag to the context to determine if enabled", func(t *testing.T) { - ctx := WithLoggingEnabled(context.Background(), true) - require.True(t, Enabled(ctx)) - }) } diff --git a/src/pkg/zoci/common.go b/src/pkg/zoci/common.go index e3d01a181d..4abccd96df 100644 --- a/src/pkg/zoci/common.go +++ b/src/pkg/zoci/common.go @@ -6,6 +6,7 @@ package zoci import ( "context" + "github.com/defenseunicorns/pkg/oci" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/zarf-dev/zarf/src/config" From f18a2a8021a3265a515368170a3c3e2572da05b2 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Wed, 26 Feb 2025 12:42:36 -0800 Subject: [PATCH 3/4] make docs-and-schema Signed-off-by: Kit Patella --- site/src/content/docs/commands/zarf.md | 5 +---- site/src/content/docs/commands/zarf_completion.md | 5 +---- site/src/content/docs/commands/zarf_completion_bash.md | 5 +---- site/src/content/docs/commands/zarf_completion_fish.md | 5 +---- site/src/content/docs/commands/zarf_completion_powershell.md | 5 +---- site/src/content/docs/commands/zarf_completion_zsh.md | 5 +---- site/src/content/docs/commands/zarf_connect.md | 5 +---- site/src/content/docs/commands/zarf_connect_list.md | 5 +---- site/src/content/docs/commands/zarf_destroy.md | 5 +---- site/src/content/docs/commands/zarf_dev.md | 5 +---- site/src/content/docs/commands/zarf_dev_deploy.md | 5 +---- site/src/content/docs/commands/zarf_dev_find-images.md | 5 +---- site/src/content/docs/commands/zarf_dev_generate-config.md | 5 +---- site/src/content/docs/commands/zarf_dev_generate.md | 5 +---- site/src/content/docs/commands/zarf_dev_inspect.md | 5 +---- .../src/content/docs/commands/zarf_dev_inspect_definition.md | 5 +---- site/src/content/docs/commands/zarf_dev_lint.md | 5 +---- site/src/content/docs/commands/zarf_dev_patch-git.md | 5 +---- site/src/content/docs/commands/zarf_dev_sha256sum.md | 5 +---- site/src/content/docs/commands/zarf_init.md | 5 +---- site/src/content/docs/commands/zarf_package.md | 5 +---- site/src/content/docs/commands/zarf_package_create.md | 5 +---- site/src/content/docs/commands/zarf_package_deploy.md | 5 +---- site/src/content/docs/commands/zarf_package_inspect.md | 5 +---- .../content/docs/commands/zarf_package_inspect_definition.md | 5 +---- .../src/content/docs/commands/zarf_package_inspect_images.md | 5 +---- site/src/content/docs/commands/zarf_package_inspect_sbom.md | 5 +---- site/src/content/docs/commands/zarf_package_list.md | 5 +---- .../content/docs/commands/zarf_package_mirror-resources.md | 5 +---- site/src/content/docs/commands/zarf_package_publish.md | 5 +---- site/src/content/docs/commands/zarf_package_pull.md | 5 +---- site/src/content/docs/commands/zarf_package_remove.md | 5 +---- site/src/content/docs/commands/zarf_say.md | 5 +---- site/src/content/docs/commands/zarf_tools.md | 5 +---- site/src/content/docs/commands/zarf_tools_archiver.md | 5 +---- .../content/docs/commands/zarf_tools_archiver_compress.md | 5 +---- .../content/docs/commands/zarf_tools_archiver_decompress.md | 5 +---- .../src/content/docs/commands/zarf_tools_archiver_version.md | 5 +---- site/src/content/docs/commands/zarf_tools_clear-cache.md | 5 +---- site/src/content/docs/commands/zarf_tools_download-init.md | 5 +---- site/src/content/docs/commands/zarf_tools_gen-key.md | 5 +---- site/src/content/docs/commands/zarf_tools_gen-pki.md | 5 +---- site/src/content/docs/commands/zarf_tools_get-creds.md | 5 +---- site/src/content/docs/commands/zarf_tools_update-creds.md | 5 +---- site/src/content/docs/commands/zarf_version.md | 5 +---- 45 files changed, 45 insertions(+), 180 deletions(-) diff --git a/site/src/content/docs/commands/zarf.md b/site/src/content/docs/commands/zarf.md index efb8a53d41..4ea8236230 100644 --- a/site/src/content/docs/commands/zarf.md +++ b/site/src/content/docs/commands/zarf.md @@ -25,11 +25,8 @@ zarf COMMAND [flags] -a, --architecture string Architecture for OCI images and Zarf packages -h, --help help for zarf --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_completion.md b/site/src/content/docs/commands/zarf_completion.md index 626f62feff..16f4b09df6 100644 --- a/site/src/content/docs/commands/zarf_completion.md +++ b/site/src/content/docs/commands/zarf_completion.md @@ -27,11 +27,8 @@ See each sub-command's help for details on how to use the generated script. ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_completion_bash.md b/site/src/content/docs/commands/zarf_completion_bash.md index 8d54e5f193..681c996866 100644 --- a/site/src/content/docs/commands/zarf_completion_bash.md +++ b/site/src/content/docs/commands/zarf_completion_bash.md @@ -50,11 +50,8 @@ zarf completion bash ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_completion_fish.md b/site/src/content/docs/commands/zarf_completion_fish.md index 4733ee33ac..b5c6d62df0 100644 --- a/site/src/content/docs/commands/zarf_completion_fish.md +++ b/site/src/content/docs/commands/zarf_completion_fish.md @@ -41,11 +41,8 @@ zarf completion fish [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_completion_powershell.md b/site/src/content/docs/commands/zarf_completion_powershell.md index 6d57ecd89a..e0e447b781 100644 --- a/site/src/content/docs/commands/zarf_completion_powershell.md +++ b/site/src/content/docs/commands/zarf_completion_powershell.md @@ -38,11 +38,8 @@ zarf completion powershell [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_completion_zsh.md b/site/src/content/docs/commands/zarf_completion_zsh.md index e8e18eeca0..88e685b7e8 100644 --- a/site/src/content/docs/commands/zarf_completion_zsh.md +++ b/site/src/content/docs/commands/zarf_completion_zsh.md @@ -52,11 +52,8 @@ zarf completion zsh [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_connect.md b/site/src/content/docs/commands/zarf_connect.md index 49b8eff6ee..2379487a86 100644 --- a/site/src/content/docs/commands/zarf_connect.md +++ b/site/src/content/docs/commands/zarf_connect.md @@ -41,11 +41,8 @@ zarf connect { REGISTRY | GIT | connect-name } [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_connect_list.md b/site/src/content/docs/commands/zarf_connect_list.md index a1253033ff..d9466b7032 100644 --- a/site/src/content/docs/commands/zarf_connect_list.md +++ b/site/src/content/docs/commands/zarf_connect_list.md @@ -25,11 +25,8 @@ zarf connect list [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_destroy.md b/site/src/content/docs/commands/zarf_destroy.md index 016f36d983..842caf01f6 100644 --- a/site/src/content/docs/commands/zarf_destroy.md +++ b/site/src/content/docs/commands/zarf_destroy.md @@ -37,11 +37,8 @@ zarf destroy --confirm [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev.md b/site/src/content/docs/commands/zarf_dev.md index 0f4c964c6b..5c93e1d1e2 100644 --- a/site/src/content/docs/commands/zarf_dev.md +++ b/site/src/content/docs/commands/zarf_dev.md @@ -21,11 +21,8 @@ Commands useful for developing packages ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_deploy.md b/site/src/content/docs/commands/zarf_dev_deploy.md index a2762b865d..a51abf0cb6 100644 --- a/site/src/content/docs/commands/zarf_dev_deploy.md +++ b/site/src/content/docs/commands/zarf_dev_deploy.md @@ -38,11 +38,8 @@ zarf dev deploy [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_find-images.md b/site/src/content/docs/commands/zarf_dev_find-images.md index 9b8b591d34..09daad78f1 100644 --- a/site/src/content/docs/commands/zarf_dev_find-images.md +++ b/site/src/content/docs/commands/zarf_dev_find-images.md @@ -39,11 +39,8 @@ zarf dev find-images [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_generate-config.md b/site/src/content/docs/commands/zarf_dev_generate-config.md index 5861715a17..e4988d156e 100644 --- a/site/src/content/docs/commands/zarf_dev_generate-config.md +++ b/site/src/content/docs/commands/zarf_dev_generate-config.md @@ -34,11 +34,8 @@ zarf dev generate-config [ FILENAME ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_generate.md b/site/src/content/docs/commands/zarf_dev_generate.md index 90c64bd0e8..814e8c0b96 100644 --- a/site/src/content/docs/commands/zarf_dev_generate.md +++ b/site/src/content/docs/commands/zarf_dev_generate.md @@ -36,11 +36,8 @@ zarf dev generate podinfo --url https://github.com/stefanprodan/podinfo.git --ve ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_inspect.md b/site/src/content/docs/commands/zarf_dev_inspect.md index 5d18e568f2..05613d2cd6 100644 --- a/site/src/content/docs/commands/zarf_dev_inspect.md +++ b/site/src/content/docs/commands/zarf_dev_inspect.md @@ -21,11 +21,8 @@ Commands to get information about a Zarf package using a `zarf.yaml` ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_inspect_definition.md b/site/src/content/docs/commands/zarf_dev_inspect_definition.md index 10535e3b1e..03234b652b 100644 --- a/site/src/content/docs/commands/zarf_dev_inspect_definition.md +++ b/site/src/content/docs/commands/zarf_dev_inspect_definition.md @@ -31,11 +31,8 @@ zarf dev inspect definition [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_lint.md b/site/src/content/docs/commands/zarf_dev_lint.md index 4acc227f3d..51390c4fc1 100644 --- a/site/src/content/docs/commands/zarf_dev_lint.md +++ b/site/src/content/docs/commands/zarf_dev_lint.md @@ -31,11 +31,8 @@ zarf dev lint [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_patch-git.md b/site/src/content/docs/commands/zarf_dev_patch-git.md index ed4101b931..d70a282213 100644 --- a/site/src/content/docs/commands/zarf_dev_patch-git.md +++ b/site/src/content/docs/commands/zarf_dev_patch-git.md @@ -27,11 +27,8 @@ zarf dev patch-git HOST FILE [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_dev_sha256sum.md b/site/src/content/docs/commands/zarf_dev_sha256sum.md index 11be45ce7b..e97e800b1f 100644 --- a/site/src/content/docs/commands/zarf_dev_sha256sum.md +++ b/site/src/content/docs/commands/zarf_dev_sha256sum.md @@ -26,11 +26,8 @@ zarf dev sha256sum { FILE | URL } [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_init.md b/site/src/content/docs/commands/zarf_init.md index c92a95602b..ef863fb2f2 100644 --- a/site/src/content/docs/commands/zarf_init.md +++ b/site/src/content/docs/commands/zarf_init.md @@ -86,11 +86,8 @@ $ zarf init --artifact-push-password={PASSWORD} --artifact-push-username={USERNA ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_package.md b/site/src/content/docs/commands/zarf_package.md index d5d925a14d..79ee378914 100644 --- a/site/src/content/docs/commands/zarf_package.md +++ b/site/src/content/docs/commands/zarf_package.md @@ -23,11 +23,8 @@ Zarf package commands for creating, deploying, and inspecting packages ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_package_create.md b/site/src/content/docs/commands/zarf_package_create.md index 3a9b424d36..288bd09dbf 100644 --- a/site/src/content/docs/commands/zarf_package_create.md +++ b/site/src/content/docs/commands/zarf_package_create.md @@ -44,11 +44,8 @@ zarf package create [ DIRECTORY ] [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_deploy.md b/site/src/content/docs/commands/zarf_package_deploy.md index 214e3e0102..064ee76f79 100644 --- a/site/src/content/docs/commands/zarf_package_deploy.md +++ b/site/src/content/docs/commands/zarf_package_deploy.md @@ -39,11 +39,8 @@ zarf package deploy [ PACKAGE_SOURCE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_inspect.md b/site/src/content/docs/commands/zarf_package_inspect.md index 158ab0882d..b66e6d2652 100644 --- a/site/src/content/docs/commands/zarf_package_inspect.md +++ b/site/src/content/docs/commands/zarf_package_inspect.md @@ -33,11 +33,8 @@ zarf package inspect [ PACKAGE_SOURCE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_inspect_definition.md b/site/src/content/docs/commands/zarf_package_inspect_definition.md index 140f1a0cc8..d4b8fd50c7 100644 --- a/site/src/content/docs/commands/zarf_package_inspect_definition.md +++ b/site/src/content/docs/commands/zarf_package_inspect_definition.md @@ -27,11 +27,8 @@ zarf package inspect definition [ PACKAGE_SOURCE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_inspect_images.md b/site/src/content/docs/commands/zarf_package_inspect_images.md index d79b7527fd..b4f0a12e76 100644 --- a/site/src/content/docs/commands/zarf_package_inspect_images.md +++ b/site/src/content/docs/commands/zarf_package_inspect_images.md @@ -27,11 +27,8 @@ zarf package inspect images [ PACKAGE_SOURCE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_inspect_sbom.md b/site/src/content/docs/commands/zarf_package_inspect_sbom.md index b2a0b5c1e2..f7a9bc42de 100644 --- a/site/src/content/docs/commands/zarf_package_inspect_sbom.md +++ b/site/src/content/docs/commands/zarf_package_inspect_sbom.md @@ -28,11 +28,8 @@ zarf package inspect sbom [ PACKAGE ] [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_list.md b/site/src/content/docs/commands/zarf_package_list.md index 61bdbb744d..61ade8bd68 100644 --- a/site/src/content/docs/commands/zarf_package_list.md +++ b/site/src/content/docs/commands/zarf_package_list.md @@ -27,11 +27,8 @@ zarf package list [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_mirror-resources.md b/site/src/content/docs/commands/zarf_package_mirror-resources.md index df1267d0a2..ef8a6152ce 100644 --- a/site/src/content/docs/commands/zarf_package_mirror-resources.md +++ b/site/src/content/docs/commands/zarf_package_mirror-resources.md @@ -67,11 +67,8 @@ $ zarf package mirror-resources \ -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_publish.md b/site/src/content/docs/commands/zarf_package_publish.md index 099d252b38..14a414c19e 100644 --- a/site/src/content/docs/commands/zarf_package_publish.md +++ b/site/src/content/docs/commands/zarf_package_publish.md @@ -42,11 +42,8 @@ $ zarf package publish ./path/to/dir oci://my-registry.com/my-namespace -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_pull.md b/site/src/content/docs/commands/zarf_package_pull.md index ea748fa8e3..f4ad1f7f27 100644 --- a/site/src/content/docs/commands/zarf_package_pull.md +++ b/site/src/content/docs/commands/zarf_package_pull.md @@ -43,11 +43,8 @@ $ zarf package pull oci://ghcr.io/defenseunicorns/packages/dos-games:1.0.0 -a sk -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_package_remove.md b/site/src/content/docs/commands/zarf_package_remove.md index 6b32a1025a..93ddd60be3 100644 --- a/site/src/content/docs/commands/zarf_package_remove.md +++ b/site/src/content/docs/commands/zarf_package_remove.md @@ -33,11 +33,8 @@ zarf package remove { PACKAGE_SOURCE | PACKAGE_NAME } --confirm [flags] -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. -k, --key string Path to public key file for validating signed packages - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --oci-concurrency int Number of concurrent layer operations to perform when interacting with a remote package. (default 3) --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files diff --git a/site/src/content/docs/commands/zarf_say.md b/site/src/content/docs/commands/zarf_say.md index 7dc9719d4f..945633ad3e 100644 --- a/site/src/content/docs/commands/zarf_say.md +++ b/site/src/content/docs/commands/zarf_say.md @@ -29,11 +29,8 @@ zarf say [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools.md b/site/src/content/docs/commands/zarf_tools.md index b72b58c938..33da40d653 100644 --- a/site/src/content/docs/commands/zarf_tools.md +++ b/site/src/content/docs/commands/zarf_tools.md @@ -21,11 +21,8 @@ Collection of additional tools to make airgap easier ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_archiver.md b/site/src/content/docs/commands/zarf_tools_archiver.md index d7a0c0bda9..d929290b12 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver.md +++ b/site/src/content/docs/commands/zarf_tools_archiver.md @@ -21,11 +21,8 @@ Compresses/Decompresses generic archives, including Zarf packages ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_archiver_compress.md b/site/src/content/docs/commands/zarf_tools_archiver_compress.md index df290c0b0c..46a4e6c696 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver_compress.md +++ b/site/src/content/docs/commands/zarf_tools_archiver_compress.md @@ -25,11 +25,8 @@ zarf tools archiver compress SOURCES ARCHIVE [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_archiver_decompress.md b/site/src/content/docs/commands/zarf_tools_archiver_decompress.md index a2b21aef27..338a15146e 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver_decompress.md +++ b/site/src/content/docs/commands/zarf_tools_archiver_decompress.md @@ -26,11 +26,8 @@ zarf tools archiver decompress ARCHIVE DESTINATION [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_archiver_version.md b/site/src/content/docs/commands/zarf_tools_archiver_version.md index bd0312a2e5..1c907cbbf0 100644 --- a/site/src/content/docs/commands/zarf_tools_archiver_version.md +++ b/site/src/content/docs/commands/zarf_tools_archiver_version.md @@ -25,11 +25,8 @@ zarf tools archiver version [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_clear-cache.md b/site/src/content/docs/commands/zarf_tools_clear-cache.md index d70e93b204..01ded85b6c 100644 --- a/site/src/content/docs/commands/zarf_tools_clear-cache.md +++ b/site/src/content/docs/commands/zarf_tools_clear-cache.md @@ -26,11 +26,8 @@ zarf tools clear-cache [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files ``` diff --git a/site/src/content/docs/commands/zarf_tools_download-init.md b/site/src/content/docs/commands/zarf_tools_download-init.md index 5d1384c896..7d5349bb84 100644 --- a/site/src/content/docs/commands/zarf_tools_download-init.md +++ b/site/src/content/docs/commands/zarf_tools_download-init.md @@ -26,11 +26,8 @@ zarf tools download-init [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_gen-key.md b/site/src/content/docs/commands/zarf_tools_gen-key.md index e735a6fa48..2a74ebc6a0 100644 --- a/site/src/content/docs/commands/zarf_tools_gen-key.md +++ b/site/src/content/docs/commands/zarf_tools_gen-key.md @@ -25,11 +25,8 @@ zarf tools gen-key [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_gen-pki.md b/site/src/content/docs/commands/zarf_tools_gen-pki.md index 10989e3775..41843b5ae1 100644 --- a/site/src/content/docs/commands/zarf_tools_gen-pki.md +++ b/site/src/content/docs/commands/zarf_tools_gen-pki.md @@ -26,11 +26,8 @@ zarf tools gen-pki HOST [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_get-creds.md b/site/src/content/docs/commands/zarf_tools_get-creds.md index 69aedbed06..cb796ce0b8 100644 --- a/site/src/content/docs/commands/zarf_tools_get-creds.md +++ b/site/src/content/docs/commands/zarf_tools_get-creds.md @@ -46,11 +46,8 @@ $ zarf tools get-creds artifact ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_tools_update-creds.md b/site/src/content/docs/commands/zarf_tools_update-creds.md index 8b040bf2b1..08eb39974e 100644 --- a/site/src/content/docs/commands/zarf_tools_update-creds.md +++ b/site/src/content/docs/commands/zarf_tools_update-creds.md @@ -74,11 +74,8 @@ $ zarf tools update-creds artifact --artifact-push-username={USERNAME} --artifac ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") diff --git a/site/src/content/docs/commands/zarf_version.md b/site/src/content/docs/commands/zarf_version.md index e677883117..26ee161e3a 100644 --- a/site/src/content/docs/commands/zarf_version.md +++ b/site/src/content/docs/commands/zarf_version.md @@ -30,11 +30,8 @@ zarf version [flags] ``` -a, --architecture string Architecture for OCI images and Zarf packages --insecure-skip-tls-verify Skip checking server's certificate for validity. This flag should only be used if you have a specific reason and accept the reduced security posture. - --log-format string [beta] Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev', 'legacy'. The legacy option will be removed in a coming release (default "console") + --log-format string Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'. (default "console") -l, --log-level string Log level when running Zarf. Valid options are: warn, info, debug, trace (default "info") - --no-color Disable colors in output - --no-log-file Disable log file creation - --no-progress Disable fancy UI progress bars, spinners, logos, etc --plain-http Force the connections over HTTP instead of HTTPS. This flag should only be used if you have a specific reason and accept the reduced security posture. --tmpdir string Specify the temporary directory to use for intermediate files --zarf-cache string Specify the location of the Zarf cache directory (default "~/.zarf-cache") From 97c89fa51570a3aa4b0cd5b2a1f41b76ba7553f9 Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Wed, 26 Feb 2025 17:41:05 -0800 Subject: [PATCH 4/4] wip: remove pkg/message based logging Signed-off-by: Kit Patella --- src/cmd/destroy.go | 4 -- src/cmd/dev.go | 7 ++-- src/cmd/helm.go | 2 - src/cmd/initialize.go | 3 -- src/cmd/internal.go | 2 - src/cmd/kubectl.go | 2 - src/cmd/package.go | 3 +- src/cmd/root.go | 44 ++++++++++---------- src/cmd/table.go | 1 - src/cmd/viper.go | 1 + src/config/lang/english.go | 1 - src/internal/git/repository.go | 6 --- src/internal/packager/helm/chart.go | 3 -- src/internal/packager/helm/common.go | 4 -- src/internal/packager/helm/post-render.go | 5 +-- src/internal/packager/helm/repo.go | 21 +--------- src/internal/packager/images/pull.go | 47 ++++++---------------- src/internal/packager/images/push.go | 2 - src/internal/packager/sbom/tools.go | 5 --- src/internal/packager/template/template.go | 9 ----- src/internal/packager2/actions/actions.go | 28 ++----------- src/internal/packager2/layout/create.go | 12 ------ src/internal/packager2/layout/package.go | 2 - src/internal/packager2/mirror.go | 4 -- src/internal/packager2/remove.go | 5 --- src/pkg/cluster/cluster.go | 4 -- src/pkg/cluster/data.go | 7 ---- src/pkg/cluster/injector.go | 10 +---- src/pkg/cluster/namespace.go | 3 -- src/pkg/cluster/secrets.go | 11 ----- src/pkg/cluster/state.go | 21 +--------- src/pkg/transform/types.go | 1 - 32 files changed, 52 insertions(+), 228 deletions(-) diff --git a/src/cmd/destroy.go b/src/cmd/destroy.go index 0df579e9b3..a34fe5a45f 100644 --- a/src/cmd/destroy.go +++ b/src/cmd/destroy.go @@ -17,7 +17,6 @@ import ( "github.com/zarf-dev/zarf/src/internal/packager/helm" "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/utils/exec" "github.com/spf13/cobra" @@ -62,7 +61,6 @@ func (o *destroyOptions) run(cmd *cobra.Command, _ []string) error { // the scripts to remove k3s, we will still try to remove a locally installed k3s cluster state, err := c.LoadZarfState(ctx) if err != nil { - message.WarnErr(err, err.Error()) l.Warn(err.Error()) } @@ -85,7 +83,6 @@ func (o *destroyOptions) run(cmd *cobra.Command, _ []string) error { // Run the matched script err := exec.CmdWithPrint(script) if errors.Is(err, os.ErrPermission) { - message.Warnf(lang.CmdDestroyErrScriptPermissionDenied, script) l.Warn("received 'permission denied' when trying to execute script. Please double-check you have the correct kube-context.", "script", script) // Don't remove scripts we can't execute so the user can try to manually run @@ -97,7 +94,6 @@ func (o *destroyOptions) run(cmd *cobra.Command, _ []string) error { // Try to remove the script, but ignore any errors and debug log them err = os.Remove(script) if err != nil { - message.WarnErr(err, fmt.Sprintf("Unable to remove script. script=%s", script)) l.Warn("unable to remove script", "script", script, "error", err.Error()) } } diff --git a/src/cmd/dev.go b/src/cmd/dev.go index 24c5f9e4b0..49da1f2ec9 100644 --- a/src/cmd/dev.go +++ b/src/cmd/dev.go @@ -25,7 +25,6 @@ import ( layout2 "github.com/zarf-dev/zarf/src/internal/packager2/layout" "github.com/zarf-dev/zarf/src/pkg/lint" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" @@ -250,8 +249,9 @@ func (o *devPatchGitOptions) run(_ *cobra.Command, args []string) error { // Perform git url transformation via regex text := string(content) - // TODO(mkcp): Currently uses message for its log fn. Migrate to ctx and slog - processedText := transform.MutateGitURLsInText(message.Warnf, gitServer.Address, text, gitServer.PushUsername) + // FIXME(mkcp): Currently uses message for its log fn. Migrate to ctx and slog + l := logger.Default() + processedText := transform.MutateGitURLsInText(l.Warn, gitServer.Address, text, gitServer.PushUsername) // Print the differences // TODO(mkcp): Uses pterm to print text diffs. Decouple from pterm after we release logger. @@ -309,7 +309,6 @@ func (o *devSha256SumOptions) run(cmd *cobra.Command, args []string) (err error) var data io.ReadCloser if helpers.IsURL(fileName) { - message.Warn(lang.CmdDevSha256sumRemoteWarning) logger.From(cmd.Context()).Warn("this is a remote source. If a published checksum is available you should use that rather than calculating it directly from the remote link") fileBase, err := helpers.ExtractBasePathFromURL(fileName) diff --git a/src/cmd/helm.go b/src/cmd/helm.go index 4f6b33f0ff..fd6fa71250 100644 --- a/src/cmd/helm.go +++ b/src/cmd/helm.go @@ -11,7 +11,6 @@ import ( "github.com/zarf-dev/zarf/src/cmd/helm" "github.com/zarf-dev/zarf/src/config/lang" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/action" ) @@ -29,7 +28,6 @@ func newHelmCommand() *cobra.Command { // The inclusion of Helm in this manner should be changed once https://github.com/helm/helm/pull/13617 is merged cmd, err := helm.NewRootCmd(actionConfig, os.Stdout, helmArgs) if err != nil { - message.Debug("Failed to initialize helm command", "error", err) logger.Default().Debug("failed to initialize helm command", "error", err) } cmd.Short = lang.CmdToolsHelmShort diff --git a/src/cmd/initialize.go b/src/cmd/initialize.go index ad75f29b24..113ebe8abf 100644 --- a/src/cmd/initialize.go +++ b/src/cmd/initialize.go @@ -18,7 +18,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/config/lang" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager" "github.com/zarf-dev/zarf/src/pkg/packager/sources" "github.com/zarf-dev/zarf/src/pkg/utils" @@ -186,8 +185,6 @@ func downloadInitPackage(ctx context.Context, cacheDirectory string) (string, er url := zoci.GetInitPackageURL(config.CLIVersion) // Give the user the choice to download the init-package and note that this does require an internet connection - message.Question(fmt.Sprintf(lang.CmdInitPullAsk, url)) - message.Note(lang.CmdInitPullNote) l.Info("the init package was not found locally, but can be pulled in connected environments", "url", fmt.Sprintf("oci://%s", url)) var confirmDownload bool diff --git a/src/cmd/internal.go b/src/cmd/internal.go index b12ddeeb19..87ac46f002 100644 --- a/src/cmd/internal.go +++ b/src/cmd/internal.go @@ -20,7 +20,6 @@ import ( "github.com/zarf-dev/zarf/src/internal/gitea" "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" ) func newInternalCommand(rootCmd *cobra.Command) *cobra.Command { @@ -358,7 +357,6 @@ func (o *internalUpdateGiteaPVCOptions) run(cmd *cobra.Command, _ []string) erro // There is a possibility that the pvc does not yet exist and Gitea helm chart should create it helmShouldCreate, err := c.UpdateGiteaPVC(ctx, pvcName, o.rollback) if err != nil { - message.WarnErr(err, lang.CmdInternalUpdateGiteaPVCErr) logger.From(ctx).Warn("Unable to update the existing Gitea persistent volume claim", "error", err.Error()) } fmt.Print(helmShouldCreate) diff --git a/src/cmd/kubectl.go b/src/cmd/kubectl.go index 8dc8067b57..47f7c6a800 100644 --- a/src/cmd/kubectl.go +++ b/src/cmd/kubectl.go @@ -10,7 +10,6 @@ import ( "github.com/spf13/cobra" "github.com/zarf-dev/zarf/src/config/lang" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" kubeCLI "k8s.io/component-base/cli" kubeCmd "k8s.io/kubectl/pkg/cmd" @@ -32,7 +31,6 @@ func newKubectlCommand() *cobra.Command { if err := kubeCLI.RunNoErrOutput(cmd); err != nil { // @todo(jeff-mccoy) - Kubectl gets mad about being a subcommand. - message.Debug(err) logger.Default().Debug(err.Error()) } } diff --git a/src/cmd/package.go b/src/cmd/package.go index 852623842a..2d1909163b 100644 --- a/src/cmd/package.go +++ b/src/cmd/package.go @@ -9,7 +9,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/zarf-dev/zarf/src/pkg/message" "io" "os" "path/filepath" @@ -17,6 +16,8 @@ import ( "runtime" "strings" + "github.com/zarf-dev/zarf/src/pkg/message" + "github.com/AlecAivazis/survey/v2" "github.com/defenseunicorns/pkg/helpers/v2" goyaml "github.com/goccy/go-yaml" diff --git a/src/cmd/root.go b/src/cmd/root.go index 71b4d306c3..c6add0c811 100644 --- a/src/cmd/root.go +++ b/src/cmd/root.go @@ -31,10 +31,8 @@ var ( LogLevelCLI string // LogFormat holds the log format as input from a command LogFormat string - // SkipLogFile is a flag to skip logging to a file - SkipLogFile bool // NoColor is a flag to disable colors in output - NoColor bool + IsColorDisabled bool // OutputWriter provides a default writer to Stdout for user-facing command output OutputWriter = os.Stdout ) @@ -82,14 +80,19 @@ func preRun(cmd *cobra.Command, _ []string) error { return nil } - // Configure logger and add it to cmd context. - l, err := setupLogger(LogLevelCLI, LogFormat, !NoColor) + // Configure logger and add it to cmd context. We flip NoColor because setLogger wants "isColor" + l, err := setupLogger(LogLevelCLI, LogFormat, !IsColorDisabled) if err != nil { return err } ctx := logger.WithContext(cmd.Context(), l) cmd.SetContext(ctx) + // if --no-color is set, disable PTerm color in message prints + if IsColorDisabled { + pterm.DisableColor() + } + // Print out config location err = PrintViperConfigUsed(cmd.Context()) if err != nil { @@ -171,25 +174,27 @@ func init() { return } - v := getViper() + vpr := getViper() // Logs - rootCmd.PersistentFlags().StringVarP(&LogLevelCLI, "log-level", "l", v.GetString(VLogLevel), lang.RootCmdFlagLogLevel) - rootCmd.PersistentFlags().StringVar(&LogFormat, "log-format", v.GetString(VLogFormat), "Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'.") + rootCmd.PersistentFlags().StringVarP(&LogLevelCLI, "log-level", "l", vpr.GetString(VLogLevel), lang.RootCmdFlagLogLevel) + rootCmd.PersistentFlags().StringVar(&LogFormat, "log-format", vpr.GetString(VLogFormat), "Select a logging format. Defaults to 'console'. Valid options are: 'console', 'json', 'dev'.") + rootCmd.PersistentFlags().BoolVar(&IsColorDisabled, "no-color", vpr.GetBool(VNoColor), "Disable terminal color codes in logging and stdout prints.") - rootCmd.PersistentFlags().StringVarP(&config.CLIArch, "architecture", "a", v.GetString(VArchitecture), lang.RootCmdFlagArch) - rootCmd.PersistentFlags().StringVar(&config.CommonOptions.CachePath, "zarf-cache", v.GetString(VZarfCache), lang.RootCmdFlagCachePath) - rootCmd.PersistentFlags().StringVar(&config.CommonOptions.TempDirectory, "tmpdir", v.GetString(VTmpDir), lang.RootCmdFlagTempDir) + // Core functionality + rootCmd.PersistentFlags().StringVarP(&config.CLIArch, "architecture", "a", vpr.GetString(VArchitecture), lang.RootCmdFlagArch) + rootCmd.PersistentFlags().StringVar(&config.CommonOptions.CachePath, "zarf-cache", vpr.GetString(VZarfCache), lang.RootCmdFlagCachePath) + rootCmd.PersistentFlags().StringVar(&config.CommonOptions.TempDirectory, "tmpdir", vpr.GetString(VTmpDir), lang.RootCmdFlagTempDir) // Security - rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.Insecure, "insecure", v.GetBool(VInsecure), lang.RootCmdFlagInsecure) - rootCmd.PersistentFlags().MarkDeprecated("insecure", "please use --plain-http, --insecure-skip-tls-verify, or --skip-signature-validation instead.") - rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.PlainHTTP, "plain-http", v.GetBool(VPlainHTTP), lang.RootCmdFlagPlainHTTP) - rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.InsecureSkipTLSVerify, "insecure-skip-tls-verify", v.GetBool(VInsecureSkipTLSVerify), lang.RootCmdFlagInsecureSkipTLSVerify) + rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.Insecure, "insecure", vpr.GetBool(VInsecure), lang.RootCmdFlagInsecure) + rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.PlainHTTP, "plain-http", vpr.GetBool(VPlainHTTP), lang.RootCmdFlagPlainHTTP) + rootCmd.PersistentFlags().BoolVar(&config.CommonOptions.InsecureSkipTLSVerify, "insecure-skip-tls-verify", vpr.GetBool(VInsecureSkipTLSVerify), lang.RootCmdFlagInsecureSkipTLSVerify) + _ = rootCmd.PersistentFlags().MarkDeprecated("insecure", "please use --plain-http, --insecure-skip-tls-verify, or --skip-signature-validation instead.") } -// setup Logger handles creating a logger and setting it as the global default. -func setupLogger(level, format string, color bool) (*slog.Logger, error) { +// setupLogger handles creating a logger and setting it as the global default. +func setupLogger(level, format string, isColor bool) (*slog.Logger, error) { // If we didn't get a level from config, fallback to "info" if level == "" { level = "info" @@ -202,15 +207,12 @@ func setupLogger(level, format string, color bool) (*slog.Logger, error) { Level: sLevel, Format: logger.Format(format), Destination: logger.DestinationDefault, - Color: logger.Color(color), + Color: logger.Color(isColor), } l, err := logger.New(cfg) if err != nil { return nil, err } - if !color { - pterm.DisableColor() - } logger.SetDefault(l) l.Debug("logger successfully initialized", "cfg", cfg) return l, nil diff --git a/src/cmd/table.go b/src/cmd/table.go index 9a23528ba6..190cc71601 100644 --- a/src/cmd/table.go +++ b/src/cmd/table.go @@ -44,7 +44,6 @@ func PrintFindings(ctx context.Context, lintErr *lint.LintError) { } // Print table to our OutputWriter - message.Notef("Linting package %q at %s", findings[0].PackageNameOverride, packagePathFromUser) logger.From(ctx).Info("linting package", "name", findings[0].PackageNameOverride, "path", packagePathFromUser) message.TableWithWriter(OutputWriter, []string{"Type", "Path", "Message"}, lintData) } diff --git a/src/cmd/viper.go b/src/cmd/viper.go index 50fea5d57c..36120e370b 100644 --- a/src/cmd/viper.go +++ b/src/cmd/viper.go @@ -34,6 +34,7 @@ const ( VLogLevel = "log_level" VLogFormat = "log_format" + VNoColor = "no_color" // Init config keys diff --git a/src/config/lang/english.go b/src/config/lang/english.go index 34905a7428..a8374d4ec6 100644 --- a/src/config/lang/english.go +++ b/src/config/lang/english.go @@ -45,7 +45,6 @@ const ( RootCmdFlagArch = "Architecture for OCI images and Zarf packages" RootCmdFlagSkipLogFile = "Disable log file creation" RootCmdFlagNoProgress = "Disable fancy UI progress bars, spinners, logos, etc" - RootCmdFlagNoColor = "Disable colors in output" RootCmdFlagCachePath = "Specify the location of the Zarf cache directory" RootCmdFlagTempDir = "Specify the temporary directory to use for intermediate files" RootCmdFlagInsecure = "Allow access to insecure registries and disable other recommended security enforcements such as package checksum and signature validation. This flag should only be used if you have a specific reason and accept the reduced security posture." diff --git a/src/internal/git/repository.go b/src/internal/git/repository.go index 95f6bade0a..4201ea6923 100644 --- a/src/internal/git/repository.go +++ b/src/internal/git/repository.go @@ -19,7 +19,6 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" ) @@ -97,7 +96,6 @@ func Clone(ctx context.Context, rootPath, address string, shallow bool) (*Reposi } repo, err := git.PlainCloneContext(ctx, r.path, false, cloneOpts) if err != nil { - message.Notef("Falling back to host 'git', failed to clone the repo %q with Zarf: %s", gitURLNoRef, err.Error()) l.Info("falling back to host 'git', failed to clone the repo with Zarf", "url", gitURLNoRef, "error", err) err := r.gitCloneFallback(ctx, gitURLNoRef, ref, shallow) if err != nil { @@ -198,13 +196,10 @@ func (r *Repository) Push(ctx context.Context, address, username, password strin } err = repo.FetchContext(ctx, fetchOptions) if errors.Is(err, transport.ErrRepositoryNotFound) { - message.Debugf("Repo not yet available offline, skipping fetch...") l.Debug("repo not yet available offline, skipping fetch") } else if errors.Is(err, git.ErrForceNeeded) { - message.Debugf("Repo fetch requires force, skipping fetch...") l.Debug("repo fetch requires force, skipping fetch") } else if errors.Is(err, git.NoErrAlreadyUpToDate) { - message.Debugf("Repo already up-to-date, skipping fetch...") l.Debug("repo already up-to-date, skipping fetch") } else if err != nil { return fmt.Errorf("unable to fetch the git repo prior to push: %w", err) @@ -223,7 +218,6 @@ func (r *Repository) Push(ctx context.Context, address, username, password strin }, }) if errors.Is(err, git.NoErrAlreadyUpToDate) { - message.Debug("Repo already up-to-date") l.Debug("repo already up-to-date") } else if errors.Is(err, plumbing.ErrObjectNotFound) { return fmt.Errorf("unable to push repo due to likely shallow clone: %s", err.Error()) diff --git a/src/internal/packager/helm/chart.go b/src/internal/packager/helm/chart.go index 2a32402eb7..1dfb178560 100644 --- a/src/internal/packager/helm/chart.go +++ b/src/internal/packager/helm/chart.go @@ -30,7 +30,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/internal/healthchecks" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/types" ) @@ -218,7 +217,6 @@ func (h *Helm) RemoveChart(ctx context.Context, namespace string, name string) e _ = h.createActionConfig(ctx, namespace) // Perform the uninstall. response, err := h.uninstallChart(name) - message.Debug(response) logger.From(ctx).Debug("chart uninstalled", "response", response) return err } @@ -439,7 +437,6 @@ func (h *Helm) migrateDeprecatedAPIs(ctx context.Context, latestRelease *release // If the release was modified in the above loop, save it back to the cluster if modified { - message.Warnf("Zarf detected deprecated APIs for the '%s' helm release. Attempting automatic upgrade.", latestRelease.Name) logger.From(ctx).Warn("detected deprecated APIs for the helm release", "name", latestRelease.Name) // Update current release version to be superseded (same as the helm mapkubeapis plugin) diff --git a/src/internal/packager/helm/common.go b/src/internal/packager/helm/common.go index 8d20e84483..650e0fe853 100644 --- a/src/internal/packager/helm/common.go +++ b/src/internal/packager/helm/common.go @@ -17,7 +17,6 @@ import ( "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/cluster" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/variables" "github.com/zarf-dev/zarf/src/types" "helm.sh/helm/v3/pkg/action" @@ -80,9 +79,6 @@ func NewClusterOnly(cfg *types.PackagerConfig, variableConfig *variables.Variabl // NewFromZarfManifest generates a helm chart and config from a given Zarf manifest. func NewFromZarfManifest(manifest v1alpha1.ZarfManifest, manifestPath, packageName, componentName string, mods ...Modifier) (h *Helm, err error) { - spinner := message.NewProgressSpinner("Starting helm chart generation %s", manifest.Name) - defer spinner.Stop() - // Generate a new chart. tmpChart := new(chart.Chart) tmpChart.Metadata = new(chart.Metadata) diff --git a/src/internal/packager/helm/post-render.go b/src/internal/packager/helm/post-render.go index fc5c93cb75..ece394d934 100644 --- a/src/internal/packager/helm/post-render.go +++ b/src/internal/packager/helm/post-render.go @@ -8,6 +8,7 @@ import ( "bytes" "context" "fmt" + "github.com/zarf-dev/zarf/src/pkg/message" "os" "path/filepath" "slices" @@ -16,7 +17,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/utils" "github.com/zarf-dev/zarf/src/types" "helm.sh/helm/v3/pkg/releaseutil" @@ -142,7 +142,6 @@ func (r *renderer) adoptAndUpdateNamespaces(ctx context.Context) error { // Refuse to adopt namespace if it is one of four initial Kubernetes namespaces. // https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#initial-namespaces if slices.Contains([]string{"default", "kube-node-lease", "kube-public", "kube-system"}, name) { - message.Warnf("Refusing to adopt the initial namespace: %s", name) l.Warn("refusing to adopt initial namespace", "name", name) } else { // This is an existing namespace to adopt @@ -200,10 +199,8 @@ func (r *renderer) editHelmResources(ctx context.Context, resources []releaseuti namespace := &corev1.Namespace{} // parse the namespace resource so it can be applied out-of-band by zarf instead of helm to avoid helm ns shenanigans if err := runtime.DefaultUnstructuredConverter.FromUnstructured(rawData.UnstructuredContent(), namespace); err != nil { - message.WarnErrf(err, "could not parse namespace %s", rawData.GetName()) l.Warn("failed to parse namespace", "name", rawData.GetName(), "error", err) } else { - message.Debugf("Matched helm namespace %s for zarf annotation", namespace.Name) l.Debug("matched helm namespace for zarf annotation", "name", namespace.Name) namespace.Labels = cluster.AdoptZarfManagedLabels(namespace.Labels) // Add it to the stack diff --git a/src/internal/packager/helm/repo.go b/src/internal/packager/helm/repo.go index 32746e6cb6..64c6a6f113 100644 --- a/src/internal/packager/helm/repo.go +++ b/src/internal/packager/helm/repo.go @@ -42,8 +42,6 @@ func (h *Helm) PackageChart(ctx context.Context, cosignKeyPath string) error { // check if the chart is a git url with a ref (if an error is returned url will be empty) isGitURL := strings.HasSuffix(url, ".git") if err != nil { - // TODO(mkcp): Remove message on logger release - message.Debugf("unable to parse the url, continuing with %s", h.chart.URL) logger.From(ctx).Debug("unable to parse the url, continuing", "url", h.chart.URL) } @@ -80,10 +78,6 @@ func (h *Helm) PackageChartFromLocalFiles(ctx context.Context, cosignKeyPath str "version", h.chart.Version, "path", h.chart.LocalPath, ) - // TODO(mkcp): Remove message on logger release - spinner := message.NewProgressSpinner("Processing helm chart %s:%s from %s", h.chart.Name, h.chart.Version, h.chart.LocalPath) - defer spinner.Stop() - // Load and validate the chart cl, _, err := h.loadAndValidateChart(h.chart.LocalPath) if err != nil { @@ -124,8 +118,6 @@ func (h *Helm) PackageChartFromLocalFiles(ctx context.Context, cosignKeyPath str return err } - spinner.Success() - l.Debug("done processing local helm chart", "name", h.chart.Name, "version", h.chart.Version, @@ -138,10 +130,6 @@ func (h *Helm) PackageChartFromLocalFiles(ctx context.Context, cosignKeyPath str func (h *Helm) PackageChartFromGit(ctx context.Context, cosignKeyPath string) error { l := logger.From(ctx) l.Info("processing Helm chart", "name", h.chart.Name) - // TODO(mkcp): Remove message on logger release - spinner := message.NewProgressSpinner("Processing Helm chart %s", h.chart.Name) - defer spinner.Stop() - // Retrieve the repo containing the chart gitPath, err := DownloadChartFromGitToTemp(ctx, h.chart.URL) if err != nil { @@ -167,9 +155,6 @@ func (h *Helm) DownloadPublishedChart(ctx context.Context, cosignKeyPath string) "repo", h.chart.URL, ) start := time.Now() - // TODO(mkcp): Remove message on logger release - spinner := message.NewProgressSpinner("Processing Helm chart %s:%s from repo %s", h.chart.Name, h.chart.Version, h.chart.URL) - defer spinner.Stop() // Set up the helm pull config pull := action.NewPull() @@ -184,8 +169,6 @@ func (h *Helm) DownloadPublishedChart(ctx context.Context, cosignKeyPath string) // Not returning the error here since the repo file is only needed if we are pulling from a repo that requires authentication if err != nil { - // TODO(mkcp): Remove message on logger release - message.Debugf("Unable to load the repo file at %q: %s", pull.Settings.RepositoryConfig, err.Error()) l.Debug("unable to load the repo file", "path", pull.Settings.RepositoryConfig, "error", err.Error(), @@ -240,7 +223,8 @@ func (h *Helm) DownloadPublishedChart(ctx context.Context, cosignKeyPath string) // Set up the chart chartDownloader chartDownloader := downloader.ChartDownloader{ - Out: spinner, + // FIXME(mkcp): Should we be using OutputWriter here? + Out: message.OutputWriter, RegistryClient: regClient, // TODO: Further research this with regular/OCI charts Verify: downloader.VerifyNever, @@ -280,7 +264,6 @@ func (h *Helm) DownloadPublishedChart(ctx context.Context, cosignKeyPath string) return err } - spinner.Success() l.Debug("done downloading helm chart", "name", h.chart.Name, "version", h.chart.Version, diff --git a/src/internal/packager/images/pull.go b/src/internal/packager/images/pull.go index 5f83051ac3..5f296109ed 100644 --- a/src/internal/packager/images/pull.go +++ b/src/internal/packager/images/pull.go @@ -16,7 +16,6 @@ import ( "runtime" "strings" "sync" - "sync/atomic" "time" "github.com/docker/cli/cli/command" @@ -90,17 +89,8 @@ func getDockerEndpointHost() (string, error) { // Pull pulls all images from the given config. func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, error) { l := logger.From(ctx) - var longer string pullStart := time.Now() - imageCount := len(cfg.ImageList) - // Give some additional user feedback on larger image sets - if imageCount > 15 { - longer = "This step may take a couple of minutes to complete." - } else if imageCount > 5 { - longer = "This step may take several seconds to complete." - } - if err := helpers.CreateDirectory(cfg.DestinationDirectory, helpers.ReadExecuteAllWriteUser); err != nil { return nil, fmt.Errorf("failed to create image path %s: %w", cfg.DestinationDirectory, err) } @@ -110,12 +100,18 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er return nil, err } - // Give some additional user feedback on larger image sets imageFetchStart := time.Now() - // TODO(mkcp): Remove message on logger release - spinner := message.NewProgressSpinner("Fetching info for %d images. %s", imageCount, longer) - defer spinner.Stop() + // Give some additional user feedback on larger image sets + imageCount := len(cfg.ImageList) l.Info("fetching info for images", "count", imageCount, "destination", cfg.DestinationDirectory) + switch { + case imageCount > 15: + l.Warn("This step may take a couple of minutes to complete.") + break + case imageCount > 5: + l.Warn("This step may take several seconds to complete.") + break + } logs.Warn.SetOutput(&message.DebugWriter{}) logs.Progress.SetOutput(&message.DebugWriter{}) @@ -129,16 +125,12 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er fetched := map[transform.Image]v1.Image{} - var counter, totalBytes atomic.Int64 var dockerEndPointHost string // Spawn a goroutine for each for _, refInfo := range cfg.ImageList { refInfo := refInfo eg.Go(func() error { - idx := counter.Add(1) - // TODO(mkcp): Remove message on logger release - spinner.Updatef("Fetching image info (%d of %d)", idx, imageCount) l.Debug("fetching image info", "name", refInfo.Name) ref := refInfo.Reference @@ -168,8 +160,6 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er return fmt.Errorf("rate limited by registry: %w", err) } - // TODO(mkcp): Remove message on logger release - message.Warnf("Falling back to local 'docker', failed to find the manifest on a remote: %s", err.Error()) l.Warn("Falling back to local 'docker', failed to find the manifest on a remote", "error", err.Error()) if dockerEndPointHost == "" { @@ -197,9 +187,9 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er // Warn the user if the image is large. if rawImg.Size > 750*1000*1000 { - message.Warnf("%s is %s and may take a very long time to load via docker. "+ - "See https://docs.zarf.dev/faq for suggestions on how to improve large local image loading operations.", - ref, utils.ByteFormat(float64(rawImg.Size), 2)) + l.Warn("ref is large and may take a very long time to load via docker. See https://docs.zarf.dev/faq for suggestions on how to improve large local image loading operations.", + "ref", ref, + "size", utils.ByteFormat(float64(rawImg.Size), 2)) } // Use unbuffered opener to avoid OOM Kill issues https://github.com/zarf-dev/zarf/issues/1214. @@ -228,12 +218,6 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er img = cache.Image(img, cache.NewFilesystemCache(cfg.CacheDirectory)) } - size, err := getSizeOfImage(img) - if err != nil { - return fmt.Errorf("failed to get size of image: %w", err) - } - totalBytes.Add(size) - layers, err := img.Layers() if err != nil { return fmt.Errorf("unable to get layers for %s: %w", refInfo.Reference, err) @@ -266,14 +250,9 @@ func Pull(ctx context.Context, cfg PullConfig) (map[transform.Image]v1.Image, er return nil, err } - // TODO(mkcp): Remove message on logger release - spinner.Successf("Fetched info for %d images", imageCount) l.Debug("done fetching info for images", "count", len(cfg.ImageList), "duration", time.Since(imageFetchStart)) doneSaving := make(chan error) - updateText := fmt.Sprintf("Pulling %d images", imageCount) - // TODO(mkcp): Remove progress bar on logger release - go utils.RenderProgressBarForLocalDirWrite(cfg.DestinationDirectory, totalBytes.Load(), doneSaving, updateText, updateText) l.Info("pulling images", "count", len(cfg.ImageList)) toPull := maps.Clone(fetched) diff --git a/src/internal/packager/images/push.go b/src/internal/packager/images/push.go index 1930754e45..5bec4258c3 100644 --- a/src/internal/packager/images/push.go +++ b/src/internal/packager/images/push.go @@ -14,7 +14,6 @@ import ( "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" ) @@ -65,7 +64,6 @@ func Push(ctx context.Context, cfg PushConfig) error { } }() for refInfo, img := range toPush { - message.Infof("Pushing %s", refInfo.Reference) l.Info("pushing image", "name", refInfo.Reference) // If this is not a no checksum image push it for use with the Zarf agent if !cfg.NoChecksum { diff --git a/src/internal/packager/sbom/tools.go b/src/internal/packager/sbom/tools.go index ae95ac7486..36230060d6 100644 --- a/src/internal/packager/sbom/tools.go +++ b/src/internal/packager/sbom/tools.go @@ -6,12 +6,10 @@ package sbom import ( "context" - "fmt" "github.com/zarf-dev/zarf/src/pkg/logger" "path/filepath" "github.com/AlecAivazis/survey/v2" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) @@ -24,14 +22,11 @@ func ViewSBOMFiles(ctx context.Context, directory string) error { } if len(sbomViewFiles) == 0 { - message.Note("There were no images with software bill-of-materials (SBOM) included.") l.Info("there were no images with software bill-of-materials (SBOM) included.") return nil } link := sbomViewFiles[0] - msg := fmt.Sprintf("This package has %d images with software bill-of-materials (SBOM) included. If your browser did not open automatically you can copy and paste this file location into your browser address bar to view them: %s\n\n", len(sbomViewFiles), link) - message.Note(msg) l.Info("this package has images with software bill-of-materials (SBOM) included. If your browser did not open automatically you can copy and paste this file location into your browser address bar to view them", "SBOMCount", len(sbomViewFiles), "link", link) if err := exec.LaunchURL(link); err != nil { return err diff --git a/src/internal/packager/template/template.go b/src/internal/packager/template/template.go index 12f1eedd34..e9f1bf1d32 100644 --- a/src/internal/packager/template/template.go +++ b/src/internal/packager/template/template.go @@ -7,7 +7,6 @@ package template import ( "context" "encoding/base64" - "encoding/json" "fmt" "strings" @@ -18,7 +17,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/interactive" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/utils" "github.com/zarf-dev/zarf/src/pkg/variables" ) @@ -129,13 +127,6 @@ func generateHtpasswd(regInfo *types.RegistryInfo) (string, error) { func debugPrintTemplateMap(ctx context.Context, templateMap map[string]*variables.TextTemplate) error { sanitizedMap := getSanitizedTemplateMap(templateMap) - - b, err := json.MarshalIndent(sanitizedMap, "", " ") - if err != nil { - return err - } - - message.Debug(fmt.Sprintf("templateMap = %s", string(b))) logger.From(ctx).Debug("cluster.debugPrintTemplateMap", "templateMap", sanitizedMap) return nil } diff --git a/src/internal/packager2/actions/actions.go b/src/internal/packager2/actions/actions.go index cf831cb2b2..bcce58e830 100644 --- a/src/internal/packager2/actions/actions.go +++ b/src/internal/packager2/actions/actions.go @@ -17,7 +17,6 @@ import ( "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/internal/packager/template" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/utils" "github.com/zarf-dev/zarf/src/pkg/utils/exec" "github.com/zarf-dev/zarf/src/pkg/variables" @@ -79,17 +78,12 @@ func runAction(ctx context.Context, basePath string, defaultCfg v1alpha1.ZarfCom cmdEscaped = helpers.Truncate(cmd, 60, false) } - // TODO(mkcp): Remove message on logger release - spinner := message.NewProgressSpinner("Running \"%s\"", cmdEscaped) - // Persist the spinner output so it doesn't get overwritten by the command output. - spinner.EnablePreserveWrites() l.Info("running command", "cmd", cmdEscaped) actionDefaults := actionGetCfg(ctx, defaultCfg, action, variableConfig.GetAllTemplates()) actionDefaults.Dir = filepath.Join(basePath, actionDefaults.Dir) if cmd, err = actionCmdMutation(ctx, cmd, actionDefaults.Shell); err != nil { - spinner.Errorf(err, "Error mutating command: %s", cmdEscaped) l.Error("error mutating command", "cmd", cmdEscaped, "err", err.Error()) } @@ -103,7 +97,7 @@ retryCmd: // Perform the action run. tryCmd := func(ctx context.Context) error { // Try running the command and continue the retry loop if it fails. - stdout, stderr, err := actionRun(ctx, actionDefaults, cmd, spinner) + stdout, stderr, err := actionRun(ctx, actionDefaults, cmd) if err != nil { if !actionDefaults.Mute { l.Warn("action failed", "cmd", cmdEscaped, "stdout", stdout, "stderr", stderr) @@ -124,14 +118,11 @@ retryCmd: } } - // If the action has a wait, change the spinner message to reflect that on success. if action.Wait != nil { - spinner.Successf("Wait for \"%s\" succeeded", cmdEscaped) l.Debug("wait for action succeeded", "cmd", cmdEscaped, "duration", time.Since(start)) return nil } - spinner.Successf("Completed \"%s\"", cmdEscaped) l.Debug("completed action", "cmd", cmdEscaped, "duration", time.Since(start)) // If the command ran successfully, continue to the next action. @@ -140,7 +131,6 @@ retryCmd: // If no timeout is set, run the command and return or continue retrying. if actionDefaults.MaxTotalSeconds < 1 { - spinner.Updatef("Waiting for \"%s\" (no timeout)", cmdEscaped) l.Info("waiting for action (no timeout)", "cmd", cmdEscaped) if err := tryCmd(ctx); err != nil { continue retryCmd @@ -150,7 +140,6 @@ retryCmd: } // Run the command on repeat until success or timeout. - spinner.Updatef("Waiting for \"%s\" (timeout: %ds)", cmdEscaped, actionDefaults.MaxTotalSeconds) l.Info("waiting for action", "cmd", cmdEscaped, "timeout", actionDefaults.MaxTotalSeconds) select { // On timeout break the loop to abort. @@ -242,8 +231,6 @@ func actionCmdMutation(ctx context.Context, cmd string, shellPref v1alpha1.Shell get, err := helpers.MatchRegex(envVarRegex, cmd) if err == nil { newCmd := strings.ReplaceAll(cmd, get("envIndicator"), fmt.Sprintf("$Env:%s", get("varName"))) - // TODO(mkcp): Remove message on logger release - message.Debugf("Converted command \"%s\" to \"%s\" t", cmd, newCmd) logger.From(ctx).Debug("converted command", "cmd", cmd, "newCmd", newCmd) cmd = newCmd } @@ -292,12 +279,11 @@ func actionGetCfg(_ context.Context, cfg v1alpha1.ZarfComponentActionDefaults, a return cfg } -func actionRun(ctx context.Context, cfg v1alpha1.ZarfComponentActionDefaults, cmd string, spinner *message.Spinner) (string, string, error) { +func actionRun(ctx context.Context, cfg v1alpha1.ZarfComponentActionDefaults, cmd string) (string, string, error) { l := logger.From(ctx) + start := time.Now() shell, shellArgs := exec.GetOSShell(cfg.Shell) - // TODO(mkcp): Remove message on logger release - message.Debugf("Running command in %s: %s", shell, cmd) l.Debug("running command", "shell", shell, "cmd", cmd) execCfg := exec.Config{ @@ -305,16 +291,10 @@ func actionRun(ctx context.Context, cfg v1alpha1.ZarfComponentActionDefaults, cm Dir: cfg.Dir, } - if !cfg.Mute { - execCfg.Stdout = spinner - execCfg.Stderr = spinner - } - stdout, stderr, err := exec.CmdWithContext(ctx, execCfg, shell, append(shellArgs, cmd)...) // Dump final complete output (respect mute to prevent sensitive values from hitting the logs). if !cfg.Mute { - // TODO(mkcp): Remove message on logger release - message.Debug(cmd, stdout, stderr) + l.Debug("command complete", "stdout", stdout, "stderr", stderr, "duration", time.Since(start)) } return stdout, stderr, err } diff --git a/src/internal/packager2/layout/create.go b/src/internal/packager2/layout/create.go index c074ac49ff..2d90bba69d 100644 --- a/src/internal/packager2/layout/create.go +++ b/src/internal/packager2/layout/create.go @@ -39,7 +39,6 @@ import ( "github.com/zarf-dev/zarf/src/pkg/interactive" "github.com/zarf-dev/zarf/src/pkg/lint" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" "github.com/zarf-dev/zarf/src/pkg/zoci" @@ -958,13 +957,6 @@ func splitFile(ctx context.Context, srcPath string, chunkSize int) (err error) { return err } - title := fmt.Sprintf("[0/%d] MB bytes written", fi.Size()/1000/1000) - progressBar := message.NewProgressBar(fi.Size(), title) - defer func(progressBar *message.ProgressBar) { - err2 := progressBar.Close() - err = errors.Join(err, err2) - }(progressBar) - hash := sha256.New() fileCount := 0 // TODO(mkcp): The inside of this loop should be wrapped in a closure so we can close the destination file each @@ -987,9 +979,6 @@ func splitFile(ctx context.Context, srcPath string, chunkSize int) (err error) { if copyErr != nil && !errors.Is(copyErr, io.EOF) { return err } - progressBar.Add(int(written)) - title := fmt.Sprintf("[%d/%d] MB bytes written", progressBar.GetCurrent()/1000/1000, fi.Size()/1000/1000) - progressBar.Updatef(title) _, err = dstFile.Seek(0, io.SeekStart) if err != nil { @@ -1045,7 +1034,6 @@ func splitFile(ctx context.Context, srcPath string, chunkSize int) (err error) { if err := os.WriteFile(path, b, 0644); err != nil { return fmt.Errorf("unable to write the file %s: %w", path, err) } - progressBar.Successf("Package split across %d files", fileCount+1) logger.From(ctx).Info("package split across files", "count", fileCount+1) return nil } diff --git a/src/internal/packager2/layout/package.go b/src/internal/packager2/layout/package.go index d1623bf759..50cc092806 100644 --- a/src/internal/packager2/layout/package.go +++ b/src/internal/packager2/layout/package.go @@ -25,7 +25,6 @@ import ( "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager/sources" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" @@ -211,7 +210,6 @@ func (p *PackageLayout) Archive(ctx context.Context, dirPath string, maxPackageS if err != nil && !errors.Is(err, os.ErrNotExist) { return err } - message.Notef("Saving package to path %s", tarballPath) logger.From(ctx).Info("writing package to disk", "path", tarballPath) files, err := os.ReadDir(p.dirPath) if err != nil { diff --git a/src/internal/packager2/mirror.go b/src/internal/packager2/mirror.go index 2f6599911a..f1a1aca5cb 100644 --- a/src/internal/packager2/mirror.go +++ b/src/internal/packager2/mirror.go @@ -24,7 +24,6 @@ import ( "github.com/zarf-dev/zarf/src/internal/packager2/layout" "github.com/zarf-dev/zarf/src/pkg/cluster" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager/filters" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" @@ -122,7 +121,6 @@ func pushImagesToRegistry(ctx context.Context, c *cluster.Cluster, pkgLayout *la } names = append(names, offlineName) for _, name := range names { - message.Infof("Pushing image %s", name) l.Info("pushing image", "name", name) err = crane.Push(img, name, pushOptions...) if err != nil { @@ -190,7 +188,6 @@ func pushReposToRepository(ctx context.Context, c *cluster.Cluster, pkgLayout *l } err = retry.Do(func() error { if !dns.IsServiceURL(gitInfo.Address) { - message.Infof("Pushing repository %s to server %s", repoURL, gitInfo.Address) l.Info("pushing repository to server", "repo", repoURL, "server", gitInfo.Address) err = repository.Push(ctx, gitInfo.Address, gitInfo.PushUsername, gitInfo.PushPassword) if err != nil { @@ -220,7 +217,6 @@ func pushReposToRepository(ctx context.Context, c *cluster.Cluster, pkgLayout *l return err } return tunnel.Wrap(func() error { - message.Infof("Pushing repository %s to server %s", repoURL, tunnel.HTTPEndpoint()) l.Info("pushing repository to server", "repo", repoURL, "server", tunnel.HTTPEndpoint()) err = repository.Push(ctx, tunnel.HTTPEndpoint(), gitInfo.PushUsername, gitInfo.PushPassword) if err != nil { diff --git a/src/internal/packager2/remove.go b/src/internal/packager2/remove.go index 10889d9bdd..ad3ff6a68a 100644 --- a/src/internal/packager2/remove.go +++ b/src/internal/packager2/remove.go @@ -18,7 +18,6 @@ import ( "github.com/zarf-dev/zarf/src/api/v1alpha1" "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/cluster" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/packager/actions" "github.com/zarf-dev/zarf/src/pkg/packager/filters" "github.com/zarf-dev/zarf/src/types" @@ -111,7 +110,6 @@ func Remove(ctx context.Context, opt RemoveOptions) error { return fmt.Errorf("unable to uninstall the helm chart %s in the namespace %s: %w", chart.ChartName, chart.Namespace, err) } if errors.Is(err, driver.ErrReleaseNotFound) { - message.Warnf("Helm release for helm chart '%s' in the namespace '%s' was not found. Was it already removed?", chart.ChartName, chart.Namespace) l.Warn("helm release was not found. was it already removed?", "name", chart.ChartName, "namespace", chart.Namespace) } @@ -122,7 +120,6 @@ func Remove(ctx context.Context, opt RemoveOptions) error { err = opt.Cluster.UpdateDeployedPackage(ctx, *depPkg) if err != nil { // We warn and ignore errors because we may have removed the cluster that this package was inside of - message.Warnf("Unable to update the secret for package %s, this may be normal if the cluster was removed: %s", depPkg.Name, err.Error()) l.Warn("unable to update secret for package, this may be normal if the cluster was removed", "pkgName", depPkg.Name, "error", err.Error()) } } @@ -143,7 +140,6 @@ func Remove(ctx context.Context, opt RemoveOptions) error { err = opt.Cluster.UpdateDeployedPackage(ctx, *depPkg) if err != nil { // We warn and ignore errors because we may have removed the cluster that this package was inside of - message.Warnf("Unable to update the secret for package %s, this may be normal if the cluster was removed: %s", depPkg.Name, err.Error()) l.Warn("unable to update secret package, this may be normal if the cluster was removed", "pkgName", depPkg.Name, "error", err.Error()) } } @@ -162,7 +158,6 @@ func Remove(ctx context.Context, opt RemoveOptions) error { if opt.Cluster != nil && len(depPkg.DeployedComponents) == 0 { err := opt.Cluster.DeleteDeployedPackage(ctx, depPkg.Name) if err != nil { - message.Warnf("Unable to delete the secret for package %s, this may be normal if the cluster was removed: %s", depPkg.Name, err.Error()) l.Warn("unable to delete secret for package, this may be normal if the cluster was removed", "pkgName", depPkg.Name, "error", err.Error()) } } diff --git a/src/pkg/cluster/cluster.go b/src/pkg/cluster/cluster.go index 463a97d7e2..861dbd29eb 100644 --- a/src/pkg/cluster/cluster.go +++ b/src/pkg/cluster/cluster.go @@ -19,7 +19,6 @@ import ( "github.com/avast/retry-go/v4" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "k8s.io/client-go/dynamic" "k8s.io/client-go/tools/clientcmd" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" @@ -45,8 +44,6 @@ type Cluster struct { func NewClusterWithWait(ctx context.Context) (*Cluster, error) { start := time.Now() l := logger.From(ctx) - spinner := message.NewProgressSpinner("Waiting for cluster connection") - defer spinner.Stop() l.Info("waiting for cluster connection") c, err := NewCluster() @@ -76,7 +73,6 @@ func NewClusterWithWait(ctx context.Context) (*Cluster, error) { return nil, err } - spinner.Success() l.Debug("done waiting for cluster, connected", "duration", time.Since(start)) return c, nil diff --git a/src/pkg/cluster/data.go b/src/pkg/cluster/data.go index a85f52c7ab..98c2f3b075 100644 --- a/src/pkg/cluster/data.go +++ b/src/pkg/cluster/data.go @@ -26,7 +26,6 @@ import ( "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/utils" "github.com/zarf-dev/zarf/src/pkg/utils/exec" ) @@ -62,7 +61,6 @@ func (c *Cluster) HandleDataInjection(ctx context.Context, data v1alpha1.ZarfDat return fmt.Errorf("unable to execute tar, ensure it is installed in the $PATH: %w", err) } - message.Debugf("Attempting to inject data into %s", data.Target) l.Debug("performing data injection", "target", data.Target) source := filepath.Join(componentPath.DataInjections, filepath.Base(data.Target.Path)) @@ -93,7 +91,6 @@ func (c *Cluster) HandleDataInjection(ctx context.Context, data v1alpha1.ZarfDat zarfCommand, err := utils.GetFinalExecutableCommand() kubectlBinPath := "kubectl" if err != nil { - message.Warnf("Unable to get the zarf executable path, falling back to host kubectl: %s", err) l.Warn("unable to get the zarf executable path, falling back to host kubectl", "error", err) } else { kubectlBinPath = fmt.Sprintf("%s tools kubectl", zarfCommand) @@ -184,7 +181,6 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac if err != nil { return nil, err } - message.Debugf("Found %d pods for target %#v", len(podList.Items), target) l.Debug("found pods matching the target", "count", len(podList.Items), "target", target) // Sort the pods from newest to oldest sort.Slice(podList.Items, func(i, j int) bool { @@ -193,7 +189,6 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac readyPods := []corev1.Pod{} for _, pod := range podList.Items { - message.Debugf("Testing pod %q", pod.Name) l.Debug("testing pod", "name", pod.Name) // If an include function is provided, only keep pods that return true @@ -203,7 +198,6 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac // Handle container targeting if target.Container != "" { - message.Debugf("Testing pod %q for container %q", pod.Name, target.Container) l.Debug("testing container", "name", target.Container, "source-pod", pod.Name) // Check the status of initContainers for a running match @@ -226,7 +220,6 @@ func waitForPodsAndContainers(ctx context.Context, clientset kubernetes.Interfac } } else { status := pod.Status.Phase - message.Debugf("Testing pod %q phase, want (%q) got (%q)", pod.Name, corev1.PodRunning, status) l.Debug(fmt.Sprintf("checking pod for %s status", corev1.PodRunning), "pod", pod.Name, "status", status) // Regular status checking without a container if status == corev1.PodRunning { diff --git a/src/pkg/cluster/injector.go b/src/pkg/cluster/injector.go index 400b798c1e..ea4d2d9e72 100644 --- a/src/pkg/cluster/injector.go +++ b/src/pkg/cluster/injector.go @@ -28,7 +28,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/internal/healthchecks" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/transform" "github.com/zarf-dev/zarf/src/pkg/utils" v1ac "k8s.io/client-go/applyconfigurations/core/v1" @@ -44,8 +43,6 @@ func (c *Cluster) StartInjection(ctx context.Context, tmpDir, imagesDir string, return err } - spinner := message.NewProgressSpinner("Attempting to bootstrap the seed image into the cluster") - defer spinner.Stop() l.Info("creating Zarf injector resources") resReq := v1ac.ResourceRequirements(). @@ -62,7 +59,7 @@ func (c *Cluster) StartInjection(ctx context.Context, tmpDir, imagesDir string, return err } - payloadCmNames, shasum, err := c.createPayloadConfigMaps(ctx, spinner, tmpDir, imagesDir, injectorSeedSrcs) + payloadCmNames, shasum, err := c.createPayloadConfigMaps(ctx, tmpDir, imagesDir, injectorSeedSrcs) if err != nil { return fmt.Errorf("unable to generate the injector payload configmaps: %w", err) } @@ -114,7 +111,6 @@ func (c *Cluster) StartInjection(ctx context.Context, tmpDir, imagesDir string, return err } - spinner.Success() l.Debug("done with injection", "duration", time.Since(start)) return nil } @@ -183,7 +179,7 @@ func (c *Cluster) StopInjection(ctx context.Context) error { return nil } -func (c *Cluster) createPayloadConfigMaps(ctx context.Context, spinner *message.Spinner, tmpDir, imagesDir string, injectorSeedSrcs []string) ([]string, string, error) { +func (c *Cluster) createPayloadConfigMaps(ctx context.Context, tmpDir, imagesDir string, injectorSeedSrcs []string) ([]string, string, error) { l := logger.From(ctx) tarPath := filepath.Join(tmpDir, "payload.tar.gz") seedImagesDir := filepath.Join(tmpDir, "seed-images") @@ -233,8 +229,6 @@ func (c *Cluster) createPayloadConfigMaps(ctx context.Context, spinner *message. for i, data := range chunks { fileName := fmt.Sprintf("zarf-payload-%03d", i) - spinner.Updatef("Adding archive binary configmap %d of %d to the cluster", i+1, len(chunks)) - cm := v1ac.ConfigMap(fileName, ZarfNamespaceName). WithLabels(map[string]string{ "zarf-injector": "payload", diff --git a/src/pkg/cluster/namespace.go b/src/pkg/cluster/namespace.go index b94c1a3a61..9c2aa93f46 100644 --- a/src/pkg/cluster/namespace.go +++ b/src/pkg/cluster/namespace.go @@ -14,7 +14,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" corev1 "k8s.io/api/core/v1" v1ac "k8s.io/client-go/applyconfigurations/core/v1" ) @@ -23,8 +22,6 @@ import ( func (c *Cluster) DeleteZarfNamespace(ctx context.Context) error { start := time.Now() l := logger.From(ctx) - spinner := message.NewProgressSpinner("Deleting the zarf namespace from this cluster") - defer spinner.Stop() l.Info("deleting the zarf namespace from this cluster") err := c.Clientset.CoreV1().Namespaces().Delete(ctx, ZarfNamespaceName, metav1.DeleteOptions{}) diff --git a/src/pkg/cluster/secrets.go b/src/pkg/cluster/secrets.go index 6cd716ece2..410e7851e5 100644 --- a/src/pkg/cluster/secrets.go +++ b/src/pkg/cluster/secrets.go @@ -17,7 +17,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/types" ) @@ -95,8 +94,6 @@ func (c *Cluster) GenerateGitPullCreds(namespace, name string, gitServerInfo typ // UpdateZarfManagedImageSecrets updates all Zarf-managed image secrets in all namespaces based on state func (c *Cluster) UpdateZarfManagedImageSecrets(ctx context.Context, state *types.ZarfState) error { l := logger.From(ctx) - spinner := message.NewProgressSpinner("Updating existing Zarf-managed image secrets") - defer spinner.Stop() namespaceList, err := c.Clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) if err != nil { @@ -120,21 +117,17 @@ func (c *Cluster) UpdateZarfManagedImageSecrets(ctx context.Context, state *type return err } l.Info("applying Zarf managed registry secret for namespace", "name", namespace.Name) - spinner.Updatef("Updating existing Zarf-managed image secret for namespace: '%s'", namespace.Name) _, err = c.Clientset.CoreV1().Secrets(*newRegistrySecret.Namespace).Apply(ctx, newRegistrySecret, metav1.ApplyOptions{Force: true, FieldManager: FieldManagerName}) if err != nil { return err } } - spinner.Success() return nil } // UpdateZarfManagedGitSecrets updates all Zarf-managed git secrets in all namespaces based on state func (c *Cluster) UpdateZarfManagedGitSecrets(ctx context.Context, state *types.ZarfState) error { - spinner := message.NewProgressSpinner("Updating existing Zarf-managed git secrets") - defer spinner.Stop() l := logger.From(ctx) namespaceList, err := c.Clientset.CoreV1().Namespaces().List(ctx, metav1.ListOptions{}) @@ -154,15 +147,12 @@ func (c *Cluster) UpdateZarfManagedGitSecrets(ctx context.Context, state *types. continue } newGitSecret := c.GenerateGitPullCreds(namespace.Name, config.ZarfGitServerSecretName, state.GitServer) - spinner.Updatef("Updating existing Zarf-managed git secret for namespace: %s", namespace.Name) l.Info("applying Zarf managed git secret for namespace", "name", namespace.Name) _, err = c.Clientset.CoreV1().Secrets(*newGitSecret.Namespace).Apply(ctx, newGitSecret, metav1.ApplyOptions{Force: true, FieldManager: FieldManagerName}) if err != nil { return err } } - - spinner.Success() return nil } @@ -176,7 +166,6 @@ func (c *Cluster) GetServiceInfoFromRegistryAddress(ctx context.Context, stateRe // If this is an internal service then we need to look it up and svc, port, err := serviceInfoFromNodePortURL(serviceList.Items, stateRegistryAddress) if err != nil { - message.Debugf("registry appears to not be a nodeport service, using original address %q", stateRegistryAddress) logger.From(ctx).Debug("registry appears to not be a nodeport service, using original address", "address", stateRegistryAddress) return stateRegistryAddress, nil } diff --git a/src/pkg/cluster/state.go b/src/pkg/cluster/state.go index 551856db25..4493d29eb6 100644 --- a/src/pkg/cluster/state.go +++ b/src/pkg/cluster/state.go @@ -9,6 +9,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/zarf-dev/zarf/src/pkg/message" "slices" "time" @@ -22,7 +23,6 @@ import ( "github.com/zarf-dev/zarf/src/config" "github.com/zarf-dev/zarf/src/config/lang" "github.com/zarf-dev/zarf/src/pkg/logger" - "github.com/zarf-dev/zarf/src/pkg/message" "github.com/zarf-dev/zarf/src/pkg/pki" "github.com/zarf-dev/zarf/src/types" ) @@ -39,12 +39,9 @@ const ( // InitZarfState initializes the Zarf state with the given temporary directory and init configs. func (c *Cluster) InitZarfState(ctx context.Context, initOptions types.ZarfInitOptions) error { l := logger.From(ctx) - spinner := message.NewProgressSpinner("Gathering cluster state information") - defer spinner.Stop() // Attempt to load an existing state prior to init. // NOTE: We are ignoring the error here because we don't really expect a state to exist yet. - spinner.Updatef("Checking cluster for existing Zarf deployment") l.Debug("checking cluster for existing Zarf deployment") state, err := c.LoadZarfState(ctx) if err != nil && !kerrors.IsNotFound(err) { @@ -54,7 +51,6 @@ func (c *Cluster) InitZarfState(ctx context.Context, initOptions types.ZarfInitO // If state is nil, this is a new cluster. if state == nil { state = &types.ZarfState{} - spinner.Updatef("New cluster, no prior Zarf deployments found") l.Debug("new cluster, no prior Zarf deployments found") if initOptions.ApplianceMode { // If the K3s component is being deployed, skip distro detection. @@ -77,7 +73,6 @@ func (c *Cluster) InitZarfState(ctx context.Context, initOptions types.ZarfInitO } if state.Distro != DistroIsUnknown { - spinner.Updatef("Detected K8s distro %s", state.Distro) l.Debug("Detected K8s distro", "name", state.Distro) } @@ -113,7 +108,6 @@ func (c *Cluster) InitZarfState(ctx context.Context, initOptions types.ZarfInitO } // Try to create the zarf namespace. - spinner.Updatef("Creating the Zarf namespace") l.Debug("creating the Zarf namespace") zarfNamespace := NewZarfManagedApplyNamespace(ZarfNamespaceName) _, err = c.Clientset.CoreV1().Namespaces().Apply(ctx, zarfNamespace, metav1.ApplyOptions{FieldManager: FieldManagerName, Force: true}) @@ -152,18 +146,12 @@ func (c *Cluster) InitZarfState(ctx context.Context, initOptions types.ZarfInitO } else { // TODO (@austinabro321) validate immediately in `zarf init` if these are set and not equal and error out if so if helpers.IsNotZeroAndNotEqual(initOptions.GitServer, state.GitServer) { - message.Warn("Detected a change in Git Server init options on a re-init. Ignoring... To update run:") - message.ZarfCommand("tools update-creds git") l.Warn("ignoring change in git sever init options on re-init, to update run `zarf tools update-creds git`") } if helpers.IsNotZeroAndNotEqual(initOptions.RegistryInfo, state.RegistryInfo) { - message.Warn("Detected a change in Image Registry init options on a re-init. Ignoring... To update run:") - message.ZarfCommand("tools update-creds registry") l.Warn("ignoring change to registry init options on re-init, to update run `zarf tools update-creds registry`") } if helpers.IsNotZeroAndNotEqual(initOptions.ArtifactServer, state.ArtifactServer) { - message.Warn("Detected a change in Artifact Server init options on a re-init. Ignoring... To update run:") - message.ZarfCommand("tools update-creds artifact") l.Warn("ignoring change to registry init options on re-init, to update run `zarf tools update-creds registry`") } } @@ -183,8 +171,6 @@ func (c *Cluster) InitZarfState(ctx context.Context, initOptions types.ZarfInitO state.StorageClass = initOptions.StorageClass } - spinner.Success() - // Save the state back to K8s if err := c.SaveZarfState(ctx, state); err != nil { return fmt.Errorf("unable to save the Zarf state: %w", err) @@ -238,11 +224,6 @@ func (c *Cluster) debugPrintZarfState(ctx context.Context, state *types.ZarfStat // this is a shallow copy, nested pointers WILL NOT be copied oldState := *state sanitized := c.sanitizeZarfState(&oldState) - b, err := json.MarshalIndent(sanitized, "", " ") - if err != nil { - return - } - message.Debugf("ZarfState - %s", string(b)) logger.From(ctx).Debug("cluster.debugPrintZarfState", "state", sanitized) } diff --git a/src/pkg/transform/types.go b/src/pkg/transform/types.go index 89cfaa391e..dbf4922a0f 100644 --- a/src/pkg/transform/types.go +++ b/src/pkg/transform/types.go @@ -4,5 +4,4 @@ package transform // Log is a function that logs a message. -// TODO(mkcp): Remove Log and port over to logger once we remove message. type Log func(string, ...any)