Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zombienet-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
zombienet-sdk
Commits
30642927
Unverified
Commit
30642927
authored
1 year ago
by
Nikos Kontakis
Browse files
Options
Downloads
Patches
Plain Diff
Use the Entry API for hashmap
parent
c4707ac6
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crates/provider/src/native.rs
+4
-17
4 additions, 17 deletions
crates/provider/src/native.rs
with
4 additions
and
17 deletions
crates/provider/src/native.rs
+
4
−
17
View file @
30642927
...
...
@@ -168,19 +168,6 @@ impl<T: FileSystem + Send + Sync> Provider for NativeProvider<T> {
async
fn
create_resource
(
&
mut
self
,
resource_def
:
PodDef
)
->
Result
<
(),
Box
<
dyn
Error
>>
{
let
name
:
String
=
resource_def
.metadata.name
.clone
();
// This is temporary solution for filling up the process map. To be deleted:
// self.process_map.insert(
// name.clone(),
// Process {
// pid: 1,
// log_dir: format!("{}/{}", self.tmp_dir, name.clone()),
// port_mapping: HashMap::new(),
// command: String::new(),
// },
// );
// Delete the code above once spawnFromDef is implemented
let
local_file_path
:
String
=
format!
(
"{}/{}.yaml"
,
&
self
.tmp_dir
,
name
);
let
content
:
String
=
serde_json
::
to_string
(
&
resource_def
)
?
;
...
...
@@ -229,11 +216,11 @@ impl<T: FileSystem + Send + Sync> Provider for NativeProvider<T> {
// nodeProcess.stdout.pipe(log);
// nodeProcess.stderr.pipe(log);
self
.process_map
.get_mut
(
&
name
)
.unwrap
()
.pid
=
child_process
.id
()
.unwrap
();
self
.process_map
.get_mut
(
&
name
)
.unwrap
()
.command
=
format!
(
"{}"
,
resource_def
.spec.command
);
self
.process_map
.entry
(
name
.clone
())
.and_modify
(|
f
|
{
f
.pid
=
child_process
.id
()
.unwrap
();
f
.command
=
format!
(
"{}"
,
resource_def
.spec.command
);
});
// TODO: await this.wait_node_ready(name);
let
_
=
self
.wait_node_ready
(
name
)
.await
;
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment