Skip to content

Commit 815f979

Browse files
committed
resolving issues and generate YAMLs
Signed-off-by: Santosh Kaluskar <[email protected]>
1 parent 62487db commit 815f979

22 files changed

+349
-99
lines changed

Diff for: api/v1beta1/artifact_types.go

+10
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,30 @@ import (
2626
// Artifact represents the output of a source synchronisation.
2727
type Artifact struct {
2828
// Path is the relative file path of this artifact.
29+
// +kubebuilder:validation:MinLength=1
30+
// +kubebuilder:validation:MaxLength=253
31+
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
2932
// +required
3033
Path string `json:"path"`
3134

3235
// URL is the HTTP address of this artifact.
36+
// +kubebuilder:validation:MinLength=1
37+
// +kubebuilder:validation:MaxLength=2048
38+
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
3339
// +required
3440
URL string `json:"url"`
3541

3642
// Revision is a human readable identifier traceable in the origin source
3743
// system. It can be a Git commit SHA, Git tag, a Helm index timestamp, a Helm
3844
// chart version, etc.
45+
// +kubebuilder:validation:MaxLength=65
46+
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
3947
// +optional
4048
Revision string `json:"revision"`
4149

4250
// Checksum is the SHA256 checksum of the artifact.
51+
// +kubebuilder:validation:MaxLength=65
52+
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
4353
// +optional
4454
Checksum string `json:"checksum"`
4555

Diff for: api/v1beta1/bucket_types.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ type BucketSpec struct {
7878
// Ignore overrides the set of excluded patterns in the .sourceignore format
7979
// (which is the same as .gitignore). If not provided, a default will be used,
8080
// consult the documentation for your version to find out what those are.
81-
// +kubebuilder:validation:MinLength=1
82-
// +kubebuilder:validation:MaxLength=63
83-
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
81+
// +kubebuilder:validation:MaxLength=5119
8482
// +optional
8583
Ignore *string `json:"ignore,omitempty"`
8684

@@ -110,7 +108,7 @@ type BucketStatus struct {
110108
Conditions []metav1.Condition `json:"conditions,omitempty"`
111109

112110
// URL is the download link for the artifact output of the last Bucket sync.
113-
// +kubebuilder:validation:MaxLength=250
111+
// +kubebuilder:validation:MaxLength=2048
114112
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
115113
// +optional
116114
URL string `json:"url,omitempty"`
@@ -220,7 +218,7 @@ type Bucket struct {
220218
metav1.ObjectMeta `json:"metadata,omitempty"`
221219

222220
// +kubebuilder:validation:required
223-
Spec BucketSpec `json:"spec,omitempty"`
221+
Spec BucketSpec `json:"spec"`
224222
// +kubebuilder:default={"observedGeneration":-1}
225223
Status BucketStatus `json:"status,omitempty"`
226224
}

Diff for: api/v1beta1/gitrepository_types.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type GitRepositorySpec struct {
3939
// The repository URL, can be a HTTP/S or SSH address.
4040

4141
// +kubebuilder:validation:MinLength=1
42-
// +kubebuilder:validation:MaxLength=253
42+
// +kubebuilder:validation:MaxLength=2048
4343
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
4444
// +required
4545
URL string `json:"url"`
@@ -73,7 +73,7 @@ type GitRepositorySpec struct {
7373
// Ignore overrides the set of excluded patterns in the .sourceignore format
7474
// (which is the same as .gitignore). If not provided, a default will be used,
7575
// consult the documentation for your version to find out what those are.
76-
// +kubebuilder:validation:MaxLength=63
76+
// +kubebuilder:validation:MaxLength=5119
7777
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
7878
// +optional
7979
Ignore *string `json:"ignore,omitempty"`
@@ -135,7 +135,7 @@ type GitRepositoryInclude struct {
135135
// GitRepositoryRef defines the Git ref used for pull and checkout operations.
136136
type GitRepositoryRef struct {
137137
// The Git branch to checkout, defaults to master.
138-
// +kubebuilder:validation:MaxLength=253
138+
// +kubebuilder:validation:MaxLength=244
139139
// +kubebuilder:validation:Pattern=`^[\-._a-zA-Z0-9]+$`
140140
// +optional
141141
Branch string `json:"branch,omitempty"`
@@ -147,14 +147,14 @@ type GitRepositoryRef struct {
147147
Tag string `json:"tag,omitempty"`
148148

149149
// The Git tag semver expression, takes precedence over Tag.
150-
// +kubebuilder:validation:MaxLength=253
151-
// +kubebuilder:validation:Pattern=`^[\-._0-9]+$`
150+
// +kubebuilder:validation:MaxLength=63
151+
// +kubebuilder:validation:Pattern=`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
152152
// +optional
153153
SemVer string `json:"semver,omitempty"`
154154

155155
// The Git commit SHA to checkout, if specified Tag filters will be ignored.
156-
// +kubebuilder:validation:MaxLength=253
157-
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$
156+
// +kubebuilder:validation:MaxLength=65
157+
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
158158
// +optional
159159
Commit string `json:"commit,omitempty"`
160160
}
@@ -181,7 +181,7 @@ type GitRepositoryStatus struct {
181181

182182
// URL is the download link for the artifact output of the last repository
183183
// sync.
184-
// +kubebuilder:validation:MaxLength=253
184+
// +kubebuilder:validation:MaxLength=2048
185185
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
186186
// +optional
187187
URL string `json:"url,omitempty"`
@@ -299,7 +299,7 @@ type GitRepository struct {
299299
metav1.ObjectMeta `json:"metadata,omitempty"`
300300

301301
// +kubebuilder:validation:required
302-
Spec GitRepositorySpec `json:"spec,omitempty"`
302+
Spec GitRepositorySpec `json:"spec"`
303303
// +kubebuilder:default={"observedGeneration":-1}
304304
Status GitRepositoryStatus `json:"status,omitempty"`
305305
}

Diff for: api/v1beta1/helmchart_types.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type HelmChartSpec struct {
3939
// The chart version semver expression, ignored for charts from GitRepository
4040
// and Bucket sources. Defaults to latest when omitted.
4141
// +kubebuilder:default:=*
42-
// +kubebuilder:validation:MaxLength=63
42+
// +kubebuilder:validation:MaxLength=2048
4343
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
4444
// +optional
4545
Version string `json:"version,omitempty"`
@@ -97,9 +97,8 @@ const (
9797
// the typed referenced object at namespace level.
9898
type LocalHelmChartSourceReference struct {
9999
// APIVersion of the referent.
100-
// +kubebuilder:validation:MaxLength=63
100+
// +kubebuilder:validation:MaxLength=2048
101101
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
102-
103102
// +optional
104103
APIVersion string `json:"apiVersion,omitempty"`
105104

@@ -111,7 +110,7 @@ type LocalHelmChartSourceReference struct {
111110

112111
// Name of the referent.
113112
// +kubebuilder:validation:MinLength=1
114-
// +kubebuilder:validation:MaxLength=63
113+
// +kubebuilder:validation:MaxLength=253
115114
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
116115
// +required
117116
Name string `json:"name"`
@@ -128,6 +127,8 @@ type HelmChartStatus struct {
128127
Conditions []metav1.Condition `json:"conditions,omitempty"`
129128

130129
// URL is the download link for the last chart pulled.
130+
// +kubebuilder:validation:MaxLength=2048
131+
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
131132
// +optional
132133
URL string `json:"url,omitempty"`
133134

@@ -260,7 +261,7 @@ type HelmChart struct {
260261
metav1.ObjectMeta `json:"metadata,omitempty"`
261262

262263
// +kubebuilder:validation:required
263-
Spec HelmChartSpec `json:"spec,omitempty"`
264+
Spec HelmChartSpec `json:"spec"`
264265
// +kubebuilder:default={"observedGeneration":-1}
265266
Status HelmChartStatus `json:"status,omitempty"`
266267
}

Diff for: api/v1beta1/helmrepository_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const (
3636
type HelmRepositorySpec struct {
3737
// The Helm repository URL, a valid URL contains at least a protocol and host.
3838
// +kubebuilder:validation:MinLength=1
39-
// +kubebuilder:validation:MaxLength=253
39+
// +kubebuilder:validation:MaxLength=2048
4040
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
4141
// +required
4242
URL string `json:"url"`
@@ -88,7 +88,7 @@ type HelmRepositoryStatus struct {
8888
Conditions []metav1.Condition `json:"conditions,omitempty"`
8989

9090
// URL is the download link for the last index fetched.
91-
// +kubebuilder:validation:MaxLength=253
91+
// +kubebuilder:validation:MaxLength=2048
9292
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
9393
// +optional
9494
URL string `json:"url,omitempty"`
@@ -201,7 +201,7 @@ type HelmRepository struct {
201201
metav1.ObjectMeta `json:"metadata,omitempty"`
202202

203203
// +kubebuilder:validation:required
204-
Spec HelmRepositorySpec `json:"spec,omitempty"`
204+
Spec HelmRepositorySpec `json:"spec"`
205205
// +kubebuilder:default={"observedGeneration":-1}
206206
Status HelmRepositoryStatus `json:"status,omitempty"`
207207
}

Diff for: api/v1beta2/artifact_types.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,20 @@ type Artifact struct {
3838
// managing the Source. It can be used to retrieve the Artifact for
3939
// consumption, e.g. by another controller applying the Artifact contents.
4040
// +kubebuilder:validation:MinLength=1
41-
// +kubebuilder:validation:MaxLength=253
41+
// +kubebuilder:validation:MaxLength=2048
4242
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
4343
// +required
4444
URL string `json:"url"`
4545

4646
// Revision is a human-readable identifier traceable in the origin source
4747
// system. It can be a Git commit SHA, Git tag, a Helm chart version, etc.
48-
// +kubebuilder:validation:MaxLength=63
49-
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
48+
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
5049
// +optional
5150
Revision string `json:"revision"`
5251

5352
// Checksum is the SHA256 checksum of the Artifact file.
54-
// +kubebuilder:validation:MaxLength=250
55-
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
53+
// +kubebuilder:validation:MaxLength=65
54+
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
5655
// +optional
5756
Checksum string `json:"checksum"`
5857

Diff for: api/v1beta2/bucket_types.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ type BucketSpec struct {
9797
// Ignore overrides the set of excluded patterns in the .sourceignore format
9898
// (which is the same as .gitignore). If not provided, a default will be used,
9999
// consult the documentation for your version to find out what those are.
100-
// +kubebuilder:validation:MaxLength=63
101-
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
100+
// +kubebuilder:validation:MaxLength=5119
102101
// +optional
103102
Ignore *string `json:"ignore,omitempty"`
104103

@@ -127,7 +126,7 @@ type BucketStatus struct {
127126
// URL is the dynamic fetch link for the latest Artifact.
128127
// It is provided on a "best effort" basis, and using the precise
129128
// BucketStatus.Artifact data is recommended.
130-
// +kubebuilder:validation:MaxLength=253
129+
// +kubebuilder:validation:MaxLength=2048
131130
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
132131
// +optional
133132
URL string `json:"url,omitempty"`
@@ -185,7 +184,7 @@ type Bucket struct {
185184
metav1.ObjectMeta `json:"metadata,omitempty"`
186185

187186
// +kubebuilder:validation:required
188-
Spec BucketSpec `json:"spec,omitempty"`
187+
Spec BucketSpec `json:"spec"`
189188
// +kubebuilder:default={"observedGeneration":-1}
190189
Status BucketStatus `json:"status,omitempty"`
191190
}

Diff for: api/v1beta2/gitrepository_types.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const (
4949
type GitRepositorySpec struct {
5050
// URL specifies the Git repository URL, it can be an HTTP/S or SSH address.
5151
// +kubebuilder:validation:MinLength=1
52-
// +kubebuilder:validation:MaxLength=253
52+
// +kubebuilder:validation:MaxLength=2048
5353
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
5454
// +required
5555
URL string `json:"url"`
@@ -85,7 +85,7 @@ type GitRepositorySpec struct {
8585
// Ignore overrides the set of excluded patterns in the .sourceignore format
8686
// (which is the same as .gitignore). If not provided, a default will be used,
8787
// consult the documentation for your version to find out what those are.
88-
// +kubebuilder:validation:MaxLength=253
88+
// +kubebuilder:validation:MaxLength=5119
8989
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
9090
// +optional
9191
Ignore *string `json:"ignore,omitempty"`
@@ -161,7 +161,7 @@ type GitRepositoryRef struct {
161161
//
162162
// When GitRepositorySpec.GitImplementation is set to 'go-git', a shallow
163163
// clone of the specified branch is performed.
164-
// +kubebuilder:validation:MaxLength=63
164+
// +kubebuilder:validation:MaxLength=244
165165
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
166166
// +optional
167167
Branch string `json:"branch,omitempty"`
@@ -174,7 +174,7 @@ type GitRepositoryRef struct {
174174

175175
// SemVer tag expression to check out, takes precedence over Tag.
176176
// +kubebuilder:validation:MaxLength=63
177-
// +kubebuilder:validation:Pattern=`^[\-._0-9]+$`
177+
// +kubebuilder:validation:Pattern=`^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
178178
// +optional
179179
SemVer string `json:"semver,omitempty"`
180180

@@ -183,8 +183,7 @@ type GitRepositoryRef struct {
183183
// When GitRepositorySpec.GitImplementation is set to 'go-git', this can be
184184
// combined with Branch to shallow clone the branch, in which the commit is
185185
// expected to exist.
186-
// +kubebuilder:validation:MaxLength=250
187-
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
186+
// +kubebuilder:validation:Pattern=`^[A-Za-z0-9]{65}$`
188187
// +optional
189188
Commit string `json:"commit,omitempty"`
190189
}
@@ -215,7 +214,7 @@ type GitRepositoryStatus struct {
215214
// URL is the dynamic fetch link for the latest Artifact.
216215
// It is provided on a "best effort" basis, and using the precise
217216
// GitRepositoryStatus.Artifact data is recommended.
218-
// +kubebuilder:validation:MaxLength=253
217+
// +kubebuilder:validation:MaxLength=2048
219218
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
220219
// +optional
221220
URL string `json:"url,omitempty"`
@@ -293,7 +292,7 @@ type GitRepository struct {
293292
metav1.ObjectMeta `json:"metadata,omitempty"`
294293

295294
// +kubebuilder:validation:required
296-
Spec GitRepositorySpec `json:"spec,omitempty"`
295+
Spec GitRepositorySpec `json:"spec"`
297296
// +kubebuilder:default={"observedGeneration":-1}
298297
Status GitRepositoryStatus `json:"status,omitempty"`
299298
}

Diff for: api/v1beta2/helmchart_types.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type HelmChartSpec struct {
4141
// Version is the chart version semver expression, ignored for charts from
4242
// GitRepository and Bucket sources. Defaults to latest when omitted.
4343
// +kubebuilder:default:=*
44-
// +kubebuilder:validation:MaxLength=63
44+
// +kubebuilder:validation:MaxLength=2048
4545
// +kubebuilder:validation:Pattern=`^[\-._0-9]+$`
4646
// +optional
4747
Version string `json:"version,omitempty"`
@@ -103,7 +103,7 @@ const (
103103
// the typed referenced object at namespace level.
104104
type LocalHelmChartSourceReference struct {
105105
// APIVersion of the referent.
106-
// +kubebuilder:validation:MaxLength=63
106+
// +kubebuilder:validation:MaxLength=2048
107107
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
108108
// +optional
109109
APIVersion string `json:"apiVersion,omitempty"`
@@ -116,7 +116,7 @@ type LocalHelmChartSourceReference struct {
116116

117117
// Name of the referent.
118118
// +kubebuilder:validation:MinLength=1
119-
// +kubebuilder:validation:MaxLength=63
119+
// +kubebuilder:validation:MaxLength=253
120120
// +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$`
121121
// +required
122122
Name string `json:"name"`
@@ -150,7 +150,7 @@ type HelmChartStatus struct {
150150
// URL is the dynamic fetch link for the latest Artifact.
151151
// It is provided on a "best effort" basis, and using the precise
152152
// BucketStatus.Artifact data is recommended.
153-
// +kubebuilder:validation:MaxLength=253
153+
// +kubebuilder:validation:MaxLength=2048
154154
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
155155
// +optional
156156
URL string `json:"url,omitempty"`
@@ -225,7 +225,7 @@ type HelmChart struct {
225225
metav1.ObjectMeta `json:"metadata,omitempty"`
226226

227227
// +kubebuilder:validation:required
228-
Spec HelmChartSpec `json:"spec,omitempty"`
228+
Spec HelmChartSpec `json:"spec"`
229229
// +kubebuilder:default={"observedGeneration":-1}
230230
Status HelmChartStatus `json:"status,omitempty"`
231231
}

Diff for: api/v1beta2/helmrepository_types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type HelmRepositorySpec struct {
4444
// URL of the Helm repository, a valid URL contains at least a protocol and
4545
// host.
4646
// +kubebuilder:validation:MinLength=1
47-
// +kubebuilder:validation:MaxLength=253
47+
// +kubebuilder:validation:MaxLength=2048
4848
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
4949
// +required
5050
URL string `json:"url"`
@@ -118,7 +118,7 @@ type HelmRepositoryStatus struct {
118118
// URL is the dynamic fetch link for the latest Artifact.
119119
// It is provided on a "best effort" basis, and using the precise
120120
// HelmRepositoryStatus.Artifact data is recommended.
121-
// +kubebuilder:validation:MaxLength=253
121+
// +kubebuilder:validation:MaxLength=2048
122122
// +kubebuilder:validation:Pattern="^(http|https|ssh)://.*$"
123123
// +optional
124124
URL string `json:"url,omitempty"`
@@ -175,7 +175,7 @@ type HelmRepository struct {
175175
metav1.ObjectMeta `json:"metadata,omitempty"`
176176

177177
// +kubebuilder:validation:required
178-
Spec HelmRepositorySpec `json:"spec,omitempty"`
178+
Spec HelmRepositorySpec `json:"spec"`
179179
// +kubebuilder:default={"observedGeneration":-1}
180180
Status HelmRepositoryStatus `json:"status,omitempty"`
181181
}

0 commit comments

Comments
 (0)