Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rke
Commits
4e60bf8e
Commit
4e60bf8e
authored
6 years ago
by
galal-hussein
Committed by
Alena Prokharchyk
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Restart components if binds changed
parent
6d36c9a7
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/docker.go
+4
-3
docker/docker.go
with
4 additions
and
3 deletions
+4
-3
docker/docker.go
+
4
-
3
View file @
4e60bf8e
...
...
@@ -64,7 +64,7 @@ func DoRunContainer(ctx context.Context, dClient *client.Client, imageCfg *conta
}
}
logrus
.
Debugf
(
"[%s] Container [%s] is already running on host [%s]"
,
plane
,
containerName
,
hostname
)
isUpgradable
,
err
:=
IsContainerUpgradable
(
ctx
,
dClient
,
imageCfg
,
containerName
,
hostname
,
plane
)
isUpgradable
,
err
:=
IsContainerUpgradable
(
ctx
,
dClient
,
imageCfg
,
hostCfg
,
containerName
,
hostname
,
plane
)
if
err
!=
nil
{
return
err
}
...
...
@@ -299,7 +299,7 @@ func WaitForContainer(ctx context.Context, dClient *client.Client, hostname stri
return
0
,
nil
}
func
IsContainerUpgradable
(
ctx
context
.
Context
,
dClient
*
client
.
Client
,
imageCfg
*
container
.
Config
,
containerName
string
,
hostname
string
,
plane
string
)
(
bool
,
error
)
{
func
IsContainerUpgradable
(
ctx
context
.
Context
,
dClient
*
client
.
Client
,
imageCfg
*
container
.
Config
,
hostCfg
*
container
.
HostConfig
,
containerName
string
,
hostname
string
,
plane
string
)
(
bool
,
error
)
{
logrus
.
Debugf
(
"[%s] Checking if container [%s] is eligible for upgrade on host [%s]"
,
plane
,
containerName
,
hostname
)
// this should be moved to a higher layer.
...
...
@@ -310,7 +310,8 @@ func IsContainerUpgradable(ctx context.Context, dClient *client.Client, imageCfg
if
containerInspect
.
Config
.
Image
!=
imageCfg
.
Image
||
!
sliceEqualsIgnoreOrder
(
containerInspect
.
Config
.
Entrypoint
,
imageCfg
.
Entrypoint
)
||
!
sliceEqualsIgnoreOrder
(
containerInspect
.
Config
.
Cmd
,
imageCfg
.
Cmd
)
||
!
isContainerRKEEnvChanged
(
containerInspect
.
Config
.
Env
,
imageCfg
.
Env
)
{
!
isContainerRKEEnvChanged
(
containerInspect
.
Config
.
Env
,
imageCfg
.
Env
)
||
!
sliceEqualsIgnoreOrder
(
containerInspect
.
HostConfig
.
Binds
,
hostCfg
.
Binds
)
{
logrus
.
Debugf
(
"[%s] Container [%s] is eligible for upgrade on host [%s]"
,
plane
,
containerName
,
hostname
)
return
true
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help