dapp 0.27.17 → 0.27.18

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
  SHA1:
3
- metadata.gz: e63b81994211f6a51dd719fe2a684386cc2c7a59
4
- data.tar.gz: b95c44e0143dbe47a61ea70ae56f664020391953
3
+ metadata.gz: 8440680da7a98e32cd8dbf3bb3bf4e522d596482
4
+ data.tar.gz: 5ed9d3a156f03910d19b5b10f1ced387ad5fea4e
5
5
  SHA512:
6
- metadata.gz: 199a0259aa6457d09950b4ba708a70ca5f185c90deab4a25d326bbe0d05b58a7ae6744859c86a6d473efc3fe1b00dc324ecf3f825006aa0fbea906961cd0db45
7
- data.tar.gz: 8b1bafc0a0cc79f2e1ba1d569cf92dea200c29719af87d4e67c62bbfcd1da807be955c44cbd6509e2bd0d9a69c7006639ab9228a641c94c9d6e62caacd6c918d
6
+ metadata.gz: 5340c8801ad7e9505788f9f245e6d3893f9e1515b1216cac1f9268ccd425a9c728d64e555cb54aa46fb921b36865212395dc45c4586f8fd40249c046ad88f9a8
7
+ data.tar.gz: 3ee188865fec1d6d23e5a7f099dbde2369caf2a8a8ade6d6271c87ce5df560d384acb2a11acbe465c2eaac1d8b8ba4dcada18638e9b6bc7f73e01c0f7cd1c6fb
@@ -31,7 +31,11 @@ module Dapp
31
31
  def generate_git_artifacts(repo, **git_artifact_options)
32
32
  [].tap do |artifacts|
33
33
  artifacts << (artifact = ::Dapp::Dimg::GitArtifact.new(repo, self, **git_artifact_options))
34
- artifacts.concat(generate_git_embedded_artifacts(artifact))
34
+ if ENV['DAPP_DISABLE_GIT_SUBMODULES']
35
+ artifacts
36
+ else
37
+ artifacts.concat(generate_git_embedded_artifacts(artifact))
38
+ end
35
39
  end.select do |artifact|
36
40
  !artifact.empty?
37
41
  end
@@ -0,0 +1,50 @@
1
+ module Dapp
2
+ module Kube
3
+ module Kubernetes
4
+ class Config
5
+ extend Helper::YAML
6
+
7
+ class << self
8
+ def new_from_kubeconfig(path)
9
+ self.new yaml_load_file(path)
10
+ end
11
+
12
+ def new_from_kubectl
13
+ # TODO
14
+ end
15
+ end # << self
16
+
17
+ attr_reader :config_hash
18
+
19
+ def initialize(config_hash)
20
+ @config_hash = config_hash
21
+ end
22
+
23
+ def current_context_name
24
+ config_hash['current-context'] || begin
25
+ if (context = kube_config.fetch('contexts', []).first)
26
+ warn "[WARN] .kube/config current-context is not set, using context '#{context['name']}'"
27
+ context['name']
28
+ end
29
+ end
30
+ end
31
+
32
+ def context_config(context_name)
33
+ config_hash.fetch('contexts', []).find {|context| context['name'] == context_name}
34
+ end
35
+
36
+ def user_config(user_name)
37
+ config_hash.fetch('users', []).find {|user| user['name'] == user_name}
38
+ end
39
+
40
+ def cluster_config(cluster_name)
41
+ config_hash.fetch('clusters', []).find {|cluster| cluster['name'] == cluster_name}
42
+ end
43
+
44
+ def context_namespace(context_config)
45
+ context_config['context']['namespace']
46
+ end
47
+ end # Kubeconfig
48
+ end # Kubernetes
49
+ end # Kube
50
+ end # Dapp
data/lib/dapp/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.27.17"
2
+ VERSION = "0.27.18"
3
3
  BUILD_CACHE_VERSION = 28
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.17
4
+ version: 0.27.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Stolyarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -743,6 +743,7 @@ files:
743
743
  - lib/dapp/kube/kubernetes/client/resource/job.rb
744
744
  - lib/dapp/kube/kubernetes/client/resource/pod.rb
745
745
  - lib/dapp/kube/kubernetes/client/resource/replicaset.rb
746
+ - lib/dapp/kube/kubernetes/config.rb
746
747
  - lib/dapp/kube/kubernetes/error.rb
747
748
  - lib/dapp/kube/kubernetes/manager/base.rb
748
749
  - lib/dapp/kube/kubernetes/manager/container.rb