Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce utils size #1883

Merged
merged 5 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cmd/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/packager"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -50,8 +51,8 @@ var initCmd = &cobra.Command{
pkgConfig.PkgSourcePath = pkgConfig.DeployOpts.PackagePath

// Ensure uppercase keys from viper
viperConfig := utils.TransformMapKeys(v.GetStringMapString(V_PKG_DEPLOY_SET), strings.ToUpper)
pkgConfig.DeployOpts.SetVariables = utils.MergeMap(viperConfig, pkgConfig.DeployOpts.SetVariables)
viperConfig := helpers.TransformMapKeys(v.GetStringMapString(V_PKG_DEPLOY_SET), strings.ToUpper)
pkgConfig.DeployOpts.SetVariables = helpers.MergeMap(viperConfig, pkgConfig.DeployOpts.SetVariables)

// Configure the packager
pkgClient := packager.NewOrDie(&pkgConfig)
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/defenseunicorns/zarf/src/internal/packager/git"
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
Expand Down Expand Up @@ -185,7 +186,7 @@ var computeCrc32 = &cobra.Command{
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
text := args[0]
hash := utils.GetCRCHash(text)
hash := helpers.GetCRCHash(text)
fmt.Printf("%d\n", hash)
},
}
Expand Down
11 changes: 6 additions & 5 deletions src/cmd/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/defenseunicorns/zarf/src/config/lang"
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/pterm/pterm"
"oras.land/oras-go/v2/registry"

Expand Down Expand Up @@ -55,8 +56,8 @@ var packageCreateCmd = &cobra.Command{
}

// Ensure uppercase keys from viper
viperConfig := utils.TransformMapKeys(v.GetStringMapString(V_PKG_CREATE_SET), strings.ToUpper)
pkgConfig.CreateOpts.SetVariables = utils.MergeMap(viperConfig, pkgConfig.CreateOpts.SetVariables)
viperConfig := helpers.TransformMapKeys(v.GetStringMapString(V_PKG_CREATE_SET), strings.ToUpper)
pkgConfig.CreateOpts.SetVariables = helpers.MergeMap(viperConfig, pkgConfig.CreateOpts.SetVariables)

