kuby-azure 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24d0848e7922b6abc19d27f7dd4abc0e8807419c93c7b7386681afcd94a5fa41
4
- data.tar.gz: 934d00e201a8879f5fe571df77334b08e65a5e601bf7358689104826a41745ea
3
+ metadata.gz: 4027520ee2e9376cadfea437510c241d52302865a36d03892cc7f62bdd7f144d
4
+ data.tar.gz: 27c981836c7941d690d7180173398931ff8eef430f76b6e80d98b26553dee416
5
5
  SHA512:
6
- metadata.gz: d8653b583236e129babd47d864f2a6fd07daea2b039e728b79e703e0a28dca3da5adf31440a8b070df43630693d8b0ddc27a75df9299a376ed924bc69564afb9
7
- data.tar.gz: b9f2f49764db5bc4125bf44afba3230e368235960c4b82403fb482a79b2e36ee9e50b74b9d6ec471b9d2d29869f9601b3069aa99b1b180c388282932d2aa54b9
6
+ metadata.gz: 109405ffc24f9a2907c12e52bd79bba0f0d187ae40ac3bb86a9b6453198afbf1d49f1c87b7ab313822b1543b4fe63c8ec249864c48b30a79bd14a5199288c570
7
+ data.tar.gz: adc4a21adca8cbd0472da690ae9213198d6cdabf0eb48a85ceff6faeb4738892703a564e05bb88a3b4533fd7046df70f67bf304b46e0fcb05e87e47a4fce4a6c
@@ -1,3 +1,6 @@
1
+ ## 0.3.1
2
+ * Add a unique hash of the configuration options to the kubeconfig path (#1, @pandwoter)
3
+
1
4
  ## 0.3.0
2
5
  * Accept `environment` instead of `definition` instances.
3
6
 
data/README.md CHANGED
@@ -13,30 +13,32 @@ All providers adhere to a specific interface, meaning you can swap out one provi
13
13
  Enable the Azure provider like so:
14
14
 
15
15
  ```ruby
16
- Kuby.define(:production) do
17
- kubernetes do
16
+ Kuby.define('MyApp') do
17
+ environment(:production) do
18
+ kubernetes do
18
19
 
19
- provider :azure do
20
- # Visible in the subscription overview.
21
- subscription_id 'my-subscription-id'
20
+ provider :azure do
21
+ # Visible in the subscription overview.
22
+ subscription_id 'my-subscription-id'
22
23
 
23
- # Visible in Azure Active Directory.
24
- tenant_id 'my-tenant-id'
24
+ # Visible in Azure Active Directory.
25
+ tenant_id 'my-tenant-id'
25
26
 
26
- # These must be configured in Azure Active Directory -> App
27
- # Registrations. It's easiest to generate a client id and
28
- # secret for the service principal.
29
- client_id 'my-client-id'
30
- client_secret 'my-client-secret'
27
+ # These must be configured in Azure Active Directory -> App
28
+ # Registrations. It's easiest to generate a client id and
29
+ # secret for the service principal.
30
+ client_id 'my-client-id'
31
+ client_secret 'my-client-secret'
31
32
 
32
- # Your cluster should have been created inside a resource group.
33
- # Put its name here.
34
- resource_group_name 'my-resource-group-name'
33
+ # Your cluster should have been created inside a resource group.
34
+ # Put its name here.
35
+ resource_group_name 'my-resource-group-name'
35
36
 
36
- # The name of your cluster.
37
- resource_name 'my-resource-name'
38
- end
37
+ # The name of your cluster.
38
+ resource_name 'my-resource-name'
39
+ end
39
40
 
41
+ end
40
42
  end
41
43
  end
42
44
  ```
@@ -1,4 +1,5 @@
1
1
  require 'kube-dsl'
2
+ require 'digest'
2
3
 
3
4
  module Kuby
4
5
  module Azure
@@ -7,6 +8,15 @@ module Kuby
7
8
 
8
9
  value_fields :tenant_id, :client_id, :client_secret, :subscription_id
9
10
  value_fields :resource_group_name, :resource_name
11
+
12
+ def hash_value
13
+ parts = [
14
+ tenant_id, client_id, client_secret, subscription_id,
15
+ resource_group_name, resource_name
16
+ ]
17
+
18
+ Digest::SHA256.hexdigest(parts.join(':'))
19
+ end
10
20
  end
11
21
  end
12
22
  end
@@ -1,6 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'azure_mgmt_container_service'
3
3
  require 'tmpdir'
4
+ require 'digest'
4
5
 
5
6
  module Kuby
6
7
  module Azure
@@ -14,8 +15,9 @@ module Kuby
14
15
  end
15
16
 
16
17
  def kubeconfig_path
17
- @kubeconfig_path ||= File.join(
18
- kubeconfig_dir, "#{environment.app_name.downcase}-kubeconfig.yaml"
18
+ File.join(
19
+ kubeconfig_dir,
20
+ "#{environment.app_name.downcase}-#{config.hash_value}-kubeconfig.yaml"
19
21
  )
20
22
  end
21
23
 
@@ -1,5 +1,5 @@
1
1
  module Kuby
2
2
  module Azure
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.3.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuby-azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-30 00:00:00.000000000 Z
11
+ date: 2020-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kube-dsl