Commit f23f7a19 authored by Eric Tune's avatar Eric Tune

Merge pull request #11256 from mikedanese/fix-e2e

temporary fix e2e by duping files
parents c1797258 1e85c9cf
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
#!/bin/bash
# Copyright 2014 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script will build and push the images necessary for the demo.
set -o errexit
set -o nounset
set -o pipefail
DOCKER_HUB_USER=${DOCKER_HUB_USER:-kubernetes}
set -x
docker build -t "${DOCKER_HUB_USER}/update-demo:kitten" images/kitten
docker build -t "${DOCKER_HUB_USER}/update-demo:nautilus" images/nautilus
docker push "${DOCKER_HUB_USER}/update-demo"
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM kubernetes/test-webserver
COPY html/kitten.jpg kitten.jpg
COPY html/data.json data.json
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM kubernetes/test-webserver
COPY html/nautilus.jpg nautilus.jpg
COPY html/data.json data.json
apiVersion: v1
kind: ReplicationController
metadata:
name: update-demo-kitten
spec:
selector:
name: update-demo
version: kitten
template:
metadata:
labels:
name: update-demo
version: kitten
spec:
containers:
- image: gcr.io/google_containers/update-demo:kitten
name: update-demo
ports:
- containerPort: 80
protocol: TCP
The MIT License
Copyright (c) 2010-2014 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<!--
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html ng-app>
<head>
<script src="angular.min.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" href="style.css"></link>
</head>
<body ng-controller="ButtonsCtrl">
<div ng-repeat="server in servers" class="pod">
<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="/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>
<ul>
<li ng-repeat="(key,value) in server.labels">{{key}}={{value}}</li>
</ul>
</div>
</body>
</html>
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var base = "/api/v1/";
var updateImage = function($http, server) {
$http.get(base + "proxy/namespaces/default/pods/" + server.podName + "/data.json")
.success(function(data) {
console.log(data);
server.image = data.image;
})
.error(function(data) {
console.log(data);
server.image = "";
});
};
var updateServer = function($http, server) {
$http.get(base + "namespaces/default/pods/" + server.podName)
.success(function(data) {
console.log(data);
server.labels = data.metadata.labels;
server.host = data.status.hostIP.split('.')[0];
server.status = data.status.phase;
server.dockerImage = data.status.containerStatuses[0].image;
updateImage($http, server);
})
.error(function(data) {
console.log(data);
});
};
var updateData = function($scope, $http) {
var servers = $scope.servers;
for (var i = 0; i < servers.length; ++i) {
var server = servers[i];
updateServer($http, server);
}
};
var ButtonsCtrl = function ($scope, $http, $interval) {
$scope.servers = [];
update($scope, $http);
$interval(angular.bind({}, update, $scope, $http), 2000);
};
var getServer = function($scope, name) {
var servers = $scope.servers;
for (var i = 0; i < servers.length; ++i) {
if (servers[i].podName == name) {
return servers[i];
}
}
return null;
};
var isUpdateDemoPod = function(pod) {
return pod.metadata && pod.metadata.labels && pod.metadata.labels.name == "update-demo";
};
var update = function($scope, $http) {
if (!$http) {
console.log("No HTTP!");
return;
}
$http.get(base + "namespaces/default/pods")
.success(function(data) {
console.log(data);
var newServers = [];
for (var i = 0; i < data.items.length; ++i) {
var pod = data.items[i];
if (!isUpdateDemoPod(pod)) {
continue;
}
var server = getServer($scope, pod.metadata.name);
if (server == null) {
server = { "podName": pod.metadata.name };
}
newServers.push(server);
}
$scope.servers = newServers;
updateData($scope, $http);
})
.error(function(data) {
console.log("ERROR: " + data);
})
};
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
img {
height: 100px;
width: 100px;
float: right;
background-size: 100px 100px;
background-color: black;
margin-left: 10px;
border: none;
}
ul {
margin-top: 0;
margin-bottom: 0;
}
.pod {
font-family: Roboto, Open Sans, arial;
border: 1px solid black;
border-radius: 5px;
padding: 10px;
margin: 10px;
display: inline-block;
background-color: #D1D1D1;
}
apiVersion: v1
kind: ReplicationController
metadata:
name: update-demo-nautilus
spec:
replicas: 2
selector:
name: update-demo
version: nautilus
template:
metadata:
labels:
name: update-demo
version: nautilus
spec:
containers:
- image: gcr.io/google_containers/update-demo:nautilus
name: update-demo
ports:
- containerPort: 80
protocol: TCP
......@@ -142,7 +142,7 @@ var _ = Describe("Kubectl client", func() {
var podPath string
BeforeEach(func() {
podPath = filepath.Join(testContext.RepoRoot, "docs/user-guide/pod.yaml")
podPath = filepath.Join(testContext.RepoRoot, "examples/pod.yaml")
By("creating the pod")
runKubectl("create", "-f", podPath, fmt.Sprintf("--namespace=%v", ns))
checkPodsRunningReady(c, ns, []string{simplePodName}, podStartTimeout)
......@@ -206,7 +206,7 @@ var _ = Describe("Kubectl client", func() {
var podPath string
var nsFlag string
BeforeEach(func() {
podPath = filepath.Join(testContext.RepoRoot, "docs/user-guide/pod.yaml")
podPath = filepath.Join(testContext.RepoRoot, "examples/pod.yaml")
By("creating the pod")
nsFlag = fmt.Sprintf("--namespace=%v", ns)
runKubectl("create", "-f", podPath, nsFlag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment