Skip to content

Commit 25c5f55

Browse files
add omitempty tag to optional fields
Signed-off-by: Rashmi Gottipati <[email protected]>
1 parent 32373a7 commit 25c5f55

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ type PreflightConfig struct {
319319
// consequences of upgrading a CRD, such as data loss.
320320
//
321321
// This field is required if the spec.preflight field is specified.
322-
CRDUpgradeSafety CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety"`
322+
CRDUpgradeSafety CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety,omitempty"`
323323
}
324324

325325
// CRDUpgradeSafetyPreflightConfig is the configuration for CRD upgrade safety preflight check.
@@ -340,7 +340,7 @@ type CRDUpgradeSafetyPreflightConfig struct {
340340
//
341341
//+kubebuilder:validation:Enum:="Enabled";"Disabled"
342342
//+kubebuilder:default:=Enabled
343-
Policy CRDUpgradeSafetyPolicy `json:"policy"`
343+
Policy CRDUpgradeSafetyPolicy `json:"policy,omitempty"`
344344
}
345345

346346
const (

config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,7 @@ spec:
253253
- Enabled
254254
- Disabled
255255
type: string
256-
required:
257-
- policy
258256
type: object
259-
required:
260-
- crdUpgradeSafety
261257
type: object
262258
serviceAccount:
263259
description: |-

internal/applier/helm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func (h *Helm) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1alpha1.Clust
7373
// Skip this preflight check because it is of type *crdupgradesafety.Preflight and the CRD Upgrade Safety
7474
// preflight check has been disabled
7575
continue
76-
7776
}
7877
switch state {
7978
case StateNeedsInstall:

0 commit comments

Comments
 (0)