kitchen-oci 1.14.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 +25 -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
|
@@ -67,6 +67,7 @@ module Kitchen
|
|
|
67
67
|
default_config :use_token_auth, false
|
|
68
68
|
default_config :preemptible_instance, false
|
|
69
69
|
default_config :shape_config, {}
|
|
70
|
+
default_config :custom_metadata, {}
|
|
70
71
|
|
|
71
72
|
# dbaas config items
|
|
72
73
|
default_config :dbaas, {}
|
|
@@ -347,6 +348,10 @@ module Kitchen
|
|
|
347
348
|
inject_powershell(state) if config[:setup_winrm] == true
|
|
348
349
|
|
|
349
350
|
metadata = {}
|
|
351
|
+
md = config[:custom_metadata]
|
|
352
|
+
md.each do |key, value|
|
|
353
|
+
metadata.store(key, value)
|
|
354
|
+
end
|
|
350
355
|
metadata.store('ssh_authorized_keys', pubkey)
|
|
351
356
|
data = user_data
|
|
352
357
|
metadata.store('user_data', data) if config[:user_data] && !config[:user_data].empty?
|
|
@@ -495,7 +500,7 @@ module Kitchen
|
|
|
495
500
|
created_vol = []
|
|
496
501
|
config[:volumes].each do |vol_settings|
|
|
497
502
|
# convert to hash because otherwise it's an an OCI API Object and won't load
|
|
498
|
-
volume_attachment_type = vol_settings[:type].downcase
|
|
503
|
+
volume_attachment_type = vol_settings[:type] ? vol_settings[:type].downcase : 'paravirtual'
|
|
499
504
|
unless %w[iscsi paravirtual].include?(volume_attachment_type)
|
|
500
505
|
info("invalid volume attachment type: #{volume_attachment_type}")
|
|
501
506
|
next
|
|
@@ -514,7 +519,7 @@ module Kitchen
|
|
|
514
519
|
end
|
|
515
520
|
|
|
516
521
|
def volume_create(availability_domain, display_name, size_in_gbs, vpus_per_gb)
|
|
517
|
-
info("Creating
|
|
522
|
+
info("Creating <#{display_name}>...")
|
|
518
523
|
result = blockstorage_api.create_volume(
|
|
519
524
|
OCI::Core::Models::CreateVolumeDetails.new(
|
|
520
525
|
compartment_id: compartment_id,
|
|
@@ -526,28 +531,29 @@ module Kitchen
|
|
|
526
531
|
)
|
|
527
532
|
get_volume_response = blockstorage_api.get_volume(result.data.id)
|
|
528
533
|
.wait_until(:lifecycle_state, OCI::Core::Models::Volume::LIFECYCLE_STATE_AVAILABLE)
|
|
529
|
-
info("Finished creating
|
|
530
|
-
|
|
531
|
-
:
|
|
534
|
+
info("Finished creating <#{display_name}>.")
|
|
535
|
+
{
|
|
536
|
+
id: get_volume_response.data.id,
|
|
537
|
+
display_name: get_volume_response.data.display_name
|
|
532
538
|
}
|
|
533
539
|
end
|
|
534
540
|
|
|
535
541
|
def volume_delete(volume_id)
|
|
536
|
-
info("Deleting
|
|
542
|
+
info("Deleting <#{volume_id}>...")
|
|
537
543
|
blockstorage_api.delete_volume(volume_id)
|
|
538
544
|
blockstorage_api.get_volume(volume_id)
|
|
539
545
|
.wait_until(:lifecycle_state, OCI::Core::Models::Volume::LIFECYCLE_STATE_TERMINATED)
|
|
540
|
-
info("
|
|
546
|
+
info("Finished deleting <#{volume_id}>.")
|
|
541
547
|
end
|
|
542
548
|
|
|
543
549
|
def process_volume_attachments(state)
|
|
544
550
|
attachments = []
|
|
545
551
|
state[:volumes].each do |volume|
|
|
546
|
-
info("Attaching
|
|
552
|
+
info("Attaching <#{volume[:display_name]}>...")
|
|
547
553
|
details = volume_create_attachment_details(volume, state[:server_id])
|
|
548
554
|
attachment = volume_attach(details).to_hash
|
|
549
555
|
attachments << attachment
|
|
550
|
-
info("
|
|
556
|
+
info("Finished attaching <#{volume[:display_name]}>.")
|
|
551
557
|
end
|
|
552
558
|
attachments
|
|
553
559
|
end
|
|
@@ -559,7 +565,7 @@ module Kitchen
|
|
|
559
565
|
volume_id: volume[:id],
|
|
560
566
|
instance_id: instance_id
|
|
561
567
|
)
|
|
562
|
-
elsif volume[:attachment_type].
|
|
568
|
+
elsif volume[:attachment_type].eql?('paravirtual')
|
|
563
569
|
OCI::Core::Models::AttachParavirtualizedVolumeDetails.new(
|
|
564
570
|
display_name: 'paravirtAttachment',
|
|
565
571
|
volume_id: volume[:id],
|
|
@@ -574,19 +580,22 @@ module Kitchen
|
|
|
574
580
|
comp_api.get_volume_attachment(result.data.id)
|
|
575
581
|
.wait_until(:lifecycle_state, OCI::Core::Models::VolumeAttachment::LIFECYCLE_STATE_ATTACHED)
|
|
576
582
|
state_data = {
|
|
577
|
-
:
|
|
578
|
-
:iqn_ipv4 => get_volume_attachment_response.data.ipv4,
|
|
579
|
-
:iqn => get_volume_attachment_response.data.iqn,
|
|
580
|
-
:port => get_volume_attachment_response.data.port,
|
|
583
|
+
id: get_volume_attachment_response.data.id
|
|
581
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
|
|
582
591
|
end
|
|
583
592
|
|
|
584
593
|
def volume_detach(volume_attachment)
|
|
585
|
-
info("Detaching
|
|
594
|
+
info("Detaching <#{volume_attachment[:id]}>...")
|
|
586
595
|
comp_api.detach_volume(volume_attachment[:id])
|
|
587
596
|
comp_api.get_volume_attachment(volume_attachment[:id])
|
|
588
597
|
.wait_until(:lifecycle_state, OCI::Core::Models::VolumeAttachment::LIFECYCLE_STATE_DETACHED)
|
|
589
|
-
info("
|
|
598
|
+
info("Finished detaching <#{volume_attachment[:id]}>.")
|
|
590
599
|
end
|
|
591
600
|
|
|
592
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.
|
|
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-
|
|
11
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: oci
|