diff --git a/src/cmd/connect.go b/src/cmd/connect.go index 26f012660e..4258279ebf 100644 --- a/src/cmd/connect.go +++ b/src/cmd/connect.go @@ -65,7 +65,7 @@ var connectCmd = &cobra.Command{ } else { spinner.Updatef(lang.CmdConnectEstablishedWeb, tunnel.FullURL()) if err := exec.LaunchURL(tunnel.FullURL()); err != nil { - message.Debug(err) + return err } } diff --git a/src/pkg/cluster/zarf.go b/src/pkg/cluster/zarf.go index 71d6f73c9e..f9ac54ef0c 100644 --- a/src/pkg/cluster/zarf.go +++ b/src/pkg/cluster/zarf.go @@ -179,11 +179,11 @@ func (c *Cluster) RecordPackageDeploymentAndWait(ctx context.Context, pkg types. func (c *Cluster) RecordPackageDeployment(ctx context.Context, pkg types.ZarfPackage, components []types.DeployedComponent, connectStrings types.ConnectStrings, generation int) (deployedPackage *types.DeployedPackage, err error) { packageName := pkg.Metadata.Name - // Attempt to load information about webhooks for the package + // Optionally try to get information about webhooks for the package. var componentWebhooks map[string]map[string]types.Webhook existingPackageSecret, err := c.GetDeployedPackage(ctx, packageName) - if err != nil { - message.Debugf("Unable to fetch existing secret for package '%s': %s", packageName, err.Error()) + if err != nil && !kerrors.IsNotFound(err) { + return nil, err } if existingPackageSecret != nil { componentWebhooks = existingPackageSecret.ComponentWebhooks diff --git a/src/pkg/packager/deploy.go b/src/pkg/packager/deploy.go index 5f2f2f4ab3..a85ffaff6b 100644 --- a/src/pkg/packager/deploy.go +++ b/src/pkg/packager/deploy.go @@ -178,7 +178,7 @@ func (p *Packager) deployComponents(ctx context.Context) (deployedComponents []t // Update the package secret to indicate that we are attempting to deploy this component if p.isConnectedToCluster() { if _, err := p.cluster.RecordPackageDeploymentAndWait(ctx, p.cfg.Pkg, deployedComponents, p.connectStrings, p.generation, component, p.cfg.DeployOpts.SkipWebhooks); err != nil { - message.Debugf("Unable to record package deployment for component %s: this will affect features like `zarf package remove`: %s", component.Name, err.Error()) + return nil, err } } @@ -206,7 +206,7 @@ func (p *Packager) deployComponents(ctx context.Context) (deployedComponents []t deployedComponents[idx].Status = types.ComponentStatusFailed if p.isConnectedToCluster() { if _, err := p.cluster.RecordPackageDeploymentAndWait(ctx, p.cfg.Pkg, deployedComponents, p.connectStrings, p.generation, component, p.cfg.DeployOpts.SkipWebhooks); err != nil { - message.Debugf("Unable to record package deployment for component %q: this will affect features like `zarf package remove`: %s", component.Name, err.Error()) + return nil, err } } @@ -218,7 +218,7 @@ func (p *Packager) deployComponents(ctx context.Context) (deployedComponents []t deployedComponents[idx].Status = types.ComponentStatusSucceeded if p.isConnectedToCluster() { if _, err := p.cluster.RecordPackageDeploymentAndWait(ctx, p.cfg.Pkg, deployedComponents, p.connectStrings, p.generation, component, p.cfg.DeployOpts.SkipWebhooks); err != nil { - message.Debugf("Unable to record package deployment for component %q: this will affect features like `zarf package remove`: %s", component.Name, err.Error()) + return nil, err } } @@ -312,10 +312,9 @@ func (p *Packager) deployComponent(ctx context.Context, component types.ZarfComp // Disable the registry HPA scale down if we are deploying images and it is not already disabled if hasImages && !p.hpaModified && p.state.RegistryInfo.InternalRegistry { if err := p.cluster.DisableRegHPAScaleDown(ctx); err != nil { - message.Debugf("unable to disable the registry HPA scale down: %s", err.Error()) - } else { - p.hpaModified = true + return nil, fmt.Errorf("unable to dsable the registry HPA scale down: %w", err) } + p.hpaModified = true } } @@ -407,7 +406,7 @@ func (p *Packager) processComponentFiles(component types.ZarfComponent, pkgLocat // Check if the file looks like a text file isText, err := helpers.IsTextFile(subFile) if err != nil { - message.Debugf("unable to determine if file %s is a text file: %s", subFile, err) + return err } // If the file is a text file, template it