fix(topo): support old topology key for backward compatibility

Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
Pawan 2021-05-04 10:35:59 +05:30 committed by Kiran Mova
parent ea8049f30d
commit 0e6a02ea74
4 changed files with 5 additions and 0 deletions

View file

@ -0,0 +1 @@
support old topology key `openebs.io/nodename` for backward compatibility

View file

@ -233,6 +233,8 @@ func (ns *node) NodeGetInfo(
if _, ok := topology[zfs.ZFSTopologyKey]; !ok { if _, ok := topology[zfs.ZFSTopologyKey]; !ok {
topology[zfs.ZFSTopologyKey] = ns.driver.config.Nodename topology[zfs.ZFSTopologyKey] = ns.driver.config.Nodename
} }
// add old topology key to support backward compatibility for velero
topology[zfs.ZFSTopoNodenameKey] = ns.driver.config.Nodename
return &csi.NodeGetInfoResponse{ return &csi.NodeGetInfoResponse{
NodeId: ns.driver.config.Nodename, NodeId: ns.driver.config.Nodename,

View file

@ -51,6 +51,8 @@ const (
ZFSNodeKey string = "kubernetes.io/nodename" ZFSNodeKey string = "kubernetes.io/nodename"
// ZFSTopologyKey is supported topology key for the zfs driver // ZFSTopologyKey is supported topology key for the zfs driver
ZFSTopologyKey string = "openebs.io/nodeid" ZFSTopologyKey string = "openebs.io/nodeid"
// ZFSTopoNodenameKey is supported topology key for the zfs driver
ZFSTopoNodenameKey string = "openebs.io/nodename"
// ZFSStatusPending shows object has not handled yet // ZFSStatusPending shows object has not handled yet
ZFSStatusPending string = "Pending" ZFSStatusPending string = "Pending"
// ZFSStatusFailed shows object operation has failed // ZFSStatusFailed shows object operation has failed