Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
bdad6f1a
Unverified
Commit
bdad6f1a
authored
Oct 07, 2025
by
Graham King
Committed by
GitHub
Oct 07, 2025
Browse files
fix: Make planner VirtualConnectorClient also use v1/ prefix. (#3468)
Signed-off-by:
Graham King
<
grahamk@nvidia.com
>
parent
55f7e637
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
lib/bindings/python/rust/planner.rs
lib/bindings/python/rust/planner.rs
+2
-2
lib/runtime/src/transports/etcd.rs
lib/runtime/src/transports/etcd.rs
+2
-5
No files found.
lib/bindings/python/rust/planner.rs
View file @
bdad6f1a
...
@@ -102,7 +102,7 @@ impl VirtualConnectorCoordinator {
...
@@ -102,7 +102,7 @@ impl VirtualConnectorCoordinator {
let
prefix
=
root_key
(
&
self
.0
.namespace
);
let
prefix
=
root_key
(
&
self
.0
.namespace
);
let
inner
=
self
.0
.clone
();
let
inner
=
self
.0
.clone
();
pyo3_async_runtimes
::
tokio
::
future_into_py
(
py
,
async
move
{
pyo3_async_runtimes
::
tokio
::
future_into_py
(
py
,
async
move
{
let
kv_cache
=
KvCache
::
new
(
inner
.etcd_client
.clone
(),
"v1"
,
prefix
,
HashMap
::
new
())
let
kv_cache
=
KvCache
::
new
(
inner
.etcd_client
.clone
(),
prefix
,
HashMap
::
new
())
.await
.await
.map_err
(
to_pyerr
)
?
;
.map_err
(
to_pyerr
)
?
;
*
inner
.kv_cache
.lock
()
=
Some
(
Arc
::
new
(
kv_cache
));
*
inner
.kv_cache
.lock
()
=
Some
(
Arc
::
new
(
kv_cache
));
...
@@ -497,5 +497,5 @@ fn load(a: &AtomicUsize) -> usize {
...
@@ -497,5 +497,5 @@ fn load(a: &AtomicUsize) -> usize {
}
}
fn
root_key
(
namespace
:
&
str
)
->
String
{
fn
root_key
(
namespace
:
&
str
)
->
String
{
format!
(
"{namespace}/planner/"
)
format!
(
"
v1/
{namespace}/planner/"
)
}
}
lib/runtime/src/transports/etcd.rs
View file @
bdad6f1a
...
@@ -515,14 +515,11 @@ impl KvCache {
...
@@ -515,14 +515,11 @@ impl KvCache {
/// Create a new KV cache for the given prefix
/// Create a new KV cache for the given prefix
pub
async
fn
new
(
pub
async
fn
new
(
client
:
Client
,
client
:
Client
,
version
:
&
str
,
prefix
:
String
,
prefix
:
String
,
initial_values
:
HashMap
<
String
,
Vec
<
u8
>>
,
initial_values
:
HashMap
<
String
,
Vec
<
u8
>>
,
)
->
Result
<
Self
>
{
)
->
Result
<
Self
>
{
let
mut
cache
=
HashMap
::
new
();
let
mut
cache
=
HashMap
::
new
();
let
prefix
=
format!
(
"{version}/{prefix}"
);
// First get all existing keys with this prefix
// First get all existing keys with this prefix
let
existing_kvs
=
client
.kv_get_prefix
(
&
prefix
)
.await
?
;
let
existing_kvs
=
client
.kv_get_prefix
(
&
prefix
)
.await
?
;
for
kv
in
existing_kvs
{
for
kv
in
existing_kvs
{
...
@@ -712,7 +709,7 @@ mod tests {
...
@@ -712,7 +709,7 @@ mod tests {
// Create a unique test prefix to avoid conflicts with other tests
// Create a unique test prefix to avoid conflicts with other tests
let
test_id
=
uuid
::
Uuid
::
new_v4
()
.to_string
();
let
test_id
=
uuid
::
Uuid
::
new_v4
()
.to_string
();
let
prefix
=
format!
(
"test_kv_cache_{}/"
,
test_id
);
let
prefix
=
format!
(
"
v1/
test_kv_cache_{}/"
,
test_id
);
// Initial values
// Initial values
let
mut
initial_values
=
HashMap
::
new
();
let
mut
initial_values
=
HashMap
::
new
();
...
@@ -720,7 +717,7 @@ mod tests {
...
@@ -720,7 +717,7 @@ mod tests {
initial_values
.insert
(
"key2"
.to_string
(),
b
"value2"
.to_vec
());
initial_values
.insert
(
"key2"
.to_string
(),
b
"value2"
.to_vec
());
// Create the KV cache
// Create the KV cache
let
kv_cache
=
KvCache
::
new
(
client
.clone
(),
"v1"
,
prefix
.clone
(),
initial_values
)
.await
?
;
let
kv_cache
=
KvCache
::
new
(
client
.clone
(),
prefix
.clone
(),
initial_values
)
.await
?
;
// Test get
// Test get
let
value1
=
kv_cache
.get
(
"key1"
)
.await
;
let
value1
=
kv_cache
.get
(
"key1"
)
.await
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment