1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-10 08:15:25 +02:00

fix(swarm/update): pass the potential errors to compose deployer

This commit is contained in:
Oscar Zhou 2023-01-09 08:36:00 +13:00
parent dd0d1737b0
commit a424586839
4 changed files with 11 additions and 9 deletions

View file

@ -36,7 +36,7 @@ require (
github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.9.1
github.com/portainer/docker-compose-wrapper v0.0.0-20221215210951-2c30d1b17a27
github.com/portainer/docker-compose-wrapper v0.0.0-20221221135649-4b6a34dcca80
github.com/portainer/libcrypto v0.0.0-20220506221303-1f4fb3b30f9a
github.com/portainer/libhttp v0.0.0-20221121135534-76f46e09c9a9
github.com/portainer/portainer/pkg/libhelm v0.0.0-20221201012749-4fee35924724

View file

@ -344,10 +344,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/portainer/docker-compose-wrapper v0.0.0-20221122145319-915b021aea84 h1:d1P8i0pCPvAfxH6nSLUFm6NYoi8tMrIpafaZXSV8Lac=
github.com/portainer/docker-compose-wrapper v0.0.0-20221122145319-915b021aea84/go.mod h1:03UmPLyjiPUexGJuW20mQXvmsoSpeErvMlItJGtq/Ww=
github.com/portainer/docker-compose-wrapper v0.0.0-20221215210951-2c30d1b17a27 h1:PceCpp86SDYb3lZHT4KpuBCkmcJMW5x1qrdFNEfAdUo=
github.com/portainer/docker-compose-wrapper v0.0.0-20221215210951-2c30d1b17a27/go.mod h1:03UmPLyjiPUexGJuW20mQXvmsoSpeErvMlItJGtq/Ww=
github.com/portainer/docker-compose-wrapper v0.0.0-20221221135649-4b6a34dcca80 h1:EybuiLzP2/bW9ciPBlmIP0dKj+WrHqNfDzzi0KqvsLU=
github.com/portainer/docker-compose-wrapper v0.0.0-20221221135649-4b6a34dcca80/go.mod h1:03UmPLyjiPUexGJuW20mQXvmsoSpeErvMlItJGtq/Ww=
github.com/portainer/libcrypto v0.0.0-20220506221303-1f4fb3b30f9a h1:B0z3skIMT+OwVNJPQhKp52X+9OWW6A9n5UWig3lHBJk=
github.com/portainer/libcrypto v0.0.0-20220506221303-1f4fb3b30f9a/go.mod h1:n54EEIq+MM0NNtqLeCby8ljL+l275VpolXO0ibHegLE=
github.com/portainer/libhttp v0.0.0-20221121135534-76f46e09c9a9 h1:L7o0L+1qq+LzKjzgRB6bDIh5ZrZ5A1oSS+WgWzDgJIo=

View file

@ -32,7 +32,9 @@ const (
skipPullImageEnvVar = "UPGRADE_SKIP_PULL_PORTAINER_IMAGE"
// updaterImageEnvVar represents the name of the environment variable used to define the updater image
// useful if there's a need to test a different updater
updaterImageEnvVar = "UPGRADE_UPDATER_IMAGE"
updaterImageEnvVar = "UPGRADE_UPDATER_IMAGE"
errMessageUpdateFailure = "update failure"
errMessagePullImageFailure = "pull image failure"
)
type Service interface {
@ -136,6 +138,10 @@ func (service *service) upgradeDocker(licenseKey, version, envType string) error
AbortOnContainerExit: true,
Options: libstack.Options{
ProjectName: projectName,
PotentialErrors: []string{
errMessageUpdateFailure,
errMessagePullImageFailure,
},
},
},
)

View file

@ -8,10 +8,8 @@ services:
"--env-type", "{{envType}}{{^envType}}standalone{{/envType}}",
"--license", "{{license}}"
]
{{#skip_pull_image}}
environment:
- SKIP_PULL=1
{{/skip_pull_image}}
- SKIP_PULL={{skip_pull_image}}{{^skip_pull_image}}0{{/skip_pull_image}}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
{{! - \\.\pipe\docker_engine:\\.\pipe\docker_engine }}