Skip to content

Commit

Permalink
Repctl: Set migration namespace only if it is provided (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshatdell authored Jun 5, 2023
1 parent aad1796 commit a3cbec5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions repctl/pkg/cmd/migrate.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit a3cbec5

Please sign in to comment.