diff --git a/api/v1beta2/helmrepository_types.go b/api/v1beta2/helmrepository_types.go index a73a445b..1c25a9eb 100644 --- a/api/v1beta2/helmrepository_types.go +++ b/api/v1beta2/helmrepository_types.go @@ -89,13 +89,13 @@ type HelmRepositorySpec struct { // efficient use of resources. // +kubebuilder:validation:Type=string // +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$" - // +required - Interval metav1.Duration `json:"interval"` + // +optional + Interval metav1.Duration `json:"interval,omitempty"` // Timeout is used for the index fetch operation for an HTTPS helm repository, - // and for remote OCI Repository operations like pulling for an OCI helm repository. + // and for remote OCI Repository operations like pulling for an OCI helm + // chart by the associated HelmChart. // Its default value is 60s. - // +kubebuilder:default:="60s" // +kubebuilder:validation:Type=string // +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m))+$" // +optional @@ -170,7 +170,19 @@ func (in *HelmRepository) SetConditions(conditions []metav1.Condition) { // GetRequeueAfter returns the duration after which the source must be // reconciled again. func (in HelmRepository) GetRequeueAfter() time.Duration { - return in.Spec.Interval.Duration + if in.Spec.Interval.Duration != 0 { + return in.Spec.Interval.Duration + } + return time.Minute +} + +// GetTimeout returns the timeout duration used for various operations related +// to this HelmRepository. +func (in HelmRepository) GetTimeout() time.Duration { + if in.Spec.Timeout != nil { + return in.Spec.Timeout.Duration + } + return time.Minute } // GetArtifact returns the latest artifact from the source if present in the diff --git a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml index 5d157287..a17ab56d 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml @@ -357,10 +357,10 @@ spec: of this HelmRepository. type: boolean timeout: - default: 60s description: Timeout is used for the index fetch operation for an HTTPS helm repository, and for remote OCI Repository operations - like pulling for an OCI helm repository. Its default value is 60s. + like pulling for an OCI helm chart by the associated HelmChart. + Its default value is 60s. pattern: ^([0-9]+(\.[0-9]+)?(ms|s|m))+$ type: string type: @@ -376,7 +376,6 @@ spec: pattern: ^(http|https|oci)://.*$ type: string required: - - interval - url type: object status: diff --git a/docs/api/v1beta2/source.md b/docs/api/v1beta2/source.md index edfa29a5..46649e23 100644 --- a/docs/api/v1beta2/source.md +++ b/docs/api/v1beta2/source.md @@ -866,6 +866,7 @@ Kubernetes meta/v1.Duration
Interval at which the HelmRepository URL is checked for updates. This interval is approximate and may be subject to jitter to ensure efficient use of resources.
@@ -883,7 +884,8 @@ Kubernetes meta/v1.DurationTimeout is used for the index fetch operation for an HTTPS helm repository, -and for remote OCI Repository operations like pulling for an OCI helm repository. +and for remote OCI Repository operations like pulling for an OCI helm +chart by the associated HelmChart. Its default value is 60s.
Interval at which the HelmRepository URL is checked for updates. This interval is approximate and may be subject to jitter to ensure efficient use of resources.
@@ -2600,7 +2603,8 @@ Kubernetes meta/v1.DurationTimeout is used for the index fetch operation for an HTTPS helm repository, -and for remote OCI Repository operations like pulling for an OCI helm repository. +and for remote OCI Repository operations like pulling for an OCI helm +chart by the associated HelmChart. Its default value is 60s.