Merge pull request #954 from hangyan/support-compose-v3.2

Add support for compose v3.2
This commit is contained in:
Charlie Drage 2018-03-22 10:02:32 -04:00 committed by GitHub
commit 5d733f33cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -182,7 +182,7 @@ func (c *Compose) LoadFile(files []string) (kobject.KomposeObject, error) {
}
return komposeObject, nil
// Use docker/cli for 3
case "3", "3.0":
case "3", "3.0", "3.1", "3.2":
komposeObject, err := parseV3(files)
if err != nil {
return kobject.KomposeObject{}, err

View File

@ -168,10 +168,10 @@ func (k *Kubernetes) InitConfigMap(name string, service kobject.ServiceConfig, o
}
// Remove root pathing
// replace all other slashes / preiods
// replace all other slashes / periods
envName := FormatEnvName(envFile)
// In order to differentiate files, we append to the name and remove '.env' if applicate from the file name
// In order to differentiate files, we append to the name and remove '.env' if applicable from the file name
configMap := &api.ConfigMap{
TypeMeta: unversioned.TypeMeta{
Kind: "ConfigMap",
@ -280,7 +280,7 @@ func (k *Kubernetes) initIngress(name string, service kobject.ServiceConfig, por
// CreatePVC initializes PersistentVolumeClaim
func (k *Kubernetes) CreatePVC(name string, mode string, size string) (*api.PersistentVolumeClaim, error) {
volsize, err := resource.ParseQuantity(size)
volSize, err := resource.ParseQuantity(size)
if err != nil {
return nil, errors.Wrap(err, "resource.ParseQuantity failed, Error parsing size")
}
@ -297,7 +297,7 @@ func (k *Kubernetes) CreatePVC(name string, mode string, size string) (*api.Pers
Spec: api.PersistentVolumeClaimSpec{
Resources: api.ResourceRequirements{
Requests: api.ResourceList{
api.ResourceStorage: volsize,
api.ResourceStorage: volSize,
},
},
},
@ -443,7 +443,7 @@ func (k *Kubernetes) ConfigVolumes(name string, service kobject.ServiceConfig) (
}
var count int
//interating over array of `Vols` struct as it contains all necessary information about volumes
//iterating over array of `Vols` struct as it contains all necessary information about volumes
for _, volume := range service.Volumes {
// check if ro/rw mode is defined, default rw
@ -461,12 +461,12 @@ func (k *Kubernetes) ConfigVolumes(name string, service kobject.ServiceConfig) (
} else {
volumeName = volume.VolumeName
}
volmount := api.VolumeMount{
volMount := api.VolumeMount{
Name: volumeName,
ReadOnly: readonly,
MountPath: volume.Container,
}
volumeMounts = append(volumeMounts, volmount)
volumeMounts = append(volumeMounts, volMount)
// Get a volume source based on the type of volume we are using
// For PVC we will also create a PVC object and add to list
var volsource *api.VolumeSource