Skip to content

Commit f907e81

Browse files
Aaron Schlesingeraledbf
authored andcommitted
fix(k8s_utils.go): create pods properly
1 parent 5309940 commit f907e81

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

pkg/gitreceive/k8s_util.go

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55

66
"code.google.com/p/go-uuid/uuid"
77
"k8s.io/kubernetes/pkg/api"
8+
"k8s.io/kubernetes/pkg/api/unversioned"
89
)
910

1011
const (
@@ -24,27 +25,29 @@ func slugBuilderPodName(appName, shortSha string) string {
2425

2526
func dockerBuilderPod(debug, withAuth bool, name, namespace, heritageLabel, versionLabel, tarURL, imageName string) *api.Pod {
2627
return &api.Pod{
27-
Kind: podKind,
28-
APIVersion: v1Version,
29-
Name: name,
30-
Namespace: namespace,
31-
Labels: map[string]string{
32-
"heritage": heritageLabel,
33-
"version": versionLabel,
28+
TypeMeta: unversioned.TypeMeta{Kind: podKind, APIVersion: v1Version},
29+
ObjectMeta: api.ObjectMeta{
30+
Name: name,
31+
Namespace: namespace,
32+
Labels: map[string]string{
33+
"heritage": heritageLabel,
34+
"version": versionLabel,
35+
},
3436
},
3537
Spec: api.PodSpec{},
3638
}
3739
}
3840

3941
func slugbuilderPod(debug, withAuth bool, name, namespace, heritageLabel, versionLabel, tarURL, putURL, buildpackURL string) *api.Pod {
4042
return &api.Pod{
41-
Kind: podKind,
42-
APIVersion: v1Version,
43-
Name: name,
44-
Namespace: namespace,
45-
Labels: map[string]string{
46-
"heritage": heritageLabel,
47-
"version": versionLabel,
43+
TypeMeta: unversioned.TypeMeta{Kind: podKind, APIVersion: v1Version},
44+
ObjectMeta: api.ObjectMeta{
45+
Name: name,
46+
Namespace: namespace,
47+
Labels: map[string]string{
48+
"heritage": heritageLabel,
49+
"version": versionLabel,
50+
},
4851
},
4952
Spec: api.PodSpec{},
5053
}

0 commit comments

Comments
 (0)