From cbd88068b2b2d118478fdf47b91be5a47fc3f83e Mon Sep 17 00:00:00 2001 From: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:41:06 -0400 Subject: [PATCH] fix(kustomize): no concurrent processing if Kustomize patches are used (#15654) Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --- pkg/apis/application/v1alpha1/types.go | 3 ++- pkg/apis/application/v1alpha1/types_test.go | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/apis/application/v1alpha1/types.go b/pkg/apis/application/v1alpha1/types.go index ca2ed3158080c..8d02fa5bfb624 100644 --- a/pkg/apis/application/v1alpha1/types.go +++ b/pkg/apis/application/v1alpha1/types.go @@ -555,7 +555,8 @@ func (k *ApplicationSourceKustomize) AllowsConcurrentProcessing() bool { len(k.CommonAnnotations) == 0 && k.NamePrefix == "" && k.Namespace == "" && - k.NameSuffix == "" + k.NameSuffix == "" && + len(k.Patches) == 0 } // IsZero returns true when the Kustomize options are considered empty diff --git a/pkg/apis/application/v1alpha1/types_test.go b/pkg/apis/application/v1alpha1/types_test.go index fdabb9b009571..35b49f8e91c70 100644 --- a/pkg/apis/application/v1alpha1/types_test.go +++ b/pkg/apis/application/v1alpha1/types_test.go @@ -3002,6 +3002,16 @@ func TestSourceAllowsConcurrentProcessing_KustomizeParams(t *testing.T) { assert.False(t, src.AllowsConcurrentProcessing()) }) + + t.Run("Has Patches", func(t *testing.T) { + src := ApplicationSource{Path: ".", Kustomize: &ApplicationSourceKustomize{ + Patches: KustomizePatches{{ + Path: "test", + }}, + }} + + assert.False(t, src.AllowsConcurrentProcessing()) + }) } func TestUnSetCascadedDeletion(t *testing.T) {