kubeclient 4.1.1 → 4.1.2

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: 6ac264e165704f976eae8ecab0b3106b021af071e38d7385fc88d5f12751d337
4
- data.tar.gz: 963542f98fd9dbdba4dcf5ada66e1308250ee4521bb81851bb2b02d5621d9822
3
+ metadata.gz: '036441648e04f1ead9f4c15517c8f8ae31ecf521a77e08601fcfc4d298bbaa28'
4
+ data.tar.gz: 6ee8cd72c57fb7a10334d7ceebd7f51a7f38e1eced12a40b12d50c7180e56945
5
5
  SHA512:
6
- metadata.gz: 949fc44fb2c395ecd6fda5435953f74ae443968ca3d33b3dafdaa7724d5019d870cbcccc7e70c436a79a029e470ec5e383fd92926311c21eb074c71194c2c393
7
- data.tar.gz: a1ec16df3211a8c10496462010c9900cf3f93c11b1acaa85de5dafcbb15e5ad4ace9c531dc40c1c3b104f5371eddca7c6c3d5298887097f66879a283e6d28f59
6
+ metadata.gz: 97f3c94d05d1cc79d889c1f851a52b82162a8093ada781444f1e10209d7a3896081fdf423807598c3bae95ce107234005a149b08bf71cf7f3248398631a3dad7
7
+ data.tar.gz: 9924a65f531452cccd20c1fe03457acfb9ec779af055513e2dc3532849dd089613011ed3bea005f2e1a5d80243b168940620dca0a21c8842f2be4e4112ebac7f
@@ -4,10 +4,14 @@ 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.1.1 — 2018-12-17
7
+ ## 4.1.2 — 2018-12-26
8
8
 
9
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 (#382).
11
+
12
+ ## 4.1.1 — 2018-12-17
10
13
 
14
+ ### Fixed
11
15
  - Fixed method names for non-suffix plurals such as y -> ies (#377).
12
16
 
13
17
  ## 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.1.1'.freeze
3
+ VERSION = '4.1.2'.freeze
4
4
  end
@@ -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.1.1
4
+ version: 4.1.2
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-17 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