diff --git a/VERSION b/VERSION index bd8bf882d0..27f9cd322b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.0 +1.8.0 diff --git a/pkg/apis/openebs.io/v1alpha1/versionDetails.go b/pkg/apis/openebs.io/v1alpha1/versionDetails.go index edb5ad32d8..86e4bab2a3 100644 --- a/pkg/apis/openebs.io/v1alpha1/versionDetails.go +++ b/pkg/apis/openebs.io/v1alpha1/versionDetails.go @@ -26,7 +26,7 @@ import ( var ( validCurrentVersions = map[string]bool{ "1.0.0": true, "1.1.0": true, "1.2.0": true, "1.3.0": true, - "1.4.0": true, "1.5.0": true, "1.6.0": true, + "1.4.0": true, "1.5.0": true, "1.6.0": true, "1.7.0": true, } validDesiredVersion = version.GetVersion() ) diff --git a/pkg/upgrade/templates/v1/cstor_pool.go b/pkg/upgrade/templates/v1/cstor_pool.go index d390921818..9482300fbc 100644 --- a/pkg/upgrade/templates/v1/cstor_pool.go +++ b/pkg/upgrade/templates/v1/cstor_pool.go @@ -17,6 +17,25 @@ limitations under the License. package templates var ( + // CSPPatch is used for patching cstor pool + CSPPatch = `{ + "metadata": { + "labels": { + "openebs.io/version": "{{.UpgradeVersion}}" + } + },{{if lt .CurrentVersion "1.8.0"}} + "spec": { + "poolSpec": { + "roThresholdLimit": 85 + } + },{{end}} + "versionDetails": { + "desired": "{{.UpgradeVersion}}", + "status": { + "state": "ReconcilePending" + } + } +}` // CSPDeployPatch is used for patching cstor pool deployment CSPDeployPatch = `{ "metadata": { diff --git a/pkg/upgrade/upgrader/csp_upgrade.go b/pkg/upgrade/upgrader/csp_upgrade.go index d498a0cb52..5474c9808d 100644 --- a/pkg/upgrade/upgrader/csp_upgrade.go +++ b/pkg/upgrade/upgrader/csp_upgrade.go @@ -38,6 +38,10 @@ type cspDeployPatchDetails struct { BaseDir, PoolMgmtImage, MExporterImage, SPCName string } +type cspPatchDetails struct { + CurrentVersion, UpgradeVersion string +} + func getCSPDeployPatchDetails( d *appsv1.Deployment, ) (*cspDeployPatchDetails, error) { @@ -118,14 +122,18 @@ func getCSPDeployment(cspName, openebsNamespace string) (*appsv1.Deployment, err } func patchCSP(cspObj *apis.CStorPool) error { + patchDetails := cspPatchDetails{ + CurrentVersion: currentVersion, + UpgradeVersion: upgradeVersion, + } cspVersion := cspObj.Labels["openebs.io/version"] if cspVersion == currentVersion { tmpl, err := template.New("cspPatch"). - Parse(templates.VersionDetailsPatch) + Parse(templates.CSPPatch) if err != nil { return errors.Wrapf(err, "failed to create template for csp patch") } - err = tmpl.Execute(&buffer, upgradeVersion) + err = tmpl.Execute(&buffer, patchDetails) if err != nil { return errors.Wrapf(err, "failed to populate template for csp patch") }