dex_sync 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/exe/dex_sync +1 -1
- data/lib/dex_sync.rb +19 -15
- data/lib/dex_sync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c312a2780882517deff930cdda229c0d7875c04c
|
4
|
+
data.tar.gz: 48cd2f694bd4e65ae3c2b2f423726303ca55d745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2433bab29e109e677264735240a3db7d104334070bc4e42b23b22e95b4831a58255415f8a783420cfd1e23c010a676905b7387df40a9ff7f5a1eb70ba39ec787
|
7
|
+
data.tar.gz: 0f32c5475ddfabae50a71eaf21bc4edad46470e024b0513de277562ca5ad6d014dbc2bda6b6021a94cf6d492bc80b7192ba9ab4203f672492c22322a4a8714cf
|
data/Gemfile.lock
CHANGED
data/exe/dex_sync
CHANGED
data/lib/dex_sync.rb
CHANGED
@@ -8,31 +8,35 @@ require 'yaml'
|
|
8
8
|
module DexSync
|
9
9
|
class Config
|
10
10
|
def initialize
|
11
|
-
@
|
11
|
+
@config = YAML.safe_load(File.read(File.expand_path('~/dex_sync.yaml')))
|
12
12
|
end
|
13
13
|
|
14
14
|
def dex
|
15
|
-
@
|
15
|
+
@config.fetch('DEX')
|
16
16
|
end
|
17
17
|
|
18
|
-
def
|
19
|
-
@
|
18
|
+
def domain
|
19
|
+
@config.fetch('DOMAIN', 'github.com')
|
20
20
|
end
|
21
21
|
|
22
22
|
def namespaces
|
23
|
-
@
|
23
|
+
@config.fetch('NAMESPACES')
|
24
|
+
end
|
25
|
+
|
26
|
+
def download_path
|
27
|
+
@config.fetch('DOWNLOAD_PATH', '~/.kubeconfigs')
|
24
28
|
end
|
25
29
|
|
26
30
|
def clusters
|
27
|
-
@
|
31
|
+
@config.fetch('CLUSTERS')
|
28
32
|
end
|
29
33
|
|
30
34
|
def user_session
|
31
|
-
@
|
35
|
+
@config.fetch('USER_SESSION')
|
32
36
|
end
|
33
37
|
|
34
38
|
def gh_session
|
35
|
-
@
|
39
|
+
@config.fetch('GH_SESSION')
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
@@ -66,11 +70,11 @@ module DexSync
|
|
66
70
|
|
67
71
|
response = connection.post('download', download_params)
|
68
72
|
|
69
|
-
|
73
|
+
downloaded_config = YAML.safe_load(response.body)
|
74
|
+
|
75
|
+
expanded_path = File.expand_path(@config.download_path + "/#{cluster}-#{namespace}-internal")
|
70
76
|
|
71
|
-
File.open(
|
72
|
-
f.write(config.to_yaml)
|
73
|
-
end
|
77
|
+
File.open(expanded_path, 'w') { |f| f.write(downloaded_config.to_yaml) }
|
74
78
|
end
|
75
79
|
end
|
76
80
|
end
|
@@ -98,7 +102,7 @@ module DexSync
|
|
98
102
|
HTTP::Cookie.new(
|
99
103
|
name: 'user_session',
|
100
104
|
value: @config.user_session,
|
101
|
-
domain: @config.
|
105
|
+
domain: @config.domain,
|
102
106
|
path: '/'
|
103
107
|
)
|
104
108
|
end
|
@@ -107,9 +111,9 @@ module DexSync
|
|
107
111
|
HTTP::Cookie.new(
|
108
112
|
name: '_gh_sess',
|
109
113
|
value: @config.gh_session,
|
110
|
-
domain: @config.
|
114
|
+
domain: @config.domain,
|
111
115
|
path: '/'
|
112
116
|
)
|
113
117
|
end
|
114
118
|
end
|
115
|
-
end
|
119
|
+
end
|
data/lib/dex_sync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dex_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Hsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|