vagrant-lxd 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +56 -53
- data/README.md +2 -2
- data/lib/vagrant-lxd/capability.rb +21 -2
- data/lib/vagrant-lxd/driver.rb +21 -3
- data/lib/vagrant-lxd/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be2300b7aa0ba5ccc8ae1d3ed7af2bbc0da4a1ded7aefe64e9896d26a672d905
|
4
|
+
data.tar.gz: c7e73c349e90e91f180e76f1a550d35852b0aa720a406361ef9f94e692eaa68a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bff61ace1311df547b7b0aa6ccb3917ec950353ac7a164e78971cf2297881e007d559fb86798913d8ae1c91b0c4d9b7d5a2e565d5fd00689ff04f9a64b71dbb
|
7
|
+
data.tar.gz: cb70de69a9de248887c1b3b116fb807f324783ce1adde52f411dc83a1f7245a3da08b687c14385ee34183a144823eec469f7a0968baafdc6455af2e3ccfd154b
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,34 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/mitchellh/vagrant.git
|
3
|
-
revision:
|
3
|
+
revision: 7df0e62aded9316485e83fd5548bebbacf702ec7
|
4
4
|
specs:
|
5
|
-
vagrant (2.2.
|
5
|
+
vagrant (2.2.10.dev)
|
6
6
|
bcrypt_pbkdf (~> 1.0.0)
|
7
|
-
childprocess (~> 0.
|
7
|
+
childprocess (~> 3.0.0)
|
8
8
|
ed25519 (~> 1.2.4)
|
9
9
|
erubis (~> 2.7.0)
|
10
10
|
hashicorp-checkpoint (~> 0.1.5)
|
11
|
-
i18n (~> 1.
|
11
|
+
i18n (~> 1.8)
|
12
12
|
listen (~> 3.1.5)
|
13
13
|
log4r (~> 1.1.9, < 1.1.11)
|
14
|
+
mime (~> 0.4.4)
|
14
15
|
net-scp (~> 1.2.0)
|
15
16
|
net-sftp (~> 2.1)
|
16
|
-
net-ssh (~> 5.
|
17
|
+
net-ssh (~> 5.2.0)
|
17
18
|
rb-kqueue (~> 0.2.0)
|
18
19
|
rest-client (>= 1.6.0, < 3.0)
|
19
20
|
ruby_dep (<= 1.3.1)
|
20
|
-
rubyzip (~>
|
21
|
-
vagrant_cloud (~> 2.0.
|
21
|
+
rubyzip (~> 2.0)
|
22
|
+
vagrant_cloud (~> 2.0.3)
|
22
23
|
wdm (~> 0.1.0)
|
23
|
-
winrm (
|
24
|
-
winrm-elevated (
|
25
|
-
winrm-fs (
|
24
|
+
winrm (>= 2.3.4, < 3.0)
|
25
|
+
winrm-elevated (>= 1.2.1, < 2.0)
|
26
|
+
winrm-fs (>= 1.3.4, < 2.0)
|
26
27
|
|
27
28
|
PATH
|
28
29
|
remote: .
|
29
30
|
specs:
|
30
|
-
vagrant-lxd (0.4.
|
31
|
+
vagrant-lxd (0.4.5)
|
31
32
|
activesupport (~> 5.2.3)
|
32
33
|
faraday (~> 0.17)
|
33
34
|
hyperkit (~> 1.2.0)
|
@@ -35,7 +36,7 @@ PATH
|
|
35
36
|
GEM
|
36
37
|
remote: https://rubygems.org/
|
37
38
|
specs:
|
38
|
-
activesupport (5.2.4.
|
39
|
+
activesupport (5.2.4.3)
|
39
40
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
40
41
|
i18n (>= 0.7, < 2)
|
41
42
|
minitest (~> 5.1)
|
@@ -43,19 +44,19 @@ GEM
|
|
43
44
|
addressable (2.7.0)
|
44
45
|
public_suffix (>= 2.0.2, < 5.0)
|
45
46
|
bcrypt_pbkdf (1.0.1)
|
46
|
-
builder (3.2.
|
47
|
-
childprocess (0.
|
48
|
-
|
49
|
-
|
50
|
-
diff-lcs (1.3)
|
47
|
+
builder (3.2.4)
|
48
|
+
childprocess (3.0.0)
|
49
|
+
concurrent-ruby (1.1.6)
|
50
|
+
diff-lcs (1.4.4)
|
51
51
|
domain_name (0.5.20190701)
|
52
52
|
unf (>= 0.0.5, < 1.0.0)
|
53
53
|
ed25519 (1.2.4)
|
54
|
+
erubi (1.9.0)
|
54
55
|
erubis (2.7.0)
|
55
|
-
fakefs (
|
56
|
+
fakefs (1.2.2)
|
56
57
|
faraday (0.17.3)
|
57
58
|
multipart-post (>= 1.2, < 3)
|
58
|
-
ffi (1.
|
59
|
+
ffi (1.13.1)
|
59
60
|
gssapi (1.3.0)
|
60
61
|
ffi (>= 1.0.1)
|
61
62
|
gyoku (1.3.1)
|
@@ -67,7 +68,7 @@ GEM
|
|
67
68
|
hyperkit (1.2.0)
|
68
69
|
activesupport (>= 4.2.6)
|
69
70
|
sawyer
|
70
|
-
i18n (1.
|
71
|
+
i18n (1.8.3)
|
71
72
|
concurrent-ruby (~> 1.0)
|
72
73
|
listen (3.1.5)
|
73
74
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
@@ -75,26 +76,27 @@ GEM
|
|
75
76
|
ruby_dep (~> 1.2)
|
76
77
|
little-plugger (1.1.4)
|
77
78
|
log4r (1.1.10)
|
78
|
-
logging (2.
|
79
|
+
logging (2.3.0)
|
79
80
|
little-plugger (~> 1.1)
|
80
|
-
multi_json (~> 1.
|
81
|
-
mime
|
81
|
+
multi_json (~> 1.14)
|
82
|
+
mime (0.4.4)
|
83
|
+
mime-types (3.3.1)
|
82
84
|
mime-types-data (~> 3.2015)
|
83
|
-
mime-types-data (3.
|
84
|
-
minitest (5.
|
85
|
-
multi_json (1.
|
85
|
+
mime-types-data (3.2020.0512)
|
86
|
+
minitest (5.14.1)
|
87
|
+
multi_json (1.14.1)
|
86
88
|
multipart-post (2.1.1)
|
87
89
|
net-scp (1.2.1)
|
88
90
|
net-ssh (>= 2.6.5)
|
89
91
|
net-sftp (2.1.2)
|
90
92
|
net-ssh (>= 2.6.5)
|
91
|
-
net-ssh (5.
|
93
|
+
net-ssh (5.2.0)
|
92
94
|
netrc (0.11.0)
|
93
95
|
nori (2.6.0)
|
94
|
-
public_suffix (4.0.
|
95
|
-
rake (
|
96
|
-
rb-fsevent (0.10.
|
97
|
-
rb-inotify (0.10.
|
96
|
+
public_suffix (4.0.5)
|
97
|
+
rake (13.0.1)
|
98
|
+
rb-fsevent (0.10.4)
|
99
|
+
rb-inotify (0.10.1)
|
98
100
|
ffi (~> 1.0)
|
99
101
|
rb-kqueue (0.2.5)
|
100
102
|
ffi (>= 0.5.0)
|
@@ -102,53 +104,54 @@ GEM
|
|
102
104
|
http-cookie (>= 1.0.2, < 2.0)
|
103
105
|
mime-types (>= 1.16, < 4.0)
|
104
106
|
netrc (~> 0.8)
|
105
|
-
rspec (3.
|
106
|
-
rspec-core (~> 3.
|
107
|
-
rspec-expectations (~> 3.
|
108
|
-
rspec-mocks (~> 3.
|
109
|
-
rspec-core (3.
|
110
|
-
rspec-support (~> 3.
|
111
|
-
rspec-expectations (3.
|
107
|
+
rspec (3.9.0)
|
108
|
+
rspec-core (~> 3.9.0)
|
109
|
+
rspec-expectations (~> 3.9.0)
|
110
|
+
rspec-mocks (~> 3.9.0)
|
111
|
+
rspec-core (3.9.2)
|
112
|
+
rspec-support (~> 3.9.3)
|
113
|
+
rspec-expectations (3.9.2)
|
112
114
|
diff-lcs (>= 1.2.0, < 2.0)
|
113
|
-
rspec-support (~> 3.
|
115
|
+
rspec-support (~> 3.9.0)
|
114
116
|
rspec-its (1.3.0)
|
115
117
|
rspec-core (>= 3.0.0)
|
116
118
|
rspec-expectations (>= 3.0.0)
|
117
|
-
rspec-mocks (3.
|
119
|
+
rspec-mocks (3.9.1)
|
118
120
|
diff-lcs (>= 1.2.0, < 2.0)
|
119
|
-
rspec-support (~> 3.
|
120
|
-
rspec-support (3.
|
121
|
+
rspec-support (~> 3.9.0)
|
122
|
+
rspec-support (3.9.3)
|
121
123
|
ruby_dep (1.3.1)
|
122
124
|
rubyntlm (0.6.2)
|
123
|
-
rubyzip (
|
125
|
+
rubyzip (2.3.0)
|
124
126
|
sawyer (0.8.2)
|
125
127
|
addressable (>= 2.3.5)
|
126
128
|
faraday (> 0.8, < 2.0)
|
127
129
|
thread_safe (0.3.6)
|
128
|
-
tzinfo (1.2.
|
130
|
+
tzinfo (1.2.7)
|
129
131
|
thread_safe (~> 0.1)
|
130
132
|
unf (0.1.4)
|
131
133
|
unf_ext
|
132
|
-
unf_ext (0.0.7.
|
133
|
-
vagrant_cloud (2.0.
|
134
|
+
unf_ext (0.0.7.7)
|
135
|
+
vagrant_cloud (2.0.3)
|
134
136
|
rest-client (~> 2.0.2)
|
135
137
|
wdm (0.1.1)
|
136
|
-
winrm (2.3.
|
138
|
+
winrm (2.3.4)
|
137
139
|
builder (>= 2.1.2)
|
138
|
-
|
140
|
+
erubi (~> 1.8)
|
139
141
|
gssapi (~> 1.2)
|
140
142
|
gyoku (~> 1.0)
|
141
143
|
httpclient (~> 2.2, >= 2.2.0.2)
|
142
144
|
logging (>= 1.6.1, < 3.0)
|
143
145
|
nori (~> 2.0)
|
144
146
|
rubyntlm (~> 0.6.0, >= 0.6.1)
|
145
|
-
winrm-elevated (1.
|
147
|
+
winrm-elevated (1.2.1)
|
148
|
+
erubi (~> 1.8)
|
146
149
|
winrm (~> 2.0)
|
147
150
|
winrm-fs (~> 1.0)
|
148
|
-
winrm-fs (1.3.
|
149
|
-
|
151
|
+
winrm-fs (1.3.4)
|
152
|
+
erubi (~> 1.8)
|
150
153
|
logging (>= 1.6.1, < 3.0)
|
151
|
-
rubyzip (~>
|
154
|
+
rubyzip (~> 2.0)
|
152
155
|
winrm (~> 2.0)
|
153
156
|
|
154
157
|
PLATFORMS
|
@@ -164,4 +167,4 @@ DEPENDENCIES
|
|
164
167
|
vagrant-lxd!
|
165
168
|
|
166
169
|
BUNDLED WITH
|
167
|
-
2.
|
170
|
+
2.1.4
|
data/README.md
CHANGED
@@ -148,7 +148,7 @@ is passed through to LXD. The hash values should all be strings:
|
|
148
148
|
recursive: 'false',
|
149
149
|
}
|
150
150
|
|
151
|
-
[disk]: https://lxd.readthedocs.io/en/latest/
|
151
|
+
[disk]: https://lxd.readthedocs.io/en/latest/instances/#type-disk
|
152
152
|
|
153
153
|
### Shared LXD Containers
|
154
154
|
|
@@ -234,7 +234,7 @@ to run graphical applications transparently from within the guest:
|
|
234
234
|
Note that disk devices should be configured as [synced
|
235
235
|
folders](#synced-folders) rather than ad-hoc devices.
|
236
236
|
|
237
|
-
[device-config]: https://lxd.readthedocs.io/en/latest/
|
237
|
+
[device-config]: https://lxd.readthedocs.io/en/latest/instances/#devices-configuration
|
238
238
|
|
239
239
|
## Hacking
|
240
240
|
|
@@ -29,14 +29,33 @@ module VagrantLXD
|
|
29
29
|
def Capability.synced_folders(env)
|
30
30
|
logger = Log4r::Logger.new('vagrant::lxd::capability')
|
31
31
|
logger.debug "Checking synced folders support for effective UID/GID #{Process.uid}/#{Process.gid}..."
|
32
|
-
|
32
|
+
%w(uid gid).all? do |type|
|
33
33
|
begin
|
34
|
-
|
34
|
+
id = Process.send(type)
|
35
|
+
id_map = File.readlines("/etc/sub#{type}")
|
36
|
+
id_in_sub_id?(id, id_map)
|
35
37
|
rescue StandardError => e
|
36
38
|
logger.warn "Cannot read subordinate permissions file: #{e.message}"
|
37
39
|
false
|
38
40
|
end
|
39
41
|
end
|
40
42
|
end
|
43
|
+
|
44
|
+
# Determines whether the given numerical `id` is included in the
|
45
|
+
# subordinate map `id_map`, which should be an array of lines from
|
46
|
+
# the file /etc/subuid or /etc/subgid.
|
47
|
+
#
|
48
|
+
# Invalid lines, and any lines for a user or group other than root,
|
49
|
+
# are ignored. See subuid(5) and subgid(5) for details about these
|
50
|
+
# files, and the expected format of their entries.
|
51
|
+
def Capability.id_in_sub_id?(id, id_map)
|
52
|
+
id_map.any? do |line|
|
53
|
+
if line.match(/^(root|0):(\d+):(\d+)/)
|
54
|
+
range_min = $2.to_i
|
55
|
+
range_max = range_min + $3.to_i
|
56
|
+
id.between?(range_min, range_max)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
41
60
|
end
|
42
61
|
end
|
data/lib/vagrant-lxd/driver.rb
CHANGED
@@ -173,8 +173,8 @@ module VagrantLXD
|
|
173
173
|
raw_idmap = container[:config][:'raw.idmap']
|
174
174
|
begin
|
175
175
|
raw_idmap and
|
176
|
-
|
177
|
-
|
176
|
+
id_in_map?(Process.uid, 'uid', raw_idmap) and
|
177
|
+
id_in_map?(Process.gid, 'gid', raw_idmap)
|
178
178
|
end
|
179
179
|
rescue Vagrant::Errors::ProviderNotUsable
|
180
180
|
false
|
@@ -403,7 +403,7 @@ module VagrantLXD
|
|
403
403
|
end
|
404
404
|
end
|
405
405
|
|
406
|
-
|
406
|
+
private
|
407
407
|
|
408
408
|
#
|
409
409
|
# The remaining methods are just conveniences, not part of the API
|
@@ -550,6 +550,24 @@ module VagrantLXD
|
|
550
550
|
config
|
551
551
|
end
|
552
552
|
|
553
|
+
# Determines whether the numerical `id` of the specified `type` is
|
554
|
+
# included in the given idmap. These values should follow the format
|
555
|
+
# of the "raw.idmap" property specified here:
|
556
|
+
#
|
557
|
+
# https://lxd.readthedocs.io/en/latest/userns-idmap/#custom-idmaps
|
558
|
+
#
|
559
|
+
def id_in_map?(id, type, map)
|
560
|
+
range_types = ['both', type]
|
561
|
+
map.each_line.any? do |line|
|
562
|
+
range_type, range_values = line.split
|
563
|
+
range = range_values.split('-')
|
564
|
+
begin
|
565
|
+
range_types.include?(range_type) and
|
566
|
+
id.between?(range.first.to_i, range.last.to_i)
|
567
|
+
end
|
568
|
+
end
|
569
|
+
end
|
570
|
+
|
553
571
|
def locate_or_generate_client_certificate
|
554
572
|
vagrant_path = @machine.env.data_dir / 'lxd'
|
555
573
|
default_path = Certificate.default_path / 'lxc'
|
data/lib/vagrant-lxd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-lxd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Hanson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -99,8 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
|
103
|
-
rubygems_version: 2.7.6
|
102
|
+
rubygems_version: 3.0.3
|
104
103
|
signing_key:
|
105
104
|
specification_version: 4
|
106
105
|
summary: Vagrant LXD provider
|