fix(swarm/update): pass the potential errors to compose deployer
This commit is contained in:
@@ -35,7 +35,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-20221221110420-81b7f92b10f6
|
||||
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
|
||||
|
||||
@@ -336,8 +336,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-20221221110420-81b7f92b10f6 h1:snz3ijUiKAwFEUKJ1BKzLcbQKxOZgDvZI+E8cusOrYw=
|
||||
github.com/portainer/docker-compose-wrapper v0.0.0-20221221110420-81b7f92b10f6/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=
|
||||
|
||||
@@ -32,6 +32,11 @@ const (
|
||||
updaterImageEnvVar = "UPGRADE_UPDATER_IMAGE"
|
||||
)
|
||||
|
||||
var (
|
||||
errUpdateFailure = errors.New("update failure")
|
||||
errPullImageFailure = errors.New("pull image failure")
|
||||
)
|
||||
|
||||
type Service interface {
|
||||
Upgrade(licenseKey string) error
|
||||
}
|
||||
@@ -125,6 +130,10 @@ func (service *service) upgradeDocker(licenseKey, version, envType string) error
|
||||
AbortOnContainerExit: true,
|
||||
Options: libstack.Options{
|
||||
ProjectName: projectName,
|
||||
PotentialErrors: []string{
|
||||
errUpdateFailure.Error(),
|
||||
errPullImageFailure.Error(),
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user