kitchen-oci 1.15.0 → 1.15.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/lib/kitchen/driver/oci.rb +20 -16
- data/lib/kitchen/driver/oci_version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e3fbf95593303d5f9538c59a7f07eb03dd1871b05b12ca0a82e5d2ed9b529b4
|
|
4
|
+
data.tar.gz: d0c4e60f05ebaf18293ce93bad6f6a52d5d9657de9a0d34b4bb1d61ddaf3d57e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dac56f0b424e0b74ca273de0242d5f0883c95eee61c4e086a7cfa66c9382b9b933f5eb907099c83860f1a44c64c10277a0a656e56c755658a44b548b824c2875
|
|
7
|
+
data.tar.gz: 19adf812199ecbba332985656ffbcc67252107f3f3d1ae2d9fbd1401a9c05e00342bf3d0ba2285f76388ba3075b111de0cb54dab43b94de8424c9ff3359aa04c
|
data/lib/kitchen/driver/oci.rb
CHANGED
|
@@ -500,7 +500,7 @@ module Kitchen
|
|
|
500
500
|
created_vol = []
|
|
501
501
|
config[:volumes].each do |vol_settings|
|
|
502
502
|
# convert to hash because otherwise it's an an OCI API Object and won't load
|
|
503
|
-
volume_attachment_type = vol_settings[:type].downcase
|
|
503
|
+
volume_attachment_type = vol_settings[:type] ? vol_settings[:type].downcase : 'paravirtual'
|
|
504
504
|
unless %w[iscsi paravirtual].include?(volume_attachment_type)
|
|
505
505
|
info("invalid volume attachment type: #{volume_attachment_type}")
|
|
506
506
|
next
|
|
@@ -519,7 +519,7 @@ module Kitchen
|
|
|
519
519
|
end
|
|
520
520
|
|
|
521
521
|
def volume_create(availability_domain, display_name, size_in_gbs, vpus_per_gb)
|
|
522
|
-
info("Creating
|
|
522
|
+
info("Creating <#{display_name}>...")
|
|
523
523
|
result = blockstorage_api.create_volume(
|
|
524
524
|
OCI::Core::Models::CreateVolumeDetails.new(
|
|
525
525
|
compartment_id: compartment_id,
|
|
@@ -531,28 +531,29 @@ module Kitchen
|
|
|
531
531
|
)
|
|
532
532
|
get_volume_response = blockstorage_api.get_volume(result.data.id)
|
|
533
533
|
.wait_until(:lifecycle_state, OCI::Core::Models::Volume::LIFECYCLE_STATE_AVAILABLE)
|
|
534
|
-
info("Finished creating
|
|
535
|
-
|
|
536
|
-
:
|
|
534
|
+
info("Finished creating <#{display_name}>.")
|
|
535
|
+
{
|
|
536
|
+
id: get_volume_response.data.id,
|
|
537
|
+
display_name: get_volume_response.data.display_name
|
|
537
538
|
}
|
|
538
539
|
end
|
|
539
540
|
|
|
540
541
|
def volume_delete(volume_id)
|
|
541
|
-
info("Deleting
|
|
542
|
+
info("Deleting <#{volume_id}>...")
|
|
542
543
|
blockstorage_api.delete_volume(volume_id)
|
|
543
544
|
blockstorage_api.get_volume(volume_id)
|
|
544
545
|
.wait_until(:lifecycle_state, OCI::Core::Models::Volume::LIFECYCLE_STATE_TERMINATED)
|
|
545
|
-
info("
|
|
546
|
+
info("Finished deleting <#{volume_id}>.")
|
|
546
547
|
end
|
|
547
548
|
|
|
548
549
|
def process_volume_attachments(state)
|
|
549
550
|
attachments = []
|
|
550
551
|
state[:volumes].each do |volume|
|
|
551
|
-
info("Attaching
|
|
552
|
+
info("Attaching <#{volume[:display_name]}>...")
|
|
552
553
|
details = volume_create_attachment_details(volume, state[:server_id])
|
|
553
554
|
attachment = volume_attach(details).to_hash
|
|
554
555
|
attachments << attachment
|
|
555
|
-
info("
|
|
556
|
+
info("Finished attaching <#{volume[:display_name]}>.")
|
|
556
557
|
end
|
|
557
558
|
attachments
|
|
558
559
|
end
|
|
@@ -564,7 +565,7 @@ module Kitchen
|
|
|
564
565
|
volume_id: volume[:id],
|
|
565
566
|
instance_id: instance_id
|
|
566
567
|
)
|
|
567
|
-
elsif volume[:attachment_type].
|
|
568
|
+
elsif volume[:attachment_type].eql?('paravirtual')
|
|
568
569
|
OCI::Core::Models::AttachParavirtualizedVolumeDetails.new(
|
|
569
570
|
display_name: 'paravirtAttachment',
|
|
570
571
|
volume_id: volume[:id],
|
|
@@ -579,19 +580,22 @@ module Kitchen
|
|
|
579
580
|
comp_api.get_volume_attachment(result.data.id)
|
|
580
581
|
.wait_until(:lifecycle_state, OCI::Core::Models::VolumeAttachment::LIFECYCLE_STATE_ATTACHED)
|
|
581
582
|
state_data = {
|
|
582
|
-
:
|
|
583
|
-
:iqn_ipv4 => get_volume_attachment_response.data.ipv4,
|
|
584
|
-
:iqn => get_volume_attachment_response.data.iqn,
|
|
585
|
-
:port => get_volume_attachment_response.data.port,
|
|
583
|
+
id: get_volume_attachment_response.data.id
|
|
586
584
|
}
|
|
585
|
+
if get_volume_attachment_response.data.attachment_type == 'iscsi'
|
|
586
|
+
state_data.store(:iqn_ipv4, get_volume_attachment_response.data.ipv4)
|
|
587
|
+
state_data.store(:iqn, get_volume_attachment_response.data.iqn)
|
|
588
|
+
state_data.store(:port, get_volume_attachment_response.data.port)
|
|
589
|
+
end
|
|
590
|
+
state_data
|
|
587
591
|
end
|
|
588
592
|
|
|
589
593
|
def volume_detach(volume_attachment)
|
|
590
|
-
info("Detaching
|
|
594
|
+
info("Detaching <#{volume_attachment[:id]}>...")
|
|
591
595
|
comp_api.detach_volume(volume_attachment[:id])
|
|
592
596
|
comp_api.get_volume_attachment(volume_attachment[:id])
|
|
593
597
|
.wait_until(:lifecycle_state, OCI::Core::Models::VolumeAttachment::LIFECYCLE_STATE_DETACHED)
|
|
594
|
-
info("
|
|
598
|
+
info("Finished detaching <#{volume_attachment[:id]}>.")
|
|
595
599
|
end
|
|
596
600
|
|
|
597
601
|
#################
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-oci
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.15.
|
|
4
|
+
version: 1.15.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Pearson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-03-
|
|
11
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oci
|