kubeclient 3.1.2 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kubeclient might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +12 -7
- data/RELEASING.md +64 -0
- data/kubeclient.gemspec +2 -2
- data/lib/kubeclient/common.rb +1 -6
- data/lib/kubeclient/version.rb +1 -1
- data/test/test_kubeclient.rb +6 -6
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c23c8b10cd66debded65c26047c58bb1bfabe98
|
4
|
+
data.tar.gz: 109df25bd52f01568ec2777025cdda0a236c4027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3ccdb84c4ffc1c8e5dc236b5edb824150e121d82099db5041ae29c198254312c8fca844537c31efee079fe2b27a7463c30387fe3b020edbecdaf62b3487ce38
|
7
|
+
data.tar.gz: 220030de1ca7be78050b718dd3bbd561ebe9eb2f4e9c55f78fad54ef46f508fd0370becbb65ec57e1ceb512ffb60027257c175985060a67dbd05d6d17bb2ba6c
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,18 @@ Notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
|
5
5
|
Kubeclient release versioning follows [SemVer](https://semver.org/).
|
6
6
|
|
7
|
+
## 4.0.0 — 2018-07-23
|
8
|
+
|
9
|
+
### Removed
|
10
|
+
- Bumped officially supported kubernetes versions to >= 1.3.
|
11
|
+
- Specifically `proxy_url` no longer works for <= 1.2 (#323).
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- `proxy_url` now works for kubernetes 1.10 and later (#323).
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- Switched `http` gem dependency from 2.y to 3.y (#321).
|
18
|
+
|
7
19
|
## 3.1.2 — 2018-06-11
|
8
20
|
|
9
21
|
### Fixed
|
data/README.md
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/kubeclient.svg)](http://badge.fury.io/rb/kubeclient)
|
4
4
|
[![Build Status](https://travis-ci.org/abonas/kubeclient.svg?branch=master)](https://travis-ci.org/abonas/kubeclient)
|
5
5
|
[![Code Climate](http://img.shields.io/codeclimate/github/abonas/kubeclient.svg)](https://codeclimate.com/github/abonas/kubeclient)
|
6
|
-
[![Dependency Status](https://gemnasium.com/abonas/kubeclient.svg)](https://gemnasium.com/abonas/kubeclient)
|
7
6
|
|
8
7
|
A Ruby client for Kubernetes REST api.
|
9
8
|
The client supports GET, POST, PUT, DELETE on all the entities available in kubernetes in both the core and group apis.
|
@@ -170,10 +169,10 @@ You can find information about tokens in [this guide](https://kubernetes.io/docs
|
|
170
169
|
#### Google's Application Default Credentials
|
171
170
|
|
172
171
|
On Google Compute Engine, Google App Engine, or Google Cloud Functions, as well as `gcloud`-configured systems
|
173
|
-
with [application default credentials](https://developers.google.com/identity/protocols/application-default-credentials),
|
172
|
+
with [application default credentials](https://developers.google.com/identity/protocols/application-default-credentials),
|
174
173
|
you can use the token provider to authorize `kubeclient`.
|
175
174
|
|
176
|
-
This requires the [`googleauth` gem](https://github.com/google/google-auth-library-ruby) that is _not_ included in
|
175
|
+
This requires the [`googleauth` gem](https://github.com/google/google-auth-library-ruby) that is _not_ included in
|
177
176
|
`kubeclient` dependencies so you should add it to your bundle.
|
178
177
|
|
179
178
|
```ruby
|
@@ -187,7 +186,7 @@ client = Kubeclient::Client.new(
|
|
187
186
|
)
|
188
187
|
```
|
189
188
|
|
190
|
-
Note that this token is good for one hour. If your code runs for longer than that, you should plan to
|
189
|
+
Note that this token is good for one hour. If your code runs for longer than that, you should plan to
|
191
190
|
acquire a new one.
|
192
191
|
|
193
192
|
### Non-blocking IO
|
@@ -315,7 +314,9 @@ puts config.context.namespace
|
|
315
314
|
|
316
315
|
### Supported kubernetes versions
|
317
316
|
|
318
|
-
|
317
|
+
We try to support the last 3 minor versions, matching the [official support policy for Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/release/versioning.md#supported-releases-and-component-skew).
|
318
|
+
Kubernetes 1.2 and below have known issues and are unsupported.
|
319
|
+
Kubernetes 1.3 presumed to still work although nobody is really testing on such old versions...
|
319
320
|
|
320
321
|
## Examples:
|
321
322
|
|
@@ -377,8 +378,8 @@ node = client.get_node "127.0.0.1", as: :raw
|
|
377
378
|
```
|
378
379
|
|
379
380
|
Other formats are:
|
380
|
-
- `:ros` (default) for `RecursiveOpenStruct`
|
381
|
-
- `:parsed` for `JSON.parse`
|
381
|
+
- `:ros` (default) for `RecursiveOpenStruct`
|
382
|
+
- `:parsed` for `JSON.parse`
|
382
383
|
- `:parsed_symbolized` for `JSON.parse(..., symbolize_names: true)`
|
383
384
|
|
384
385
|
#### Delete an entity (by name)
|
@@ -567,6 +568,10 @@ client.process_template template
|
|
567
568
|
Kubeclient release versioning follows [SemVer](https://semver.org/).
|
568
569
|
See [CHANGELOG.md](CHANGELOG.md) for full changelog.
|
569
570
|
|
571
|
+
#### past version 4.0
|
572
|
+
|
573
|
+
Old kubernetes versions < 1.3 no longer supported.
|
574
|
+
|
570
575
|
#### past version 3.0
|
571
576
|
|
572
577
|
Ruby versions < 2.2 are no longer supported
|
data/RELEASING.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# Releasing Kubeclient
|
2
|
+
|
3
|
+
## Versioning
|
4
|
+
Kubeclient release versioning follows [SemVer](https://semver.org/).
|
5
|
+
At some point in time it is decided to release version x.y.z.
|
6
|
+
Prerequisite: A [changelog](CHANGELOG.md) is generated & merged into the release branch.
|
7
|
+
|
8
|
+
```bash
|
9
|
+
RUBYGEMS_USERNAME=bob
|
10
|
+
RELEASE_BRANCH="master"
|
11
|
+
RELEASE_VERSION="x.y.z"
|
12
|
+
GIT_REMOTE="origin"
|
13
|
+
GIT_UPSTREAM="upstream"
|
14
|
+
|
15
|
+
#
|
16
|
+
# Install the release gem
|
17
|
+
#At this point Open & merge a PR in github.
|
18
|
+
gem install gem-release
|
19
|
+
|
20
|
+
#
|
21
|
+
# Checking out the release branch
|
22
|
+
#
|
23
|
+
git fetch $GIT_UPSTREAM
|
24
|
+
git checkout $GIT_UPSTREAM/$RELEASE_BRANCH -b $RELEASE_BRANCH
|
25
|
+
git status # Make sure there are no local changes
|
26
|
+
|
27
|
+
#
|
28
|
+
# Preparing to release
|
29
|
+
#
|
30
|
+
bundle install
|
31
|
+
bundle exec rake test rubocop
|
32
|
+
|
33
|
+
#
|
34
|
+
# Grabbing an authentication token for rubygems.org api
|
35
|
+
#
|
36
|
+
curl -u $RUBYGEMS_USERNAME https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
|
37
|
+
|
38
|
+
cat ~/.gem/credentials
|
39
|
+
---
|
40
|
+
:rubygems_api_key: ****
|
41
|
+
|
42
|
+
#
|
43
|
+
# Bumping the gem's version can be done manually, or by using
|
44
|
+
#
|
45
|
+
gem bump --version $RELEASE_VERSION
|
46
|
+
git show # View version bump change.
|
47
|
+
|
48
|
+
git push $GIT_REMOTE $RELEASE_BRANCH
|
49
|
+
|
50
|
+
#
|
51
|
+
# At this point Open & merge a PR in github.
|
52
|
+
#
|
53
|
+
|
54
|
+
git pull --ff-only $GIT_UPSTREAM
|
55
|
+
|
56
|
+
#
|
57
|
+
# In github, generate a new release and make sure you have the tag locally.
|
58
|
+
#
|
59
|
+
|
60
|
+
#
|
61
|
+
# Release the gem
|
62
|
+
#
|
63
|
+
gem release
|
64
|
+
```
|
data/kubeclient.gemspec
CHANGED
@@ -24,12 +24,12 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'rake', '~> 12.0'
|
25
25
|
spec.add_development_dependency 'minitest'
|
26
26
|
spec.add_development_dependency 'minitest-rg'
|
27
|
-
spec.add_development_dependency 'webmock', '~> 3.0
|
27
|
+
spec.add_development_dependency 'webmock', '~> 3.0'
|
28
28
|
spec.add_development_dependency 'vcr'
|
29
29
|
spec.add_development_dependency 'rubocop', '= 0.49.1'
|
30
30
|
spec.add_development_dependency 'googleauth', '~> 0.5.1'
|
31
31
|
|
32
32
|
spec.add_dependency 'rest-client', '~> 2.0'
|
33
33
|
spec.add_dependency 'recursive-open-struct', '~> 1.0', '>= 1.0.4'
|
34
|
-
spec.add_dependency 'http', '~>
|
34
|
+
spec.add_dependency 'http', '~> 3.0'
|
35
35
|
end
|
data/lib/kubeclient/common.rb
CHANGED
@@ -401,12 +401,7 @@ module Kubeclient
|
|
401
401
|
@entities[kind.to_s].resource_name
|
402
402
|
end
|
403
403
|
ns_prefix = build_namespace_prefix(namespace)
|
404
|
-
#
|
405
|
-
if entity_name_plural == 'pods'
|
406
|
-
rest_client["#{ns_prefix}#{entity_name_plural}/#{name}:#{port}/proxy"].url
|
407
|
-
else
|
408
|
-
rest_client["proxy/#{ns_prefix}#{entity_name_plural}/#{name}:#{port}"].url
|
409
|
-
end
|
404
|
+
rest_client["#{ns_prefix}#{entity_name_plural}/#{name}:#{port}/proxy"].url
|
410
405
|
end
|
411
406
|
|
412
407
|
def process_template(template)
|
data/lib/kubeclient/version.rb
CHANGED
data/test/test_kubeclient.rb
CHANGED
@@ -710,12 +710,12 @@ class KubeclientTest < MiniTest::Test
|
|
710
710
|
|
711
711
|
client = Kubeclient::Client.new('http://host:8080', 'v1')
|
712
712
|
assert_equal(
|
713
|
-
'http://host:8080/api/v1/
|
713
|
+
'http://host:8080/api/v1/namespaces/ns/services/srvname:srvportname/proxy',
|
714
714
|
client.proxy_url('service', 'srvname', 'srvportname', 'ns')
|
715
715
|
)
|
716
716
|
|
717
717
|
assert_equal(
|
718
|
-
'http://host:8080/api/v1/
|
718
|
+
'http://host:8080/api/v1/namespaces/ns/services/srvname:srvportname/proxy',
|
719
719
|
client.proxy_url('services', 'srvname', 'srvportname', 'ns')
|
720
720
|
)
|
721
721
|
|
@@ -731,23 +731,23 @@ class KubeclientTest < MiniTest::Test
|
|
731
731
|
|
732
732
|
# Check no namespace provided
|
733
733
|
assert_equal(
|
734
|
-
'http://host:8080/api/v1/
|
734
|
+
'http://host:8080/api/v1/nodes/srvname:srvportname/proxy',
|
735
735
|
client.proxy_url('nodes', 'srvname', 'srvportname')
|
736
736
|
)
|
737
737
|
|
738
738
|
assert_equal(
|
739
|
-
'http://host:8080/api/v1/
|
739
|
+
'http://host:8080/api/v1/nodes/srvname:srvportname/proxy',
|
740
740
|
client.proxy_url('node', 'srvname', 'srvportname')
|
741
741
|
)
|
742
742
|
|
743
743
|
# Check integer port
|
744
744
|
assert_equal(
|
745
|
-
'http://host:8080/api/v1/
|
745
|
+
'http://host:8080/api/v1/nodes/srvname:5001/proxy',
|
746
746
|
client.proxy_url('nodes', 'srvname', 5001)
|
747
747
|
)
|
748
748
|
|
749
749
|
assert_equal(
|
750
|
-
'http://host:8080/api/v1/
|
750
|
+
'http://host:8080/api/v1/nodes/srvname:5001/proxy',
|
751
751
|
client.proxy_url('node', 'srvname', 5001)
|
752
752
|
)
|
753
753
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubeclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alissa Bonas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.0
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.0
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: vcr
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,14 +162,14 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
165
|
+
version: '3.0'
|
166
166
|
type: :runtime
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
172
|
+
version: '3.0'
|
173
173
|
description: A client for Kubernetes REST api
|
174
174
|
email:
|
175
175
|
- abonas@redhat.com
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- Gemfile
|
185
185
|
- LICENSE.txt
|
186
186
|
- README.md
|
187
|
+
- RELEASING.md
|
187
188
|
- Rakefile
|
188
189
|
- kubeclient.gemspec
|
189
190
|
- lib/kubeclient.rb
|