Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Distributed Computing and Network Fusion System
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WirelessInformationCollaborate
Distributed Computing and Network Fusion System
Commits
544e2ce3
Commit
544e2ce3
authored
Nov 11, 2019
by
wutu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发现几处bug并修复
parent
1f84edba
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
2 deletions
+11
-2
.gitignore
.gitignore
+1
-0
bishe-edge-center/src/main/java/top/ninwoo/edgecenter/service/impl/ClusterServiceImpl.java
...op/ninwoo/edgecenter/service/impl/ClusterServiceImpl.java
+5
-1
bishe-utils/src/main/java/top/ninwoo/utils/util/impl/DockerUtilsImpl.java
...main/java/top/ninwoo/utils/util/impl/DockerUtilsImpl.java
+4
-1
pom.xml
pom.xml
+1
-0
No files found.
.gitignore
View file @
544e2ce3
...
...
@@ -2,3 +2,4 @@
*.iml
/bishe-utils/target/
/bishe-edge-center/log/
/.idea/
bishe-edge-center/src/main/java/top/ninwoo/edgecenter/service/impl/ClusterServiceImpl.java
View file @
544e2ce3
...
...
@@ -148,7 +148,11 @@ public class ClusterServiceImpl implements ClusterService {
*/
@Override
public
Set
<
String
>
getContainerIdsByClusterId
(
long
clusterId
,
String
containerName
)
{
return
clustersInfo
.
get
(
clusterId
).
get
(
containerName
);
// 做安全判断
if
(
clustersInfo
.
containsKey
(
clusterId
))
{
return
clustersInfo
.
get
(
clusterId
).
get
(
containerName
);
}
return
new
HashSet
<>();
}
/**
...
...
bishe-utils/src/main/java/top/ninwoo/utils/util/impl/DockerUtilsImpl.java
View file @
544e2ce3
...
...
@@ -62,6 +62,7 @@ public class DockerUtilsImpl implements DockerUtils {
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
List
<
DockerContainer
>
dockerContainers
=
convertDockerResult
(
containers
);
dockerContainers
.
forEach
(
dockerContainer
->
containersMap
.
put
(
dockerContainer
.
getId
(),
dockerContainer
));
return
containersMap
;
...
...
@@ -74,7 +75,9 @@ public class DockerUtilsImpl implements DockerUtils {
*/
public
List
<
DockerContainer
>
convertDockerResult
(
List
<
Container
>
containers
)
{
if
(
containers
==
null
)
{
throw
new
RuntimeException
(
"容器列表不能为null"
);
LOG
.
warn
(
"docker容器列表为null"
);
// 返回一个空的列表
return
new
ArrayList
<>();
}
List
<
DockerContainer
>
dockerContainers
=
new
ArrayList
<
DockerContainer
>(
containers
.
size
());
containers
.
forEach
(
c
->
{
...
...
pom.xml
View file @
544e2ce3
...
...
@@ -19,6 +19,7 @@
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.1.2.RELEASE
</version>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
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