forked from LaconicNetwork/kompose
fix stop_grace_period in v3 (#1300)
This commit is contained in:
parent
7801a8f8b3
commit
8edc5f4d01
@ -17,11 +17,12 @@ limitations under the License.
|
||||
package compose
|
||||
|
||||
import (
|
||||
"github.com/spf13/cast"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cast"
|
||||
|
||||
libcomposeyaml "github.com/docker/libcompose/yaml"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
@ -311,6 +312,10 @@ func dockerComposeToKomposeMapping(composeObject *types.Config) (kobject.Kompose
|
||||
serviceConfig.DomainName = composeServiceConfig.DomainName
|
||||
serviceConfig.Secrets = composeServiceConfig.Secrets
|
||||
|
||||
if composeServiceConfig.StopGracePeriod != nil {
|
||||
serviceConfig.StopGracePeriod = composeServiceConfig.StopGracePeriod.String()
|
||||
}
|
||||
|
||||
parseV3Network(&composeServiceConfig, &serviceConfig, composeObject)
|
||||
|
||||
if err := parseV3Resources(&composeServiceConfig, &serviceConfig); err != nil {
|
||||
@ -726,9 +731,6 @@ func mergeComposeObject(oldCompose *types.Config, newCompose *types.Config) (*ty
|
||||
if service.StdinOpen != tmpOldService.StdinOpen {
|
||||
tmpOldService.StdinOpen = service.StdinOpen
|
||||
}
|
||||
if service.StopGracePeriod != nil {
|
||||
tmpOldService.StopGracePeriod = service.StopGracePeriod
|
||||
}
|
||||
if service.StopSignal != "" {
|
||||
tmpOldService.StopSignal = service.StopSignal
|
||||
}
|
||||
|
||||
@ -367,6 +367,7 @@
|
||||
}
|
||||
],
|
||||
"restartPolicy": "OnFailure",
|
||||
"terminationGracePeriodSeconds": 20,
|
||||
"hostname": "foo",
|
||||
"subdomain": "foo.com"
|
||||
},
|
||||
|
||||
@ -367,6 +367,7 @@
|
||||
}
|
||||
],
|
||||
"restartPolicy": "OnFailure",
|
||||
"terminationGracePeriodSeconds": 20,
|
||||
"hostname": "foo",
|
||||
"subdomain": "foo.com"
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user