Add Git branch and tag to API

This commit is contained in:
stefanprodan 2020-04-06 10:42:35 +03:00
parent f740d434dc
commit f4e568d4b9
2 changed files with 18 additions and 4 deletions

View File

@ -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

View File

@ -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