k8s-client 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/k8s/client.rb +1 -0
- data/lib/k8s/client/version.rb +1 -1
- data/lib/k8s/transport.rb +8 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe5285594d28e6f112fe34e988cbd981c1cba982
|
4
|
+
data.tar.gz: 62512ffc4b9619d55a1b944bfd2c7d22ef5ba9a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02e79f42d225490c54aeb855f526cd3ddbcb71a5e266c1438734ae7839fc2716a7eadf0f44b556279a69d38acb9fe6037a98f5b7bbf16ba165a50467afa21e5b
|
7
|
+
data.tar.gz: 534208a895291ebac3d6f831db8513c85f52a73396689be0e254568913cc6bfa527e212b198ae52109e444873469b2a5dfc24298ce9ed528b3d3e5e434e1045a
|
data/lib/k8s/client.rb
CHANGED
data/lib/k8s/client/version.rb
CHANGED
data/lib/k8s/transport.rb
CHANGED
@@ -142,15 +142,17 @@ module K8s
|
|
142
142
|
)
|
143
143
|
end
|
144
144
|
|
145
|
-
attr_reader :server, :options
|
145
|
+
attr_reader :server, :options, :path_prefix
|
146
146
|
|
147
|
-
# @param server [String] URL with protocol://host:port
|
147
|
+
# @param server [String] URL with protocol://host:port (paths are preserved as well)
|
148
148
|
# @param auth_token [String] optional Authorization: Bearer token
|
149
149
|
# @param auth_username [String] optional Basic authentication username
|
150
150
|
# @param auth_password [String] optional Basic authentication password
|
151
151
|
# @param options [Hash] @see Excon.new
|
152
152
|
def initialize(server, auth_token: nil, auth_username: nil, auth_password: nil, **options)
|
153
|
-
|
153
|
+
uri = URI.parse(server)
|
154
|
+
@server = "#{uri.scheme}://#{uri.host}:#{uri.port}"
|
155
|
+
@path_prefix = File.join('/', uri.path, '/') # add leading and/or trailing slashes
|
154
156
|
@auth_token = auth_token
|
155
157
|
@auth_username = auth_username
|
156
158
|
@auth_password = auth_password
|
@@ -175,10 +177,10 @@ module K8s
|
|
175
177
|
)
|
176
178
|
end
|
177
179
|
|
178
|
-
# @param
|
180
|
+
# @param parts [Array<String>] join path parts together to build the full URL
|
179
181
|
# @return [String]
|
180
|
-
def path(*
|
181
|
-
File.join(
|
182
|
+
def path(*parts)
|
183
|
+
File.join(path_prefix, *parts)
|
182
184
|
end
|
183
185
|
|
184
186
|
# @param request_object [Object] include request body using to_json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: k8s-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kontena, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|