Skip to content

Commit feaa4a8

Browse files
committed
[wip] yay ruby!
1 parent 74d64d8 commit feaa4a8

File tree

1 file changed

+6
-4
lines changed
  • test/integration/instance_with_config_file/controls

1 file changed

+6
-4
lines changed

test/integration/instance_with_config_file/controls/docker.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,18 @@
5151
it "should have the right number of hostPath volumes on the right mount points" do
5252
mounts.each do |mount|
5353
# mount destinations have to be unique, so use it to lookup the mount definition
54-
mount_def = mount_definitions.select { |md| md["mountPath"] == mount.Destination }.first
55-
# use the mount definition name to lookup the volume by name
56-
volume_def = host_path_volume_definitions.select { |vd| vd["name"] == mount_def["name"] }.first
54+
mount_def = mount_definitions.find { |md| md["mountPath"] == mount.Destination }
55+
expect(mount_def).not_to be_nil
56+
# use the mount definition name to lookup the volume definition by name
57+
volume_def = host_path_volume_definitions.find { |vd| vd["name"] == mount_def["name"] }
58+
expect(volume_def).not_to be_nil
5759

5860
expect(mount).to eq({
5961
"Destination" => mount_def["mountPath"],
6062
"Mode" => mount_def["readOnly"] ? "ro" : "rw",
6163
"Propagation" => "rprivate",
6264
"RW" => !mount_def["readOnly"],
63-
"Source" => volume_definition["hostPath"]["path"],
65+
"Source" => volume_def["hostPath"]["path"],
6466
"Type" => "bind",
6567
})
6668
end

0 commit comments

Comments
 (0)