git: fix reference json serialization
- add omitempty to GitRepositoryRef fields
This commit is contained in:
parent
f2bff9053d
commit
c9db552555
|
|
@ -42,8 +42,7 @@ type GitRepositorySpec struct {
|
||||||
// +required
|
// +required
|
||||||
Interval metav1.Duration `json:"interval"`
|
Interval metav1.Duration `json:"interval"`
|
||||||
|
|
||||||
// The timeout for remote git operations like cloning.
|
// The timeout for remote git operations like cloning, default to 20s.
|
||||||
// +kubebuilder:validation:Default=20s
|
|
||||||
// +optional
|
// +optional
|
||||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||||
|
|
||||||
|
|
@ -61,20 +60,19 @@ type GitRepositorySpec struct {
|
||||||
type GitRepositoryRef struct {
|
type GitRepositoryRef struct {
|
||||||
// The git branch to checkout, defaults to master.
|
// The git branch to checkout, defaults to master.
|
||||||
// +optional
|
// +optional
|
||||||
Branch string `json:"branch"`
|
Branch string `json:"branch,omitempty"`
|
||||||
|
|
||||||
// The git tag to checkout, takes precedence over branch.
|
// The git tag to checkout, takes precedence over branch.
|
||||||
// +optional
|
// +optional
|
||||||
Tag string `json:"tag"`
|
Tag string `json:"tag,omitempty"`
|
||||||
|
|
||||||
// The git tag semver expression, takes precedence over tag.
|
// The git tag semver expression, takes precedence over tag.
|
||||||
// +optional
|
// +optional
|
||||||
SemVer string `json:"semver"`
|
SemVer string `json:"semver,omitempty"`
|
||||||
|
|
||||||
// The git commit sha to checkout, if specified tag filters will be
|
// The git commit sha to checkout, if specified tag filters will be ignored.
|
||||||
// ignored.
|
|
||||||
// +optional
|
// +optional
|
||||||
Commit string `json:"commit"`
|
Commit string `json:"commit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GitRepositoryVerification defines the OpenPGP signature verification process.
|
// GitRepositoryVerification defines the OpenPGP signature verification process.
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,8 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
timeout:
|
timeout:
|
||||||
description: The timeout for remote git operations like cloning.
|
description: The timeout for remote git operations like cloning, default
|
||||||
|
to 20s.
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
description: The repository URL, can be a HTTP or SSH address.
|
description: The repository URL, can be a HTTP or SSH address.
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ type GitRepositorySpec struct {
|
||||||
// The interval at which to check for repository updates.
|
// The interval at which to check for repository updates.
|
||||||
Interval metav1.Duration `json:"interval"`
|
Interval metav1.Duration `json:"interval"`
|
||||||
|
|
||||||
// The timeout for remote git operations like cloning.
|
// The timeout for remote git operations like cloning, default to 20s.
|
||||||
// +kubebuilder:validation:Default=20s
|
|
||||||
// +optional
|
// +optional
|
||||||
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
Timeout *metav1.Duration `json:"timeout,omitempty"`
|
||||||
|
|
||||||
|
|
@ -50,20 +49,19 @@ Git repository reference:
|
||||||
type GitRepositoryRef struct {
|
type GitRepositoryRef struct {
|
||||||
// The git branch to checkout, defaults to master.
|
// The git branch to checkout, defaults to master.
|
||||||
// +optional
|
// +optional
|
||||||
Branch string `json:"branch"`
|
Branch string `json:"branch,omitempty"`
|
||||||
|
|
||||||
// The git tag to checkout, takes precedence over branch.
|
// The git tag to checkout, takes precedence over branch.
|
||||||
// +optional
|
// +optional
|
||||||
Tag string `json:"tag"`
|
Tag string `json:"tag,omitempty"`
|
||||||
|
|
||||||
// The git tag semver expression, takes precedence over tag.
|
// The git tag semver expression, takes precedence over tag.
|
||||||
// +optional
|
// +optional
|
||||||
SemVer string `json:"semver"`
|
SemVer string `json:"semver,omitempty"`
|
||||||
|
|
||||||
// The git commit sha to checkout, if specified branch and tag filters will
|
// The git commit sha to checkout, if specified tag filters will be ignored.
|
||||||
// ignored.
|
|
||||||
// +optional
|
// +optional
|
||||||
Commit string `json:"commit"`
|
Commit string `json:"commit,omitempty"`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue