diff --git a/repctl/pkg/cmd/migrate.go b/repctl/pkg/cmd/migrate.go index 39dc9615..0ac793b0 100644 --- a/repctl/pkg/cmd/migrate.go +++ b/repctl/pkg/cmd/migrate.go @@ -1,5 +1,5 @@ /* - Copyright © 2022 Dell Inc. or its subsidiaries. All Rights Reserved. + Copyright © 2022-2023 Dell Inc. or its subsidiaries. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -341,7 +341,9 @@ func migratePV(ctx context.Context, cluster k8s.ClusterInterface, pvName string, } log.Infof("Setting migration annotation %s on pv %s", migrationAnnotation+"/"+toSC, pv.Name) pv.Annotations[migrationAnnotation] = toSC - pv.Annotations[migrationNS] = targetNS + if len(targetNS) > 0 { + pv.Annotations[migrationNS] = targetNS + } err = cluster.UpdatePersistentVolume(context.Background(), pv) if err != nil { log.Error(err, "unable to update persistent volume")