Add repository sync interval to API
This commit is contained in:
parent
2fadfbd6fc
commit
f740d434dc
|
@ -25,7 +25,10 @@ type GitRepositorySpec struct {
|
||||||
// +kubebuilder:validation:MinLength=4
|
// +kubebuilder:validation:MinLength=4
|
||||||
|
|
||||||
// The repository address
|
// The repository address
|
||||||
Url string `json:"url,omitempty"`
|
Url string `json:"url"`
|
||||||
|
|
||||||
|
// The interval at which to check for repository updates
|
||||||
|
Interval metav1.Duration `json:"interval"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GitRepositoryStatus defines the observed state of GitRepository
|
// GitRepositoryStatus defines the observed state of GitRepository
|
||||||
|
|
|
@ -25,7 +25,10 @@ type HelmRepositorySpec struct {
|
||||||
// +kubebuilder:validation:MinLength=4
|
// +kubebuilder:validation:MinLength=4
|
||||||
|
|
||||||
// The repository address
|
// The repository address
|
||||||
Url string `json:"url,omitempty"`
|
Url string `json:"url"`
|
||||||
|
|
||||||
|
// The interval at which to check for repository updates
|
||||||
|
Interval metav1.Duration `json:"interval"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// HelmRepositoryStatus defines the observed state of HelmRepository
|
// HelmRepositoryStatus defines the observed state of HelmRepository
|
||||||
|
|
|
@ -86,6 +86,7 @@ func (in *GitRepositoryList) DeepCopyObject() runtime.Object {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *GitRepositorySpec) DeepCopyInto(out *GitRepositorySpec) {
|
func (in *GitRepositorySpec) DeepCopyInto(out *GitRepositorySpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
out.Interval = in.Interval
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepositorySpec.
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitRepositorySpec.
|
||||||
|
@ -182,6 +183,7 @@ func (in *HelmRepositoryList) DeepCopyObject() runtime.Object {
|
||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *HelmRepositorySpec) DeepCopyInto(out *HelmRepositorySpec) {
|
func (in *HelmRepositorySpec) DeepCopyInto(out *HelmRepositorySpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
out.Interval = in.Interval
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepositorySpec.
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRepositorySpec.
|
||||||
|
|
|
@ -49,10 +49,16 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
description: GitRepositorySpec defines the desired state of GitRepository
|
description: GitRepositorySpec defines the desired state of GitRepository
|
||||||
properties:
|
properties:
|
||||||
|
interval:
|
||||||
|
description: The interval at which to check for repository updates
|
||||||
|
type: string
|
||||||
url:
|
url:
|
||||||
description: The repository address
|
description: The repository address
|
||||||
minLength: 4
|
minLength: 4
|
||||||
type: string
|
type: string
|
||||||
|
required:
|
||||||
|
- interval
|
||||||
|
- url
|
||||||
type: object
|
type: object
|
||||||
status:
|
status:
|
||||||
description: GitRepositoryStatus defines the observed state of GitRepository
|
description: GitRepositoryStatus defines the observed state of GitRepository
|
||||||
|
|
|
@ -49,10 +49,16 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
description: HelmRepositorySpec defines the desired state of HelmRepository
|
description: HelmRepositorySpec defines the desired state of HelmRepository
|
||||||
properties:
|
properties:
|
||||||
|
interval:
|
||||||
|
description: The interval at which to check for repository updates
|
||||||
|
type: string
|
||||||
url:
|
url:
|
||||||
description: The repository address
|
description: The repository address
|
||||||
minLength: 4
|
minLength: 4
|
||||||
type: string
|
type: string
|
||||||
|
required:
|
||||||
|
- interval
|
||||||
|
- url
|
||||||
type: object
|
type: object
|
||||||
status:
|
status:
|
||||||
description: HelmRepositoryStatus defines the observed state of HelmRepository
|
description: HelmRepositoryStatus defines the observed state of HelmRepository
|
||||||
|
|
|
@ -101,7 +101,7 @@ func (r *HelmRepositoryReconciler) Reconcile(req ctrl.Request) (ctrl.Result, err
|
||||||
return ctrl.Result{}, err
|
return ctrl.Result{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctrl.Result{RequeueAfter: time.Minute}, nil
|
return ctrl.Result{RequeueAfter: repo.Spec.Interval.Duration}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *HelmRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error {
|
func (r *HelmRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error {
|
||||||
|
|
Loading…
Reference in New Issue