-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathk8s_util.go
More file actions
51 lines (44 loc) · 1.14 KB
/
k8s_util.go
File metadata and controls
51 lines (44 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package gitreceive
import (
"fmt"
"code.google.com/p/go-uuid/uuid"
"k8s.io/kubernetes/pkg/api"
)
const (
podKind = "Pod"
v1Version = "v1"
)
func dockerBuilderPodName(appName, shortSha) string {
uid := uuid.New()[:8]
return fmt.Sprintf("dockerbuild-%s-%s-%s", appName, shortSha, uid)
}
func slugBuilderPodName(appName, shortSha) string {
uid := uuid.New()[:8]
return fmt.Sprintf("slugbuild-%s-%s-%s", appName, shortSha, uid)
}
func dockerBuilderPod(debug, withAuth bool, name, namespace, heritageLabel, versionLabel, tarURL, imageName string) *api.Pod {
return &api.Pod{
Kind: podKind,
APIVersion: v1Version,
Name: name,
Namespace: namespace,
Labels: map[string]string{
"heritage": heritageLabel,
"version": versionLabel,
},
Spec: api.PodSpec{},
}
}
func slugbuilderPod(debug, withAuth bool, name, namespace, heritageLabel, versionLabel, tarURL, putURL, buildpackURL string) *api.Pod {
return &api.Pod{
Kind: podKind,
APIVersion: v1Version,
Name: name,
Namespace: namespace,
Labels: map[string]string{
"heritage": heritageLabel,
"version": versionLabel,
},
Spec: api.PodSpec{},
}
}