OnlyOnce preupgrade check (#2037)

* OnlyOnce preupgrade check

Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>

* Update preupgradechecks.go

Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Harsh Thakur
2021-05-24 14:32:11 +05:30
committed by GitHub
co-authored by Sanket Sudake
parent 42c22a7bbb
commit 4a1fc11b2d
+1 -1
View File
@@ -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