Use BuildConfig reaper to delete BuildConfig with all related pods

This commit is contained in:
Tomas Kral 2017-04-27 15:36:20 +02:00
parent 792976da1f
commit bee784faf6
No known key found for this signature in database
GPG Key ID: E690DA7E4F291FA6

View File

@ -42,6 +42,7 @@ import (
"github.com/kubernetes-incubator/kompose/pkg/transformer"
buildapi "github.com/openshift/origin/pkg/build/api"
buildconfigreaper "github.com/openshift/origin/pkg/build/cmd"
deployapi "github.com/openshift/origin/pkg/deploy/api"
deploymentconfigreaper "github.com/openshift/origin/pkg/deploy/cmd"
imageapi "github.com/openshift/origin/pkg/image/api"
@ -593,7 +594,8 @@ func (o *OpenShift) Undeploy(komposeObject kobject.KomposeObject, opt kobject.Co
}
for _, l := range buildConfig.Items {
if reflect.DeepEqual(l.Labels, komposeLabel) {
err := oclient.BuildConfigs(namespace).Delete(t.Name)
bcreaper := buildconfigreaper.NewBuildConfigReaper(oclient)
err := bcreaper.Stop(namespace, t.Name, TIMEOUT*time.Second, nil)
if err != nil {
errorList = append(errorList, err)
break