Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-WIC-Cnf
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
CommunityXG
OpenXG-WIC-Cnf
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 @@
...
@@ -2,3 +2,4 @@
*.iml
*.iml
/bishe-utils/target/
/bishe-utils/target/
/bishe-edge-center/log/
/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 {
...
@@ -148,7 +148,11 @@ public class ClusterServiceImpl implements ClusterService {
*/
*/
@Override
@Override
public
Set
<
String
>
getContainerIdsByClusterId
(
long
clusterId
,
String
containerName
)
{
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 {
...
@@ -62,6 +62,7 @@ public class DockerUtilsImpl implements DockerUtils {
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
List
<
DockerContainer
>
dockerContainers
=
convertDockerResult
(
containers
);
List
<
DockerContainer
>
dockerContainers
=
convertDockerResult
(
containers
);
dockerContainers
.
forEach
(
dockerContainer
->
containersMap
.
put
(
dockerContainer
.
getId
(),
dockerContainer
));
dockerContainers
.
forEach
(
dockerContainer
->
containersMap
.
put
(
dockerContainer
.
getId
(),
dockerContainer
));
return
containersMap
;
return
containersMap
;
...
@@ -74,7 +75,9 @@ public class DockerUtilsImpl implements DockerUtils {
...
@@ -74,7 +75,9 @@ public class DockerUtilsImpl implements DockerUtils {
*/
*/
public
List
<
DockerContainer
>
convertDockerResult
(
List
<
Container
>
containers
)
{
public
List
<
DockerContainer
>
convertDockerResult
(
List
<
Container
>
containers
)
{
if
(
containers
==
null
)
{
if
(
containers
==
null
)
{
throw
new
RuntimeException
(
"容器列表不能为null"
);
LOG
.
warn
(
"docker容器列表为null"
);
// 返回一个空的列表
return
new
ArrayList
<>();
}
}
List
<
DockerContainer
>
dockerContainers
=
new
ArrayList
<
DockerContainer
>(
containers
.
size
());
List
<
DockerContainer
>
dockerContainers
=
new
ArrayList
<
DockerContainer
>(
containers
.
size
());
containers
.
forEach
(
c
->
{
containers
.
forEach
(
c
->
{
...
...
pom.xml
View file @
544e2ce3
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
<plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.1.2.RELEASE
</version>
</plugin>
</plugin>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<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