From deaf0779a1ad5f004d299712190f333251a3aab2 Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Wed, 3 Apr 2019 14:05:25 -0700 Subject: [PATCH] add generators/transformers fields in kusotmization.yaml --- pkg/commands/kustfile/kustomizationfile.go | 2 ++ pkg/commands/kustfile/kustomizationfile_test.go | 2 ++ pkg/types/kustomization.go | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/pkg/commands/kustfile/kustomizationfile.go b/pkg/commands/kustfile/kustomizationfile.go index 42b93d789..b31fc8464 100644 --- a/pkg/commands/kustfile/kustomizationfile.go +++ b/pkg/commands/kustfile/kustomizationfile.go @@ -67,6 +67,8 @@ func determineFieldOrder() []string { "Vars", "Images", "Configurations", + "Generators", + "Transformers", } // Add deprecated fields here. diff --git a/pkg/commands/kustfile/kustomizationfile_test.go b/pkg/commands/kustfile/kustomizationfile_test.go index 0795986c3..20751ab74 100644 --- a/pkg/commands/kustfile/kustomizationfile_test.go +++ b/pkg/commands/kustfile/kustomizationfile_test.go @@ -46,6 +46,8 @@ func TestFieldOrder(t *testing.T) { "Vars", "Images", "Configurations", + "Generators", + "Transformers", } actual := determineFieldOrder() if len(expected) != len(actual) { diff --git a/pkg/types/kustomization.go b/pkg/types/kustomization.go index 37b07f58f..68d3a8e36 100644 --- a/pkg/types/kustomization.go +++ b/pkg/types/kustomization.go @@ -130,6 +130,12 @@ type Kustomization struct { // Configurations is a list of transformer configuration files Configurations []string `json:"configurations,omitempty" yaml:"configurations,omitempty"` + + // Generators is a list of files containing custom generators + Generators []string `json:"generators,omitempty" yaml:"generators,omitempty"` + + // Transformers is a list of files containing transformers + Transformers []string `json:"transformers,omitempty" yaml:"transformers,omitempty"` } // DealWithMissingFields fills the missing fields