Skip to content

Commit 742ce20

Browse files
committed
Add support for Kustomize components
Fix #753
1 parent 4a391bd commit 742ce20

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

api/v1beta2/kustomization_types.go

+5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ type KustomizationSpec struct {
153153
// +kubebuilder:validation:Enum=none;client;server
154154
// +optional
155155
Validation string `json:"validation,omitempty"`
156+
157+
// Components specifies relative paths to specifications of other Components
158+
// via relative paths, absolute paths, or URLs.
159+
// +optional
160+
Components []string `json:"components,omitempty"`
156161
}
157162

158163
// Decryption defines how decryption is handled for Kubernetes manifests.

api/v1beta2/zz_generated.deepcopy.go

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/kustomize.toolkit.fluxcd.io_kustomizations.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,12 @@ spec:
585585
description: KustomizationSpec defines the configuration to calculate
586586
the desired state from a Source using Kustomize.
587587
properties:
588+
components:
589+
description: Components specifies relative paths to specifications
590+
of other Components via relative paths, absolute paths, or URLs.
591+
items:
592+
type: string
593+
type: array
588594
decryption:
589595
description: Decrypt Kubernetes secrets before applying them on the
590596
cluster.

internal/generator/generator.go

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ func (kg *KustomizeGenerator) WriteFile(dirPath string) (string, error) {
7979
})
8080
}
8181

82+
kus.Components = kg.kustomization.Spec.Components
83+
8284
for _, m := range kg.kustomization.Spec.PatchesStrategicMerge {
8385
kus.PatchesStrategicMerge = append(kus.PatchesStrategicMerge, kustypes.PatchStrategicMerge(m.Raw))
8486
}

0 commit comments

Comments
 (0)