WIP: Adding CRD validation by Santosh1176 · Pull Request #888 · fluxcd/source-controller
Comment on lines +81 to +83
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=63 | ||
| // +kubebuilder:validation:Pattern=`^([a-zA-Z0-9_\-.\\\/]|\[[0-9]{1,5}\])+$` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignore field can have thousands of lines with special characters and UTF8, think of file paths written in Chinese.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Should the validation be removed from this Igonore?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation pattern yes, the max length should be less than etcd entry max size (1MB).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would that be 5000? (<5120)
|
|
||
| // The Git tag semver expression, takes precedence over Tag. | ||
| // +kubebuilder:validation:MaxLength=253 | ||
| // +kubebuilder:validation:Pattern=`^[\-._0-9]+$` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| // Name of the referent. | ||
| // +kubebuilder:validation:MinLength=1 | ||
| // +kubebuilder:validation:MaxLength=63 |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // +kubebuilder:validation:MaxLength=63 | |
| // +kubebuilder:validation:MaxLength=253 |
Kubernetes object name max length is 253, please use this value for all fields that references a Kube object by name.
|
|
||
| // Revision is a human-readable identifier traceable in the origin source | ||
| // system. It can be a Git commit SHA, Git tag, a Helm chart version, etc. | ||
| // +kubebuilder:validation:MaxLength=63 |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks Flux, we use SHA256 for OCI and for Git we append the brach name to the Git SHA.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| // the typed referenced object at namespace level. | ||
| type LocalHelmChartSourceReference struct { | ||
| // APIVersion of the referent. | ||
| // +kubebuilder:validation:MaxLength=63 |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // +kubebuilder:validation:MaxLength=63 | |
| // +kubebuilder:validation:MaxLength=2048 |
Please change this in all objects with APIVersion fields.
| // | ||
| // When GitRepositorySpec.GitImplementation is set to 'go-git', a shallow | ||
| // clone of the specified branch is performed. | ||
| // +kubebuilder:validation:MaxLength=63 |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // +kubebuilder:validation:MaxLength=63 | |
| // +kubebuilder:validation:MaxLength=244 |
Comment on lines +44 to +45
| // +kubebuilder:validation:MaxLength=63 | ||
| // +kubebuilder:validation:Pattern=`^[\-._0-9]+$` |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version can be a semver expression as documented above