mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-17 03:04:46 +08:00
fix: 解决应用同步异常的问题 (#3991)
This commit is contained in:
parent
a0af04bbf7
commit
279b3942b4
2
.gitignore
vendored
2
.gitignore
vendored
@ -39,6 +39,8 @@ frontend/auto-imports.d.ts
|
|||||||
frontend/components.d.ts
|
frontend/components.d.ts
|
||||||
frontend/src/xpack
|
frontend/src/xpack
|
||||||
backend/xpack
|
backend/xpack
|
||||||
|
backend/router/entry_xpack.go
|
||||||
|
backend/server/init_xpack.go
|
||||||
|
|
||||||
.history/
|
.history/
|
||||||
dist/
|
dist/
|
||||||
|
@ -701,7 +701,7 @@ func (a *AppInstallService) GetParams(id uint) (*response.AppConfig, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func syncAppInstallStatus(appInstall *model.AppInstall) error {
|
func syncAppInstallStatus(appInstall *model.AppInstall) error {
|
||||||
if appInstall.Status == constant.Installing || appInstall.Status == constant.Rebuilding {
|
if appInstall.Status == constant.Installing || appInstall.Status == constant.Rebuilding || appInstall.Status == constant.Upgrading {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
containerNames, err := getContainerNames(*appInstall)
|
containerNames, err := getContainerNames(*appInstall)
|
||||||
|
@ -48,12 +48,15 @@ func NewDockerClient() (*client.Client, error) {
|
|||||||
|
|
||||||
func (c Client) ListContainersByName(names []string) ([]types.Container, error) {
|
func (c Client) ListContainersByName(names []string) ([]types.Container, error) {
|
||||||
var (
|
var (
|
||||||
options container.ListOptions
|
options container.ListOptions
|
||||||
|
namesMap = make(map[string]bool)
|
||||||
|
res []types.Container
|
||||||
)
|
)
|
||||||
options.All = true
|
options.All = true
|
||||||
if len(names) > 0 {
|
if len(names) > 0 {
|
||||||
var array []filters.KeyValuePair
|
var array []filters.KeyValuePair
|
||||||
for _, n := range names {
|
for _, n := range names {
|
||||||
|
namesMap["/"+n] = true
|
||||||
array = append(array, filters.Arg("name", n))
|
array = append(array, filters.Arg("name", n))
|
||||||
}
|
}
|
||||||
options.Filters = filters.NewArgs(array...)
|
options.Filters = filters.NewArgs(array...)
|
||||||
@ -62,7 +65,12 @@ func (c Client) ListContainersByName(names []string) ([]types.Container, error)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return containers, nil
|
for _, con := range containers {
|
||||||
|
if _, ok := namesMap[con.Names[0]]; ok {
|
||||||
|
res = append(res, con)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) CreateNetwork(name string) error {
|
func (c Client) CreateNetwork(name string) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user