From f0d3f2bcf369348682ef6078092f455f5be1cd2a Mon Sep 17 00:00:00 2001 From: Harsh Thakur Date: Mon, 24 May 2021 09:02:11 +0000 Subject: [PATCH] OnlyOnce preupgrade check (#2037) * OnlyOnce preupgrade check Signed-off-by: Harsh Thakur * Update preupgradechecks.go Co-authored-by: Sanket Sudake --- cmd/preupgradechecks/preupgradechecks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/preupgradechecks/preupgradechecks.go b/cmd/preupgradechecks/preupgradechecks.go index 3359a9604..3522d3733 100644 --- a/cmd/preupgradechecks/preupgradechecks.go +++ b/cmd/preupgradechecks/preupgradechecks.go @@ -87,7 +87,7 @@ func (client *PreUpgradeTaskClient) LatestSchemaApplied() error { return errors.New("Could not get the Function CRD") } // Any new field added in Function spec can be checked here provided the substring matches the description in CRD Validation of the field - if !strings.Contains(crd.Spec.String(), "RequestsPerPod") { + if !strings.Contains(crd.Spec.String(), "RequestsPerPod") || !strings.Contains(crd.Spec.String(), "OnceOnly") { return errors.New("Apply the newer CRDs before upgrading") } return nil