From b9c65907521e460b2712162f096068349ea349eb Mon Sep 17 00:00:00 2001 From: unclegedd Date: Tue, 5 Mar 2024 16:08:56 -0600 Subject: [PATCH] fix: error when removing bundles with short names --- src/pkg/utils/oci.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkg/utils/oci.go b/src/pkg/utils/oci.go index 7108f888..e0632d0e 100644 --- a/src/pkg/utils/oci.go +++ b/src/pkg/utils/oci.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" "slices" + "strings" "github.com/defenseunicorns/uds-cli/src/config" "github.com/defenseunicorns/uds-cli/src/types" @@ -247,7 +248,7 @@ func GetIndex(remote *oci.OrasRemote, ref string) (*ocispec.Index, error) { // EnsureOCIPrefix ensures oci prefix is part of provided remote source path, and adds it if it's not func EnsureOCIPrefix(source string) string { var ociPrefix = "oci://" - if source[:len(ociPrefix)] != ociPrefix { + if !strings.Contains(source, ociPrefix) { return ociPrefix + source } return source