dapp 0.28.3 → 0.28.4

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: 133cb8650b8a32dbcab30858828f2fec61ba2f66
4
- data.tar.gz: 394e02a4ee6ee245db65906f8bbab0aedbf9a564
3
+ metadata.gz: 14dc6c5ac7750cce04f4e71175ff0e677c7a51e3
4
+ data.tar.gz: 8be80c04317eb1281eab6fe2fea2a9da42bb5beb
5
5
  SHA512:
6
- metadata.gz: 804e5320128d9c7d2fe2879e0757947f5e215e0007aeef7ae88331f5a2cb34b006127a6d5aa4760c6c721d674015816d09054384a76bdaefefe316209cebd810
7
- data.tar.gz: a8c6d208f8fbc8312dd3f0c6f129b33f39329091870ac77825fdf0409f33221c6d6670f0776e58c82e6d2faadbfee844b1fef4f121fc06285062ef8ff447668e
6
+ metadata.gz: 53dd45f084ff2c308cb78958bbd6799a86a2425645117efe1c7a2f8735da70ef8be3ac1767dfb6670f1272729967f8a00803ca99d6d8293f01677304fc1720a1
7
+ data.tar.gz: 6127532222b67d34860397ad99041e16fde66d8f290e98e10cf074a49808f2c5afc62b7a217918820be26c2ba4dfdb7c6b7a2eb7ae78adc0416593d0e095bacb
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Dapp
2
- VERSION = "0.28.3"
2
+ VERSION = "0.28.4"
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.28.3
4
+ version: 0.28.4
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
@@ -744,6 +744,7 @@ files:
744
744
  - lib/dapp/kube/kubernetes/client/resource/job.rb
745
745
  - lib/dapp/kube/kubernetes/client/resource/pod.rb
746
746
  - lib/dapp/kube/kubernetes/client/resource/replicaset.rb
747
+ - lib/dapp/kube/kubernetes/config.rb
747
748
  - lib/dapp/kube/kubernetes/error.rb
748
749
  - lib/dapp/kube/kubernetes/manager/base.rb
749
750
  - lib/dapp/kube/kubernetes/manager/container.rb