kitchen-oci 1.14.0 → 1.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0cea9f46ffa83a8b4e5f7eed890889aa6265631e5cfbea839169f31e0dccaa7
4
- data.tar.gz: 213c557476fce406d144335deba42318dd0a4fbb8820b4754b37acf1f4460bf0
3
+ metadata.gz: 3e3fbf95593303d5f9538c59a7f07eb03dd1871b05b12ca0a82e5d2ed9b529b4
4
+ data.tar.gz: d0c4e60f05ebaf18293ce93bad6f6a52d5d9657de9a0d34b4bb1d61ddaf3d57e
5
5
  SHA512:
6
- metadata.gz: 23272af5f39d286faf4affcd9b1966d5b67a531fe300614a9fe982d443af8fcac016aa511b6f953f790c425a75b6582eb1dbc010c3ce9fa3195cacdfba2506f6
7
- data.tar.gz: a8b5c341ee9762d0d246e192a443dbe98f13e28b24c58b7674d80484b792d348e8dfdb0644252246a823832987201b6a7aa966809b5a8d5b2d5744db6189d8e0
6
+ metadata.gz: dac56f0b424e0b74ca273de0242d5f0883c95eee61c4e086a7cfa66c9382b9b933f5eb907099c83860f1a44c64c10277a0a656e56c755658a44b548b824c2875
7
+ data.tar.gz: 19adf812199ecbba332985656ffbcc67252107f3f3d1ae2d9fbd1401a9c05e00342bf3d0ba2285f76388ba3075b111de0cb54dab43b94de8424c9ff3359aa04c
@@ -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 || 'paravirtual'
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 volume <#{display_name}>...")
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 volume <#{display_name}>.")
530
- state_data = {
531
- :id => get_volume_response.data.id
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 volume: <#{volume_id}>...")
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("Deleted volume: <#{volume_id}>")
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 Volume: #{volume[:displayName]} - #{volume[:attachment_type]}")
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("Attached Volume #{volume[:displayName]} - #{volume[:attachment_type]}")
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].eq?('paravirtual')
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
- :id => get_volume_attachment_response.data.id,
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 volume: #{volume_attachment[:id]}")
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("Detached volume: #{volume_attachment[:id]}")
598
+ info("Finished detaching <#{volume_attachment[:id]}>.")
590
599
  end
591
600
 
592
601
  #################
@@ -20,6 +20,6 @@
20
20
  module Kitchen
21
21
  module Driver
22
22
  # Version string for Oracle OCI Kitchen driver
23
- OCI_VERSION = '1.14.0'
23
+ OCI_VERSION = '1.15.1'
24
24
  end
25
25
  end
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.14.0
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-02-20 00:00:00.000000000 Z
11
+ date: 2024-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oci