| ... | ... |
@@ -63,10 +63,13 @@ func NewDeploymentConfigPipeline(g osgraph.Graph, dcNode *deploygraph.Deployment |
| 63 | 63 |
|
| 64 | 64 |
dcPipeline.ActiveDeployment, dcPipeline.InactiveDeployments = deployedges.RelevantDeployments(g, dcNode) |
| 65 | 65 |
for _, rc := range dcPipeline.InactiveDeployments {
|
| 66 |
- covered.Insert(rc.ID()) |
|
| 66 |
+ _, covers := NewReplicationController(g, rc) |
|
| 67 |
+ covered.Insert(covers.List()...) |
|
| 67 | 68 |
} |
| 69 |
+ |
|
| 68 | 70 |
if dcPipeline.ActiveDeployment != nil {
|
| 69 |
- covered.Insert(dcPipeline.ActiveDeployment.ID()) |
|
| 71 |
+ _, covers := NewReplicationController(g, dcPipeline.ActiveDeployment) |
|
| 72 |
+ covered.Insert(covers.List()...) |
|
| 70 | 73 |
} |
| 71 | 74 |
|
| 72 | 75 |
return dcPipeline, covered |
| ... | ... |
@@ -307,6 +307,20 @@ func TestProjectStatus(t *testing.T) {
|
| 307 | 307 |
"You have no services, deployment configs, or build configs.", |
| 308 | 308 |
}, |
| 309 | 309 |
}, |
| 310 |
+ "deploys single pod": {
|
|
| 311 |
+ Path: "../../../../test/fixtures/simple-deployment.yaml", |
|
| 312 |
+ Extra: []runtime.Object{
|
|
| 313 |
+ &projectapi.Project{
|
|
| 314 |
+ ObjectMeta: kapi.ObjectMeta{Name: "example", Namespace: ""},
|
|
| 315 |
+ }, |
|
| 316 |
+ }, |
|
| 317 |
+ ErrFn: func(err error) bool { return err == nil },
|
|
| 318 |
+ Contains: []string{
|
|
| 319 |
+ "In project example on server https://example.com:8443\n", |
|
| 320 |
+ "dc/simple-deployment deploys docker.io/openshift/deployment-example:v1", |
|
| 321 |
+ `View details with 'oc describe <resource>/<name>' or list everything with 'oc get all'.`, |
|
| 322 |
+ }, |
|
| 323 |
+ }, |
|
| 310 | 324 |
} |
| 311 | 325 |
oldTimeFn := timeNowFn |
| 312 | 326 |
defer func() { timeNowFn = oldTimeFn }()
|
| ... | ... |
@@ -29,6 +29,9 @@ os::cmd::expect_success 'oc describe deploymentConfigs test-deployment-config' |
| 29 | 29 |
os::cmd::expect_success_and_text 'oc get dc -o name' 'deploymentconfig/test-deployment-config' |
| 30 | 30 |
os::cmd::try_until_success 'oc get rc/test-deployment-config-1' |
| 31 | 31 |
os::cmd::expect_success_and_text 'oc describe dc test-deployment-config' 'deploymentconfig=test-deployment-config' |
| 32 |
+os::cmd::expect_success_and_text 'oc status' 'dc/test-deployment-config deploys docker.io/openshift/origin-pod:latest' |
|
| 33 |
+os::cmd::expect_success 'oc create -f examples/hello-openshift/hello-pod.json' |
|
| 34 |
+os::cmd::try_until_text 'oc status' 'pod/hello-openshift runs openshift/hello-openshift' |
|
| 32 | 35 |
|
| 33 | 36 |
os::test::junit::declare_suite_start "cmd/deployments/env" |
| 34 | 37 |
# Patch a nil list |
| ... | ... |
@@ -87,7 +87,7 @@ os::cmd::expect_success "oc delete project test-scratchimage" |
| 87 | 87 |
VERBOSE=true os::cmd::expect_success "oc project new-app" |
| 88 | 88 |
# error due to partial match |
| 89 | 89 |
os::cmd::expect_failure_and_text "oc new-app test/scratchimage2 -o yaml" "partial match" |
| 90 |
-# success with exact match |
|
| 90 |
+# success with exact match |
|
| 91 | 91 |
os::cmd::expect_success "oc new-app test/scratchimage" |
| 92 | 92 |
echo "[INFO] newapp: ok" |
| 93 | 93 |
os::test::junit::declare_suite_end |
| ... | ... |
@@ -170,6 +170,12 @@ os::cmd::expect_success "oc create configmap default-conf --from-file=test/exten |
| 170 | 170 |
os::cmd::expect_success "oc set volumes dc/nginx --add --configmap-name=default-conf --mount-path=/etc/nginx/conf.d" |
| 171 | 171 |
os::cmd::try_until_text "oc get pods -l deployment-config.name=nginx" 'Running' |
| 172 | 172 |
|
| 173 |
+# only show single pods in status if they are really single |
|
| 174 |
+os::cmd::expect_success 'oc create -f test/integration/fixtures/test-deployment-config.yaml' |
|
| 175 |
+os::cmd::try_until_text 'oc status' 'dc\/test-deployment-config deploys docker\.io\/openshift\/origin-pod:latest' "$(( 2 * TIME_MIN ))" |
|
| 176 |
+os::cmd::try_until_text 'oc status' 'deployment #1 deployed.*- 1 pod' "$(( 2 * TIME_MIN ))" |
|
| 177 |
+os::cmd::expect_success_and_not_text 'oc status' 'pod\/test-deployment-config-1-[0-9a-z]{5} runs openshift\/origin-pod'
|
|
| 178 |
+ |
|
| 173 | 179 |
# break mac os |
| 174 | 180 |
service_ip=$(oc get service/nginx -o=jsonpath={.spec.clusterIP})
|
| 175 | 181 |
os::cmd::try_until_success "curl --cacert ${MASTER_CONFIG_DIR}/service-signer.crt --resolve nginx.service-serving-cert-generation.svc:443:${service_ip} https://nginx.service-serving-cert-generation.svc:443"
|
| 176 | 182 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,27 @@ |
| 0 |
+apiVersion: v1 |
|
| 1 |
+kind: DeploymentConfig |
|
| 2 |
+metadata: |
|
| 3 |
+ name: simple-deployment |
|
| 4 |
+spec: |
|
| 5 |
+ replicas: 1 |
|
| 6 |
+ selector: |
|
| 7 |
+ name: simple-deployment |
|
| 8 |
+ strategy: |
|
| 9 |
+ type: Rolling |
|
| 10 |
+ rollingParams: |
|
| 11 |
+ template: |
|
| 12 |
+ metadata: |
|
| 13 |
+ labels: |
|
| 14 |
+ name: simple-deployment |
|
| 15 |
+ spec: |
|
| 16 |
+ containers: |
|
| 17 |
+ - image: "docker.io/openshift/deployment-example:v1" |
|
| 18 |
+ imagePullPolicy: IfNotPresent |
|
| 19 |
+ name: myapp |
|
| 20 |
+ readinessProbe: |
|
| 21 |
+ httpGet: |
|
| 22 |
+ path: / |
|
| 23 |
+ port: 8080 |
|
| 24 |
+ scheme: HTTP |
|
| 25 |
+ triggers: |
|
| 26 |
+ - type: ConfigChange |