From 46ca4a1fcc90d6ad187e2be44fbebf334b6fba13 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 17:47:59 -0500 Subject: [PATCH] fix(deps): update module github.com/defenseunicorns/pkg/oci to v1 (#2511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [github.com/defenseunicorns/pkg/oci](https://togithub.com/defenseunicorns/pkg) | `v0.0.1` -> `v1.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fdefenseunicorns%2fpkg%2foci/v1.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fdefenseunicorns%2fpkg%2foci/v1.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fdefenseunicorns%2fpkg%2foci/v0.0.1/v1.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fdefenseunicorns%2fpkg%2foci/v0.0.1/v1.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/defenseunicorns/zarf). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lucas Rodriguez Signed-off-by: Austin Abro --- go.mod | 7 ++- go.sum | 8 +-- src/cmd/destroy.go | 2 +- src/cmd/dev.go | 2 +- src/cmd/initialize.go | 2 +- src/cmd/internal.go | 2 +- src/cmd/package.go | 2 +- src/cmd/tools/helm/repo_add.go | 2 +- src/cmd/tools/helm/repo_index.go | 2 +- src/cmd/tools/helm/repo_remove.go | 2 +- src/cmd/tools/zarf.go | 2 +- src/extensions/bigbang/bigbang.go | 2 +- src/extensions/bigbang/flux.go | 2 +- .../agent/hooks/argocd-application.go | 2 +- src/internal/agent/hooks/argocd-repository.go | 2 +- src/internal/agent/hooks/flux.go | 2 +- src/internal/packager/helm/chart.go | 2 +- src/internal/packager/helm/images.go | 2 +- src/internal/packager/helm/post-render.go | 2 +- src/internal/packager/helm/repo.go | 2 +- src/internal/packager/helm/utils.go | 2 +- src/internal/packager/images/common.go | 2 +- src/internal/packager/images/pull.go | 2 +- src/internal/packager/images/push.go | 6 +-- src/internal/packager/kustomize/build.go | 2 +- src/internal/packager/sbom/catalog.go | 2 +- src/internal/packager/template/template.go | 2 +- src/pkg/cluster/data.go | 2 +- src/pkg/cluster/injector.go | 2 +- src/pkg/cluster/state.go | 2 +- src/pkg/cluster/state_test.go | 2 +- src/pkg/cluster/tunnel.go | 2 +- src/pkg/k8s/tunnel.go | 2 +- src/pkg/layout/component.go | 2 +- src/pkg/layout/package.go | 2 +- src/pkg/layout/sbom.go | 2 +- src/pkg/message/message.go | 2 +- src/pkg/message/progress.go | 51 +++++++++++-------- src/pkg/packager/actions/actions.go | 2 +- src/pkg/packager/composer/list.go | 2 +- src/pkg/packager/composer/oci.go | 2 +- src/pkg/packager/composer/pathfixer.go | 2 +- src/pkg/packager/create.go | 2 +- src/pkg/packager/creator/normal.go | 2 +- src/pkg/packager/creator/skeleton.go | 2 +- src/pkg/packager/deploy.go | 2 +- src/pkg/packager/dev.go | 2 +- src/pkg/packager/filters/deploy.go | 2 +- src/pkg/packager/filters/deploy_test.go | 2 +- src/pkg/packager/filters/select.go | 2 +- src/pkg/packager/generate.go | 2 +- src/pkg/packager/inspect.go | 2 +- src/pkg/packager/interactive.go | 2 +- src/pkg/packager/lint/lint.go | 2 +- src/pkg/packager/lint/validator.go | 2 +- src/pkg/packager/prepare.go | 2 +- src/pkg/packager/publish.go | 2 +- src/pkg/packager/remove.go | 2 +- src/pkg/packager/sources/cluster.go | 2 +- src/pkg/packager/sources/new.go | 2 +- src/pkg/packager/sources/split.go | 2 +- src/pkg/packager/sources/tarball.go | 2 +- src/pkg/packager/sources/url.go | 2 +- src/pkg/packager/sources/utils.go | 2 +- src/pkg/packager/sources/validate.go | 2 +- src/pkg/pki/pki.go | 2 +- src/pkg/transform/artifact.go | 2 +- src/pkg/transform/git.go | 2 +- src/pkg/transform/image.go | 2 +- src/pkg/utils/bytes.go | 6 ++- src/pkg/utils/cosign.go | 2 +- src/pkg/utils/image.go | 2 +- src/pkg/utils/io.go | 6 +-- src/pkg/utils/network.go | 4 +- src/pkg/utils/network_test.go | 2 +- src/pkg/variables/templates.go | 2 +- src/pkg/zoci/copier.go | 2 +- src/pkg/zoci/pull.go | 2 +- src/pkg/zoci/push.go | 4 +- src/pkg/zoci/utils.go | 2 +- src/test/common.go | 2 +- src/test/e2e/00_use_cli_test.go | 2 +- src/test/e2e/05_tarball_test.go | 2 +- src/test/e2e/51_oci_compose_test.go | 2 +- src/test/external/ext_out_cluster_test.go | 2 +- src/types/k8s.go | 2 +- src/types/validate.go | 2 +- src/types/validate_test.go | 2 +- 88 files changed, 130 insertions(+), 122 deletions(-) diff --git a/go.mod b/go.mod index 137284437c..cc839e69ef 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/anchore/clio v0.0.0-20240408173007-3c4abf89e72f github.com/anchore/stereoscope v0.0.1 github.com/anchore/syft v0.100.0 - github.com/defenseunicorns/pkg/helpers v1.1.1 - github.com/defenseunicorns/pkg/oci v0.0.1 + github.com/defenseunicorns/pkg/helpers/v2 v2.0.1 + github.com/defenseunicorns/pkg/oci v1.0.1 github.com/derailed/k9s v0.31.7 github.com/distribution/reference v0.5.0 github.com/fairwindsops/pluto/v5 v5.18.4 @@ -61,8 +61,6 @@ require ( sigs.k8s.io/yaml v1.4.0 ) -require cuelang.org/go v0.7.0 // indirect - require ( atomicgo.dev/cursor v0.2.0 // indirect atomicgo.dev/keyboard v0.2.9 // indirect @@ -76,6 +74,7 @@ require ( cloud.google.com/go/longrunning v0.5.7 // indirect cloud.google.com/go/storage v1.41.0 // indirect cuelabs.dev/go/oci/ociregistry v0.0.0-20231103182354-93e78c079a13 // indirect + cuelang.org/go v0.7.0 // indirect dario.cat/mergo v1.0.0 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect diff --git a/go.sum b/go.sum index cb92210e44..8b31775074 100644 --- a/go.sum +++ b/go.sum @@ -597,10 +597,10 @@ github.com/daviddengcn/go-colortext v1.0.0 h1:ANqDyC0ys6qCSvuEK7l3g5RaehL/Xck9EX github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c= github.com/defenseunicorns/gojsonschema v0.0.0-20231116163348-e00f069122d6 h1:gwevOZ0fxT2nzM9hrtdPbsiOHjFqDRIYMzJHba3/G6Q= github.com/defenseunicorns/gojsonschema v0.0.0-20231116163348-e00f069122d6/go.mod h1:StKLYMmPj1R5yIs6CK49EkcW1TvUYuw5Vri+LRk7Dy8= -github.com/defenseunicorns/pkg/helpers v1.1.1 h1:p3pKeK5SeFaoZUJZIX9sEsJqX1CGGMS8OpQMPgJtSqM= -github.com/defenseunicorns/pkg/helpers v1.1.1/go.mod h1:F4S5VZLDrlNWQKklzv4v9tFWjjZNhxJ1gT79j4XiLwk= -github.com/defenseunicorns/pkg/oci v0.0.1 h1:EFRp3NeiwzhOWKpQ6mAxi0l9chnrAvDcIgjMr0o0fkM= -github.com/defenseunicorns/pkg/oci v0.0.1/go.mod h1:zVBgRjckEAhfdvbnQrnfOP/3M/GYJkIgWtJtY7pjYdo= +github.com/defenseunicorns/pkg/helpers/v2 v2.0.1 h1:j08rz9vhyD9Bs+yKiyQMY2tSSejXRMxTqEObZ5M1Wbk= +github.com/defenseunicorns/pkg/helpers/v2 v2.0.1/go.mod h1:u1PAqOICZyiGIVA2v28g55bQH1GiAt0Bc4U9/rnWQvQ= +github.com/defenseunicorns/pkg/oci v1.0.1 h1:WPrWRrae1L19X1vuhy6yYMR2zrTzgBbJHp3ImgUm4ZM= +github.com/defenseunicorns/pkg/oci v1.0.1/go.mod h1:qZ3up/d0P81taW37fKR4lb19jJhQZJVtNOEJMu00dHQ= github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da h1:ZOjWpVsFZ06eIhnh4mkaceTiVoktdU67+M7KDHJ268M= github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da/go.mod h1:B3tI9iGHi4imdLi4Asdha1Sc6feLMTfPLXh9IUYmysk= github.com/depcheck-test/depcheck-test v0.0.0-20220607135614-199033aaa936 h1:foGzavPWwtoyBvjWyKJYDYsyzy+23iBV7NKTwdk+LRY= diff --git a/src/cmd/destroy.go b/src/cmd/destroy.go index 429aec2c16..0034186089 100644 --- a/src/cmd/destroy.go +++ b/src/cmd/destroy.go @@ -9,7 +9,7 @@ import ( "os" "regexp" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/cmd/common" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" diff --git a/src/cmd/dev.go b/src/cmd/dev.go index 4d47f59c59..7ee2b4b2b7 100644 --- a/src/cmd/dev.go +++ b/src/cmd/dev.go @@ -12,7 +12,7 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/cmd/common" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" diff --git a/src/cmd/initialize.go b/src/cmd/initialize.go index b41c3ca8d9..7673be27c4 100644 --- a/src/cmd/initialize.go +++ b/src/cmd/initialize.go @@ -13,7 +13,7 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/cmd/common" "github.com/defenseunicorns/zarf/src/config" diff --git a/src/cmd/internal.go b/src/cmd/internal.go index 59c1981b0a..ceca2d612e 100644 --- a/src/cmd/internal.go +++ b/src/cmd/internal.go @@ -11,7 +11,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/cmd/common" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/internal/agent" diff --git a/src/cmd/package.go b/src/cmd/package.go index a62f11e1c7..c6ac07e698 100644 --- a/src/cmd/package.go +++ b/src/cmd/package.go @@ -19,7 +19,7 @@ import ( "oras.land/oras-go/v2/registry" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/defenseunicorns/zarf/src/pkg/packager" diff --git a/src/cmd/tools/helm/repo_add.go b/src/cmd/tools/helm/repo_add.go index 114cd020f5..5bbca44356 100644 --- a/src/cmd/tools/helm/repo_add.go +++ b/src/cmd/tools/helm/repo_add.go @@ -30,7 +30,7 @@ import ( "strings" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/gofrs/flock" diff --git a/src/cmd/tools/helm/repo_index.go b/src/cmd/tools/helm/repo_index.go index 1d6182e85e..ddccb7b46e 100644 --- a/src/cmd/tools/helm/repo_index.go +++ b/src/cmd/tools/helm/repo_index.go @@ -26,7 +26,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/pkg/errors" "github.com/spf13/cobra" diff --git a/src/cmd/tools/helm/repo_remove.go b/src/cmd/tools/helm/repo_remove.go index 00f5cd45d4..6decbadf64 100644 --- a/src/cmd/tools/helm/repo_remove.go +++ b/src/cmd/tools/helm/repo_remove.go @@ -27,7 +27,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/pkg/errors" "github.com/spf13/cobra" diff --git a/src/cmd/tools/zarf.go b/src/cmd/tools/zarf.go index bab8eb17a5..243bc74027 100644 --- a/src/cmd/tools/zarf.go +++ b/src/cmd/tools/zarf.go @@ -13,7 +13,7 @@ import ( "github.com/sigstore/cosign/v2/pkg/cosign" "github.com/spf13/cobra" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/cmd/common" diff --git a/src/extensions/bigbang/bigbang.go b/src/extensions/bigbang/bigbang.go index e71954f7d0..b89b61f460 100644 --- a/src/extensions/bigbang/bigbang.go +++ b/src/extensions/bigbang/bigbang.go @@ -13,7 +13,7 @@ import ( "time" "github.com/Masterminds/semver/v3" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/internal/packager/helm" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/extensions/bigbang/flux.go b/src/extensions/bigbang/flux.go index 6b7f8ebc6e..e67129c07c 100644 --- a/src/extensions/bigbang/flux.go +++ b/src/extensions/bigbang/flux.go @@ -10,7 +10,7 @@ import ( "path" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/internal/packager/kustomize" "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/defenseunicorns/zarf/src/types" diff --git a/src/internal/agent/hooks/argocd-application.go b/src/internal/agent/hooks/argocd-application.go index 0e037fbb00..a09b6d003f 100644 --- a/src/internal/agent/hooks/argocd-application.go +++ b/src/internal/agent/hooks/argocd-application.go @@ -9,7 +9,7 @@ import ( "encoding/json" "fmt" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/internal/agent/operations" "github.com/defenseunicorns/zarf/src/pkg/cluster" diff --git a/src/internal/agent/hooks/argocd-repository.go b/src/internal/agent/hooks/argocd-repository.go index 53d96af44b..40506a395f 100644 --- a/src/internal/agent/hooks/argocd-repository.go +++ b/src/internal/agent/hooks/argocd-repository.go @@ -10,7 +10,7 @@ import ( "encoding/json" "fmt" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/internal/agent/operations" "github.com/defenseunicorns/zarf/src/pkg/cluster" diff --git a/src/internal/agent/hooks/flux.go b/src/internal/agent/hooks/flux.go index 77382aecf3..2638da0b5b 100644 --- a/src/internal/agent/hooks/flux.go +++ b/src/internal/agent/hooks/flux.go @@ -9,7 +9,7 @@ import ( "encoding/json" "fmt" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/internal/agent/operations" diff --git a/src/internal/packager/helm/chart.go b/src/internal/packager/helm/chart.go index 3f0fc1ac8d..0ff647b60a 100644 --- a/src/internal/packager/helm/chart.go +++ b/src/internal/packager/helm/chart.go @@ -22,7 +22,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/yaml" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/internal/packager/helm/images.go b/src/internal/packager/helm/images.go index dbe4d051ac..447aefc780 100644 --- a/src/internal/packager/helm/images.go +++ b/src/internal/packager/helm/images.go @@ -4,7 +4,7 @@ package helm import ( - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/goccy/go-yaml" "helm.sh/helm/v3/pkg/chart/loader" diff --git a/src/internal/packager/helm/post-render.go b/src/internal/packager/helm/post-render.go index f4789fdcca..0a44acd06b 100644 --- a/src/internal/packager/helm/post-render.go +++ b/src/internal/packager/helm/post-render.go @@ -13,7 +13,7 @@ import ( "reflect" "slices" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/internal/packager/helm/repo.go b/src/internal/packager/helm/repo.go index 97582a64b9..245625c787 100644 --- a/src/internal/packager/helm/repo.go +++ b/src/internal/packager/helm/repo.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/internal/packager/git" diff --git a/src/internal/packager/helm/utils.go b/src/internal/packager/helm/utils.go index 2f3b11035a..4f6119de8e 100644 --- a/src/internal/packager/helm/utils.go +++ b/src/internal/packager/helm/utils.go @@ -7,7 +7,7 @@ package helm import ( "fmt" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/message" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" diff --git a/src/internal/packager/images/common.go b/src/internal/packager/images/common.go index 9fca5c0a0c..8efb18f12d 100644 --- a/src/internal/packager/images/common.go +++ b/src/internal/packager/images/common.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/transform" diff --git a/src/internal/packager/images/pull.go b/src/internal/packager/images/pull.go index 9063075879..11cc686239 100644 --- a/src/internal/packager/images/pull.go +++ b/src/internal/packager/images/pull.go @@ -18,7 +18,7 @@ import ( "sync/atomic" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/internal/packager/images/push.go b/src/internal/packager/images/push.go index e9a3645335..84a00a2455 100644 --- a/src/internal/packager/images/push.go +++ b/src/internal/packager/images/push.go @@ -9,7 +9,7 @@ import ( "fmt" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/defenseunicorns/zarf/src/pkg/k8s" "github.com/defenseunicorns/zarf/src/pkg/message" @@ -53,7 +53,7 @@ func Push(ctx context.Context, cfg PushConfig) error { ) progress := message.NewProgressBar(totalSize, fmt.Sprintf("Pushing %d images", len(toPush))) - defer progress.Stop() + defer progress.Close() if err := helpers.Retry(func() error { c, _ := cluster.NewCluster() @@ -86,7 +86,7 @@ func Push(ctx context.Context, cfg PushConfig) error { }() for refInfo, img := range toPush { refTruncated := helpers.Truncate(refInfo.Reference, 55, true) - progress.UpdateTitle(fmt.Sprintf("Pushing %s", refTruncated)) + progress.Updatef(fmt.Sprintf("Pushing %s", refTruncated)) size, err := calcImgSize(img) if err != nil { diff --git a/src/internal/packager/kustomize/build.go b/src/internal/packager/kustomize/build.go index 29f05281e0..8b640b905a 100644 --- a/src/internal/packager/kustomize/build.go +++ b/src/internal/packager/kustomize/build.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "sigs.k8s.io/kustomize/api/krusty" krustytypes "sigs.k8s.io/kustomize/api/types" "sigs.k8s.io/kustomize/kyaml/filesys" diff --git a/src/internal/packager/sbom/catalog.go b/src/internal/packager/sbom/catalog.go index 3fba53bb2d..2843791e3f 100755 --- a/src/internal/packager/sbom/catalog.go +++ b/src/internal/packager/sbom/catalog.go @@ -23,7 +23,7 @@ import ( "github.com/anchore/syft/syft/pkg/cataloger" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/internal/packager/template/template.go b/src/internal/packager/template/template.go index 20f0d42af4..ad7ee64f11 100644 --- a/src/internal/packager/template/template.go +++ b/src/internal/packager/template/template.go @@ -12,7 +12,7 @@ import ( "github.com/defenseunicorns/zarf/src/types" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/interactive" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/cluster/data.go b/src/pkg/cluster/data.go index 0c5e526536..9b52b934ab 100644 --- a/src/pkg/cluster/data.go +++ b/src/pkg/cluster/data.go @@ -13,7 +13,7 @@ import ( "strings" "sync" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/k8s" "github.com/defenseunicorns/zarf/src/pkg/layout" diff --git a/src/pkg/cluster/injector.go b/src/pkg/cluster/injector.go index 3412553d29..8342315a3e 100644 --- a/src/pkg/cluster/injector.go +++ b/src/pkg/cluster/injector.go @@ -13,7 +13,7 @@ import ( "regexp" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/k8s" "github.com/defenseunicorns/zarf/src/pkg/layout" diff --git a/src/pkg/cluster/state.go b/src/pkg/cluster/state.go index 03ac17e32c..ba0cf0ee95 100644 --- a/src/pkg/cluster/state.go +++ b/src/pkg/cluster/state.go @@ -16,7 +16,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/pkg/k8s" diff --git a/src/pkg/cluster/state_test.go b/src/pkg/cluster/state_test.go index e056aab5f4..7259daa884 100644 --- a/src/pkg/cluster/state_test.go +++ b/src/pkg/cluster/state_test.go @@ -15,7 +15,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/k8s" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/cluster/tunnel.go b/src/pkg/cluster/tunnel.go index 122a57abf4..113779671b 100644 --- a/src/pkg/cluster/tunnel.go +++ b/src/pkg/cluster/tunnel.go @@ -14,7 +14,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/k8s" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/k8s/tunnel.go b/src/pkg/k8s/tunnel.go index 7b890d2e20..a2e5f25db9 100644 --- a/src/pkg/k8s/tunnel.go +++ b/src/pkg/k8s/tunnel.go @@ -18,7 +18,7 @@ import ( "k8s.io/client-go/tools/portforward" "k8s.io/client-go/transport/spdy" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" ) // Global lock to synchronize port selections. diff --git a/src/pkg/layout/component.go b/src/pkg/layout/component.go index e8da0de72a..c933fce6f6 100644 --- a/src/pkg/layout/component.go +++ b/src/pkg/layout/component.go @@ -10,7 +10,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/types" "github.com/mholt/archiver/v3" diff --git a/src/pkg/layout/package.go b/src/pkg/layout/package.go index 3949f4fcc2..decc7a82e1 100644 --- a/src/pkg/layout/package.go +++ b/src/pkg/layout/package.go @@ -12,7 +12,7 @@ import ( "strings" "github.com/Masterminds/semver/v3" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/interactive" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" diff --git a/src/pkg/layout/sbom.go b/src/pkg/layout/sbom.go index 8cfaaae6a0..7ac39c02a7 100644 --- a/src/pkg/layout/sbom.go +++ b/src/pkg/layout/sbom.go @@ -10,7 +10,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/mholt/archiver/v3" ) diff --git a/src/pkg/message/message.go b/src/pkg/message/message.go index 9cafa0f1c1..7c50315e77 100644 --- a/src/pkg/message/message.go +++ b/src/pkg/message/message.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/fatih/color" "github.com/pterm/pterm" diff --git a/src/pkg/message/progress.go b/src/pkg/message/progress.go index 1c6e732042..7c050b0ba2 100644 --- a/src/pkg/message/progress.go +++ b/src/pkg/message/progress.go @@ -5,6 +5,7 @@ package message import ( + "fmt" "os" "github.com/pterm/pterm" @@ -40,24 +41,43 @@ func NewProgressBar(total int64, text string) *ProgressBar { } } -// Update updates the ProgressBar with completed progress and new text. -func (p *ProgressBar) Update(complete int64, text string) { +// Updatef updates the ProgressBar with new text. +func (p *ProgressBar) Updatef(format string, a ...any) { + msg := fmt.Sprintf(format, a...) if NoProgress { - debugPrinter(2, text) + debugPrinter(2, msg) return } - p.progress.UpdateTitle(padding + text) - chunk := int(complete) - p.progress.Current - p.Add(chunk) + p.progress.UpdateTitle(padding + msg) +} + +// Failf marks the ProgressBar as failed in the CLI. +func (p *ProgressBar) Failf(format string, a ...any) { + p.Close() + Warnf(format, a...) +} + +// Close stops the ProgressBar from continuing. +func (p *ProgressBar) Close() error { + if p.progress == nil { + return nil + } + _, err := p.progress.Stop() + if err != nil { + return err + } + return nil } -// UpdateTitle updates the ProgressBar with new text. -func (p *ProgressBar) UpdateTitle(text string) { +// Update updates the ProgressBar with completed progress and new text. +func (p *ProgressBar) Update(complete int64, text string) { if NoProgress { debugPrinter(2, text) return } p.progress.UpdateTitle(padding + text) + chunk := int(complete) - p.progress.Current + p.Add(chunk) } // Add updates the ProgressBar with completed progress. @@ -83,23 +103,10 @@ func (p *ProgressBar) Write(data []byte) (int, error) { // Successf marks the ProgressBar as successful in the CLI. func (p *ProgressBar) Successf(format string, a ...any) { - p.Stop() + p.Close() pterm.Success.Printfln(format, a...) } -// Stop stops the ProgressBar from continuing. -func (p *ProgressBar) Stop() { - if p.progress != nil { - _, _ = p.progress.Stop() - } -} - -// Errorf marks the ProgressBar as failed in the CLI. -func (p *ProgressBar) Errorf(err error, format string, a ...any) { - p.Stop() - WarnErrf(err, format, a...) -} - // GetCurrent returns the current total func (p *ProgressBar) GetCurrent() int { if p.progress != nil { diff --git a/src/pkg/packager/actions/actions.go b/src/pkg/packager/actions/actions.go index e68947895b..2f01757d6c 100644 --- a/src/pkg/packager/actions/actions.go +++ b/src/pkg/packager/actions/actions.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/internal/packager/template" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/utils" diff --git a/src/pkg/packager/composer/list.go b/src/pkg/packager/composer/list.go index c88a0bb019..5c2d378d14 100644 --- a/src/pkg/packager/composer/list.go +++ b/src/pkg/packager/composer/list.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/extensions/bigbang" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/packager/deprecated" diff --git a/src/pkg/packager/composer/oci.go b/src/pkg/packager/composer/oci.go index 53fd42ad77..baa4d0fc81 100644 --- a/src/pkg/packager/composer/oci.go +++ b/src/pkg/packager/composer/oci.go @@ -11,7 +11,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" diff --git a/src/pkg/packager/composer/pathfixer.go b/src/pkg/packager/composer/pathfixer.go index a37dfe47f2..fac110c47c 100644 --- a/src/pkg/packager/composer/pathfixer.go +++ b/src/pkg/packager/composer/pathfixer.go @@ -7,7 +7,7 @@ package composer import ( "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/types" ) diff --git a/src/pkg/packager/create.go b/src/pkg/packager/create.go index bad88d5d4e..7613c2f6f4 100755 --- a/src/pkg/packager/create.go +++ b/src/pkg/packager/create.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/packager/creator/normal.go b/src/pkg/packager/creator/normal.go index fc2302a4a1..ddc7cb8e04 100644 --- a/src/pkg/packager/creator/normal.go +++ b/src/pkg/packager/creator/normal.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" diff --git a/src/pkg/packager/creator/skeleton.go b/src/pkg/packager/creator/skeleton.go index 1dcad92fad..47d06fadd5 100644 --- a/src/pkg/packager/creator/skeleton.go +++ b/src/pkg/packager/creator/skeleton.go @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/extensions/bigbang" diff --git a/src/pkg/packager/deploy.go b/src/pkg/packager/deploy.go index b7268bb8ca..b6e26e7693 100644 --- a/src/pkg/packager/deploy.go +++ b/src/pkg/packager/deploy.go @@ -21,7 +21,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" diff --git a/src/pkg/packager/dev.go b/src/pkg/packager/dev.go index 2f32785bb9..a9caaa2386 100644 --- a/src/pkg/packager/dev.go +++ b/src/pkg/packager/dev.go @@ -10,7 +10,7 @@ import ( "os" "runtime" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/packager/filters/deploy.go b/src/pkg/packager/filters/deploy.go index 622f481229..f5ac17916f 100644 --- a/src/pkg/packager/filters/deploy.go +++ b/src/pkg/packager/filters/deploy.go @@ -10,7 +10,7 @@ import ( "strings" "github.com/agnivade/levenshtein" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/interactive" "github.com/defenseunicorns/zarf/src/types" ) diff --git a/src/pkg/packager/filters/deploy_test.go b/src/pkg/packager/filters/deploy_test.go index 310ed6286b..029a2a9d53 100644 --- a/src/pkg/packager/filters/deploy_test.go +++ b/src/pkg/packager/filters/deploy_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/types" "github.com/stretchr/testify/require" ) diff --git a/src/pkg/packager/filters/select.go b/src/pkg/packager/filters/select.go index 2927fb827c..9116efe453 100644 --- a/src/pkg/packager/filters/select.go +++ b/src/pkg/packager/filters/select.go @@ -5,7 +5,7 @@ package filters import ( - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/types" ) diff --git a/src/pkg/packager/generate.go b/src/pkg/packager/generate.go index 64bb824285..d03e80c88d 100644 --- a/src/pkg/packager/generate.go +++ b/src/pkg/packager/generate.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/packager/inspect.go b/src/pkg/packager/inspect.go index 56645e2d54..5500be26da 100644 --- a/src/pkg/packager/inspect.go +++ b/src/pkg/packager/inspect.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/internal/packager/sbom" "github.com/defenseunicorns/zarf/src/pkg/utils" ) diff --git a/src/pkg/packager/interactive.go b/src/pkg/packager/interactive.go index d1c0711dc7..2326a4910a 100644 --- a/src/pkg/packager/interactive.go +++ b/src/pkg/packager/interactive.go @@ -10,7 +10,7 @@ import ( "path/filepath" "github.com/AlecAivazis/survey/v2" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/packager/lint/lint.go b/src/pkg/packager/lint/lint.go index eb73102617..3c85ebed9f 100644 --- a/src/pkg/packager/lint/lint.go +++ b/src/pkg/packager/lint/lint.go @@ -9,7 +9,7 @@ import ( "regexp" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/pkg/layout" diff --git a/src/pkg/packager/lint/validator.go b/src/pkg/packager/lint/validator.go index 96fe435c00..109118e83b 100644 --- a/src/pkg/packager/lint/validator.go +++ b/src/pkg/packager/lint/validator.go @@ -8,7 +8,7 @@ import ( "fmt" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/types" "github.com/fatih/color" diff --git a/src/pkg/packager/prepare.go b/src/pkg/packager/prepare.go index 54c9158d5e..276cdcc4db 100644 --- a/src/pkg/packager/prepare.go +++ b/src/pkg/packager/prepare.go @@ -14,7 +14,7 @@ import ( "github.com/goccy/go-yaml" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/internal/packager/helm" "github.com/defenseunicorns/zarf/src/internal/packager/images" diff --git a/src/pkg/packager/publish.go b/src/pkg/packager/publish.go index 899579332f..c06ecafb34 100644 --- a/src/pkg/packager/publish.go +++ b/src/pkg/packager/publish.go @@ -10,7 +10,7 @@ import ( "os" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" diff --git a/src/pkg/packager/remove.go b/src/pkg/packager/remove.go index a107147714..535e7dedc4 100644 --- a/src/pkg/packager/remove.go +++ b/src/pkg/packager/remove.go @@ -13,7 +13,7 @@ import ( "slices" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/internal/packager/helm" "github.com/defenseunicorns/zarf/src/pkg/cluster" diff --git a/src/pkg/packager/sources/cluster.go b/src/pkg/packager/sources/cluster.go index c1478cb3da..ad14136afd 100644 --- a/src/pkg/packager/sources/cluster.go +++ b/src/pkg/packager/sources/cluster.go @@ -8,7 +8,7 @@ import ( "context" "fmt" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/cluster" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/packager/filters" diff --git a/src/pkg/packager/sources/new.go b/src/pkg/packager/sources/new.go index c9b2e2438f..192bd39f88 100644 --- a/src/pkg/packager/sources/new.go +++ b/src/pkg/packager/sources/new.go @@ -9,7 +9,7 @@ import ( "net/url" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" diff --git a/src/pkg/packager/sources/split.go b/src/pkg/packager/sources/split.go index fe4e9fbade..d635159002 100644 --- a/src/pkg/packager/sources/split.go +++ b/src/pkg/packager/sources/split.go @@ -13,7 +13,7 @@ import ( "sort" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/packager/filters" diff --git a/src/pkg/packager/sources/tarball.go b/src/pkg/packager/sources/tarball.go index 2172d7ef13..b6a70d4355 100644 --- a/src/pkg/packager/sources/tarball.go +++ b/src/pkg/packager/sources/tarball.go @@ -12,7 +12,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/packager/filters" diff --git a/src/pkg/packager/sources/url.go b/src/pkg/packager/sources/url.go index 384be49668..67b6ccd1d9 100644 --- a/src/pkg/packager/sources/url.go +++ b/src/pkg/packager/sources/url.go @@ -10,7 +10,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/packager/filters" diff --git a/src/pkg/packager/sources/utils.go b/src/pkg/packager/sources/utils.go index 280e940930..f880e11d0e 100644 --- a/src/pkg/packager/sources/utils.go +++ b/src/pkg/packager/sources/utils.go @@ -11,7 +11,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/zoci" diff --git a/src/pkg/packager/sources/validate.go b/src/pkg/packager/sources/validate.go index cddf34d816..1d8a4f6255 100644 --- a/src/pkg/packager/sources/validate.go +++ b/src/pkg/packager/sources/validate.go @@ -13,7 +13,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/pki/pki.go b/src/pkg/pki/pki.go index 68373d3f81..f732b2e1cb 100644 --- a/src/pkg/pki/pki.go +++ b/src/pkg/pki/pki.go @@ -14,7 +14,7 @@ import ( "net" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/k8s" "github.com/defenseunicorns/zarf/src/pkg/message" ) diff --git a/src/pkg/transform/artifact.go b/src/pkg/transform/artifact.go index 96a295e4c6..0aed7a46ea 100644 --- a/src/pkg/transform/artifact.go +++ b/src/pkg/transform/artifact.go @@ -10,7 +10,7 @@ import ( "regexp" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" ) const ( diff --git a/src/pkg/transform/git.go b/src/pkg/transform/git.go index 3710579ab2..d215df9481 100644 --- a/src/pkg/transform/git.go +++ b/src/pkg/transform/git.go @@ -9,7 +9,7 @@ import ( "net/url" "regexp" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" ) // For further explanation: https://regex101.com/r/YxpfhC/5 diff --git a/src/pkg/transform/image.go b/src/pkg/transform/image.go index 3b5de1d920..293cb61a64 100644 --- a/src/pkg/transform/image.go +++ b/src/pkg/transform/image.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/distribution/reference" ) diff --git a/src/pkg/utils/bytes.go b/src/pkg/utils/bytes.go index 7ef3ef5c8c..4ff6c06d59 100644 --- a/src/pkg/utils/bytes.go +++ b/src/pkg/utils/bytes.go @@ -12,7 +12,7 @@ import ( "strconv" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/message" ) @@ -74,7 +74,9 @@ func RenderProgressBarForLocalDirWrite(filepath string, expectedTotal int64, com completeChan <- nil return } else { - progressBar.Stop() + if err := progressBar.Close(); err != nil { + message.Debugf("unable to close progress bar: %s", err.Error()) + } completeChan <- nil return } diff --git a/src/pkg/utils/cosign.go b/src/pkg/utils/cosign.go index d9f017afce..d4b8fe695d 100644 --- a/src/pkg/utils/cosign.go +++ b/src/pkg/utils/cosign.go @@ -11,7 +11,7 @@ import ( "os" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/pkg/message" diff --git a/src/pkg/utils/image.go b/src/pkg/utils/image.go index 0074ea9036..80920cbc8b 100644 --- a/src/pkg/utils/image.go +++ b/src/pkg/utils/image.go @@ -10,7 +10,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/transform" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/google/go-containerregistry/pkg/v1/layout" diff --git a/src/pkg/utils/io.go b/src/pkg/utils/io.go index 55c60fc1dc..8b9592def3 100755 --- a/src/pkg/utils/io.go +++ b/src/pkg/utils/io.go @@ -12,7 +12,7 @@ import ( "os" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/types" @@ -108,7 +108,7 @@ func SplitFile(srcPath string, chunkSizeBytes int) (err error) { // start progress bar title := fmt.Sprintf("[0/%d] MB bytes written", fileSize/1000/1000) progressBar := message.NewProgressBar(fileSize, title) - defer progressBar.Stop() + defer progressBar.Close() // open srcFile srcFile, err := os.Open(srcPath) @@ -183,7 +183,7 @@ func SplitFile(srcPath string, chunkSizeBytes int) (err error) { // update progress bar progressBar.Add(bufferSize) title := fmt.Sprintf("[%d/%d] MB bytes written", progressBar.GetCurrent()/1000/1000, fileSize/1000/1000) - progressBar.UpdateTitle(title) + progressBar.Updatef(title) } srcFile.Close() _ = os.RemoveAll(srcPath) diff --git a/src/pkg/utils/network.go b/src/pkg/utils/network.go index 036d4fe57c..8a4a93821f 100644 --- a/src/pkg/utils/network.go +++ b/src/pkg/utils/network.go @@ -14,7 +14,7 @@ import ( "path/filepath" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/pkg/message" ) @@ -112,7 +112,7 @@ func httpGetFile(url string, destinationFile *os.File) error { progressBar := message.NewProgressBar(resp.ContentLength, title) if _, err = io.Copy(destinationFile, io.TeeReader(resp.Body, progressBar)); err != nil { - progressBar.Errorf(err, "Unable to save the file %s", destinationFile.Name()) + progressBar.Failf("Unable to save the file %s: %s", destinationFile.Name(), err.Error()) return err } diff --git a/src/pkg/utils/network_test.go b/src/pkg/utils/network_test.go index 1728fe874b..ee30624885 100644 --- a/src/pkg/utils/network_test.go +++ b/src/pkg/utils/network_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" ) func TestParseChecksum(t *testing.T) { diff --git a/src/pkg/variables/templates.go b/src/pkg/variables/templates.go index 9363357d39..e350d77c28 100644 --- a/src/pkg/variables/templates.go +++ b/src/pkg/variables/templates.go @@ -11,7 +11,7 @@ import ( "regexp" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" ) // TextTemplate represents a value to be templated into a text file. diff --git a/src/pkg/zoci/copier.go b/src/pkg/zoci/copier.go index 8ff5b26c69..d6ed8dffb4 100644 --- a/src/pkg/zoci/copier.go +++ b/src/pkg/zoci/copier.go @@ -27,7 +27,7 @@ func CopyPackage(ctx context.Context, src *Remote, dst *Remote, concurrency int) title := fmt.Sprintf("[0/%d] layers copied", len(layers)) progressBar := message.NewProgressBar(size, title) - defer progressBar.Stop() + defer progressBar.Close() if err := oci.Copy(ctx, src.OrasRemote, dst.OrasRemote, nil, concurrency, progressBar); err != nil { return err diff --git a/src/pkg/zoci/pull.go b/src/pkg/zoci/pull.go index 9fb7a8408a..bd259259e1 100644 --- a/src/pkg/zoci/pull.go +++ b/src/pkg/zoci/pull.go @@ -9,7 +9,7 @@ import ( "fmt" "path/filepath" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/transform" diff --git a/src/pkg/zoci/push.go b/src/pkg/zoci/push.go index 380750574e..ccbad6862b 100644 --- a/src/pkg/zoci/push.go +++ b/src/pkg/zoci/push.go @@ -8,7 +8,7 @@ import ( "context" "fmt" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/pkg/oci" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" @@ -68,7 +68,7 @@ func (r *Remote) PublishPackage(ctx context.Context, pkg *types.ZarfPackage, pat total += manifestConfigDesc.Size progressBar := message.NewProgressBar(total, fmt.Sprintf("Publishing %s:%s", r.Repo().Reference.Repository, r.Repo().Reference.Reference)) - defer progressBar.Stop() + defer progressBar.Close() r.SetProgressWriter(progressBar) defer r.ClearProgressWriter() diff --git a/src/pkg/zoci/utils.go b/src/pkg/zoci/utils.go index 968db5f591..e63910a738 100644 --- a/src/pkg/zoci/utils.go +++ b/src/pkg/zoci/utils.go @@ -9,7 +9,7 @@ import ( "fmt" "strings" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/types" "oras.land/oras-go/v2/registry" ) diff --git a/src/test/common.go b/src/test/common.go index 35d6820d28..4eb9844045 100644 --- a/src/test/common.go +++ b/src/test/common.go @@ -16,7 +16,7 @@ import ( "slices" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" ) diff --git a/src/test/e2e/00_use_cli_test.go b/src/test/e2e/00_use_cli_test.go index e830139086..c59fdf9d55 100644 --- a/src/test/e2e/00_use_cli_test.go +++ b/src/test/e2e/00_use_cli_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/otiai10/copy" "github.com/stretchr/testify/require" ) diff --git a/src/test/e2e/05_tarball_test.go b/src/test/e2e/05_tarball_test.go index e929d3b420..7293b378bc 100644 --- a/src/test/e2e/05_tarball_test.go +++ b/src/test/e2e/05_tarball_test.go @@ -11,7 +11,7 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/message" "github.com/defenseunicorns/zarf/src/pkg/utils" diff --git a/src/test/e2e/51_oci_compose_test.go b/src/test/e2e/51_oci_compose_test.go index 7c55e3238d..c59d7477c1 100644 --- a/src/test/e2e/51_oci_compose_test.go +++ b/src/test/e2e/51_oci_compose_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/layout" "github.com/defenseunicorns/zarf/src/pkg/transform" "github.com/defenseunicorns/zarf/src/pkg/utils" diff --git a/src/test/external/ext_out_cluster_test.go b/src/test/external/ext_out_cluster_test.go index eeef4b94db..050150e5fa 100644 --- a/src/test/external/ext_out_cluster_test.go +++ b/src/test/external/ext_out_cluster_test.go @@ -15,7 +15,7 @@ import ( "path/filepath" "testing" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/pkg/utils" "github.com/defenseunicorns/zarf/src/pkg/utils/exec" "github.com/stretchr/testify/require" diff --git a/src/types/k8s.go b/src/types/k8s.go index 581b02e947..183125c72b 100644 --- a/src/types/k8s.go +++ b/src/types/k8s.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/pkg/k8s" ) diff --git a/src/types/validate.go b/src/types/validate.go index 3d001c4e7f..2d477ca8ef 100644 --- a/src/types/validate.go +++ b/src/types/validate.go @@ -10,7 +10,7 @@ import ( "path/filepath" "regexp" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" ) diff --git a/src/types/validate_test.go b/src/types/validate_test.go index 5fcce6821b..64af534f58 100644 --- a/src/types/validate_test.go +++ b/src/types/validate_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/defenseunicorns/pkg/helpers" + "github.com/defenseunicorns/pkg/helpers/v2" "github.com/defenseunicorns/zarf/src/config/lang" "github.com/defenseunicorns/zarf/src/pkg/variables" "github.com/stretchr/testify/require"