Browse code

Replace docker-registry-*.json with osadm registry

Remove sample-app's docker-registry-{config,template}.json since we have
osadm registry now. Update the docs and tests that use these files
accordingly as well.

Fixes #1964

Andy Goldstein authored on 2015/04/29 22:41:58
Showing 6 changed files
... ...
@@ -53,13 +53,19 @@ Docker Registry
53 53
 
54 54
 Most of the v3 flows today assume you are running a docker registry pod.  You should ensure that this local registry is running:
55 55
 
56
-    $ osc get pods --selector="name=registrypod"
56
+    $ openshift admin registry
57 57
 
58
-If it's not running, you can launch it via:
58
+If it's running, you should see this:
59
+
60
+    Docker registry "docker-registry" service exists
61
+
62
+If it's not running, you will instead see:
59 63
 
60
-    $ osc create -f examples/sample-app/docker-registry-config.json
64
+    F0429 09:22:54.492990   25259 registry.go:154] Docker-registry "docker-registry" does not exist (no service). Pass --create to install.
65
+
66
+If it's not running, you can launch it via:
61 67
 
62
-In addition, confirm the IP and Port reported in the services list matches the registry references in your configuration json (e.g. any image tags that contain a registry hostname).  
68
+    $ osadm registry --create --credentials="${OPENSHIFTCONFIG}"
63 69
 
64 70
 Probing Containers
65 71
 ------------------
... ...
@@ -66,8 +66,6 @@ func TestExampleObjectSchemas(t *testing.T) {
66 66
 		},
