Skip to content

Commit

Permalink
Add support for Kustomize components
Browse files Browse the repository at this point in the history
Fix #753
  • Loading branch information
klausenbusk committed Oct 28, 2022
1 parent 4a391bd commit 742ce20
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v1beta2/kustomization_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ type KustomizationSpec struct {
// +kubebuilder:validation:Enum=none;client;server
// +optional
Validation string `json:"validation,omitempty"`

// Components specifies relative paths to specifications of other Components
// via relative paths, absolute paths, or URLs.
// +optional
Components []string `json:"components,omitempty"`
}

// Decryption defines how decryption is handled for Kubernetes manifests.
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,12 @@ spec:
description: KustomizationSpec defines the configuration to calculate
the desired state from a Source using Kustomize.
properties:
components:
description: Components specifies relative paths to specifications
of other Components via relative paths, absolute paths, or URLs.
items:
type: string
type: array
decryption:
description: Decrypt Kubernetes secrets before applying them on the
cluster.
Expand Down
2 changes: 2 additions & 0 deletions internal/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ func (kg *KustomizeGenerator) WriteFile(dirPath string) (string, error) {
})
}

kus.Components = kg.kustomization.Spec.Components

for _, m := range kg.kustomization.Spec.PatchesStrategicMerge {
kus.PatchesStrategicMerge = append(kus.PatchesStrategicMerge, kustypes.PatchStrategicMerge(m.Raw))
}
Expand Down

0 comments on commit 742ce20

Please sign in to comment.