dapp 0.27.17 → 0.27.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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: 8440680da7a98e32cd8dbf3bb3bf4e522d596482
|
4
|
+
data.tar.gz: 5ed9d3a156f03910d19b5b10f1ced387ad5fea4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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.27.
|
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-
|
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
|