mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
feat: do not redeploy global service if spec hasn't changed
This commit is contained in:
1 parent
5e2b2ac836
commit
a53fa2c1d8
6 files changed
+107
-34
No files matched your search
@@ -47,8 +47,8 @@ func (cli *Client) CreateContainer(
|
||||
api.LabelManaged: "",
|
||||
},
|
||||
}
|
||||
if spec.Mode == api.ServiceModeGlobal {
|
||||
config.Labels[api.LabelServiceMode] = api.ServiceModeGlobal
|
||||
if spec.Mode != "" {
|
||||
config.Labels[api.LabelServiceMode] = spec.Mode
|
||||
}
|
||||
|
||||
if len(spec.Ports) > 0 {
|
||||
|
||||
@@ -120,7 +120,10 @@ func reconcileGlobalContainer(
|
||||
continue
|
||||
}
|
||||
|
||||
svcSpec := c.Container.ServiceSpec()
|
||||
svcSpec, err := c.Container.ServiceSpec()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("get service spec: %w", err)
|
||||
}
|
||||
if svcSpec.Equals(spec) {
|
||||
// The container is already running with the same spec.
|
||||
upToDate = true
|
||||
|
||||
Reference in new issue
Block a user