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 +4 -4
- data/lib/dapp/dimg/dimg/git_artifact.rb +5 -1
- data/lib/dapp/kube/kubernetes/config.rb +50 -0
- data/lib/dapp/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14dc6c5ac7750cce04f4e71175ff0e677c7a51e3
|
4
|
+
data.tar.gz: 8be80c04317eb1281eab6fe2fea2a9da42bb5beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
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.
|
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-
|
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
|