Job: Add ControllerRef on all created Pods.

This commit is contained in:
Anthony Yeh
2017-02-26 17:00:33 -08:00
parent 33d036a564
commit bdfe18f638
3 changed files with 36 additions and 4 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
package job
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1"
batch "k8s.io/kubernetes/pkg/apis/batch/v1"
)
@@ -29,3 +30,14 @@ func IsJobFinished(j *batch.Job) bool {
}
return false
}
func newControllerRef(j *batch.Job) *metav1.OwnerReference {
isController := true
return &metav1.OwnerReference{
APIVersion: controllerKind.GroupVersion().String(),
Kind: controllerKind.Kind,
Name: j.Name,
UID: j.UID,
Controller: &isController,
}
}