| ... | ... |
@@ -7,6 +7,12 @@ import ( |
| 7 | 7 |
|
| 8 | 8 |
func OkStrategy() api.DeploymentStrategy {
|
| 9 | 9 |
return api.DeploymentStrategy{
|
| 10 |
+ Type: api.DeploymentStrategyTypeBasic, |
|
| 11 |
+ } |
|
| 12 |
+} |
|
| 13 |
+ |
|
| 14 |
+func OkCustomPodStrategy() api.DeploymentStrategy {
|
|
| 15 |
+ return api.DeploymentStrategy{
|
|
| 10 | 16 |
Type: api.DeploymentStrategyTypeCustomPod, |
| 11 | 17 |
CustomPod: OkCustomPod(), |
| 12 | 18 |
} |
| ... | ... |
@@ -25,6 +31,13 @@ func OkControllerTemplate() kapi.ReplicationControllerState {
|
| 25 | 25 |
} |
| 26 | 26 |
} |
| 27 | 27 |
|
| 28 |
+func OkDeploymentTemplate() api.DeploymentTemplate {
|
|
| 29 |
+ return api.DeploymentTemplate{
|
|
| 30 |
+ Strategy: OkStrategy(), |
|
| 31 |
+ ControllerTemplate: OkControllerTemplate(), |
|
| 32 |
+ } |
|
| 33 |
+} |
|
| 34 |
+ |
|
| 28 | 35 |
func OkSelector() map[string]string {
|
| 29 | 36 |
return map[string]string{"a": "b"}
|
| 30 | 37 |
} |
| ... | ... |
@@ -3,9 +3,9 @@ package validation |
| 3 | 3 |
import ( |
| 4 | 4 |
"testing" |
| 5 | 5 |
|
| 6 |
- kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" |
|
| 7 | 6 |
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" |
| 8 | 7 |
"github.com/openshift/origin/pkg/deploy/api" |
| 8 |
+ "github.com/openshift/origin/pkg/deploy/api/test" |
|
| 9 | 9 |
) |
| 10 | 10 |
|
| 11 | 11 |
// Convenience methods |
| ... | ... |
@@ -18,54 +18,12 @@ func manualTrigger() []api.DeploymentTriggerPolicy {
|
| 18 | 18 |
} |
| 19 | 19 |
} |
| 20 | 20 |
|
| 21 |
-func okControllerTemplate() kapi.ReplicationControllerState {
|
|
| 22 |
- return kapi.ReplicationControllerState{
|
|
| 23 |
- ReplicaSelector: okSelector(), |
|
| 24 |
- PodTemplate: okPodTemplate(), |
|
| 25 |
- } |
|
| 26 |
-} |
|
| 27 |
- |
|
| 28 |
-func okSelector() map[string]string {
|
|
| 29 |
- return map[string]string{"a": "b"}
|
|
| 30 |
-} |
|
| 31 |
- |
|
| 32 |
-func okPodTemplate() kapi.PodTemplate {
|
|
| 33 |
- return kapi.PodTemplate{
|
|
| 34 |
- DesiredState: kapi.PodState{
|
|
| 35 |
- Manifest: kapi.ContainerManifest{
|
|
| 36 |
- Version: "v1beta1", |
|
| 37 |
- }, |
|
| 38 |
- }, |
|
| 39 |
- Labels: okSelector(), |
|
| 40 |
- } |
|
| 41 |
-} |
|
| 42 |
- |
|
| 43 |
-func okDeploymentTemplate() api.DeploymentTemplate {
|
|
| 44 |
- return api.DeploymentTemplate{
|
|
| 45 |
- Strategy: okStrategy(), |
|
| 46 |
- ControllerTemplate: okControllerTemplate(), |
|
| 47 |
- } |
|
| 48 |
-} |
|
| 49 |
- |
|
| 50 |
-func okStrategy() api.DeploymentStrategy {
|
|
| 51 |
- return api.DeploymentStrategy{
|
|
| 52 |
- Type: api.DeploymentStrategyTypeCustomPod, |
|
| 53 |
- CustomPod: okCustomPod(), |
|
| 54 |
- } |
|
| 55 |
-} |
|
| 56 |
- |
|
| 57 |
-func okCustomPod() *api.CustomPodDeploymentStrategy {
|
|
| 58 |
- return &api.CustomPodDeploymentStrategy{
|
|
| 59 |
- Image: "openshift/kube-deploy", |
|
| 60 |
- } |
|
| 61 |
-} |
|
| 62 |
- |
|
| 63 | 21 |
// TODO: test validation errors for ReplicationControllerTemplates |
| 64 | 22 |
|
| 65 | 23 |
func TestValidateDeploymentOK(t *testing.T) {
|
| 66 | 24 |
errs := ValidateDeployment(&api.Deployment{
|
| 67 |
- Strategy: okStrategy(), |
|
| 68 |
- ControllerTemplate: okControllerTemplate(), |
|
| 25 |
+ Strategy: test.OkStrategy(), |
|
| 26 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 69 | 27 |
}) |
| 70 | 28 |
if len(errs) > 0 {
|
| 71 | 29 |
t.Errorf("Unxpected non-empty error list: %#v", errs)
|
| ... | ... |
@@ -80,10 +38,8 @@ func TestValidateDeploymentMissingFields(t *testing.T) {
|
| 80 | 80 |
}{
|
| 81 | 81 |
"missing strategy.type": {
|
| 82 | 82 |
api.Deployment{
|
| 83 |
- Strategy: api.DeploymentStrategy{
|
|
| 84 |
- CustomPod: okCustomPod(), |
|
| 85 |
- }, |
|
| 86 |
- ControllerTemplate: okControllerTemplate(), |
|
| 83 |
+ Strategy: api.DeploymentStrategy{},
|
|
| 84 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 87 | 85 |
}, |
| 88 | 86 |
errors.ValidationErrorTypeRequired, |
| 89 | 87 |
"strategy.type", |
| ... | ... |
@@ -93,7 +49,7 @@ func TestValidateDeploymentMissingFields(t *testing.T) {
|
| 93 | 93 |
Strategy: api.DeploymentStrategy{
|
| 94 | 94 |
Type: api.DeploymentStrategyTypeCustomPod, |
| 95 | 95 |
}, |
| 96 |
- ControllerTemplate: okControllerTemplate(), |
|
| 96 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 97 | 97 |
}, |
| 98 | 98 |
errors.ValidationErrorTypeRequired, |
| 99 | 99 |
"strategy.customPod", |
| ... | ... |
@@ -104,7 +60,7 @@ func TestValidateDeploymentMissingFields(t *testing.T) {
|
| 104 | 104 |
Type: api.DeploymentStrategyTypeCustomPod, |
| 105 | 105 |
CustomPod: &api.CustomPodDeploymentStrategy{},
|
| 106 | 106 |
}, |
| 107 |
- ControllerTemplate: okControllerTemplate(), |
|
| 107 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 108 | 108 |
}, |
| 109 | 109 |
errors.ValidationErrorTypeRequired, |
| 110 | 110 |
"strategy.customPod.image", |
| ... | ... |
@@ -130,7 +86,7 @@ func TestValidateDeploymentMissingFields(t *testing.T) {
|
| 130 | 130 |
func TestValidateDeploymentConfigOK(t *testing.T) {
|
| 131 | 131 |
errs := ValidateDeploymentConfig(&api.DeploymentConfig{
|
| 132 | 132 |
Triggers: manualTrigger(), |
| 133 |
- Template: okDeploymentTemplate(), |
|
| 133 |
+ Template: test.OkDeploymentTemplate(), |
|
| 134 | 134 |
}) |
| 135 | 135 |
|
| 136 | 136 |
if len(errs) > 0 {
|
| ... | ... |
@@ -153,7 +109,7 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) {
|
| 153 | 153 |
}, |
| 154 | 154 |
}, |
| 155 | 155 |
}, |
| 156 |
- Template: okDeploymentTemplate(), |
|
| 156 |
+ Template: test.OkDeploymentTemplate(), |
|
| 157 | 157 |
}, |
| 158 | 158 |
errors.ValidationErrorTypeRequired, |
| 159 | 159 |
"triggers[0].type", |
| ... | ... |
@@ -168,7 +124,7 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) {
|
| 168 | 168 |
}, |
| 169 | 169 |
}, |
| 170 | 170 |
}, |
| 171 |
- Template: okDeploymentTemplate(), |
|
| 171 |
+ Template: test.OkDeploymentTemplate(), |
|
| 172 | 172 |
}, |
| 173 | 173 |
errors.ValidationErrorTypeRequired, |
| 174 | 174 |
"triggers[0].imageChangeParams.repositoryName", |
| ... | ... |
@@ -183,7 +139,7 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) {
|
| 183 | 183 |
}, |
| 184 | 184 |
}, |
| 185 | 185 |
}, |
| 186 |
- Template: okDeploymentTemplate(), |
|
| 186 |
+ Template: test.OkDeploymentTemplate(), |
|
| 187 | 187 |
}, |
| 188 | 188 |
errors.ValidationErrorTypeRequired, |
| 189 | 189 |
"triggers[0].imageChangeParams.containerNames", |
| ... | ... |
@@ -193,9 +149,9 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) {
|
| 193 | 193 |
Triggers: manualTrigger(), |
| 194 | 194 |
Template: api.DeploymentTemplate{
|
| 195 | 195 |
Strategy: api.DeploymentStrategy{
|
| 196 |
- CustomPod: okCustomPod(), |
|
| 196 |
+ CustomPod: test.OkCustomPod(), |
|
| 197 | 197 |
}, |
| 198 |
- ControllerTemplate: okControllerTemplate(), |
|
| 198 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 199 | 199 |
}, |
| 200 | 200 |
}, |
| 201 | 201 |
errors.ValidationErrorTypeRequired, |
| ... | ... |
@@ -208,7 +164,7 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) {
|
| 208 | 208 |
Strategy: api.DeploymentStrategy{
|
| 209 | 209 |
Type: api.DeploymentStrategyTypeCustomPod, |
| 210 | 210 |
}, |
| 211 |
- ControllerTemplate: okControllerTemplate(), |
|
| 211 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 212 | 212 |
}, |
| 213 | 213 |
}, |
| 214 | 214 |
errors.ValidationErrorTypeRequired, |
| ... | ... |
@@ -222,7 +178,7 @@ func TestValidateDeploymentConfigMissingFields(t *testing.T) {
|
| 222 | 222 |
Type: api.DeploymentStrategyTypeCustomPod, |
| 223 | 223 |
CustomPod: &api.CustomPodDeploymentStrategy{},
|
| 224 | 224 |
}, |
| 225 |
- ControllerTemplate: okControllerTemplate(), |
|
| 225 |
+ ControllerTemplate: test.OkControllerTemplate(), |
|
| 226 | 226 |
}, |
| 227 | 227 |
}, |
| 228 | 228 |
errors.ValidationErrorTypeRequired, |
| ... | ... |
@@ -129,163 +129,138 @@ func (i *testChangeStrategy) UpdateDeploymentConfig(ctx kapi.Context, config *de |
| 129 | 129 |
} |
| 130 | 130 |
|
| 131 | 131 |
func initialConfig() *deployapi.DeploymentConfig {
|
| 132 |
- return &deployapi.DeploymentConfig{
|
|
| 133 |
- TypeMeta: kapi.TypeMeta{ID: "test-deploy-config"},
|
|
| 134 |
- Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 135 |
- {
|
|
| 136 |
- Type: deployapi.DeploymentTriggerOnConfigChange, |
|
| 137 |
- }, |
|
| 138 |
- }, |
|
| 139 |
- LatestVersion: 2, |
|
| 140 |
- Template: deployapi.DeploymentTemplate{
|
|
| 141 |
- Strategy: deployapi.DeploymentStrategy{
|
|
| 142 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 143 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 144 |
- Image: "registry:8080/openshift/kube-deploy", |
|
| 145 |
- }, |
|
| 146 |
- }, |
|
| 147 |
- ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 148 |
- Replicas: 1, |
|
| 149 |
- ReplicaSelector: map[string]string{
|
|
| 150 |
- "name": "test-pod", |
|
| 151 |
- }, |
|
| 152 |
- PodTemplate: kapi.PodTemplate{
|
|
| 153 |
- Labels: map[string]string{
|
|
| 154 |
- "name": "test-pod", |
|
| 155 |
- }, |
|
| 156 |
- DesiredState: kapi.PodState{
|
|
| 157 |
- Manifest: kapi.ContainerManifest{
|
|
| 158 |
- Version: "v1beta1", |
|
| 159 |
- Containers: []kapi.Container{
|
|
| 160 |
- {
|
|
| 161 |
- Name: "container-1", |
|
| 162 |
- Image: "registry:8080/openshift/test-image:ref-1", |
|
| 163 |
- }, |
|
| 164 |
- }, |
|
| 165 |
- }, |
|
| 166 |
- }, |
|
| 167 |
- }, |
|
| 168 |
- }, |
|
| 169 |
- }, |
|
| 170 |
- } |
|
| 132 |
+ return &deployapi.DeploymentConfig{
|
|
| 133 |
+ TypeMeta: kapi.TypeMeta{ID: "test-deploy-config"},
|
|
| 134 |
+ Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 135 |
+ {
|
|
| 136 |
+ Type: deployapi.DeploymentTriggerOnConfigChange, |
|
| 137 |
+ }, |
|
| 138 |
+ }, |
|
| 139 |
+ LatestVersion: 2, |
|
| 140 |
+ Template: deployapi.DeploymentTemplate{
|
|
| 141 |
+ ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 142 |
+ Replicas: 1, |
|
| 143 |
+ ReplicaSelector: map[string]string{
|
|
| 144 |
+ "name": "test-pod", |
|
| 145 |
+ }, |
|
| 146 |
+ PodTemplate: kapi.PodTemplate{
|
|
| 147 |
+ Labels: map[string]string{
|
|
| 148 |
+ "name": "test-pod", |
|
| 149 |
+ }, |
|
| 150 |
+ DesiredState: kapi.PodState{
|
|
| 151 |
+ Manifest: kapi.ContainerManifest{
|
|
| 152 |
+ Version: "v1beta1", |
|
| 153 |
+ Containers: []kapi.Container{
|
|
| 154 |
+ {
|
|
| 155 |
+ Name: "container-1", |
|
| 156 |
+ Image: "registry:8080/openshift/test-image:ref-1", |
|
| 157 |
+ }, |
|
| 158 |
+ }, |
|
| 159 |
+ }, |
|
| 160 |
+ }, |
|
| 161 |
+ }, |
|
| 162 |
+ }, |
|
| 163 |
+ }, |
|
| 164 |
+ } |
|
| 171 | 165 |
} |
| 172 | 166 |
|
| 173 | 167 |
func diffedConfig() *deployapi.DeploymentConfig {
|
| 174 |
- return &deployapi.DeploymentConfig{
|
|
| 175 |
- TypeMeta: kapi.TypeMeta{ID: "test-deploy-config"},
|
|
| 176 |
- Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 177 |
- {
|
|
| 178 |
- Type: deployapi.DeploymentTriggerOnConfigChange, |
|
| 179 |
- }, |
|
| 180 |
- }, |
|
| 181 |
- LatestVersion: 2, |
|
| 182 |
- Template: deployapi.DeploymentTemplate{
|
|
| 183 |
- Strategy: deployapi.DeploymentStrategy{
|
|
| 184 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 185 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 186 |
- Image: "registry:8080/openshift/kube-deploy", |
|
| 187 |
- }, |
|
| 188 |
- }, |
|
| 189 |
- ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 190 |
- Replicas: 1, |
|
| 191 |
- ReplicaSelector: map[string]string{
|
|
| 192 |
- "name": "test-pod-2", |
|
| 193 |
- }, |
|
| 194 |
- PodTemplate: kapi.PodTemplate{
|
|
| 195 |
- Labels: map[string]string{
|
|
| 196 |
- "name": "test-pod-2", |
|
| 197 |
- }, |
|
| 198 |
- DesiredState: kapi.PodState{
|
|
| 199 |
- Manifest: kapi.ContainerManifest{
|
|
| 200 |
- Version: "v1beta1", |
|
| 201 |
- Containers: []kapi.Container{
|
|
| 202 |
- {
|
|
| 203 |
- Name: "container-2", |
|
| 204 |
- Image: "registry:8080/openshift/test-image:ref-1", |
|
| 205 |
- }, |
|
| 206 |
- }, |
|
| 207 |
- }, |
|
| 208 |
- }, |
|
| 209 |
- }, |
|
| 210 |
- }, |
|
| 211 |
- }, |
|
| 212 |
- } |
|
| 168 |
+ return &deployapi.DeploymentConfig{
|
|
| 169 |
+ TypeMeta: kapi.TypeMeta{ID: "test-deploy-config"},
|
|
| 170 |
+ Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 171 |
+ {
|
|
| 172 |
+ Type: deployapi.DeploymentTriggerOnConfigChange, |
|
| 173 |
+ }, |
|
| 174 |
+ }, |
|
| 175 |
+ LatestVersion: 2, |
|
| 176 |
+ Template: deployapi.DeploymentTemplate{
|
|
| 177 |
+ ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 178 |
+ Replicas: 1, |
|
| 179 |
+ ReplicaSelector: map[string]string{
|
|
| 180 |
+ "name": "test-pod-2", |
|
| 181 |
+ }, |
|
| 182 |
+ PodTemplate: kapi.PodTemplate{
|
|
| 183 |
+ Labels: map[string]string{
|
|
| 184 |
+ "name": "test-pod-2", |
|
| 185 |
+ }, |
|
| 186 |
+ DesiredState: kapi.PodState{
|
|
| 187 |
+ Manifest: kapi.ContainerManifest{
|
|
| 188 |
+ Version: "v1beta1", |
|
| 189 |
+ Containers: []kapi.Container{
|
|
| 190 |
+ {
|
|
| 191 |
+ Name: "container-2", |
|
| 192 |
+ Image: "registry:8080/openshift/test-image:ref-1", |
|
| 193 |
+ }, |
|
| 194 |
+ }, |
|
| 195 |
+ }, |
|
| 196 |
+ }, |
|
| 197 |
+ }, |
|
| 198 |
+ }, |
|
| 199 |
+ }, |
|
| 200 |
+ } |
|
| 213 | 201 |
} |
| 214 | 202 |
|
| 215 | 203 |
func generatedConfig() *deployapi.DeploymentConfig {
|
| 216 |
- return &deployapi.DeploymentConfig{
|
|
| 217 |
- TypeMeta: kapi.TypeMeta{ID: "test-deploy-config"},
|
|
| 218 |
- Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 219 |
- {
|
|
| 220 |
- Type: deployapi.DeploymentTriggerOnConfigChange, |
|
| 221 |
- }, |
|
| 222 |
- }, |
|
| 223 |
- LatestVersion: 3, |
|
| 224 |
- Template: deployapi.DeploymentTemplate{
|
|
| 225 |
- Strategy: deployapi.DeploymentStrategy{
|
|
| 226 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 227 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 228 |
- Image: "registry:8080/openshift/kube-deploy", |
|
| 229 |
- }, |
|
| 230 |
- }, |
|
| 231 |
- ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 232 |
- Replicas: 1, |
|
| 233 |
- ReplicaSelector: map[string]string{
|
|
| 234 |
- "name": "test-pod", |
|
| 235 |
- }, |
|
| 236 |
- PodTemplate: kapi.PodTemplate{
|
|
| 237 |
- Labels: map[string]string{
|
|
| 238 |
- "name": "test-pod", |
|
| 239 |
- }, |
|
| 240 |
- DesiredState: kapi.PodState{
|
|
| 241 |
- Manifest: kapi.ContainerManifest{
|
|
| 242 |
- Version: "v1beta1", |
|
| 243 |
- Containers: []kapi.Container{
|
|
| 244 |
- {
|
|
| 245 |
- Name: "container-1", |
|
| 246 |
- Image: "registry:8080/openshift/test-image:ref-2", |
|
| 247 |
- }, |
|
| 248 |
- }, |
|
| 249 |
- }, |
|
| 250 |
- }, |
|
| 251 |
- }, |
|
| 252 |
- }, |
|
| 253 |
- }, |
|
| 254 |
- } |
|
| 204 |
+ return &deployapi.DeploymentConfig{
|
|
| 205 |
+ TypeMeta: kapi.TypeMeta{ID: "test-deploy-config"},
|
|
| 206 |
+ Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 207 |
+ {
|
|
| 208 |
+ Type: deployapi.DeploymentTriggerOnConfigChange, |
|
| 209 |
+ }, |
|
| 210 |
+ }, |
|
| 211 |
+ LatestVersion: 3, |
|
| 212 |
+ Template: deployapi.DeploymentTemplate{
|
|
| 213 |
+ ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 214 |
+ Replicas: 1, |
|
| 215 |
+ ReplicaSelector: map[string]string{
|
|
| 216 |
+ "name": "test-pod", |
|
| 217 |
+ }, |
|
| 218 |
+ PodTemplate: kapi.PodTemplate{
|
|
| 219 |
+ Labels: map[string]string{
|
|
| 220 |
+ "name": "test-pod", |
|
| 221 |
+ }, |
|
| 222 |
+ DesiredState: kapi.PodState{
|
|
| 223 |
+ Manifest: kapi.ContainerManifest{
|
|
| 224 |
+ Version: "v1beta1", |
|
| 225 |
+ Containers: []kapi.Container{
|
|
| 226 |
+ {
|
|
| 227 |
+ Name: "container-1", |
|
| 228 |
+ Image: "registry:8080/openshift/test-image:ref-2", |
|
| 229 |
+ }, |
|
| 230 |
+ }, |
|
| 231 |
+ }, |
|
| 232 |
+ }, |
|
| 233 |
+ }, |
|
| 234 |
+ }, |
|
| 235 |
+ }, |
|
| 236 |
+ } |
|
| 255 | 237 |
} |
| 256 | 238 |
|
| 257 | 239 |
func matchingInitialDeployment() *deployapi.Deployment {
|
| 258 |
- return &deployapi.Deployment{
|
|
| 259 |
- TypeMeta: kapi.TypeMeta{ID: "test-deploy-config-1"},
|
|
| 260 |
- Status: deployapi.DeploymentStatusNew, |
|
| 261 |
- Strategy: deployapi.DeploymentStrategy{
|
|
| 262 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 263 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 264 |
- Image: "registry:8080/repo1:ref1", |
|
| 265 |
- Environment: []kapi.EnvVar{},
|
|
| 266 |
- }, |
|
| 267 |
- }, |
|
| 268 |
- ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 269 |
- Replicas: 1, |
|
| 270 |
- ReplicaSelector: map[string]string{
|
|
| 271 |
- "name": "test-pod", |
|
| 272 |
- }, |
|
| 273 |
- PodTemplate: kapi.PodTemplate{
|
|
| 274 |
- Labels: map[string]string{
|
|
| 275 |
- "name": "test-pod", |
|
| 276 |
- }, |
|
| 277 |
- DesiredState: kapi.PodState{
|
|
| 278 |
- Manifest: kapi.ContainerManifest{
|
|
| 279 |
- Version: "v1beta1", |
|
| 280 |
- Containers: []kapi.Container{
|
|
| 281 |
- {
|
|
| 282 |
- Name: "container-1", |
|
| 283 |
- Image: "registry:8080/openshift/test-image:ref-1", |
|
| 284 |
- }, |
|
| 285 |
- }, |
|
| 286 |
- }, |
|
| 287 |
- }, |
|
| 288 |
- }, |
|
| 289 |
- }, |
|
| 290 |
- } |
|
| 240 |
+ return &deployapi.Deployment{
|
|
| 241 |
+ TypeMeta: kapi.TypeMeta{ID: "test-deploy-config-1"},
|
|
| 242 |
+ Status: deployapi.DeploymentStatusNew, |
|
| 243 |
+ ControllerTemplate: kapi.ReplicationControllerState{
|
|
| 244 |
+ Replicas: 1, |
|
| 245 |
+ ReplicaSelector: map[string]string{
|
|
| 246 |
+ "name": "test-pod", |
|
| 247 |
+ }, |
|
| 248 |
+ PodTemplate: kapi.PodTemplate{
|
|
| 249 |
+ Labels: map[string]string{
|
|
| 250 |
+ "name": "test-pod", |
|
| 251 |
+ }, |
|
| 252 |
+ DesiredState: kapi.PodState{
|
|
| 253 |
+ Manifest: kapi.ContainerManifest{
|
|
| 254 |
+ Version: "v1beta1", |
|
| 255 |
+ Containers: []kapi.Container{
|
|
| 256 |
+ {
|
|
| 257 |
+ Name: "container-1", |
|
| 258 |
+ Image: "registry:8080/openshift/test-image:ref-1", |
|
| 259 |
+ }, |
|
| 260 |
+ }, |
|
| 261 |
+ }, |
|
| 262 |
+ }, |
|
| 263 |
+ }, |
|
| 264 |
+ }, |
|
| 265 |
+ } |
|
| 291 | 266 |
} |
| ... | ... |
@@ -302,10 +302,7 @@ func imageChangeDeploymentConfig() *deployapi.DeploymentConfig {
|
| 302 | 302 |
}, |
| 303 | 303 |
Template: deployapi.DeploymentTemplate{
|
| 304 | 304 |
Strategy: deployapi.DeploymentStrategy{
|
| 305 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 306 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 307 |
- Image: "registry:8080/openshift/kube-deploy", |
|
| 308 |
- }, |
|
| 305 |
+ Type: deployapi.DeploymentStrategyTypeBasic, |
|
| 309 | 306 |
}, |
| 310 | 307 |
ControllerTemplate: kapi.ReplicationControllerState{
|
| 311 | 308 |
Replicas: 1, |
| ... | ... |
@@ -340,17 +337,9 @@ func imageChangeDeploymentConfig() *deployapi.DeploymentConfig {
|
| 340 | 340 |
func manualDeploymentConfig() *deployapi.DeploymentConfig {
|
| 341 | 341 |
return &deployapi.DeploymentConfig{
|
| 342 | 342 |
TypeMeta: kapi.TypeMeta{ID: "manual-deploy-config"},
|
| 343 |
- Triggers: []deployapi.DeploymentTriggerPolicy{
|
|
| 344 |
- {
|
|
| 345 |
- Type: deployapi.DeploymentTriggerManual, |
|
| 346 |
- }, |
|
| 347 |
- }, |
|
| 348 | 343 |
Template: deployapi.DeploymentTemplate{
|
| 349 | 344 |
Strategy: deployapi.DeploymentStrategy{
|
| 350 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 351 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 352 |
- Image: "registry:8080/openshift/kube-deploy", |
|
| 353 |
- }, |
|
| 345 |
+ Type: deployapi.DeploymentStrategyTypeBasic, |
|
| 354 | 346 |
}, |
| 355 | 347 |
ControllerTemplate: kapi.ReplicationControllerState{
|
| 356 | 348 |
Replicas: 1, |
| ... | ... |
@@ -383,18 +372,12 @@ func changeDeploymentConfig() *deployapi.DeploymentConfig {
|
| 383 | 383 |
TypeMeta: kapi.TypeMeta{ID: "change-deploy-config"},
|
| 384 | 384 |
Triggers: []deployapi.DeploymentTriggerPolicy{
|
| 385 | 385 |
{
|
| 386 |
- Type: deployapi.DeploymentTriggerManual, |
|
| 387 |
- }, |
|
| 388 |
- {
|
|
| 389 | 386 |
Type: deployapi.DeploymentTriggerOnConfigChange, |
| 390 | 387 |
}, |
| 391 | 388 |
}, |
| 392 | 389 |
Template: deployapi.DeploymentTemplate{
|
| 393 | 390 |
Strategy: deployapi.DeploymentStrategy{
|
| 394 |
- Type: deployapi.DeploymentStrategyTypeCustomPod, |
|
| 395 |
- CustomPod: &deployapi.CustomPodDeploymentStrategy{
|
|
| 396 |
- Image: "registry:8080/openshift/kube-deploy", |
|
| 397 |
- }, |
|
| 391 |
+ Type: deployapi.DeploymentStrategyTypeBasic, |
|
| 398 | 392 |
}, |
| 399 | 393 |
ControllerTemplate: kapi.ReplicationControllerState{
|
| 400 | 394 |
Replicas: 1, |