From 4a1fc11b2d4aeb041f74c03a12f20cf9c912aa4e 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 3359a960..3522d373 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