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", 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",