Handling Volume at early stage
It will resolve #544 as well as refactor volume handling part.
This commit is contained in:
@@ -470,10 +470,7 @@ func (o *OpenShift) Transform(komposeObject kobject.KomposeObject, opt kobject.C
|
||||
allobjects = append(allobjects, objects...)
|
||||
}
|
||||
|
||||
// If docker-compose has a volumes_from directive it will be handled here
|
||||
o.VolumesFrom(&allobjects, komposeObject)
|
||||
|
||||
// sort all object so all services are first
|
||||
// sort all object so Services are first
|
||||
o.SortServicesFirst(&allobjects)
|
||||
|
||||
return allobjects, nil
|
||||
|
||||
@@ -42,7 +42,7 @@ func newServiceConfig() kobject.ServiceConfig {
|
||||
Command: []string{"cmd"},
|
||||
WorkingDir: "dir",
|
||||
Args: []string{"arg1", "arg2"},
|
||||
Volumes: []string{"/tmp/volume"},
|
||||
VolList: []string{"/tmp/volume"},
|
||||
Network: []string{"network1", "network2"}, // not supported
|
||||
Labels: nil,
|
||||
Annotations: map[string]string{"abc": "def"},
|
||||
@@ -406,7 +406,8 @@ func TestRecreateStrategyWithVolumesPresent(t *testing.T) {
|
||||
service := kobject.ServiceConfig{
|
||||
ContainerName: "name",
|
||||
Image: "image",
|
||||
Volumes: []string{"/tmp/volume"},
|
||||
VolList: []string{"/tmp/volume"},
|
||||
Volumes: []kobject.Volumes{{SvcName: "app", MountPath: "/tmp/volume", PVCName: "app-claim0"}},
|
||||
}
|
||||
komposeObject := kobject.KomposeObject{
|
||||
ServiceConfigs: map[string]kobject.ServiceConfig{"app": service},
|
||||
|
||||
Reference in New Issue
Block a user