// Configure the packager
pkgClient := packager.NewOrDie(&pkgConfig)
Expand All @@ -79,11 +80,11 @@ var packageDeployCmd = &cobra.Command{
pkgConfig.DeployOpts.PackagePath = choosePackage(args)

// Ensure uppercase keys from viper and CLI --set
viperConfigSetVariables := utils.TransformMapKeys(v.GetStringMapString(V_PKG_DEPLOY_SET), strings.ToUpper)
pkgConfig.DeployOpts.SetVariables = utils.TransformMapKeys(pkgConfig.DeployOpts.SetVariables, strings.ToUpper)
viperConfigSetVariables := helpers.TransformMapKeys(v.GetStringMapString(V_PKG_DEPLOY_SET), strings.ToUpper)
pkgConfig.DeployOpts.SetVariables = helpers.TransformMapKeys(pkgConfig.DeployOpts.SetVariables, strings.ToUpper)

// Merge the viper config file variables and provided CLI flag variables (CLI takes precedence))
pkgConfig.DeployOpts.SetVariables = utils.MergeMap(viperConfigSetVariables, pkgConfig.DeployOpts.SetVariables)
pkgConfig.DeployOpts.SetVariables = helpers.MergeMap(viperConfigSetVariables, pkgConfig.DeployOpts.SetVariables)

pkgConfig.PkgSourcePath = pkgConfig.DeployOpts.PackagePath

Expand Down
9 changes: 5 additions & 4 deletions src/cmd/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/defenseunicorns/zarf/src/pkg/packager"
"github.com/defenseunicorns/zarf/src/pkg/transform"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -45,7 +46,7 @@ var prepareTransformGitLinks = &cobra.Command{

// Perform git url transformation via regex
text := string(content)
processedText := transform.MutateGitURLsInText(pkgConfig.InitOpts.GitServer.Address, text, pkgConfig.InitOpts.GitServer.PushUsername)
processedText := transform.MutateGitURLsInText(message.Warnf, pkgConfig.InitOpts.GitServer.Address, text, pkgConfig.InitOpts.GitServer.PushUsername)

// Print the differences
message.PrintDiff(text, processedText)
Expand Down Expand Up @@ -77,7 +78,7 @@ var prepareComputeFileSha256sum = &cobra.Command{
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
fileName := args[0]
hash, err := utils.GetCryptoHash(fileName, crypto.SHA256)
hash, err := utils.GetCryptoHashFromFile(fileName, crypto.SHA256)
if err != nil {
message.Fatal(err, lang.CmdPrepareSha256sumHashErr)
} else {
Expand All @@ -101,8 +102,8 @@ var prepareFindImages = &cobra.Command{
}

// Ensure uppercase keys from viper
viperConfig := utils.TransformMapKeys(v.GetStringMapString(V_PKG_CREATE_SET), strings.ToUpper)
pkgConfig.CreateOpts.SetVariables = utils.MergeMap(viperConfig, pkgConfig.CreateOpts.SetVariables)
viperConfig := helpers.TransformMapKeys(v.GetStringMapString(V_PKG_CREATE_SET), strings.ToUpper)
pkgConfig.CreateOpts.SetVariables = helpers.MergeMap(viperConfig, pkgConfig.CreateOpts.SetVariables)

// Configure the packager
pkgClient := packager.NewOrDie(&pkgConfig)
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/tools/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/defenseunicorns/zarf/src/config"
"github.com/defenseunicorns/zarf/src/config/lang"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -61,7 +61,7 @@ func CheckVendorOnlyFromPath(cmd *cobra.Command) bool {
func isVendorCmd(args []string, vendoredCmds []string) bool {
if len(args) > 2 {
if args[1] == "tools" || args[1] == "t" {
if utils.SliceContains(vendoredCmds, args[2]) {
if helpers.SliceContains(vendoredCmds, args[2]) {
return true
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/extensions/bigbang/bigbang.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/defenseunicorns/zarf/src/internal/packager/helm"
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
"github.com/defenseunicorns/zarf/src/types/extensions"
fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1"
Expand Down Expand Up @@ -231,7 +232,7 @@ func Run(YOLO bool, tmpPaths types.ComponentPaths, c types.ZarfComponent) (types
}

// Make sure the list of images is unique.
c.Images = utils.Unique(c.Images)
c.Images = helpers.Unique(c.Images)
}

// Create the flux wrapper around Big Bang for deployment.
Expand Down
3 changes: 2 additions & 1 deletion src/extensions/bigbang/flux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/defenseunicorns/zarf/src/internal/packager/kustomize"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
"github.com/defenseunicorns/zarf/src/types/extensions"
fluxHelmCtrl "github.com/fluxcd/helm-controller/api/v2beta1"
Expand Down Expand Up @@ -149,7 +150,7 @@ func composeValues(hr HelmReleaseDependency, secrets map[string]corev1.Secret, c
return nil, fmt.Errorf("unable to read values from key '%s' in %s '%s': %w", v.GetValuesKey(), v.Kind, hr.Name(), err)
}

valuesMap = utils.MergeMapRecursive(valuesMap, values)
valuesMap = helpers.MergeMapRecursive(valuesMap, values)
}

return valuesMap, nil
Expand Down
3 changes: 2 additions & 1 deletion src/internal/cluster/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/exec"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/portforward"
"k8s.io/client-go/transport/spdy"
Expand Down Expand Up @@ -167,7 +168,7 @@ func ServiceInfoFromServiceURL(serviceURL string) (*ServiceInfo, error) {

// Match hostname against local cluster service format.
pattern := regexp.MustCompile(serviceURLPattern)
get, err := utils.MatchRegex(pattern, parsedURL.Hostname())
get, err := helpers.MatchRegex(pattern, parsedURL.Hostname())

// If incomplete match, return an error.
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/packager/git/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (g *Git) prepRepoForPush() (*git.Repository, error) {
if err != nil {
return nil, fmt.Errorf("unable to transform the git url: %w", err)
}

message.Debugf("Rewrite git URL: %s -> %s", remoteURL, targetURL.String())
// Remove any preexisting offlineRemotes (happens when a retry is triggered)
_ = repo.DeleteRemote(offlineRemoteName)

Expand Down
4 changes: 2 additions & 2 deletions src/internal/packager/helm/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package helm

import (
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/goccy/go-yaml"
"helm.sh/helm/v3/pkg/chart/loader"
"helm.sh/helm/v3/pkg/chartutil"
Expand All @@ -27,7 +27,7 @@ func FindAnnotatedImagesForChart(chartPath string, values chartutil.Values) (ima
if err != nil {
return images, err
}
values = utils.MergeMapRecursive(chart.Values, values)
values = helpers.MergeMapRecursive(chart.Values, values)

imageAnnotation := chart.Metadata.Annotations["helm.sh/images"]

Expand Down
4 changes: 2 additions & 2 deletions src/pkg/oci/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package oci
import (
"path/filepath"

"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

Expand All @@ -34,7 +34,7 @@ func NewZarfOCIManifest(manifest *ocispec.Manifest) *ZarfOCIManifest {

// Locate returns the descriptor for the layer with the given path.
func (m *ZarfOCIManifest) Locate(path string) ocispec.Descriptor {
return utils.Find(m.Layers, func(layer ocispec.Descriptor) bool {
return helpers.Find(m.Layers, func(layer ocispec.Descriptor) bool {
return layer.Annotations[ocispec.AnnotationTitle] == path
})
}
Expand Down
9 changes: 5 additions & 4 deletions src/pkg/oci/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/defenseunicorns/zarf/src/config"
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pterm/pterm"
Expand Down Expand Up @@ -60,7 +61,7 @@ func (o *OrasRemote) LayersFromRequestedComponents(requestedComponents []string)
images := map[string]bool{}
tarballFormat := "%s.tar"
for _, name := range requestedComponents {
component := utils.Find(pkg.Components, func(component types.ZarfComponent) bool {
component := helpers.Find(pkg.Components, func(component types.ZarfComponent) bool {
return component.Name == name
})
if component.Name == "" {
Expand All @@ -69,7 +70,7 @@ func (o *OrasRemote) LayersFromRequestedComponents(requestedComponents []string)
}
for _, component := range pkg.Components {
// If we requested this component, or it is required, we need to pull its images and tarball
if utils.SliceContains(requestedComponents, component.Name) || component.Required {
if helpers.SliceContains(requestedComponents, component.Name) || component.Required {
for _, image := range component.Images {
images[image] = true
}
Expand All @@ -91,7 +92,7 @@ func (o *OrasRemote) LayersFromRequestedComponents(requestedComponents []string)
return nil, err
}
for image := range images {
manifestDescriptor := utils.Find(index.Manifests, func(layer ocispec.Descriptor) bool {
manifestDescriptor := helpers.Find(index.Manifests, func(layer ocispec.Descriptor) bool {
return layer.Annotations[ocispec.AnnotationBaseImageName] == image
})
manifest, err := o.FetchManifest(manifestDescriptor)
Expand Down Expand Up @@ -167,7 +168,7 @@ func (o *OrasRemote) PullPackage(destinationDir string, concurrency int, layersT
}
var ret []ocispec.Descriptor
for _, node := range nodes {
if utils.SliceContains(paths, node.Annotations[ocispec.AnnotationTitle]) {
if helpers.SliceContains(paths, node.Annotations[ocispec.AnnotationTitle]) {
ret = append(ret, node)
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/pkg/packager/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/exec"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
)

Expand Down Expand Up @@ -212,7 +213,7 @@ func actionCmdMutation(cmd string, shellPref types.ZarfComponentActionShell) (st
// Convert any ${ZARF_VAR_*} or $ZARF_VAR_* to ${env:ZARF_VAR_*} or $env:ZARF_VAR_* respectively (also TF_VAR_*).
// https://regex101.com/r/xk1rkw/1
envVarRegex := regexp.MustCompile(`(?P<envIndicator>\${?(?P<varName>(ZARF|TF)_VAR_([a-zA-Z0-9_-])+)}?)`)
get, err := utils.MatchRegex(envVarRegex, cmd)
get, err := helpers.MatchRegex(envVarRegex, cmd)
if err == nil {
newCmd := strings.ReplaceAll(cmd, get("envIndicator"), fmt.Sprintf("$Env:%s", get("varName")))
message.Debugf("Converted command \"%s\" to \"%s\" t", cmd, newCmd)
Expand Down
5 changes: 3 additions & 2 deletions src/pkg/packager/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/defenseunicorns/zarf/src/config"
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
)

// validatePackageChecksums validates the checksums of a Zarf package.
Expand All @@ -37,7 +38,7 @@ func (p *Packager) validatePackageChecksums(baseDir string, aggregateChecksum st

isPartial := false
if len(pathsToCheck) > 0 {
pathsToCheck = utils.Unique(pathsToCheck)
pathsToCheck = helpers.Unique(pathsToCheck)
isPartial = true
message.Debugf("Validating checksums for a subset of files in the package - %v", pathsToCheck)
for idx, path := range pathsToCheck {
Expand Down Expand Up @@ -78,7 +79,7 @@ func (p *Packager) validatePackageChecksums(baseDir string, aggregateChecksum st
if utils.InvalidPath(path) {
if !isPartial && !checkedMap[path] {
return fmt.Errorf("unable to validate checksums - missing file: %s", rel)
} else if utils.SliceContains(pathsToCheck, path) {
} else if helpers.SliceContains(pathsToCheck, path) {
return fmt.Errorf("unable to validate partial checksums - missing file: %s", rel)
}
// it's okay if we're doing a partial check and the file isn't there as long as the path isn't in the list of paths to check
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/packager/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func (p *Packager) handleIfPartialPkg() error {
}

var shasum string
if shasum, err = utils.GetCryptoHash(destination, crypto.SHA256); err != nil {
if shasum, err = utils.GetCryptoHashFromFile(destination, crypto.SHA256); err != nil {
return fmt.Errorf("unable to get sha256sum of package: %w", err)
}

Expand Down
7 changes: 4 additions & 3 deletions src/pkg/packager/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/defenseunicorns/zarf/src/pkg/oci"
"github.com/defenseunicorns/zarf/src/pkg/transform"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
"github.com/go-git/go-git/v5/plumbing"
"github.com/mholt/archiver/v3"
Expand Down Expand Up @@ -157,7 +158,7 @@ func (p *Packager) Create(baseDir string) error {
}
}

imgList := utils.Unique(combinedImageList)
imgList := helpers.Unique(combinedImageList)

// Images are handled separately from other component assets.
if len(imgList) > 0 {
Expand All @@ -175,7 +176,7 @@ func (p *Packager) Create(baseDir string) error {
return imgConfig.PullAll()
}

if err := utils.Retry(doPull, 3, 5*time.Second); err != nil {
if err := helpers.Retry(doPull, 3, 5*time.Second); err != nil {
return fmt.Errorf("unable to pull images after 3 attempts: %w", err)
}
}
Expand Down Expand Up @@ -403,7 +404,7 @@ func (p *Packager) addComponent(index int, component types.ZarfComponent, isSkel

// Abort packaging on invalid shasum (if one is specified).
if file.Shasum != "" {
if actualShasum, _ := utils.GetCryptoHash(dst, crypto.SHA256); actualShasum != file.Shasum {
if actualShasum, _ := utils.GetCryptoHashFromFile(dst, crypto.SHA256); actualShasum != file.Shasum {
return fmt.Errorf("shasum mismatch for file %s: expected %s, got %s", file.Source, file.Shasum, actualShasum)
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/pkg/packager/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/defenseunicorns/zarf/src/internal/packager/template"
"github.com/defenseunicorns/zarf/src/pkg/message"
"github.com/defenseunicorns/zarf/src/pkg/utils"
"github.com/defenseunicorns/zarf/src/pkg/utils/helpers"
"github.com/defenseunicorns/zarf/src/types"
"github.com/pterm/pterm"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -315,7 +316,7 @@ func (p *Packager) processComponentFiles(component types.ZarfComponent, pkgLocat
// If a shasum is specified check it again on deployment as well
if file.Shasum != "" {
spinner.Updatef("Validating SHASUM for %s", file.Target)
if shasum, _ := utils.GetCryptoHash(fileLocation, crypto.SHA256); shasum != file.Shasum {
if shasum, _ := utils.GetCryptoHashFromFile(fileLocation, crypto.SHA256); shasum != file.Shasum {
return fmt.Errorf("shasum mismatch for file %s: expected %s, got %s", file.Source, file.Shasum, shasum)
}
}
Expand Down Expand Up @@ -448,7 +449,7 @@ func (p *Packager) pushImagesToRegistry(componentImages []string, noImgChecksum
Architectures: []string{p.cfg.Pkg.Metadata.Architecture, p.cfg.Pkg.Build.Architecture},
}

return utils.Retry(func() error {
return helpers.Retry(func() error {
return imgConfig.PushToZarfRegistry()
}, 3, 5*time.Second)
}
Expand Down Expand Up @@ -480,7 +481,7 @@ func (p *Packager) pushReposToRepository(reposPath string, repos []string) error
}

// Try repo push up to 3 times
if err := utils.Retry(tryPush, 3, 5*time.Second); err != nil {
if err := helpers.Retry(tryPush, 3, 5*time.Second); err != nil {
return fmt.Errorf("unable to push repo %s to the Git Server: %w", repoURL, err)
}
}
Expand Down
Loading