forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ok.go
54 lines (46 loc) · 1.16 KB
/
ok.go
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
52
53
54
package test
import (
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/openshift/origin/pkg/deploy/api"
)
func OkStrategy() api.DeploymentStrategy {
return api.DeploymentStrategy{
Type: api.DeploymentStrategyTypeBasic,
}
}
func OkCustomPodStrategy() api.DeploymentStrategy {
return api.DeploymentStrategy{
Type: api.DeploymentStrategyTypeCustomPod,
CustomPod: OkCustomPod(),
}
}
func OkCustomPod() *api.CustomPodDeploymentStrategy {
return &api.CustomPodDeploymentStrategy{
Image: "openshift/origin-deployer",
}
}
func OkControllerTemplate() kapi.ReplicationControllerState {
return kapi.ReplicationControllerState{
ReplicaSelector: OkSelector(),
PodTemplate: OkPodTemplate(),
}
}
func OkDeploymentTemplate() api.DeploymentTemplate {
return api.DeploymentTemplate{
Strategy: OkStrategy(),
ControllerTemplate: OkControllerTemplate(),
}
}
func OkSelector() map[string]string {
return map[string]string{"a": "b"}
}
func OkPodTemplate() kapi.PodTemplate {
return kapi.PodTemplate{
DesiredState: kapi.PodState{
Manifest: kapi.ContainerManifest{
Version: "v1beta1",
},
},
Labels: OkSelector(),
}
}