Fix convert deployment log error (#1378)

This commit is contained in:
Hang Yan 2021-05-01 10:37:06 +08:00 committed by GitHub
parent 395d99fb7d
commit 45634be192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

2
go.mod
View File

@ -23,7 +23,7 @@ require (
github.com/fatih/structs v1.1.0
github.com/fsouza/go-dockerclient v1.6.5
github.com/google/go-cmp v0.4.0
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/imdario/mergo v0.3.10 // indirect
github.com/joho/godotenv v1.3.0
github.com/moby/sys/mount v0.1.1 // indirect

View File

@ -369,7 +369,15 @@ func (k *Kubernetes) InitD(name string, service kobject.ServiceConfig, replicas
Type: appsv1.RollingUpdateDeploymentStrategyType,
RollingUpdate: update,
}
log.Debugf("Set deployment '%s' rolling update: MaxSurge: %s, MaxUnavailable: %s", name, update.MaxSurge.String(), update.MaxUnavailable.String())
ms := ""
if update.MaxSurge != nil {
ms = update.MaxSurge.String()
}
mu := ""
if update.MaxUnavailable != nil {
mu = update.MaxUnavailable.String()
}
log.Debugf("Set deployment '%s' rolling update: MaxSurge: %s, MaxUnavailable: %s", name, ms, mu)
}
return dc