From 86fd0806cf6e5c91150b822a4442d3f8406bca83 Mon Sep 17 00:00:00 2001 From: deniseschannon Date: Thu, 27 Apr 2017 17:07:34 -0700 Subject: [PATCH 1/2] bump rancher-compose-executor to v0.14.3 --- vendor.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor.conf b/vendor.conf index 2161d8de8..33ce15c56 100644 --- a/vendor.conf +++ b/vendor.conf @@ -17,7 +17,7 @@ github.com/patrickmn/go-cache 1881a9bccb818787f68c52bfba648c6cf34c34fa github.com/pkg/errors 1d2e60385a13aaa66134984235061c2f9302520e github.com/rancher/go-rancher 939fd85e3c7f06f29e985fd35cb62a281a32d3b0 github.com/rancher/rancher-catalog-service a3a8b500adceb82b3a0387b2c7b06a60e7eeee9a -github.com/rancher/rancher-compose-executor v0.14.2 +github.com/rancher/rancher-compose-executor v0.14.3 github.com/rancher/rancher-docker-api-proxy 461b5e7022698283030495cf5693680699ce9c28 github.com/Sirupsen/logrus 26709e2714106fb8ad40b773b711ebce25b78914 github.com/spf13/pflag cb88ea77998c3f024757528e3305022ab50b43be From 4b1026b6e99795de7b7553cb0752e4ada2db855f Mon Sep 17 00:00:00 2001 From: deniseschannon Date: Thu, 27 Apr 2017 17:08:34 -0700 Subject: [PATCH 2/2] update vendor --- .../rancher-compose-executor/config/merge.go | 19 +++++++++++++++++ .../config/merge_v1.go | 21 ++----------------- .../config/merge_v2.go | 14 ++----------- .../rancher/service.go | 11 ++++++++++ 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/vendor/github.com/rancher/rancher-compose-executor/config/merge.go b/vendor/github.com/rancher/rancher-compose-executor/config/merge.go index af90fe995..ed8ec8a08 100644 --- a/vendor/github.com/rancher/rancher-compose-executor/config/merge.go +++ b/vendor/github.com/rancher/rancher-compose-executor/config/merge.go @@ -179,6 +179,25 @@ func Merge(existingServices *ServiceConfigs, environmentLookup EnvironmentLookup } } + // TODO: merge container configs + for name, serviceConfig := range serviceConfigs { + if existingServiceConfig, ok := existingServices.Get(name); ok { + var rawService RawService + if err := utils.Convert(serviceConfig, &rawService); err != nil { + return nil, err + } + var rawExistingService RawService + if err := utils.Convert(existingServiceConfig, &rawExistingService); err != nil { + return nil, err + } + + rawService = mergeConfig(rawExistingService, rawService) + if err := utils.Convert(rawService, &serviceConfig); err != nil { + return nil, err + } + } + } + var containerConfigs map[string]*ServiceConfig if rawConfig.Version == "2" { var err error diff --git a/vendor/github.com/rancher/rancher-compose-executor/config/merge_v1.go b/vendor/github.com/rancher/rancher-compose-executor/config/merge_v1.go index 19917e4a7..e3389ead3 100644 --- a/vendor/github.com/rancher/rancher-compose-executor/config/merge_v1.go +++ b/vendor/github.com/rancher/rancher-compose-executor/config/merge_v1.go @@ -15,29 +15,12 @@ func MergeServicesV1(existingServices *ServiceConfigs, environmentLookup Environ } for name, data := range datas { - data, err := parseV1(resourceLookup, environmentLookup, file, data, datas) + var err error + datas[name], err = parseV1(resourceLookup, environmentLookup, file, data, datas) if err != nil { logrus.Errorf("Failed to parse service %s: %v", name, err) return nil, err } - - if serviceConfig, ok := existingServices.Get(name); ok { - var rawExistingService RawService - if err := utils.Convert(serviceConfig, &rawExistingService); err != nil { - return nil, err - } - - data = mergeConfig(rawExistingService, data) - } - - datas[name] = data - } - - for name, data := range datas { - err := validateServiceConstraints(data, name) - if err != nil { - return nil, err - } } serviceConfigs := make(map[string]*ServiceConfigV1) diff --git a/vendor/github.com/rancher/rancher-compose-executor/config/merge_v2.go b/vendor/github.com/rancher/rancher-compose-executor/config/merge_v2.go index 76c3c5a74..87318f9d8 100644 --- a/vendor/github.com/rancher/rancher-compose-executor/config/merge_v2.go +++ b/vendor/github.com/rancher/rancher-compose-executor/config/merge_v2.go @@ -15,22 +15,12 @@ func MergeServicesV2(existingServices *ServiceConfigs, environmentLookup Environ } for name, data := range datas { - data, err := parseV2(resourceLookup, environmentLookup, file, data, datas) + var err error + datas[name], err = parseV2(resourceLookup, environmentLookup, file, data, datas) if err != nil { logrus.Errorf("Failed to parse service %s: %v", name, err) return nil, err } - - if serviceConfig, ok := existingServices.Get(name); ok { - var rawExistingService RawService - if err := utils.Convert(serviceConfig, &rawExistingService); err != nil { - return nil, err - } - - data = mergeConfig(rawExistingService, data) - } - - datas[name] = data } serviceConfigs := make(map[string]*ServiceConfig) diff --git a/vendor/github.com/rancher/rancher-compose-executor/rancher/service.go b/vendor/github.com/rancher/rancher-compose-executor/rancher/service.go index 2880d5d5f..227e47683 100644 --- a/vendor/github.com/rancher/rancher-compose-executor/rancher/service.go +++ b/vendor/github.com/rancher/rancher-compose-executor/rancher/service.go @@ -106,6 +106,17 @@ func (r *RancherService) up(create bool) error { } } + if service.State == "upgraded" { + service, err = r.context.Client.Service.ActionFinishupgrade(service) + if err != nil { + return err + } + err = r.Wait(service) + if err != nil { + return err + } + } + service, err = r.upgrade(service, r.context.ForceUpgrade, r.context.Args) if err != nil { return err