From 2d2fda0c87e96c9ba806a9a7f9fbaf19fc972c7f Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 15 Sep 2023 16:42:46 +0530 Subject: [PATCH 01/32] Patch resource history annotations instead of update Signed-off-by: rcmadhankumar --- pkg/kapp/clusterapply/add_or_update_change.go | 10 ++++++++-- pkg/kapp/diff/resource_with_history.go | 16 ++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pkg/kapp/clusterapply/add_or_update_change.go b/pkg/kapp/clusterapply/add_or_update_change.go index c569b8d29..a12e76f19 100644 --- a/pkg/kapp/clusterapply/add_or_update_change.go +++ b/pkg/kapp/clusterapply/add_or_update_change.go @@ -4,6 +4,7 @@ package clusterapply import ( + "encoding/json" "fmt" "time" @@ -12,6 +13,7 @@ import ( ctlres "github.com/vmware-tanzu/carvel-kapp/pkg/kapp/resources" "github.com/vmware-tanzu/carvel-kapp/pkg/kapp/util" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/types" ) const ( @@ -262,12 +264,16 @@ func (c AddOrUpdateChange) recordAppliedResource(savedRes ctlres.Resource) error return true, nil } - _, err = c.identifiedResources.Update(latestResWithHistoryUpdated) + latestResourceAnnotations := latestResWithHistoryUpdated.Annotations() + appliedResAnnValJSONStr, err := json.Marshal(latestResourceAnnotations[ctldiff.AppliedResAnnKey]) + jsonStr := fmt.Sprintf("{\"metadata\": {\"annotations\": { \"%s\" : \"%s\", \"%s\": %s}}}", ctldiff.AppliedResDiffMD5AnnKey, latestResourceAnnotations[ctldiff.AppliedResDiffMD5AnnKey], ctldiff.AppliedResAnnKey, appliedResAnnValJSONStr) + data := []byte(jsonStr) + + _, err = c.identifiedResources.Patch(savedRes, types.MergePatchType, data) if err != nil { latestResWithHistory = nil // Get again return false, fmt.Errorf("Saving record of last applied resource: %w", err) } - return true, nil }) } diff --git a/pkg/kapp/diff/resource_with_history.go b/pkg/kapp/diff/resource_with_history.go index 34115aa7f..4fa960841 100644 --- a/pkg/kapp/diff/resource_with_history.go +++ b/pkg/kapp/diff/resource_with_history.go @@ -11,8 +11,8 @@ import ( ) const ( - appliedResAnnKey = "kapp.k14s.io/original" - appliedResDiffMD5AnnKey = "kapp.k14s.io/original-diff-md5" + AppliedResAnnKey = "kapp.k14s.io/original" + AppliedResDiffMD5AnnKey = "kapp.k14s.io/original-diff-md5" // Following fields useful for debugging: debugAppliedResDiffAnnKey = "kapp.k14s.io/original-diff" @@ -88,8 +88,8 @@ func (r ResourceWithHistory) RecordLastAppliedResource(appliedChange Change) (ct ResourceMatcher: ctlres.AllMatcher{}, Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations"}), KVs: map[string]string{ - appliedResAnnKey: string(appliedResBytes), - appliedResDiffMD5AnnKey: diff.MinimalMD5(), + AppliedResAnnKey: string(appliedResBytes), + AppliedResDiffMD5AnnKey: diff.MinimalMD5(), // Following fields useful for debugging: // debugAppliedResDiffAnnKey: diff.MinimalString(), @@ -131,8 +131,8 @@ func (r ResourceWithHistory) CalculateChange(appliedRes ctlres.Resource) (Change } func (r ResourceWithHistory) recalculateLastAppliedChange() ([]Change, string, string) { - lastAppliedResBytes := r.resource.Annotations()[appliedResAnnKey] - lastAppliedDiffMD5 := r.resource.Annotations()[appliedResDiffMD5AnnKey] + lastAppliedResBytes := r.resource.Annotations()[AppliedResAnnKey] + lastAppliedDiffMD5 := r.resource.Annotations()[AppliedResDiffMD5AnnKey] if len(lastAppliedResBytes) == 0 || len(lastAppliedDiffMD5) == 0 { return nil, "", "" @@ -197,7 +197,7 @@ func (ResourceWithoutHistory) removeAppliedResAnnKeysMods() []ctlres.ResourceMod return []ctlres.ResourceMod{ ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, - Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", appliedResAnnKey}), + Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", AppliedResAnnKey}), }, ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, @@ -205,7 +205,7 @@ func (ResourceWithoutHistory) removeAppliedResAnnKeysMods() []ctlres.ResourceMod }, ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, - Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", appliedResDiffMD5AnnKey}), + Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", AppliedResDiffMD5AnnKey}), }, ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, From 8ce91c35d9ec321ff92a8477b0ebfe7895c1cbff Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 19:31:50 +0530 Subject: [PATCH 02/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index b3c8d906c..e649d8c06 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.10.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.16.0 + minikube start --driver=docker --kubernetes-version 1.20.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 661d63edcc33d94a8c7e2139e927886f698af3b5 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 19:42:58 +0530 Subject: [PATCH 03/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index e649d8c06..58ec73827 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -34,7 +34,7 @@ jobs: wget -O- https://carvel.dev/install.sh | K14SIO_INSTALL_BIN_DIR=/tmp/bin bash - wget -O- https://github.com/kubernetes/minikube/releases/download/v1.10.0/minikube-linux-amd64 > /tmp/bin/minikube + wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube minikube start --driver=docker --kubernetes-version 1.20.0 eval $(minikube docker-env --shell=bash) From 4cdc41818f284604ffbb6fef662af40b82721d2b Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 19:59:13 +0530 Subject: [PATCH 04/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 58ec73827..41e2cd544 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.20.0 + minikube start --driver=docker --kubernetes-version 1.28.2 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 070ed0f5e5f9b8d6fb7bbf434b83533ec5134060 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 21:03:30 +0530 Subject: [PATCH 05/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 41e2cd544..3fff7992b 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.28.2 + minikube start --driver=docker --kubernetes-version 1.23.17 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From c1a4f0384ade2bd4f758aeb20b03cd41c20dd6f1 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 21:25:14 +0530 Subject: [PATCH 06/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 3fff7992b..4ead62a5e 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.23.17 + minikube start --driver=docker --kubernetes-version 1.21.14 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From e3a4d8ae98276c1d01a76ac942aaf268c5a446dc Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 21:47:16 +0530 Subject: [PATCH 07/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 4ead62a5e..fc221efd5 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.14 + minikube start --driver=docker --kubernetes-version 1.20.15 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 02514c7dd3058d46d0a10ded5c40b663d16aa2bb Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Wed, 20 Sep 2023 22:12:28 +0530 Subject: [PATCH 08/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index fc221efd5..58ec73827 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.20.15 + minikube start --driver=docker --kubernetes-version 1.20.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 1167426750b52979ddcd0ad30014887668165eca Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Thu, 21 Sep 2023 14:17:13 +0530 Subject: [PATCH 09/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index ca9ec8873..8b82335d8 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.20.0 + minikube start --driver=docker --kubernetes-version 1.21.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 42bd97d2d8d1e21bb778ac339d6f2166ec1a7db8 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Thu, 21 Sep 2023 17:09:09 +0530 Subject: [PATCH 10/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 8b82335d8..4b0b3d4ca 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.0 + minikube start --driver=docker --kubernetes-version 1.21.6 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 7dd4a8189236d5f17c87a9920d8d6a3661af1f8a Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Thu, 21 Sep 2023 21:18:27 +0530 Subject: [PATCH 11/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 4b0b3d4ca..ed0307836 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.6 + minikube start --driver=docker --kubernetes-version 1.21.10 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 9968913861ffede0ed26309c292b1e3740862050 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 22 Sep 2023 09:29:59 +0530 Subject: [PATCH 12/32] fix2 --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index ed0307836..4b0b3d4ca 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.10 + minikube start --driver=docker --kubernetes-version 1.21.6 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 3709ab43eaa0dea7411601989a7cae17a60f38d0 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 22 Sep 2023 10:59:51 +0530 Subject: [PATCH 13/32] fix --- pkg/kapp/clusterapply/add_or_update_change.go | 7 ++-- pkg/kapp/diff/resource_with_history.go | 34 ++++++++----------- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/pkg/kapp/clusterapply/add_or_update_change.go b/pkg/kapp/clusterapply/add_or_update_change.go index a12e76f19..bdc53cb28 100644 --- a/pkg/kapp/clusterapply/add_or_update_change.go +++ b/pkg/kapp/clusterapply/add_or_update_change.go @@ -4,7 +4,6 @@ package clusterapply import ( - "encoding/json" "fmt" "time" @@ -254,7 +253,7 @@ func (c AddOrUpdateChange) recordAppliedResource(savedRes ctlres.Resource) error } // Record last applied change on the latest version of a resource - latestResWithHistoryUpdated, madeAnyModifications, err := latestResWithHistory.RecordLastAppliedResource(applyChange) + annotationStr, madeAnyModifications, err := latestResWithHistory.RecordLastAppliedResource(applyChange) if err != nil { return true, fmt.Errorf("Recording last applied resource: %w", err) } @@ -264,9 +263,7 @@ func (c AddOrUpdateChange) recordAppliedResource(savedRes ctlres.Resource) error return true, nil } - latestResourceAnnotations := latestResWithHistoryUpdated.Annotations() - appliedResAnnValJSONStr, err := json.Marshal(latestResourceAnnotations[ctldiff.AppliedResAnnKey]) - jsonStr := fmt.Sprintf("{\"metadata\": {\"annotations\": { \"%s\" : \"%s\", \"%s\": %s}}}", ctldiff.AppliedResDiffMD5AnnKey, latestResourceAnnotations[ctldiff.AppliedResDiffMD5AnnKey], ctldiff.AppliedResAnnKey, appliedResAnnValJSONStr) + jsonStr := fmt.Sprintf("{\"metadata\": {\"annotations\": %s }}", annotationStr) data := []byte(jsonStr) _, err = c.identifiedResources.Patch(savedRes, types.MergePatchType, data) diff --git a/pkg/kapp/diff/resource_with_history.go b/pkg/kapp/diff/resource_with_history.go index 4fa960841..1dfc84739 100644 --- a/pkg/kapp/diff/resource_with_history.go +++ b/pkg/kapp/diff/resource_with_history.go @@ -4,6 +4,7 @@ package diff import ( + "encoding/json" "fmt" "os" @@ -68,13 +69,13 @@ func (r ResourceWithHistory) AllowsRecordingLastApplied() bool { return !found } -func (r ResourceWithHistory) RecordLastAppliedResource(appliedChange Change) (ctlres.Resource, bool, error) { +func (r ResourceWithHistory) RecordLastAppliedResource(appliedChange Change) (string, bool, error) { // Use compact representation to take as little space as possible // because annotation value max length is 262144 characters // (https://github.com/vmware-tanzu/carvel-kapp/issues/48). appliedResBytes, err := appliedChange.AppliedResource().AsCompactBytes() if err != nil { - return nil, true, err + return "", true, err } diff := appliedChange.OpsDiff() @@ -84,37 +85,30 @@ func (r ResourceWithHistory) RecordLastAppliedResource(appliedChange Change) (ct r.resource.Description(), diff.MinimalMD5(), diff.MinimalString()) } - annsMod := ctlres.StringMapAppendMod{ - ResourceMatcher: ctlres.AllMatcher{}, - Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations"}), - KVs: map[string]string{ - AppliedResAnnKey: string(appliedResBytes), - AppliedResDiffMD5AnnKey: diff.MinimalMD5(), + annsKVS := map[string]string{ + AppliedResAnnKey: string(appliedResBytes), + AppliedResDiffMD5AnnKey: diff.MinimalMD5(), - // Following fields useful for debugging: - // debugAppliedResDiffAnnKey: diff.MinimalString(), - // debugAppliedResDiffFullAnnKey: diff.FullString(), - }, + // Following fields useful for debugging: + // debugAppliedResDiffAnnKey: diff.MinimalString(), + // debugAppliedResDiffFullAnnKey: diff.FullString(), } const annValMaxLen = 262144 // kapp deploy should work without adding disable annotation when annotation value max length exceed // (https://github.com/vmware-tanzu/carvel-kapp/issues/410) - for _, annVal := range annsMod.KVs { + for _, annVal := range annsKVS { if len(annVal) > annValMaxLen { - return nil, false, nil + return "", false, nil } } - resultRes := r.resource.DeepCopy() - - err = annsMod.Apply(resultRes) + result, err := json.Marshal(annsKVS) if err != nil { - return nil, true, err + return "", false, err } - - return resultRes, true, nil + return string(result), true, nil } func (r ResourceWithHistory) CalculateChange(appliedRes ctlres.Resource) (Change, error) { From b8defe5cd7638a7b17660b40a569b9b8b53f6954 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 22 Sep 2023 11:02:26 +0530 Subject: [PATCH 14/32] fix --- pkg/kapp/diff/resource_with_history.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/kapp/diff/resource_with_history.go b/pkg/kapp/diff/resource_with_history.go index 1dfc84739..7d24f740d 100644 --- a/pkg/kapp/diff/resource_with_history.go +++ b/pkg/kapp/diff/resource_with_history.go @@ -12,8 +12,8 @@ import ( ) const ( - AppliedResAnnKey = "kapp.k14s.io/original" - AppliedResDiffMD5AnnKey = "kapp.k14s.io/original-diff-md5" + appliedResAnnKey = "kapp.k14s.io/original" + appliedResDiffMD5AnnKey = "kapp.k14s.io/original-diff-md5" // Following fields useful for debugging: debugAppliedResDiffAnnKey = "kapp.k14s.io/original-diff" @@ -86,8 +86,8 @@ func (r ResourceWithHistory) RecordLastAppliedResource(appliedChange Change) (st } annsKVS := map[string]string{ - AppliedResAnnKey: string(appliedResBytes), - AppliedResDiffMD5AnnKey: diff.MinimalMD5(), + appliedResAnnKey: string(appliedResBytes), + appliedResDiffMD5AnnKey: diff.MinimalMD5(), // Following fields useful for debugging: // debugAppliedResDiffAnnKey: diff.MinimalString(), @@ -125,8 +125,8 @@ func (r ResourceWithHistory) CalculateChange(appliedRes ctlres.Resource) (Change } func (r ResourceWithHistory) recalculateLastAppliedChange() ([]Change, string, string) { - lastAppliedResBytes := r.resource.Annotations()[AppliedResAnnKey] - lastAppliedDiffMD5 := r.resource.Annotations()[AppliedResDiffMD5AnnKey] + lastAppliedResBytes := r.resource.Annotations()[appliedResAnnKey] + lastAppliedDiffMD5 := r.resource.Annotations()[appliedResDiffMD5AnnKey] if len(lastAppliedResBytes) == 0 || len(lastAppliedDiffMD5) == 0 { return nil, "", "" @@ -191,7 +191,7 @@ func (ResourceWithoutHistory) removeAppliedResAnnKeysMods() []ctlres.ResourceMod return []ctlres.ResourceMod{ ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, - Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", AppliedResAnnKey}), + Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", appliedResAnnKey}), }, ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, @@ -199,7 +199,7 @@ func (ResourceWithoutHistory) removeAppliedResAnnKeysMods() []ctlres.ResourceMod }, ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, - Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", AppliedResDiffMD5AnnKey}), + Path: ctlres.NewPathFromStrings([]string{"metadata", "annotations", appliedResDiffMD5AnnKey}), }, ctlres.FieldRemoveMod{ ResourceMatcher: ctlres.AllMatcher{}, From c0417e3aa60707de879110f4fdd26846d8f5e45d Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 22 Sep 2023 13:59:50 +0530 Subject: [PATCH 15/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 4b0b3d4ca..7d0c82088 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.6 + minikube start --driver=docker --kubernetes-version 1.21.7 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 8d1628085df91fa5e0e6b3c2ede9688d76fc8d4f Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Thu, 19 Oct 2023 19:29:22 +0530 Subject: [PATCH 16/32] test --- test/e2e/ignore_failing_api_services_flag_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index 27a176509..de51111c6 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -4,6 +4,7 @@ package e2e import ( + "fmt" "strings" "testing" @@ -125,8 +126,12 @@ metadata: }) logger.Section("deploy app that uses failing api service", func() { - _, err := kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + out, err := kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) + + fmt.Printf(" \n =========> Out: %+v", out) + fmt.Printf("\n ==========> err: %+v", err) + fmt.Printf("\n ==========> err.Error(): %+s", err.Error()) require.Errorf(t, err, "Expected error when deploying with failing api service") require.Contains(t, err.Error(), "unable to retrieve the complete list of server APIs: samplekapptest.com/v1", From 3c62fe9daa10f878b558c6e0a91c0dd9ed873995 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 09:48:09 +0530 Subject: [PATCH 17/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 7d0c82088..3991cffa8 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.7 + minikube start --driver=docker --kubernetes-version 1.16.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 2e4008e4ba9cb71273521747b9a926498c80704d Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 10:32:38 +0530 Subject: [PATCH 18/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 3991cffa8..8b82335d8 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.16.0 + minikube start --driver=docker --kubernetes-version 1.21.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 29060db89cbcf9f1a0cee3935a4776dcd90baff7 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 12:29:14 +0530 Subject: [PATCH 19/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 8b82335d8..3991cffa8 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.0 + minikube start --driver=docker --kubernetes-version 1.16.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From a8d8b9a0389291dae82066700d762f9865704631 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 13:04:12 +0530 Subject: [PATCH 20/32] fix --- test/e2e/ignore_failing_api_services_flag_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index de51111c6..2c48f0515 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -16,6 +16,7 @@ func TestIgnoreFailingAPIServices(t *testing.T) { env := BuildEnv(t) logger := Logger{} kapp := Kapp{t, env.Namespace, env.KappBinaryPath, logger} + kubectl := Kubectl{t, env.Namespace, l} yaml1 := ` --- @@ -126,13 +127,20 @@ metadata: }) logger.Section("deploy app that uses failing api service", func() { - out, err := kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + + out, err := kubectl.RunWithOpts([]string{"get", "apiservice"}, RunOpts{ + AllowError: true}) + + fmt.Printf(" \n =========> Out: %+v", out) + fmt.Printf("\n ==========> err: %+v", err) + + out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) fmt.Printf("\n ==========> err.Error(): %+s", err.Error()) - require.Errorf(t, err, "Expected error when deploying with failing api service") + require.Errorf(t, err, "Expected error when deploying with failing api serviceeasouckweg") require.Contains(t, err.Error(), "unable to retrieve the complete list of server APIs: samplekapptest.com/v1", "Expected api retrieval error") From fca0bef42213dbc6d28af03c57329eaef59954f9 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 13:32:21 +0530 Subject: [PATCH 21/32] fix --- test/e2e/ignore_failing_api_services_flag_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index 2c48f0515..f8479adcf 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -16,7 +16,7 @@ func TestIgnoreFailingAPIServices(t *testing.T) { env := BuildEnv(t) logger := Logger{} kapp := Kapp{t, env.Namespace, env.KappBinaryPath, logger} - kubectl := Kubectl{t, env.Namespace, l} + kubectl := Kubectl{t, env.Namespace, logger} yaml1 := ` --- From f18482236dcea5ae1164bb8a1c19ffd981c6102a Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 17:39:07 +0530 Subject: [PATCH 22/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- test/e2e/ignore_failing_api_services_flag_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 3991cffa8..f424f8593 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.21.1 + go-version: 1.21.5 - name: Check out code into the Go module directory uses: actions/checkout@v2 with: diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index f8479adcf..ef8cf746b 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -134,7 +134,7 @@ metadata: fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) - out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) fmt.Printf(" \n =========> Out: %+v", out) From f479d24a97bf2392956df4c19bf7305e5d34cf72 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 17:59:35 +0530 Subject: [PATCH 23/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index f424f8593..b3bb70525 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -13,7 +13,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.21.5 + go-version: 1.21.1 - name: Check out code into the Go module directory uses: actions/checkout@v2 with: @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.16.0 + minikube start --driver=docker --kubernetes-version 1.21.5 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 49dc224c826487ad091ff96208c7377963d43f82 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 18:25:19 +0530 Subject: [PATCH 24/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index b3bb70525..4b0b3d4ca 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.5 + minikube start --driver=docker --kubernetes-version 1.21.6 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From f9ba1e0d3b1ae36349c76f9d92eb588350f13986 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 19:06:18 +0530 Subject: [PATCH 25/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 4b0b3d4ca..7d0c82088 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.6 + minikube start --driver=docker --kubernetes-version 1.21.7 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 682c3d183a0911c207a7eeea2cdd22704e47bcf7 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 19:23:19 +0530 Subject: [PATCH 26/32] fix --- test/e2e/ignore_failing_api_services_flag_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index ef8cf746b..db81ad3d2 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -134,7 +134,10 @@ metadata: fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) - out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ + // out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ + // AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) + + out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) fmt.Printf(" \n =========> Out: %+v", out) From b407a53ef0a15a7ad17dc50953f96536c88966fa Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 19:45:04 +0530 Subject: [PATCH 27/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 7d0c82088..4b0b3d4ca 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.7 + minikube start --driver=docker --kubernetes-version 1.21.6 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 5f50ac04762bfe8247101ea13b7b3fdbff97b660 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 22:19:53 +0530 Subject: [PATCH 28/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 4b0b3d4ca..7d0c82088 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.6 + minikube start --driver=docker --kubernetes-version 1.21.7 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 6a28fcc961d2dfcb6b1b6bb251e64dfd68f6541e Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 22:20:36 +0530 Subject: [PATCH 29/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 7d0c82088..3991cffa8 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.21.7 + minikube start --driver=docker --kubernetes-version 1.16.0 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 9ff337300abe26c7bcc04922c0043512209a3aed Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Fri, 20 Oct 2023 22:49:16 +0530 Subject: [PATCH 30/32] fix --- test/e2e/ignore_failing_api_services_flag_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index db81ad3d2..aa8475e99 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -134,12 +134,12 @@ metadata: fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) - // out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ - // AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) - - out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) + // out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + // AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) + fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) fmt.Printf("\n ==========> err.Error(): %+s", err.Error()) From 8f03e01429a6fc6ebe9bc729bda0bd48681fd3e8 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Mon, 23 Oct 2023 13:57:18 +0530 Subject: [PATCH 31/32] fix --- .github/workflows/test-gh-k8s-1.16.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-gh-k8s-1.16.yml b/.github/workflows/test-gh-k8s-1.16.yml index 3991cffa8..4b0b3d4ca 100644 --- a/.github/workflows/test-gh-k8s-1.16.yml +++ b/.github/workflows/test-gh-k8s-1.16.yml @@ -36,7 +36,7 @@ jobs: wget -O- https://github.com/kubernetes/minikube/releases/download/v1.31.0/minikube-linux-amd64 > /tmp/bin/minikube chmod +x /tmp/bin/minikube - minikube start --driver=docker --kubernetes-version 1.16.0 + minikube start --driver=docker --kubernetes-version 1.21.6 eval $(minikube docker-env --shell=bash) # Ensure that there is no existing kapp installed From 06ad66a665642e91a53a877e5b1261f8fa904161 Mon Sep 17 00:00:00 2001 From: rcmadhankumar Date: Mon, 23 Oct 2023 14:00:37 +0530 Subject: [PATCH 32/32] fix --- .vscode/settings.json | 1 + test/e2e/ignore_failing_api_services_flag_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/e2e/ignore_failing_api_services_flag_test.go b/test/e2e/ignore_failing_api_services_flag_test.go index aa8475e99..db81ad3d2 100644 --- a/test/e2e/ignore_failing_api_services_flag_test.go +++ b/test/e2e/ignore_failing_api_services_flag_test.go @@ -134,12 +134,12 @@ metadata: fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) - out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ - AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) - - // out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + // out, err = kubectl.RunWithOpts([]string{"apply", "-f", "-"}, RunOpts{ // AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) + out, err = kapp.RunWithOpts([]string{"deploy", "-f", "-", "-a", name3}, RunOpts{ + AllowError: true, IntoNs: true, StdinReader: strings.NewReader(yaml3)}) + fmt.Printf(" \n =========> Out: %+v", out) fmt.Printf("\n ==========> err: %+v", err) fmt.Printf("\n ==========> err.Error(): %+s", err.Error())