Skip to content

Commit 753d0a2

Browse files
committed
Make Path an optional field and remove validation
As due to secure joins, the requirement on both providing a path and/or requiring it to be in a certain format offers little value over the UX experience of not having to provide it when you just want to reconcile whatever can be found in the root of the source reference. Signed-off-by: Hidde Beydals <[email protected]>
1 parent 3fa356f commit 753d0a2

File tree

5 files changed

+27
-19
lines changed

5 files changed

+27
-19
lines changed

api/v1beta1/kustomization_types.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ type KustomizationSpec struct {
4545
// +optional
4646
Decryption *Decryption `json:"decryption,omitempty"`
4747

48-
// The interval at which to reconcile the kustomization.
48+
// The interval at which to reconcile the Kustomization.
4949
// +required
5050
Interval metav1.Duration `json:"interval"`
5151

@@ -54,10 +54,11 @@ type KustomizationSpec struct {
5454
// +optional
5555
KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`
5656

57-
// Path to the directory containing the kustomization file.
58-
// +kubebuilder:validation:Pattern="^\\./"
59-
// +required
60-
Path string `json:"path"`
57+
// Path to the directory containing the kustomization.yaml file, or the
58+
// set of plain YAMLs a kustomization.yaml should be generated for.
59+
// Defaults to 'None', which translates to the root path of the SourceRef.
60+
// +optional
61+
Path string `json:"path,omitempty"`
6162

6263
// Prune enables garbage collection.
6364
// +required

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

+5-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ spec:
135135
type: object
136136
type: array
137137
interval:
138-
description: The interval at which to reconcile the kustomization.
138+
description: The interval at which to reconcile the Kustomization.
139139
type: string
140140
kubeConfig:
141141
description: The KubeConfig for reconciling the Kustomization on a
@@ -159,8 +159,10 @@ spec:
159159
type: object
160160
type: object
161161
path:
162-
description: Path to the directory containing the kustomization file.
163-
pattern: ^\./
162+
description: Path to the directory containing the kustomization.yaml
163+
file, or the set of plain YAMLs a kustomization.yaml should be generated
164+
for. Defaults to 'None', which translates to the root path of the
165+
SourceRef.
164166
type: string
165167
prune:
166168
description: Prune enables garbage collection.
@@ -219,7 +221,6 @@ spec:
219221
type: string
220222
required:
221223
- interval
222-
- path
223224
- prune
224225
- sourceRef
225226
type: object

docs/api/kustomize.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Kubernetes meta/v1.Duration
108108
</em>
109109
</td>
110110
<td>
111-
<p>The interval at which to reconcile the kustomization.</p>
111+
<p>The interval at which to reconcile the Kustomization.</p>
112112
</td>
113113
</tr>
114114
<tr>
@@ -134,7 +134,10 @@ string
134134
</em>
135135
</td>
136136
<td>
137-
<p>Path to the directory containing the kustomization file.</p>
137+
<em>(Optional)</em>
138+
<p>Path to the directory containing the kustomization.yaml file, or the
139+
set of plain YAMLs a kustomization.yaml should be generated for.
140+
Defaults to &lsquo;None&rsquo;, which translates to the root path of the SourceRef.</p>
138141
</td>
139142
</tr>
140143
<tr>
@@ -609,7 +612,7 @@ Kubernetes meta/v1.Duration
609612
</em>
610613
</td>
611614
<td>
612-
<p>The interval at which to reconcile the kustomization.</p>
615+
<p>The interval at which to reconcile the Kustomization.</p>
613616
</td>
614617
</tr>
615618
<tr>
@@ -635,7 +638,10 @@ string
635638
</em>
636639
</td>
637640
<td>
638-
<p>Path to the directory containing the kustomization file.</p>
641+
<em>(Optional)</em>
642+
<p>Path to the directory containing the kustomization.yaml file, or the
643+
set of plain YAMLs a kustomization.yaml should be generated for.
644+
Defaults to &lsquo;None&rsquo;, which translates to the root path of the SourceRef.</p>
639645
</td>
640646
</tr>
641647
<tr>

docs/spec/v1alpha1/kustomization.md

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ type KustomizationSpec struct {
3030
KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`
3131

3232
// Path to the directory containing the kustomization file.
33-
// +kubebuilder:validation:Pattern="^\\./"
3433
// +required
3534
Path string `json:"path"`
3635

docs/spec/v1beta1/kustomization.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type KustomizationSpec struct {
2121
// +optional
2222
Decryption *Decryption `json:"decryption,omitempty"`
2323

24-
// The interval at which to apply the kustomization.
24+
// The interval at which to reconcile the Kustomization.
2525
// +required
2626
Interval metav1.Duration `json:"interval"`
2727

@@ -30,10 +30,11 @@ type KustomizationSpec struct {
3030
// +optional
3131
KubeConfig *KubeConfig `json:"kubeConfig,omitempty"`
3232

33-
// Path to the directory containing the kustomization.yaml file.
34-
// +kubebuilder:validation:Pattern="^\\./"
35-
// +required
36-
Path string `json:"path"`
33+
// Path to the directory containing the kustomization.yaml file, or the
34+
// set of plain YAMLs a kustomization.yaml should be generated for.
35+
// Defaults to 'None', which translates to the root path of the SourceRef.
36+
// +optional
37+
Path string `json:"path,omitempty"`
3738

3839
// Enables garbage collection.
3940
// +required

0 commit comments

Comments
 (0)