67 67
 		"../examples/sample-app": {
68 68
 			"github-webhook-example":           nil, // Skip.
69
-			"docker-registry-config":           &configapi.Config{},
70
-			"docker-registry-template":         &templateapi.Template{},
71 69
 			"application-template-stibuild":    &templateapi.Template{},
72 70
 			"application-template-dockerbuild": &templateapi.Template{},
73 71
 			"application-template-custombuild": &templateapi.Template{},
... ...
@@ -52,9 +52,6 @@ bits that are used in the sample app.
52 52
     $ cd /var/lib/openshift
53 53
     $ mkdir -p examples/sample-app
54 54
     $ wget \
55
-    https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/docker-registry-template.json \
56
-    -O examples/sample-app/docker-registry-template.json
57
-    $ wget \
58 55
     https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json \
59 56
     -O examples/sample-app/application-template-stibuild.json
60 57
 
... ...
@@ -68,7 +65,7 @@ step #3.
68 68
 
69 69
 ## Deploy the private docker registry
70 70
 
71
-    $ openshift ex registry --create --credentials="${OPENSHIFTCONFIG}"
71
+    $ osadm registry --create --credentials="${OPENSHIFTCONFIG}"
72 72
     $ cd examples/sample-app
73 73
 
74 74
 For more information on this step, see [Application Build, Deploy, and Update
75 75
deleted file mode 100644
... ...
@@ -1,98 +0,0 @@
1
-{
2
-  "apiVersion": "v1beta1",
3
-  "creationTimestamp": "2014-09-18T18:28:38-04:00",
4
-  "items": [
5
-    {
6
-      "apiVersion": "v1beta2",
7
-      "containerPort": 5000,
8
-      "creationTimestamp": null,
9
-      "id": "docker-registry",
10
-      "kind": "Service",
11
-      "port": 5001,
12
-      "portalIp": "172.30.17.3",
13
-      "selector": {
14
-        "name": "registrypod"
15
-      }
16
-    },
17
-    {
18
-      "apiVersion": "v1beta1",
19
-      "kind": "DeploymentConfig",
20
-      "metadata": {
21
-        "name": "docker-registry"
22
-      },
23
-      "template": {
24
-        "controllerTemplate": {
25
-          "podTemplate": {
26
-            "desiredState": {
27
-              "manifest": {
28
-                "containers": [
29
-                  {
30
-                    "command": [
31
-                      "sh",
32
-                      "-c",
33
-                      "REGISTRY_URL=${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT} OPENSHIFT_URL=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/osapi/v1beta1 OPENSHIFT_INSECURE=true exec docker-registry"
34
-                    ],
35
-                    "env": [
36
-                      {
37
-                        "name": "STORAGE_PATH",
38
-                        "value": "/tmp/openshift.local.registry"
39
-                      }
40
-                    ],
41
-                    "image": "openshift/docker-registry",
42
-                    "imagePullPolicy": "PullIfNotPresent",
43
-                    "name": "registry-container",
44
-                    "ports": [
45
-                      {
46
-                        "containerPort": 5000,
47
-                        "protocol": "TCP"
48
-                      }
49
-                    ],
50
-                    "privileged": true,
51
-                    "volumeMounts": [
52
-                      {
53
-                        "mountPath": "/tmp/openshift.local.registry",
54
-                        "name": "registry-storage",
55
-                        "readOnly": false
56
-                      }
57
-                    ]
58
-                  }
59
-                ],
60
-                "version": "v1beta1",
61
-                "volumes": [
62
-                  {
63
-                    "name": "registry-storage",
64
-                    "source": {
65
-                      "hostDir": {
66
-                        "path": "/tmp/openshift.local.registry"
67
-                      }
68
-                    }
69
-                  }
70
-                ]
71
-              },
72
-              "restartpolicy": {}
73
-            },
74
-            "labels": {
75
-              "name": "registrypod"
76
-            }
77
-          },
78
-          "replicaSelector": {
79
-            "name": "registrypod"
80
-          },
81
-          "replicas": 1
82
-        },
83
-        "strategy": {
84
-          "type": "Recreate"
85
-        }
86
-      },
87
-      "triggers": [
88
-        {
89
-          "type": "ConfigChange"
90
-        }
91
-      ]
92
-    }
93
-  ],
94
-  "kind": "Config",
95
-  "metadata": {
96
-    "name": "docker-registry"
97
-  }
98
-}
99 1
deleted file mode 100644
... ...
@@ -1,135 +0,0 @@
1
-{
2
-  "apiVersion": "v1beta1",
3
-  "creationTimestamp": "2014-09-18T18:28:38-04:00",
4
-  "items": [
5
-    {
6
-      "apiVersion": "v1beta2",
7
-      "containerPort": 5000,
8
-      "creationTimestamp": null,
9
-      "id": "docker-registry",
10
-      "kind": "Service",
11
-      "port": 5001,
12
-      "selector": {
13
-        "name": "registrypod"
14
-      }
15
-    },
16
-    {
17
-      "apiVersion": "v1beta1",
18
-      "kind": "DeploymentConfig",
19
-      "metadata": {
20
-        "name": "docker-registry"
21
-      },
22
-      "template": {
23
-        "controllerTemplate": {
24
-          "podTemplate": {
25
-            "desiredState": {
26
-              "manifest": {
27
-                "containers": [
28
-                  {
29
-                    "command": [
30
-                      "sh",
31
-                      "-c",
32
-                      "echo \"$OPENSHIFT_KEY_DATA\" \u003e $STORAGE_PATH/key.key \u0026\u0026 echo \"$OPENSHIFT_CERT_DATA\" \u003e $STORAGE_PATH/cert.crt \u0026\u0026 echo \"$OPENSHIFT_CA_DATA\" \u003e $STORAGE_PATH/root.crt \u0026\u0026 echo \"$OPENSHIFT_CA_DATA\" \u003e $STORAGE_PATH/root.crt \u0026\u0026 REGISTRY_URL=${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT} OPENSHIFT_URL=${OPENSHIFT_MASTER}/osapi/v1beta1 OPENSHIFT_CA_BUNDLE=$STORAGE_PATH/root.crt OPENSHIFT_CLIENT_CERT=$STORAGE_PATH/cert.crt OPENSHIFT_CLIENT_KEY=$STORAGE_PATH/key.key exec docker-registry"
33
-                    ],
34
-                    "env": [
35
-                      {
36
-                        "name": "STORAGE_PATH",
37
-                        "value": "/tmp/openshift.local.registry"
38
-                      },
39
-                      {
40
-                        "name": "OPENSHIFT_MASTER",
41
-                        "value": "${OPENSHIFT_MASTER}"
42
-                      },
43
-                      {
44
-                        "name": "OPENSHIFT_CA_DATA",
45
-                        "value": "${OPENSHIFT_CA_DATA}"
46
-                      },
47
-                      {
48
-                        "name": "OPENSHIFT_CERT_DATA",
49
-                        "value": "${OPENSHIFT_CERT_DATA}"
50
-                      },
51
-                      {
52
-                        "name": "OPENSHIFT_KEY_DATA",
53
-                        "value": "${OPENSHIFT_KEY_DATA}"
54
-                      }
55
-                    ],
56
-                    "image": "openshift/docker-registry",
57
-                    "imagePullPolicy": "PullIfNotPresent",
58
-                    "name": "registry-container",
59
-                    "ports": [
60
-                      {
61
-                        "containerPort": 5000,
62
-                        "protocol": "TCP"
63
-                      }
64
-                    ],
65
-                    "privileged": true,
66
-                    "volumeMounts": [
67
-                      {
68
-                        "mountPath": "/tmp/openshift.local.registry",
69
-                        "name": "registry-storage",
70
-                        "readOnly": false
71
-                      }
72
-                    ]
73
-                  }
74
-                ],
75
-                "version": "v1beta1",
76
-                "volumes": [
77
-                  {
78
-                    "name": "registry-storage",
79
-                    "source": {
80
-                      "hostDir": {
81
-                        "path": "/tmp/openshift.local.registry"
82
-                      }
83
-                    }
84
-                  }
85
-                ]
86
-              },
87
-              "restartpolicy": {}
88
-            },
89
-            "labels": {
90
-              "name": "registrypod"
91
-            }
92
-          },
93
-          "replicaSelector": {
94
-            "name": "registrypod"
95
-          },
96
-          "replicas": 1
97
-        },
98
-        "strategy": {
99
-          "type": "Recreate"
100
-        }
101
-      },
102
-      "triggers": [
103
-        {
104
-          "type": "ConfigChange"
105
-        }
106
-      ]
107
-    }
108
-  ],
109
-  "kind": "Template",
110
-  "metadata": {
111
-    "annotations": {
112
-      "description": "Template for launching a docker-registry pod"
113
-    },
114
-    "name": "docker-registry-template"
115
-  },
116
-  "parameters": [
117
-    {
118
-      "description": "OpenShift master",
119
-      "name": "OPENSHIFT_MASTER",
120
-      "value": "http://localhost:8080"
121
-    },
122
-    {
123
-      "description": "OpenShift root certificates",
124
-      "name": "OPENSHIFT_CA_DATA"
125
-    },
126
-    {
127
-      "description": "OpenShift client certificate",
128
-      "name": "OPENSHIFT_CERT_DATA"
129
-    },
130
-    {
131
-      "description": "OpenShift client certificate key",
132
-      "name": "OPENSHIFT_KEY_DATA"
133
-    }
134
-  ]
135
-}
... ...
@@ -276,10 +276,18 @@ echo "images: ok"
276 276
 
277 277
 osc get imageStreams
278 278
 osc create -f test/integration/fixtures/test-image-stream.json
279
+# make sure stream.status.dockerImageRepository isn't set (no registry)
279 280
 [ -z "$(osc get imageStreams test -t "{{.status.dockerImageRepository}}")" ]
280
-osc create -f examples/sample-app/docker-registry-config.json
281
+# create the registry
282
+osadm registry --create --credentials="${OPENSHIFTCONFIG}"
283
+# make sure stream.status.dockerImageRepository IS set
281 284
 [ -n "$(osc get imageStreams test -t "{{.status.dockerImageRepository}}")" ]
282
-osc delete -f examples/sample-app/docker-registry-config.json
285
+# delete the registry resources
286
+osc delete dc docker-registry
287
+osc delete se docker-registry
288
+osc delete rc docker-registry-1
289
+osc delete pod $(osc get pod | grep docker-registry-1 | awk '{print $1}')
290
+# done deleting registry resources
283 291
 osc delete imageStreams test
284 292
 [ -z "$(osc get imageStreams test -t "{{.status.dockerImageRepository}}")" ]
285 293
 osc create -f examples/image-streams/image-streams-centos7.json