@@ -17,16 +17,14 @@ limitations under the License.
1717package v1beta1
1818
1919import (
20- "time"
21-
2220 "github.com/fluxcd/pkg/apis/meta"
2321 corev1 "k8s.io/api/core/v1"
2422 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2523)
2624
2725const (
28- GitRepositoryKind = " GitRepository"
29- GitRepositoryTimeout = time . Second * 20
26+ // GitRepositoryKind is the string representation of a GitRepository.
27+ GitRepositoryKind = "GitRepository"
3028)
3129
3230// GitRepositorySpec defines the desired state of a Git repository.
@@ -49,6 +47,7 @@ type GitRepositorySpec struct {
4947 Interval metav1.Duration `json:"interval"`
5048
5149 // The timeout for remote Git operations like cloning, defaults to 20s.
50+ // +kubebuilder:default="20s"
5251 // +optional
5352 Timeout * metav1.Duration `json:"timeout,omitempty"`
5453
@@ -71,6 +70,7 @@ type GitRepositorySpec struct {
7170// GitRepositoryRef defines the Git ref used for pull and checkout operations.
7271type GitRepositoryRef struct {
7372 // The Git branch to checkout, defaults to master.
73+ // +kubebuilder:default:=master
7474 // +optional
7575 Branch string `json:"branch,omitempty"`
7676
@@ -181,14 +181,6 @@ func GitRepositoryReadyMessage(repository GitRepository) string {
181181 return ""
182182}
183183
184- // GetTimeout returns the configured timeout or the default.
185- func (in * GitRepository ) GetTimeout () time.Duration {
186- if in .Spec .Timeout != nil {
187- return in .Spec .Timeout .Duration
188- }
189- return GitRepositoryTimeout
190- }
191-
192184// GetArtifact returns the latest artifact from the source if present in the
193185// status sub-resource.
194186func (in * GitRepository ) GetArtifact () * Artifact {
0 commit comments