From dc6a5d3915cf5b89fec27e1d81ba0b8f3f447729 Mon Sep 17 00:00:00 2001 From: Nico Braun Date: Thu, 18 Jan 2024 13:19:02 +0100 Subject: [PATCH] fix: seq node Signed-off-by: Nico Braun --- kioutil/gituri.go | 1 + kioutil/kioutil.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/kioutil/gituri.go b/kioutil/gituri.go index a0a4c34..26fa1b4 100644 --- a/kioutil/gituri.go +++ b/kioutil/gituri.go @@ -13,6 +13,7 @@ type GitPackageURI struct { Pkg string `json:"pkg,omitempty" toml:"pkg"` } +// TODO: appending .git here can cause mismatching git-credentials func (r *GitPackageURI) String() string { return fmt.Sprintf("%s.git@%s%s", r.Repo, r.Ref, r.Pkg) } diff --git a/kioutil/kioutil.go b/kioutil/kioutil.go index 7b33234..ebf6a8c 100644 --- a/kioutil/kioutil.go +++ b/kioutil/kioutil.go @@ -118,6 +118,7 @@ func (g GitPackageReader) Read() ([]*yaml.RNode, error) { PackageFileName: ".krmignore", IncludeSubpackages: true, PackagePath: pkgPath, + WrapBareSeqNode: true, } if g.SetPathAnnotation { @@ -128,6 +129,7 @@ func (g GitPackageReader) Read() ([]*yaml.RNode, error) { nodes, err := r.Read() if err != nil { + os.RemoveAll(hostPath) return nil, fmt.Errorf("read package: %w", err) }