@@ -21,29 +21,32 @@ import (
2121 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222)
2323
24- // GitRepositorySpec defines the desired state of GitRepository
24+ // GitRepositorySpec defines the desired state of a Git repository.
2525type GitRepositorySpec struct {
2626 // The repository URL, can be a HTTP or SSH address.
2727 // +kubebuilder:validation:Pattern="^(http|https|ssh)://"
2828 // +required
2929 URL string `json:"url"`
3030
3131 // The secret name containing the Git credentials.
32- // For HTTPS repositories the secret must contain username and password fields.
33- // For SSH repositories the secret must contain identity, identity.pub and known_hosts fields.
32+ // For HTTPS repositories the secret must contain username and password
33+ // fields.
34+ // For SSH repositories the secret must contain identity, identity.pub and
35+ // known_hosts fields.
3436 // +optional
3537 SecretRef * corev1.LocalObjectReference `json:"secretRef,omitempty"`
3638
3739 // The interval at which to check for repository updates.
3840 // +required
3941 Interval metav1.Duration `json:"interval"`
4042
41- // The git reference to checkout and monitor for changes, defaults to master branch.
43+ // The git reference to checkout and monitor for changes, defaults to
44+ // master branch.
4245 // +optional
4346 Reference * GitRepositoryRef `json:"ref,omitempty"`
4447}
4548
46- // GitRepositoryRef defines the git ref used for pull and checkout operations
49+ // GitRepositoryRef defines the git ref used for pull and checkout operations.
4750type GitRepositoryRef struct {
4851 // The git branch to checkout, defaults to master.
4952 // +optional
@@ -57,17 +60,19 @@ type GitRepositoryRef struct {
5760 // +optional
5861 SemVer string `json:"semver"`
5962
60- // The git commit sha to checkout, if specified tag filters will be ignored.
63+ // The git commit sha to checkout, if specified tag filters will be
64+ // ignored.
6165 // +optional
6266 Commit string `json:"commit"`
6367}
6468
65- // GitRepositoryStatus defines the observed state of GitRepository
69+ // GitRepositoryStatus defines the observed state of the GitRepository.
6670type GitRepositoryStatus struct {
6771 // +optional
6872 Conditions []SourceCondition `json:"conditions,omitempty"`
6973
70- // URL is the download link for the artifact output of the last repository sync.
74+ // URL is the download link for the artifact output of the last repository
75+ // sync.
7176 // +optional
7277 URL string `json:"url,omitempty"`
7378
@@ -77,8 +82,13 @@ type GitRepositoryStatus struct {
7782}
7883
7984const (
85+ // GitOperationSucceedReason represents the fact that the git clone, pull
86+ // and checkout operations succeeded.
8087 GitOperationSucceedReason string = "GitOperationSucceed"
81- GitOperationFailedReason string = "GitOperationFailed"
88+
89+ // GitOperationFailedReason represents the fact that the git clone, pull or
90+ // checkout operations failed.
91+ GitOperationFailedReason string = "GitOperationFailed"
8292)
8393
8494func GitRepositoryReady (repository GitRepository , artifact Artifact , url , reason , message string ) GitRepository {
0 commit comments