@@ -28,37 +28,13 @@ import (
28
28
crv1 "github.com/google/go-containerregistry/pkg/v1"
29
29
"github.com/google/go-containerregistry/pkg/v1/remote"
30
30
v1 "k8s.io/api/core/v1"
31
- "k8s.io/apimachinery/pkg/runtime/schema"
32
31
33
32
common "github.com/kubeflow/katib/pkg/apis/controller/common/v1beta1"
34
33
katibmanagerv1beta1 "github.com/kubeflow/katib/pkg/common/v1beta1"
35
34
jobv1beta1 "github.com/kubeflow/katib/pkg/job/v1beta1"
36
35
mccommon "github.com/kubeflow/katib/pkg/metricscollector/v1beta1/common"
37
36
)
38
37
39
- func getKatibJob (pod * v1.Pod ) (string , string , error ) {
40
- for _ , gvk := range jobv1beta1 .SupportedJobList {
41
- owners := pod .GetOwnerReferences ()
42
- for _ , owner := range owners {
43
- if isMatchGVK (owner , gvk ) {
44
- return owner .Kind , owner .Name , nil
45
- }
46
- }
47
- }
48
- return "" , "" , errors .New ("The Pod doesn't belong to Katib Job" )
49
- }
50
-
51
- func isMatchGVK (owner metav1.OwnerReference , gvk schema.GroupVersionKind ) bool {
52
- if owner .Kind != gvk .Kind {
53
- return false
54
- }
55
- gv := gvk .Group + "/" + gvk .Version
56
- if gv != owner .APIVersion {
57
- return false
58
- }
59
- return true
60
- }
61
-
62
38
func isPrimaryPod (podLabels , primaryLabels map [string ]string ) bool {
63
39
64
40
for primaryKey , primaryValue := range primaryLabels {
0 commit comments