You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
options for the kustomize-generator are now passed via a new struct
KustomizeGeneratorOptions, which is supplied to the New*() constructors;
besides providing a suffix for templating-subjected files, it is now
possible to use non-standard template delimiters (i.e. something
different from {{ and }}); in addition, options supplied through the
constructors can be overridden in the source, if there exists a file
.component-config.yaml at the kustomization's root directory;
finally, implicitly generated kustomizations now ignore hidden files,
i.e. files starting with a dot
Copy file name to clipboardExpand all lines: pkg/manifests/kustomize/generator.go
+58-12Lines changed: 58 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ package kustomize
8
8
import (
9
9
"bytes"
10
10
"context"
11
+
"errors"
11
12
"io"
12
13
"io/fs"
13
14
"os"
@@ -37,6 +38,20 @@ import (
37
38
38
39
// TODO: carve out logic into an internal Kustomization type (similar to the helm Chart case)
39
40
41
+
const (
42
+
componentConfigFilename=".component-config.yaml"
43
+
)
44
+
45
+
// KustomizeGeneratorOptions allows to tweak the behavior of the kustomize generator.
46
+
typeKustomizeGeneratorOptionsstruct {
47
+
// If defined, only files with that suffix will be subject to templating.
48
+
TemplateSuffix*string
49
+
// If defined, the given left delimiter will be used to parse go templates; otherwise, defaults to '{{'
50
+
LeftTemplateDelimiter*string
51
+
// If defined, the given right delimiter will be used to parse go templates; otherwise, defaults to '}}'
52
+
RightTemplateDelimiter*string
53
+
}
54
+
40
55
// KustomizeGenerator is a Generator implementation that basically renders a given Kustomization.
41
56
typeKustomizeGeneratorstruct {
42
57
kustomizer*krusty.Kustomizer
@@ -54,7 +69,17 @@ var _ manifests.Generator = &KustomizeGenerator{}
54
69
// If fsys is nil, the local operating system filesystem will be used, and kustomizationPath can be an absolute or relative path (in the latter case it will be considered
55
70
// relative to the current working directory). If fsys is non-nil, then kustomizationPath should be a relative path; if an absolute path is supplied, it will be turned
56
71
// An empty kustomizationPath will be treated like ".".
0 commit comments