Skip to content

Commit 687da6c

Browse files
mayastor-borsdsharma-dc
andcommitted
Merge #1789
1789: fix(nvmf/uri): use nvmf:// scheme for tcp r=dsharma-dc a=dsharma-dc - Fixes issue where a nexus on old version gets an AddChild request for a child with new nvmf+tcp:// uri. It resulted in Unsupported uri scheme error. - Replicas always use nvmf:// uri scheme now. - Nexus use nvmf:// scheme when shared over tcp, and uses nvmf+rdma+tcp:// scheme when shared over rdma and tcp both. Co-authored-by: Diwakar Sharma <[email protected]>
2 parents 17488f4 + 1138e79 commit 687da6c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

io-engine/src/subsys/nvmf/transport.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ impl Display for TransportId {
145145
// trstring for uri scheme to explicitly indicate the tcp support
146146
// also by default when there is rdma available.
147147
let trstring = match self.0.trstring.as_str() {
148-
"RDMA" => "rdma+tcp".to_string(),
149-
_else => _else.to_lowercase(),
148+
"RDMA" => "+rdma+tcp".to_string(),
149+
_else => "".to_string(),
150150
};
151151

152152
write!(
153153
f,
154-
"nvmf+{}://{}:{}",
154+
"nvmf{}://{}:{}",
155155
trstring,
156156
self.0.traddr.as_str(),
157157
self.0.trsvcid.as_str()

io-engine/tests/nvmf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ async fn nvmf_set_target_interface() {
189189
.into_inner()
190190
.uri;
191191

192-
let re = Regex::new(r"^nvmf(\+rdma\+tcp|\+tcp)://([0-9.]+):[0-9]+/.*$").unwrap();
192+
let re = Regex::new(r"^nvmf(\+rdma\+tcp|\+tcp)?://([0-9.]+):[0-9]+/.*$").unwrap();
193193
let cap = re.captures(&bdev_uri).unwrap();
194194
let shared_ip = cap.get(2).unwrap().as_str();
195195

test/grpc/test_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const CSI_ID = 'test-node-id';
2121
const LOCALHOST = '127.0.0.1';
2222
const NVME_MODEL_ID = 'Mayastor NVMe controller';
2323
const NVME_NQN_PREFIX = 'nqn.2019-05.io.openebs';
24-
const NVMF_URI = /^nvmf\+(tcp|rdma\+tcp):\/\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d{1,5}\/nqn.2019-05.io.openebs:/;
24+
const NVMF_URI = /^nvmf(\+tcp|\+rdma\+tcp)?:\/\/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d{1,5}\/nqn.2019-05.io.openebs:/;
2525

2626
const testPort = process.env.TEST_PORT || GRPC_PORT;
2727
const myIp = getMyIp() || LOCALHOST;

0 commit comments

Comments
 (0)