Skip to content

Commit 4646ca6

Browse files
committed
sourcev1: align CRD validation with v1beta2
Signed-off-by: kthurman59 <[email protected]>
1 parent 9e6fa65 commit 4646ca6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api/v1/helmchart_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
const HelmChartKind = "HelmChart"
2929

3030
// HelmChartSpec specifies the desired state of a Helm chart.
31+
// +kubebuilder:validation:XValidation:rule="!has(self.verify) || self.sourceRef.kind == 'HelmRepository'",message="spec.verify is only supported when spec.sourceRef.kind is 'HelmRepository'"
3132
type HelmChartSpec struct {
3233
// Chart is the name or path the Helm chart is available at in the
3334
// SourceRef.

config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ spec:
198198
- interval
199199
- sourceRef
200200
type: object
201+
x-kubernetes-validations:
202+
- message: spec.verify is only supported when spec.sourceRef.kind is 'HelmRepository'
203+
rule: '!has(self.verify) || self.sourceRef.kind == ''HelmRepository'''
201204
status:
202205
default:
203206
observedGeneration: -1

0 commit comments

Comments
 (0)