Skip to content

Commit

Permalink
fix(migrate): forward ioworkers and queuedepth from old to new volume (
Browse files Browse the repository at this point in the history
…#12)

Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubham14bajpai authored Jun 29, 2020
1 parent 407cabe commit 0f3fb8a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/migrate/cstor/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,31 @@ func (v *VolumeMigrator) createTempPolicy() error {
v.PVName, cvObj.Spec.ReplicationFactor, len(replicas.Items),
)
}
tempPolicy.Spec.Replica.IOWorkers = replicas.Items[0].Spec.ZvolWorkers
for _, replica := range replicas.Items {
tempPolicy.Spec.ReplicaPoolInfo = append(tempPolicy.Spec.ReplicaPoolInfo,
cstor.ReplicaPoolInfo{
PoolName: replica.Labels[cspiNameLabel],
},
)
}
for _, con := range targetDeploy.Spec.Template.Spec.Containers {
if con.Name == "cstor-istgt" {
for _, env := range con.Env {
switch env.Name {
case "QueueDepth":
tempPolicy.Spec.Target.QueueDepth = env.Value

case "Luworkers":
tempPolicy.Spec.Target.IOWorkers, err = strconv.ParseInt(env.Value, 10, 64)
if err != nil {
return errors.Wrap(err, "failed to set Luworkers on cvc")
}
}
}
break
}
}
_, err = v.OpenebsClientset.CstorV1().
CStorVolumePolicies(v.OpenebsNamespace).
Create(tempPolicy)
Expand Down

0 comments on commit 0f3fb8a

Please sign in to comment.