Skip to content

Commit b522ba9

Browse files
Update fields in the spec to no longer be a pointer
Signed-off-by: Rashmi Gottipati <[email protected]>
1 parent e664658 commit b522ba9

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

api/v1alpha1/clusterextension_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ type ClusterExtensionSpec struct {
265265
// When not specified, the default configuration for each preflight check will be used.
266266
//
267267
//+optional
268-
Preflight *PreflightConfig `json:"preflight,omitempty"`
268+
Preflight PreflightConfig `json:"preflight,omitempty"`
269269

270270
// serviceAccount is a required reference to a ServiceAccount that exists
271271
// in the installNamespace. The provided ServiceAccount is used to install and
@@ -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"`
323323
}
324324

325325
// CRDUpgradeSafetyPreflightConfig is the configuration for CRD upgrade safety preflight check.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 2 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/applier/helm.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ func (h *Helm) Apply(ctx context.Context, contentFS fs.FS, ext *ocv1alpha1.Clust
6969
}
7070

7171
for _, preflight := range h.Preflights {
72-
if ext.Spec.Preflight != nil && ext.Spec.Preflight.CRDUpgradeSafety != nil {
73-
if _, ok := preflight.(*crdupgradesafety.Preflight); ok && ext.Spec.Preflight.CRDUpgradeSafety.Policy == ocv1alpha1.CRDUpgradeSafetyPolicyDisabled {
74-
// Skip this preflight check because it is of type *crdupgradesafety.Preflight and the CRD Upgrade Safety
75-
// preflight check has been disabled
76-
continue
77-
}
72+
if _, ok := preflight.(*crdupgradesafety.Preflight); ok && ext.Spec.Preflight.CRDUpgradeSafety.Policy == ocv1alpha1.CRDUpgradeSafetyPolicyDisabled {
73+
// Skip this preflight check because it is of type *crdupgradesafety.Preflight and the CRD Upgrade Safety
74+
// preflight check has been disabled
75+
continue
76+
7877
}
7978
switch state {
8079
case StateNeedsInstall:

0 commit comments

Comments
 (0)