Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f4a93c

Browse files
committed
Merge branch 'master' of github.com:kubernetes-incubator/client-python into release-1.0
2 parents 7d558a4 + 2bd4077 commit 1f4a93c

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v1.0.0
2+
- Bugfix: blocking exec call should remove channel metadata #140
3+
- Add close method to websocket api of interactive exec #145
4+
15
# v1.0.0b3
26
- Bugfix: Missing websocket-client dependency #131
37

devel/release.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ should be on the same branch. To update an existing branch:
1616

1717
```bash
1818
export RELEASE_BRANCH=release-x.x
19-
git checkout RELEASE_BRANCH
19+
git checkout $RELEASE_BRANCH
2020
git fetch upstream
21+
git rebase upstream/$RELEASE_BRANCH
2122
git pull upstream master
2223
```
2324

@@ -64,7 +65,7 @@ and commit changes (should be only version number changes) to the release branch
6465
Name the commit something like "Update version constants for XXX release".
6566

6667
```bash
67-
git push upstream RELEASE_BRANCH
68+
git push upstream $RELEASE_BRANCH
6869
```
6970

7071
## Make distribution packages

examples/exec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@
9292
resp.write_stdin("whoami\n")
9393
user = resp.readline_stdout(timeout=3)
9494
print("Server user is: %s" % user)
95+
resp.close()

kubernetes/client/ws_client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,13 @@ def update(self, timeout=0):
168168
data = frame.data
169169
if six.PY3:
170170
data = data.decode("utf-8")
171-
self._all += data
172171
if len(data) > 1:
173172
channel = ord(data[0])
174173
data = data[1:]
175174
if data:
175+
# keeping all messages in the order they received for
176+
# non-blocking call.
177+
self._all += data
176178
if channel not in self._channels:
177179
self._channels[channel] = data
178180
else:
@@ -189,6 +191,14 @@ def run_forever(self, timeout=None):
189191
while self.is_open():
190192
self.update(timeout=None)
191193

194+
def close(self, **kwargs):
195+
"""
196+
close websocket connection.
197+
"""
198+
self._connected = False
199+
if self.sock:
200+
self.sock.close(**kwargs)
201+
192202

193203
WSResponse = collections.namedtuple('WSResponse', ['data'])
194204

0 commit comments

Comments
 (0)