diff --git a/api/v1alpha1/gitrepository_types.go b/api/v1alpha1/gitrepository_types.go index 7636df0f9..a6c82a26d 100644 --- a/api/v1alpha1/gitrepository_types.go +++ b/api/v1alpha1/gitrepository_types.go @@ -42,8 +42,7 @@ type GitRepositorySpec struct { // +required Interval metav1.Duration `json:"interval"` - // The timeout for remote git operations like cloning. - // +kubebuilder:validation:Default=20s + // The timeout for remote git operations like cloning, default to 20s. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` @@ -61,20 +60,19 @@ type GitRepositorySpec struct { type GitRepositoryRef struct { // The git branch to checkout, defaults to master. // +optional - Branch string `json:"branch"` + Branch string `json:"branch,omitempty"` // The git tag to checkout, takes precedence over branch. // +optional - Tag string `json:"tag"` + Tag string `json:"tag,omitempty"` // The git tag semver expression, takes precedence over tag. // +optional - SemVer string `json:"semver"` + SemVer string `json:"semver,omitempty"` - // The git commit sha to checkout, if specified tag filters will be - // ignored. + // The git commit sha to checkout, if specified tag filters will be ignored. // +optional - Commit string `json:"commit"` + Commit string `json:"commit,omitempty"` } // GitRepositoryVerification defines the OpenPGP signature verification process. diff --git a/config/crd/bases/source.fluxcd.io_gitrepositories.yaml b/config/crd/bases/source.fluxcd.io_gitrepositories.yaml index 3b1ac754b..049544737 100644 --- a/config/crd/bases/source.fluxcd.io_gitrepositories.yaml +++ b/config/crd/bases/source.fluxcd.io_gitrepositories.yaml @@ -83,7 +83,8 @@ spec: type: string type: object timeout: - description: The timeout for remote git operations like cloning. + description: The timeout for remote git operations like cloning, default + to 20s. type: string url: description: The repository URL, can be a HTTP or SSH address. diff --git a/docs/spec/v1alpha1/gitrepositories.md b/docs/spec/v1alpha1/gitrepositories.md index bfef59223..3db341ce0 100644 --- a/docs/spec/v1alpha1/gitrepositories.md +++ b/docs/spec/v1alpha1/gitrepositories.md @@ -27,8 +27,7 @@ type GitRepositorySpec struct { // The interval at which to check for repository updates. Interval metav1.Duration `json:"interval"` - // The timeout for remote git operations like cloning. - // +kubebuilder:validation:Default=20s + // The timeout for remote git operations like cloning, default to 20s. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` @@ -50,20 +49,19 @@ Git repository reference: type GitRepositoryRef struct { // The git branch to checkout, defaults to master. // +optional - Branch string `json:"branch"` + Branch string `json:"branch,omitempty"` // The git tag to checkout, takes precedence over branch. // +optional - Tag string `json:"tag"` + Tag string `json:"tag,omitempty"` // The git tag semver expression, takes precedence over tag. // +optional - SemVer string `json:"semver"` + SemVer string `json:"semver,omitempty"` - // The git commit sha to checkout, if specified branch and tag filters will - // ignored. + // The git commit sha to checkout, if specified tag filters will be ignored. // +optional - Commit string `json:"commit"` + Commit string `json:"commit,omitempty"` } ```