Merge pull request #10230 from ihmccreery/update-demo

Update update-demo to work for v1, and don't use localhost domain name
This commit is contained in:
Maxwell Forbes 2015-06-24 11:07:43 -07:00
commit 493e0cdb01
4 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@ kind: ReplicationController
metadata:
name: update-demo-kitten
spec:
replicas: 1
replicas: 4
selector:
name: update-demo
version: kitten

View File

@ -22,9 +22,9 @@ limitations under the License.
</head>
<body ng-controller="ButtonsCtrl">
<div ng-repeat="server in servers" class="pod">
<img src="http://localhost:8001/api/v1/proxy/namespaces/default/pods/{{server.podName}}/{{server.image}}" height="100px" width="100px" />
<img src="/api/v1/proxy/namespaces/default/pods/{{server.podName}}/{{server.image}}" height="100px" width="100px" />
<b>ID:</b> {{server.podName}}<br>
<b>Host:</b> <a href="http://localhost:8001/api/v1/proxy/namespaces/default/pods/{{server.podName}}/data.json">{{server.host}}</a><br>
<b>Host:</b> <a href="/api/v1/proxy/namespaces/default/pods/{{server.podName}}/data.json">{{server.host}}</a><br>
<b>Status:</b> {{server.status}}<br>
<b>Image:</b> {{server.dockerImage}}<br>
<b>Labels:</b>

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
var base = "http://localhost:8001/api/v1/";
var base = "/api/v1/";
var updateImage = function($http, server) {
$http.get(base + "proxy/namespaces/default/pods/" + server.podName + "/data.json")
@ -33,7 +33,7 @@ var updateServer = function($http, server) {
.success(function(data) {
console.log(data);
server.labels = data.metadata.labels;
server.host = data.spec.host.split('.')[0];
server.host = data.status.hostIP.split('.')[0];
server.status = data.status.phase;
server.dockerImage = data.status.containerStatuses[0].image;
updateImage($http, server);

View File

@ -102,7 +102,7 @@ var _ = Describe("Kubectl client", func() {
By("rolling-update to new replication controller")
runKubectl("rolling-update", "update-demo-nautilus", "--update-period=1s", "-f", kittenPath, fmt.Sprintf("--namespace=%v", ns))
// TODO: revisit the expected replicas once #9645 is resolved
validateController(c, kittenImage, 1, "update-demo", updateDemoSelector, getUDData("kitten.jpg", ns), ns)
validateController(c, kittenImage, 4, "update-demo", updateDemoSelector, getUDData("kitten.jpg", ns), ns)
// Everything will hopefully be cleaned up when the namespace is deleted.
})
})