Merge lp:~mbruzek/charms/trusty/kubernetes/trunk into lp:~kubernetes/charms/trusty/kubernetes/trunk
- Trusty Tahr (14.04)
- trunk
- Merge into trunk
Proposed by
Matt Bruzek
Status: | Merged |
---|---|
Merged at revision: | 12 |
Proposed branch: | lp:~mbruzek/charms/trusty/kubernetes/trunk |
Merge into: | lp:~kubernetes/charms/trusty/kubernetes/trunk |
Diff against target: |
412 lines (+162/-49) 13 files modified
Makefile (+2/-1) README.md (+43/-21) copyright (+1/-1) files/kubelet.upstart.tmpl (+3/-3) hooks/hooks.py (+19/-4) hooks/install (+13/-12) hooks/kubernetes_installer.py (+16/-2) hooks/lib/__init__.py (+16/-0) hooks/lib/registrator.py (+18/-4) hooks/start (+1/-1) python_requirements.txt (+1/-0) unit_tests/lib/test_registrator.py (+15/-0) unit_tests/test_hooks.py (+14/-0) |
To merge this branch: | bzr merge lp:~mbruzek/charms/trusty/kubernetes/trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Charles Butler (community) | Approve | ||
Review via email: mp+273993@code.launchpad.net |
Commit message
Description of the change
Synched this charm with the content on github. Then ran the lint and CI tests against the code.
Had to clean up quite a few failures to get here, but this charm passes all tests in CI and is synchronized with the content in github.
http://
To post a comment you must log in.
- 15. By Matt Bruzek
-
Changing the flake8 rules to not conflict with the verify-boilerplate k8s tool.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile' | |||
2 | --- Makefile 2015-09-24 20:09:00 +0000 | |||
3 | +++ Makefile 2015-10-09 16:18:47 +0000 | |||
4 | @@ -6,7 +6,7 @@ | |||
5 | 6 | .venv/bin/pip install -q -r requirements.txt | 6 | .venv/bin/pip install -q -r requirements.txt |
6 | 7 | 7 | ||
7 | 8 | lint: virtualenv | 8 | lint: virtualenv |
9 | 9 | @.venv/bin/flake8 hooks --exclude=charmhelpers | 9 | @.venv/bin/flake8 hooks --exclude=charmhelpers --ignore=W391 |
10 | 10 | @.venv/bin/charm proof | 10 | @.venv/bin/charm proof |
11 | 11 | 11 | ||
12 | 12 | test: virtualenv | 12 | test: virtualenv |
13 | @@ -27,3 +27,4 @@ | |||
14 | 27 | clean: | 27 | clean: |
15 | 28 | rm -rf .venv | 28 | rm -rf .venv |
16 | 29 | find -name *.pyc -delete | 29 | find -name *.pyc -delete |
17 | 30 | rm -rf unit_tests/.cache | ||
18 | 30 | 31 | ||
19 | === modified file 'README.md' | |||
20 | --- README.md 2015-04-10 21:47:06 +0000 | |||
21 | +++ README.md 2015-10-09 16:18:47 +0000 | |||
22 | @@ -1,6 +1,6 @@ | |||
24 | 1 | # Kubernetes Minion Charm | 1 | # Kubernetes Node Charm |
25 | 2 | 2 | ||
27 | 3 | [Kubernetes](https://github.com/googlecloudplatform/kubernetes) is an open | 3 | [Kubernetes](https://github.com/kubernetes/kubernetes) is an open |
28 | 4 | source system for managing containerized applications across multiple hosts. | 4 | source system for managing containerized applications across multiple hosts. |
29 | 5 | Kubernetes uses [Docker](http://www.docker.io/) to package, instantiate and run | 5 | Kubernetes uses [Docker](http://www.docker.io/) to package, instantiate and run |
30 | 6 | containerized applications. | 6 | containerized applications. |
31 | @@ -28,8 +28,9 @@ | |||
32 | 28 | main management contact point providing many management services for the worker | 28 | main management contact point providing many management services for the worker |
33 | 29 | nodes. | 29 | nodes. |
34 | 30 | 30 | ||
37 | 31 | ### Kubernetes minion | 31 | ### Kubernetes node |
38 | 32 | The servers that perform the work are known as minions. Minions must be able to | 32 | The servers that perform the work are known as nodes (previously minions). |
39 | 33 | Nodes must be able to | ||
40 | 33 | communicate with the master and run the workloads that are assigned to them. | 34 | communicate with the master and run the workloads that are assigned to them. |
41 | 34 | 35 | ||
42 | 35 | 36 | ||
43 | @@ -55,22 +56,39 @@ | |||
44 | 55 | 56 | ||
45 | 56 | #### Deploying the recommended configuration | 57 | #### Deploying the recommended configuration |
46 | 57 | 58 | ||
56 | 58 | A bundle can be used to deploy Kubernetes onto any cloud it can be | 59 | Use the 'juju quickstart' command to deploy a Kubernetes cluster to any cloud |
57 | 59 | orchestrated directly in the Juju Graphical User Interface, when using | 60 | supported by Juju. |
58 | 60 | `juju quickstart`: | 61 | |
59 | 61 | 62 | The charm store version of the Kubernetes bundle can be deployed as follows: | |
60 | 62 | juju quickstart https://raw.githubusercontent.com/whitmo/bundle-kubernetes/master/bundles.yaml | 63 | |
61 | 63 | 64 | juju quickstart u/kubernetes/kubernetes-cluster | |
62 | 64 | 65 | ||
63 | 65 | For more information on the recommended bundle deployment, see the | 66 | > Note: The charm store bundle may be locked to a specific Kubernetes release. |
64 | 66 | [Kubernetes bundle documentation](https://github.com/whitmo/bundle-kubernetes) | 67 | |
65 | 68 | Alternately you could deploy a Kubernetes bundle straight from github or a file: | ||
66 | 69 | |||
67 | 70 | juju quickstart https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/juju/bundles/local.yaml | ||
68 | 71 | |||
69 | 72 | The command above does few things for you: | ||
70 | 73 | |||
71 | 74 | - Starts a curses based gui for managing your cloud or MAAS credentials | ||
72 | 75 | - Looks for a bootstrapped deployment environment, and bootstraps if | ||
73 | 76 | required. This will launch a bootstrap node in your chosen | ||
74 | 77 | deployment environment (machine 0). | ||
75 | 78 | - Deploys the Juju GUI to your environment onto the bootstrap node. | ||
76 | 79 | - Provisions 4 machines, and deploys the Kubernetes services on top of | ||
77 | 80 | them (Kubernetes-master, two Kubernetes nodes using flannel, and etcd). | ||
78 | 81 | - Orchestrates the relations among the services, and exits. | ||
79 | 82 | |||
80 | 83 | Now you should have a running Kubernetes. Run `juju status | ||
81 | 84 | --format=oneline` to see the address of your kubernetes-master unit. | ||
82 | 67 | 85 | ||
83 | 68 | 86 | ||
84 | 69 | #### Post Deployment | 87 | #### Post Deployment |
85 | 70 | 88 | ||
86 | 71 | To interact with the kubernetes environment, either build or | 89 | To interact with the kubernetes environment, either build or |
89 | 72 | [download](https://github.com/GoogleCloudPlatform/kubernetes/releases) the | 90 | [download](https://github.com/kubernetes/kubernetes/releases) the |
90 | 73 | [kubectl](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl.md) | 91 | [kubectl](https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/kubectl/kubectl.md) |
91 | 74 | binary (available in the releases binary tarball) and point it to the master with : | 92 | binary (available in the releases binary tarball) and point it to the master with : |
92 | 75 | 93 | ||
93 | 76 | 94 | ||
94 | @@ -79,7 +97,8 @@ | |||
95 | 79 | $ export KUBERNETES_MASTER="104.131.108.99" | 97 | $ export KUBERNETES_MASTER="104.131.108.99" |
96 | 80 | 98 | ||
97 | 81 | # Configuration | 99 | # Configuration |
99 | 82 | For you convenience this charm supports changing the version of kubernetes binaries. | 100 | For you convenience this charm supports changing the version of the Kubernetes |
100 | 101 | release through a configuration option. | ||
101 | 83 | This can be done through the Juju GUI or on the command line: | 102 | This can be done through the Juju GUI or on the command line: |
102 | 84 | 103 | ||
103 | 85 | juju set kubernetes version=”v0.10.0” | 104 | juju set kubernetes version=”v0.10.0” |
104 | @@ -89,12 +108,15 @@ | |||
105 | 89 | command. | 108 | command. |
106 | 90 | 109 | ||
107 | 91 | Congratulations you know have deployed a Kubernetes environment! Use the | 110 | Congratulations you know have deployed a Kubernetes environment! Use the |
109 | 92 | [kubectl](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl.md) | 111 | [kubectl](https://github.com/kubernetes/kubernetes/blob/master/docs/user-guide/kubectl/kubectl.md) |
110 | 93 | to interact with the environment. | 112 | to interact with the environment. |
111 | 94 | 113 | ||
112 | 95 | # Kubernetes information | 114 | # Kubernetes information |
113 | 96 | 115 | ||
118 | 97 | - [Kubernetes github project](https://github.com/GoogleCloudPlatform/kubernetes) | 116 | - [Kubernetes github project](https://github.com/kubernetes/kubernetes) |
119 | 98 | - [Kubernetes issue tracker](https://github.com/GoogleCloudPlatform/kubernetes/issues) | 117 | - [Kubernetes issue tracker](https://github.com/kubernetes/kubernetes/issues) |
120 | 99 | - [Kubernetes Documenation](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/docs) | 118 | - [Kubernetes Documenation](https://github.com/kubernetes/kubernetes/tree/master/docs) |
121 | 100 | - [Kubernetes releases](https://github.com/GoogleCloudPlatform/kubernetes/releases) | 119 | - [Kubernetes releases](https://github.com/kubernetes/kubernetes/releases) |
122 | 120 | |||
123 | 121 | |||
124 | 122 | [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/juju/charms/trusty/kubernetes/README.md?pixel)]() | ||
125 | 101 | 123 | ||
126 | === modified file 'copyright' | |||
127 | --- copyright 2015-07-17 20:00:22 +0000 | |||
128 | +++ copyright 2015-10-09 16:18:47 +0000 | |||
129 | @@ -1,4 +1,4 @@ | |||
131 | 1 | Copyright 2015 Canonical Ltd. | 1 | Copyright 2015 Google Inc. All rights reserved. |
132 | 2 | 2 | ||
133 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); | 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
134 | 4 | you may not use this file except in compliance with the License. | 4 | you may not use this file except in compliance with the License. |
135 | 5 | 5 | ||
136 | === modified file 'files/kubelet.upstart.tmpl' | |||
137 | --- files/kubelet.upstart.tmpl 2015-07-17 20:00:22 +0000 | |||
138 | +++ files/kubelet.upstart.tmpl 2015-10-09 16:18:47 +0000 | |||
139 | @@ -9,7 +9,7 @@ | |||
140 | 9 | 9 | ||
141 | 10 | exec /usr/local/bin/kubelet \ | 10 | exec /usr/local/bin/kubelet \ |
142 | 11 | --address=%(kubelet_bind_addr)s \ | 11 | --address=%(kubelet_bind_addr)s \ |
146 | 12 | --api_servers=%(kubeapi_server)s \ | 12 | --api-servers=%(kubeapi_server)s \ |
147 | 13 | --hostname_override=%(kubelet_bind_addr)s \ | 13 | --hostname-override=%(kubelet_bind_addr)s \ |
148 | 14 | --cadvisor_port=4193 \ | 14 | --cadvisor-port=4193 \ |
149 | 15 | --logtostderr=true | 15 | --logtostderr=true |
150 | 16 | 16 | ||
151 | === modified file 'hooks/hooks.py' | |||
152 | --- hooks/hooks.py 2015-10-01 00:35:41 +0000 | |||
153 | +++ hooks/hooks.py 2015-10-09 16:18:47 +0000 | |||
154 | @@ -1,5 +1,19 @@ | |||
155 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
156 | 2 | 2 | ||
157 | 3 | # Copyright 2015 The Kubernetes Authors All rights reserved. | ||
158 | 4 | # | ||
159 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
160 | 6 | # you may not use this file except in compliance with the License. | ||
161 | 7 | # You may obtain a copy of the License at | ||
162 | 8 | # | ||
163 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
164 | 10 | # | ||
165 | 11 | # Unless required by applicable law or agreed to in writing, software | ||
166 | 12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
167 | 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
168 | 14 | # See the License for the specific language governing permissions and | ||
169 | 15 | # limitations under the License. | ||
170 | 16 | |||
171 | 3 | """ | 17 | """ |
172 | 4 | The main hook file that is called by Juju. | 18 | The main hook file that is called by Juju. |
173 | 5 | """ | 19 | """ |
174 | @@ -11,7 +25,7 @@ | |||
175 | 11 | 25 | ||
176 | 12 | from charmhelpers.core import hookenv, host | 26 | from charmhelpers.core import hookenv, host |
177 | 13 | from kubernetes_installer import KubernetesInstaller | 27 | from kubernetes_installer import KubernetesInstaller |
179 | 14 | from path import path | 28 | from path import Path |
180 | 15 | 29 | ||
181 | 16 | from lib.registrator import Registrator | 30 | from lib.registrator import Registrator |
182 | 17 | 31 | ||
183 | @@ -26,10 +40,10 @@ | |||
184 | 26 | from the kubernetes-master charm and installs it locally on this machine. | 40 | from the kubernetes-master charm and installs it locally on this machine. |
185 | 27 | """ | 41 | """ |
186 | 28 | hookenv.log('Starting api-relation-changed') | 42 | hookenv.log('Starting api-relation-changed') |
188 | 29 | charm_dir = path(hookenv.charm_dir()) | 43 | charm_dir = Path(hookenv.charm_dir()) |
189 | 30 | # Get the package architecture, rather than the from the kernel (uname -m). | 44 | # Get the package architecture, rather than the from the kernel (uname -m). |
190 | 31 | arch = subprocess.check_output(['dpkg', '--print-architecture']).strip() | 45 | arch = subprocess.check_output(['dpkg', '--print-architecture']).strip() |
192 | 32 | kubernetes_bin_dir = path('/opt/kubernetes/bin') | 46 | kubernetes_bin_dir = Path('/opt/kubernetes/bin') |
193 | 33 | # Get the version of kubernetes to install. | 47 | # Get the version of kubernetes to install. |
194 | 34 | version = subprocess.check_output(['relation-get', 'version']).strip() | 48 | version = subprocess.check_output(['relation-get', 'version']).strip() |
195 | 35 | print('Relation version: ', version) | 49 | print('Relation version: ', version) |
196 | @@ -187,8 +201,9 @@ | |||
197 | 187 | mem = info.strip().split(':')[1].strip().split()[0] | 201 | mem = info.strip().split(':')[1].strip().split()[0] |
198 | 188 | cpus = os.sysconf('SC_NPROCESSORS_ONLN') | 202 | cpus = os.sysconf('SC_NPROCESSORS_ONLN') |
199 | 189 | 203 | ||
200 | 204 | # https://github.com/kubernetes/kubernetes/blob/master/docs/admin/node.md | ||
201 | 190 | registration_request = Registrator() | 205 | registration_request = Registrator() |
203 | 191 | registration_request.data['Kind'] = 'Minion' | 206 | registration_request.data['kind'] = 'Node' |
204 | 192 | registration_request.data['id'] = private_address | 207 | registration_request.data['id'] = private_address |
205 | 193 | registration_request.data['name'] = private_address | 208 | registration_request.data['name'] = private_address |
206 | 194 | registration_request.data['metadata']['name'] = private_address | 209 | registration_request.data['metadata']['name'] = private_address |
207 | 195 | 210 | ||
208 | === modified file 'hooks/install' | |||
209 | --- hooks/install 2015-04-10 20:43:29 +0000 | |||
210 | +++ hooks/install 2015-10-09 16:18:47 +0000 | |||
211 | @@ -13,20 +13,21 @@ | |||
212 | 13 | python-pip \ | 13 | python-pip \ |
213 | 14 | wget | 14 | wget |
214 | 15 | 15 | ||
216 | 16 | pip install path.py | 16 | pip install -r $CHARM_DIR/python_requirements.txt |
217 | 17 | 17 | ||
218 | 18 | # Create the necessary kubernetes group. | 18 | # Create the necessary kubernetes group. |
225 | 19 | groupadd kubernetes | 19 | groupadd --force kubernetes |
226 | 20 | useradd -d /var/lib/kubernetes \ | 20 | |
227 | 21 | -g kubernetes \ | 21 | if grep -q "^kubernetes:" /etc/passwd; then |
228 | 22 | -s /sbin/nologin \ | 22 | echo "The kubernetes user already exists!" |
229 | 23 | --system \ | 23 | else |
230 | 24 | kubernetes | 24 | # Create the user when kubernetes does not exist. |
231 | 25 | useradd -d /var/lib/kubernetes \ | ||
232 | 26 | -g kubernetes \ | ||
233 | 27 | -s /sbin/nologin \ | ||
234 | 28 | --system \ | ||
235 | 29 | kubernetes | ||
236 | 30 | fi | ||
237 | 25 | 31 | ||
238 | 26 | install -d -m 0744 -o kubernetes -g kubernetes /var/lib/kubernetes | 32 | install -d -m 0744 -o kubernetes -g kubernetes /var/lib/kubernetes |
239 | 27 | install -d -m 0744 -o kubernetes -g kubernetes /etc/kubernetes/manifests | 33 | install -d -m 0744 -o kubernetes -g kubernetes /etc/kubernetes/manifests |
240 | 28 | |||
241 | 29 | # wait for the world, depends on where we installed it from distro | ||
242 | 30 | #sudo service docker.io stop | ||
243 | 31 | # or upstream archive | ||
244 | 32 | #sudo service docker stop | ||
245 | 33 | 34 | ||
246 | === modified file 'hooks/kubernetes_installer.py' | |||
247 | --- hooks/kubernetes_installer.py 2015-07-17 20:00:22 +0000 | |||
248 | +++ hooks/kubernetes_installer.py 2015-10-09 16:18:47 +0000 | |||
249 | @@ -1,7 +1,21 @@ | |||
250 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
251 | 2 | 2 | ||
252 | 3 | # Copyright 2015 The Kubernetes Authors All rights reserved. | ||
253 | 4 | # | ||
254 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
255 | 6 | # you may not use this file except in compliance with the License. | ||
256 | 7 | # You may obtain a copy of the License at | ||
257 | 8 | # | ||
258 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
259 | 10 | # | ||
260 | 11 | # Unless required by applicable law or agreed to in writing, software | ||
261 | 12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
262 | 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
263 | 14 | # See the License for the specific language governing permissions and | ||
264 | 15 | # limitations under the License. | ||
265 | 16 | |||
266 | 3 | import subprocess | 17 | import subprocess |
268 | 4 | from path import path | 18 | from path import Path |
269 | 5 | 19 | ||
270 | 6 | 20 | ||
271 | 7 | class KubernetesInstaller(): | 21 | class KubernetesInstaller(): |
272 | @@ -35,7 +49,7 @@ | |||
273 | 35 | print(output) | 49 | print(output) |
274 | 36 | destination.chmod(0o755) | 50 | destination.chmod(0o755) |
275 | 37 | 51 | ||
277 | 38 | def install(self, install_dir=path('/usr/local/bin')): | 52 | def install(self, install_dir=Path('/usr/local/bin')): |
278 | 39 | """ Create links to the binary files to the install directory. """ | 53 | """ Create links to the binary files to the install directory. """ |
279 | 40 | 54 | ||
280 | 41 | if not install_dir.isdir(): | 55 | if not install_dir.isdir(): |
281 | 42 | 56 | ||
282 | === modified file 'hooks/lib/__init__.py' | |||
283 | --- hooks/lib/__init__.py 2015-09-24 20:09:00 +0000 | |||
284 | +++ hooks/lib/__init__.py 2015-10-09 16:18:47 +0000 | |||
285 | @@ -0,0 +1,16 @@ | |||
286 | 1 | #!/usr/bin/env python | ||
287 | 2 | |||
288 | 3 | # Copyright 2015 The Kubernetes Authors All rights reserved. | ||
289 | 4 | # | ||
290 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
291 | 6 | # you may not use this file except in compliance with the License. | ||
292 | 7 | # You may obtain a copy of the License at | ||
293 | 8 | # | ||
294 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
295 | 10 | # | ||
296 | 11 | # Unless required by applicable law or agreed to in writing, software | ||
297 | 12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
298 | 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
299 | 14 | # See the License for the specific language governing permissions and | ||
300 | 15 | # limitations under the License. | ||
301 | 16 | |||
302 | 0 | 17 | ||
303 | === modified file 'hooks/lib/registrator.py' | |||
304 | --- hooks/lib/registrator.py 2015-10-01 00:35:41 +0000 | |||
305 | +++ hooks/lib/registrator.py 2015-10-09 16:18:47 +0000 | |||
306 | @@ -1,5 +1,19 @@ | |||
307 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
308 | 2 | 2 | ||
309 | 3 | # Copyright 2015 The Kubernetes Authors All rights reserved. | ||
310 | 4 | # | ||
311 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
312 | 6 | # you may not use this file except in compliance with the License. | ||
313 | 7 | # You may obtain a copy of the License at | ||
314 | 8 | # | ||
315 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
316 | 10 | # | ||
317 | 11 | # Unless required by applicable law or agreed to in writing, software | ||
318 | 12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
319 | 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
320 | 14 | # See the License for the specific language governing permissions and | ||
321 | 15 | # limitations under the License. | ||
322 | 16 | |||
323 | 3 | import httplib | 17 | import httplib |
324 | 4 | import json | 18 | import json |
325 | 5 | import time | 19 | import time |
326 | @@ -10,7 +24,7 @@ | |||
327 | 10 | def __init__(self): | 24 | def __init__(self): |
328 | 11 | self.ds = { | 25 | self.ds = { |
329 | 12 | "creationTimestamp": "", | 26 | "creationTimestamp": "", |
331 | 13 | "kind": "Minion", | 27 | "kind": "Node", |
332 | 14 | "name": "", # private_address | 28 | "name": "", # private_address |
333 | 15 | "metadata": { | 29 | "metadata": { |
334 | 16 | "name": "", # private_address, | 30 | "name": "", # private_address, |
335 | @@ -69,9 +83,9 @@ | |||
336 | 69 | return True | 83 | return True |
337 | 70 | elif response.status in (500,) and result.get( | 84 | elif response.status in (500,) and result.get( |
338 | 71 | 'message', '').startswith('The requested resource does not exist'): # noqa | 85 | 'message', '').startswith('The requested resource does not exist'): # noqa |
342 | 72 | # There's something fishy in the kube api here (0.4 dev), on first | 86 | # There is something fishy in the kube api here (0.4 dev), first |
343 | 73 | # registration of a new minion, we always seem to get this error. | 87 | # time to register a new node, we always seem to get this error. |
344 | 74 | # https://github.com/GoogleCloudPlatform/kubernetes/issues/1995 | 88 | # http://issue.k8s.io/1995 |
345 | 75 | time.sleep(1) | 89 | time.sleep(1) |
346 | 76 | print("Retrying registration...") | 90 | print("Retrying registration...") |
347 | 77 | raise ValueError("Registration returned 500, retry") | 91 | raise ValueError("Registration returned 500, retry") |
348 | 78 | 92 | ||
349 | === modified file 'hooks/start' | |||
350 | --- hooks/start 2015-01-27 17:31:57 +0000 | |||
351 | +++ hooks/start 2015-10-09 16:18:47 +0000 | |||
352 | @@ -3,7 +3,7 @@ | |||
353 | 3 | set -ex | 3 | set -ex |
354 | 4 | 4 | ||
355 | 5 | # Start is guaranteed to be called once when after the unit is installed | 5 | # Start is guaranteed to be called once when after the unit is installed |
357 | 6 | # *AND* once everytime a machine is rebooted. | 6 | # *AND* once every time a machine is rebooted. |
358 | 7 | 7 | ||
359 | 8 | if [ ! -f $CHARM_DIR/.unit-state ] | 8 | if [ ! -f $CHARM_DIR/.unit-state ] |
360 | 9 | then | 9 | then |
361 | 10 | 10 | ||
362 | === added file 'python_requirements.txt' | |||
363 | --- python_requirements.txt 1970-01-01 00:00:00 +0000 | |||
364 | +++ python_requirements.txt 2015-10-09 16:18:47 +0000 | |||
365 | @@ -0,0 +1,1 @@ | |||
366 | 1 | path.py | ||
367 | 0 | 2 | ||
368 | === modified file 'unit_tests/lib/test_registrator.py' | |||
369 | --- unit_tests/lib/test_registrator.py 2015-10-01 03:09:07 +0000 | |||
370 | +++ unit_tests/lib/test_registrator.py 2015-10-09 16:18:47 +0000 | |||
371 | @@ -1,4 +1,19 @@ | |||
372 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
373 | 2 | |||
374 | 3 | # Copyright 2015 The Kubernetes Authors All rights reserved. | ||
375 | 4 | # | ||
376 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
377 | 6 | # you may not use this file except in compliance with the License. | ||
378 | 7 | # You may obtain a copy of the License at | ||
379 | 8 | # | ||
380 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
381 | 10 | # | ||
382 | 11 | # Unless required by applicable law or agreed to in writing, software | ||
383 | 12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
384 | 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
385 | 14 | # See the License for the specific language governing permissions and | ||
386 | 15 | # limitations under the License. | ||
387 | 16 | |||
388 | 2 | import json | 17 | import json |
389 | 3 | from mock import MagicMock, patch | 18 | from mock import MagicMock, patch |
390 | 4 | from path import Path | 19 | from path import Path |
391 | 5 | 20 | ||
392 | === modified file 'unit_tests/test_hooks.py' | |||
393 | --- unit_tests/test_hooks.py 2015-07-17 20:00:22 +0000 | |||
394 | +++ unit_tests/test_hooks.py 2015-10-09 16:18:47 +0000 | |||
395 | @@ -1,5 +1,19 @@ | |||
396 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
397 | 2 | 2 | ||
398 | 3 | # Copyright 2015 The Kubernetes Authors All rights reserved. | ||
399 | 4 | # | ||
400 | 5 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
401 | 6 | # you may not use this file except in compliance with the License. | ||
402 | 7 | # You may obtain a copy of the License at | ||
403 | 8 | # | ||
404 | 9 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
405 | 10 | # | ||
406 | 11 | # Unless required by applicable law or agreed to in writing, software | ||
407 | 12 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
408 | 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
409 | 14 | # See the License for the specific language governing permissions and | ||
410 | 15 | # limitations under the License. | ||
411 | 16 | |||
412 | 3 | # import pytest | 17 | # import pytest |
413 | 4 | 18 | ||
414 | 5 | 19 |
+1 lGTM
Thanks for the hard work Matt. One minor nitpick left inline, but not a blocker.