kubeclient 4.2.0 → 4.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bc02012cb0c78fc1ec3335e836c2749973e432022083fb3b95bed3d702332a5
4
- data.tar.gz: 7b5d68aa1c1200d387a086a09f3a8ca628e892c84c590ef76180b37f60f8ca88
3
+ metadata.gz: 899369e46efd1bf4032090102865ed5cdac2a345e16ee61ac1aef5f4155edec4
4
+ data.tar.gz: 00a58a06ec28e4c61483f728df95bdf7c687aa0a3ed82814461121d74a196633
5
5
  SHA512:
6
- metadata.gz: a5c2c2d281b9ed728faf12b8a7937283225b509d6eb4ca4dc7c6245024e1677799ced3adc1a14bf111dab9092b9061af41b0b7924d54dbef5a9f72ff90d554e9
7
- data.tar.gz: 7c55c0f9c3595045ecb98b1c35d682d8aa8bb3907c3a208c33a32980890e702fca58faa927d0c82b59a69e27e5508cf1efce119ea76846c4f7b5c4bd4ee85944
6
+ metadata.gz: d8483af344834c6dd7b8040776fb1ef6a31688c5520a414eef5c47719f541c47db96402b0da6fd5a7b675e2d76d166ee90acfdc0ba36f8c6dd4c3363cf8fb216
7
+ data.tar.gz: f59b9016c41784d2bc5c6e23d294b4f6dfa00907d535bda173ac6d9b3d07ab106e6811b1a22741b7a40ff1cef3972f471cc0bdb9034846313e6b8959ac2731e3
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ 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.2.1 — 2018-12-26
8
+
9
+ ### Fixed
10
+ - For resources that contain dashes in name, there will be an attempt to resolve the method name based on singular name prefix or by replacing the dash in names with underscores (#383).
11
+
7
12
  ## 4.2.0 — 2018-12-20
8
13
 
9
14
  ### Added
@@ -16,10 +21,16 @@ Kubeclient release versioning follows [SemVer](https://semver.org/).
16
21
 
17
22
  Even in this mode, using config from untrusted sources is not recommended.
18
23
 
19
- ## 4.1.1 2018-12-17
24
+ This release included all changes up to 4.1.1, but NOT 4.1.2 which was branched off later (4.2.1 does include same fix).
25
+
26
+ ## 4.1.2 — 2018-12-26
20
27
 
21
28
  ### Fixed
29
+ - For resources that contain dashes in name, there will be an attempt to resolve the method name based on singular name prefix or by replacing the dash in names with underscores (#382).
30
+
31
+ ## 4.1.1 — 2018-12-17
22
32
 
33
+ ### Fixed
23
34
  - Fixed method names for non-suffix plurals such as y -> ies (#377).
24
35
 
25
36
  ## 4.1.0 — 2018-11-28 — REGRESSION
@@ -163,8 +163,7 @@ module Kubeclient
163
163
  method_names = [prefix_underscores + singular_suffix, # "network_policy"
164
164
  prefix_underscores + plural_suffix] # "network_policies"
165
165
  else
166
- # Something weird, can't infer underscores for plural so just give them up
167
- method_names = [singular_name, name]
166
+ method_names = resolve_unconventional_method_names(name, kind, singular_name)
168
167
  end
169
168
  end
170
169
  end
@@ -176,6 +175,17 @@ module Kubeclient
176
175
  )
177
176
  end
178
177
 
178
+ def self.resolve_unconventional_method_names(name, kind, singular_name)
179
+ underscored_name = name.tr('-', '_')
180
+ singular_underscores = ClientMixin.underscore_entity(kind)
181
+ if underscored_name.start_with?(singular_underscores)
182
+ [singular_underscores, underscored_name]
183
+ else
184
+ # fallback to lowercase, no separators for both names
185
+ [singular_name, underscored_name.tr('_', '')]
186
+ end
187
+ end
188
+
179
189
  def handle_uri(uri, path)
180
190
  raise ArgumentError, 'Missing uri' unless uri
181
191
  @api_endpoint = (uri.is_a?(URI) ? uri : URI.parse(uri))
@@ -1,4 +1,4 @@
1
1
  # Kubernetes REST-API Client
2
2
  module Kubeclient
3
- VERSION = '4.2.0'.freeze
3
+ VERSION = '4.2.1'.freeze
4
4
  end
data/test/test_common.rb CHANGED
@@ -81,6 +81,11 @@ class CommonTest < MiniTest::Test
81
81
  LatinDatum latindata latin_datum latin_data
82
82
  Noseparator noseparators noseparator noseparators
83
83
  lowercase lowercases lowercase lowercases
84
+ TestWithDash test-with-dashes test_with_dash test_with_dashes
85
+ TestUnderscore test_underscores test_underscore test_underscores
86
+ TestMismatch other-odd-name testmismatch otheroddname
87
+ MixedDashMinus mixed-dash_minuses mixed_dash_minus mixed_dash_minuses
88
+ SameUptoWordboundary sameup-toword-boundarys sameuptowordboundary sameuptowordboundarys
84
89
  ].each_slice(4) do |kind, plural, expected_single, expected_plural|
85
90
  method_names = Kubeclient::ClientMixin.parse_definition(kind, plural).method_names
86
91
  assert_equal(method_names[0], expected_single)
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.2.0
4
+ version: 4.2.1
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-12-20 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler