From 5614852b338ecd48394cfff1ed140d6ec5cb999f Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 16 Feb 2021 14:17:09 -0800 Subject: [PATCH 1/2] fix edit commands remove metadata --- kustomize/commands/internal/kustfile/kustomizationfile.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kustomize/commands/internal/kustfile/kustomizationfile.go b/kustomize/commands/internal/kustfile/kustomizationfile.go index 902b18837..ed5f9d25d 100644 --- a/kustomize/commands/internal/kustfile/kustomizationfile.go +++ b/kustomize/commands/internal/kustfile/kustomizationfile.go @@ -38,6 +38,7 @@ func determineFieldOrder() []string { } ordered := []string{ + "MetaData", "Resources", "Bases", "NamePrefix", From c04cf01b45aa92d588f8e2bd43186b5f52ec6501 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Tue, 16 Feb 2021 14:31:32 -0800 Subject: [PATCH 2/2] fix test --- kustomize/commands/internal/kustfile/kustomizationfile_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kustomize/commands/internal/kustfile/kustomizationfile_test.go b/kustomize/commands/internal/kustfile/kustomizationfile_test.go index ebd9a51e9..44c4a4e78 100644 --- a/kustomize/commands/internal/kustfile/kustomizationfile_test.go +++ b/kustomize/commands/internal/kustfile/kustomizationfile_test.go @@ -20,6 +20,7 @@ func TestFieldOrder(t *testing.T) { expected := []string{ "APIVersion", "Kind", + "MetaData", "Resources", "Bases", "NamePrefix",