kitchen-oci 1.17.0 → 1.18.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4447f287a8b33c9959c977d4fd50ce99c0f977dcb72438e266b3f936b5ef3a43
4
- data.tar.gz: 6a8520b6c8d837a71065044ed1e570efa3b303965670d4ce4fcc61de5a4807b6
3
+ metadata.gz: 04441716ec20ae5cf111a087f07990af96826770804f92a67edaa7335622391a
4
+ data.tar.gz: 378640fe182082b49904fcef4671c7954bb794a51090c7e29a74ad25128addd0
5
5
  SHA512:
6
- metadata.gz: a9476e56b93733a640744a3ed8c1f0f4b7dd043000035a5d8d86d8e57cefb302c804c034dc2f1f666ad1175b2ffadb609664f1be4be3886b4d8aabc1ac38cff5
7
- data.tar.gz: a3c7e8522bf457603f7376387247bec8fdfb9f7d266c630771c5e612577954318cd2873397795d1a440ad2f4c11601cc57bd6a0d5c200eeee71464f50805ee49
6
+ metadata.gz: 8cddfba0d04e8a8634656694b1158e9ea6e87eed48bb78b1f949d32aa2b2d0e58de38326c802da9ece1de1d5da209eab75c6b7d6e1e6f2c0e7224fa1dc81033a
7
+ data.tar.gz: 7ed171e81ff8ab9d2559df7b9a4bab80d5d7fee5440ac0816971def8b48e6d4e65eed1b098b2f95cd1d5658e702c8523e053d05998a2929cb41636b846f4d674
@@ -49,10 +49,18 @@ module Kitchen
49
49
  )
50
50
  end
51
51
 
52
+ def agent_config
53
+ launch_details.agent_config = OCI::Core::Models::LaunchInstanceAgentConfigDetails.new(
54
+ are_all_plugins_disabled: config[:all_plugins_disabled],
55
+ is_management_disabled: config[:management_disabled],
56
+ is_monitoring_disabled: config[:monitoring_disabled]
57
+ )
58
+ end
59
+
52
60
  def instance_source_details
53
61
  launch_details.source_details = OCI::Core::Models::InstanceSourceViaImageDetails.new(
54
62
  sourceType: "image",
55
- imageId: config[:image_id],
63
+ imageId: image_id,
56
64
  bootVolumeSizeInGBs: config[:boot_volume_size_in_gbs]
57
65
  )
58
66
  end
@@ -44,7 +44,7 @@ module Kitchen
44
44
  end
45
45
 
46
46
  def pdb_name
47
- database_details.pdb_name = config[:dbaas][:pdb_name] ||= "pdb001"
47
+ database_details.pdb_name = config[:dbaas][:pdb_name]
48
48
  end
49
49
 
50
50
  def db_backup_config
@@ -53,6 +53,41 @@ module Kitchen
53
53
 
54
54
  private
55
55
 
56
+ def image_id
57
+ return config[:image_id] if config[:image_id]
58
+
59
+ raise "must specify either image_id or image_name" unless config[:image_name]
60
+
61
+ image_id_by_name
62
+ end
63
+
64
+ def image_id_by_name
65
+ image_name = config[:image_name].gsub(" ", "-")
66
+ image_list = images.select { |i| i.display_name.match?(/#{image_name}/) }
67
+ raise "unable to find image_id" if image_list.empty?
68
+
69
+ image_list = filter_image_list(image_list, image_name) if image_list.count > 1
70
+ raise "unable to find image_id" if image_list.empty?
71
+
72
+ latest_image_id(image_list)
73
+ end
74
+
75
+ def filter_image_list(image_list, image_name)
76
+ image_list.select { |i| i.display_name.match?(/#{image_name}-[0-9]{4}\.[0-9]{2}\.[0-9]{2}/) }
77
+ end
78
+
79
+ def latest_image_id(image_list)
80
+ image_list.sort_by! { |o| ((DateTime.parse(Time.now.utc.to_s) - o.time_created) * 24 * 60 * 60).to_i }.first.id
81
+ end
82
+
83
+ def images(image_list = [], page = nil)
84
+ current_images = api.compute.list_images(oci.compartment, page: page)
85
+ next_page = current_images.next_page
86
+ image_list << current_images.data
87
+ images(image_list, next_page) unless next_page.nil?
88
+ image_list.flatten
89
+ end
90
+
56
91
  def instance_ip(instance_id)
57
92
  vnic = vnics(instance_id).select(&:is_primary).first
58
93
  if public_ip_allowed?
@@ -51,7 +51,8 @@ module Kitchen
51
51
  default_config :compartment_id, nil
52
52
  default_config :compartment_name, nil
53
53
  default_config :instance_type, "compute"
54
- default_config :image_id
54
+ default_config :image_id, nil
55
+ default_config :image_name, nil
55
56
  default_config :hostname_prefix do |hnp|
56
57
  hnp.instance.name
57
58
  end
@@ -67,6 +68,9 @@ module Kitchen
67
68
  default_config :use_token_auth, false
68
69
  default_config :shape_config, {}
69
70
  default_config :nsg_ids, []
71
+ default_config :all_plugins_disabled, false
72
+ default_config :management_disabled, false
73
+ default_config :monitoring_disabled, false
70
74
 
71
75
  # compute only configs
72
76
  default_config :setup_winrm, false
@@ -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.17.0"
23
+ OCI_VERSION = "1.18.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-oci
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Pearson
8
+ - Justin Steele
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2024-04-02 00:00:00.000000000 Z
12
+ date: 2024-04-04 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: oci
@@ -111,6 +112,7 @@ dependencies:
111
112
  description: A Test Kitchen Driver for Oracle OCI
112
113
  email:
113
114
  - stephen.pearson@oracle.com
115
+ - justin.steele@oracle.com
114
116
  executables: []
115
117
  extensions: []
116
118
  extra_rdoc_files: []