diff --git a/api/v1alpha1/gitrepository_types.go b/api/v1alpha1/gitrepository_types.go index cbf53f5a..09c72f36 100644 --- a/api/v1alpha1/gitrepository_types.go +++ b/api/v1alpha1/gitrepository_types.go @@ -22,13 +22,21 @@ import ( // GitRepositorySpec defines the desired state of GitRepository type GitRepositorySpec struct { - // +kubebuilder:validation:MinLength=4 + // +kubebuilder:validation:Pattern="^(http|https|ssh)://" - // The repository address + // The repository URL, can be a HTTP or SSH address. Url string `json:"url"` - // The interval at which to check for repository updates + // The interval at which to check for repository updates. Interval metav1.Duration `json:"interval"` + + // The git branch to checkout, defaults to ('master'). + // +optional + Branch string `json:"branch"` + + // The git tag to checkout, takes precedence over branch. + // +optional + Tag string `json:"tag"` } // GitRepositoryStatus defines the observed state of GitRepository diff --git a/config/crd/bases/sourcer.fluxcd.io_gitrepositories.yaml b/config/crd/bases/sourcer.fluxcd.io_gitrepositories.yaml index db82e1c3..f83b0711 100644 --- a/config/crd/bases/sourcer.fluxcd.io_gitrepositories.yaml +++ b/config/crd/bases/sourcer.fluxcd.io_gitrepositories.yaml @@ -49,12 +49,18 @@ spec: spec: description: GitRepositorySpec defines the desired state of GitRepository properties: + branch: + description: The branch to checkout + type: string interval: description: The interval at which to check for repository updates type: string + tag: + description: The tag to checkout + type: string url: description: The repository address - minLength: 4 + pattern: ^(http|https|ssh):// type: string required: - interval