Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Cleanup old/previous replicas during volume sync (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmxs authored Feb 1, 2022
1 parent 0d26255 commit 9957fef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/controllers/sync-volume/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func getConverter(vol *stosv1.Volume, obj storageos.Object, log logr.Logger) fun
ConfigLabels: obj.GetLabels(),
}

vol.Spec.NFS = stosv1.NFSConfig{}
if stosVol.Nfs.Exports != nil {
vol.Spec.NFS = stosv1.NFSConfig{
Exports: make([]stosv1.NFSExportConfig, 0, len(*stosVol.Nfs.Exports)),
Expand Down Expand Up @@ -159,6 +160,7 @@ func getConverter(vol *stosv1.Volume, obj storageos.Object, log logr.Logger) fun
AttachedOnHost: stosVol.AttachedOnHost,
}

vol.Status.Replicas = nil
if stosVol.Replicas != nil {
vol.Status.Replicas = make([]stosv1.ReplicaDeploymentInfo, 0, len(*stosVol.Replicas))
for _, stosReplica := range *stosVol.Replicas {
Expand Down

0 comments on commit 9957fef

Please sign in to comment.