kitchen-oci 1.19.0 → 1.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/oci/blockstorage.rb +2 -1
- data/lib/kitchen/driver/oci/instance/compute.rb +12 -1
- data/lib/kitchen/driver/oci/instance/database.rb +10 -0
- data/lib/kitchen/driver/oci/instance/db_home.rb +10 -0
- data/lib/kitchen/driver/oci/instance/dbaas.rb +0 -1
- data/lib/kitchen/driver/oci/models/compute.rb +24 -1
- data/lib/kitchen/driver/oci.rb +4 -0
- 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: cdbe8ed5cda132f28d85a1c882c78e24813be09f2b178df801f3cfa9ae48df7c
|
4
|
+
data.tar.gz: 2fe8183c74c928a6775884863c952ba7b9b79b28b9e2d78c8cf8b76c9b03c891
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0124726ea7e49fb87ae629b655801b2732a425990d5c289c36953244660dd47f41f60da9050824f2c689cfae208a6f3044243209aa0d3f084bfa2294e723529
|
7
|
+
data.tar.gz: 00314f3f25a026949491de79498386359b10e33f142662eb5f6a0191ce0db21e999bfbbb8ad3fcaadc0cd784a64a743493d90d8ea02a66f92c40c81adac62d3a
|
@@ -136,7 +136,8 @@ module Kitchen
|
|
136
136
|
availability_domain: config[:availability_domain],
|
137
137
|
display_name: volume[:name],
|
138
138
|
size_in_gbs: volume[:size_in_gbs],
|
139
|
-
vpus_per_gb: volume[:vpus_per_gb] || 10
|
139
|
+
vpus_per_gb: volume[:vpus_per_gb] || 10,
|
140
|
+
defined_tags: config[:defined_tags]
|
140
141
|
)
|
141
142
|
end
|
142
143
|
|
@@ -57,7 +57,9 @@ module Kitchen
|
|
57
57
|
)
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
60
|
+
def instance_source_via_image
|
61
|
+
return if config[:boot_volume_id]
|
62
|
+
|
61
63
|
launch_details.source_details = OCI::Core::Models::InstanceSourceViaImageDetails.new(
|
62
64
|
sourceType: "image",
|
63
65
|
imageId: image_id,
|
@@ -65,6 +67,15 @@ module Kitchen
|
|
65
67
|
)
|
66
68
|
end
|
67
69
|
|
70
|
+
def instance_source_via_boot_volume
|
71
|
+
return unless config[:boot_volume_id]
|
72
|
+
|
73
|
+
launch_details.source_details = OCI::Core::Models::InstanceSourceViaBootVolumeDetails.new(
|
74
|
+
boot_volume_id: clone_boot_volume,
|
75
|
+
sourceType: "bootVolume"
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
68
79
|
def instance_metadata
|
69
80
|
launch_details.metadata = metadata
|
70
81
|
end
|
@@ -22,6 +22,12 @@ module Kitchen
|
|
22
22
|
class Instance
|
23
23
|
# setter methods that populate the details of OCI::Database::Models::CreateDatabaseDetails
|
24
24
|
module DatabaseDetails
|
25
|
+
def database_software_image
|
26
|
+
return unless config[:dbaas][:db_software_image_id]
|
27
|
+
|
28
|
+
database_details.database_software_image_id = config[:dbaas][:db_software_image_id]
|
29
|
+
end
|
30
|
+
|
25
31
|
def character_set
|
26
32
|
database_details.character_set = config[:dbaas][:character_set] ||= "AL32UTF8"
|
27
33
|
end
|
@@ -53,6 +59,10 @@ module Kitchen
|
|
53
59
|
end
|
54
60
|
database_details
|
55
61
|
end
|
62
|
+
|
63
|
+
def db_defined_tags
|
64
|
+
database_details.defined_tags = config[:defined_tags]
|
65
|
+
end
|
56
66
|
end
|
57
67
|
end
|
58
68
|
end
|
@@ -35,6 +35,16 @@ module Kitchen
|
|
35
35
|
def db_home_display_name
|
36
36
|
db_home_details.display_name = ["dbhome", random_number(10)].compact.join
|
37
37
|
end
|
38
|
+
|
39
|
+
def db_home_software_image
|
40
|
+
return unless config[:dbaas][:db_software_image_id]
|
41
|
+
|
42
|
+
db_home_details.database_software_image_id = config[:dbaas][:db_software_image_id]
|
43
|
+
end
|
44
|
+
|
45
|
+
def db_home_defined_tags
|
46
|
+
db_home_details.defined_tags = config[:defined_tags]
|
47
|
+
end
|
38
48
|
end
|
39
49
|
end
|
40
50
|
end
|
@@ -93,6 +93,29 @@ module Kitchen
|
|
93
93
|
image_list.flatten
|
94
94
|
end
|
95
95
|
|
96
|
+
def clone_boot_volume
|
97
|
+
info("Cloning boot volume...")
|
98
|
+
cbv = api.blockstorage.create_boot_volume(clone_boot_volume_details)
|
99
|
+
api.blockstorage.get_boot_volume(cbv.data.id).wait_until(:lifecycle_state, OCI::Core::Models::BootVolume::LIFECYCLE_STATE_AVAILABLE)
|
100
|
+
info("Finished cloning boot volume.")
|
101
|
+
cbv.data.id
|
102
|
+
end
|
103
|
+
|
104
|
+
def clone_boot_volume_details
|
105
|
+
OCI::Core::Models::CreateBootVolumeDetails.new(
|
106
|
+
source_details: OCI::Core::Models::BootVolumeSourceFromBootVolumeDetails.new(
|
107
|
+
id: config[:boot_volume_id]
|
108
|
+
),
|
109
|
+
display_name: boot_volume_display_name,
|
110
|
+
compartment_id: oci.compartment,
|
111
|
+
defined_tags: config[:defined_tags]
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
def boot_volume_display_name
|
116
|
+
"#{api.blockstorage.get_boot_volume(config[:boot_volume_id]).data.display_name} (Clone)"
|
117
|
+
end
|
118
|
+
|
96
119
|
def instance_ip(instance_id)
|
97
120
|
vnic = vnics(instance_id).select(&:is_primary).first
|
98
121
|
if public_ip_allowed?
|
@@ -114,7 +137,7 @@ module Kitchen
|
|
114
137
|
end
|
115
138
|
|
116
139
|
def hostname
|
117
|
-
|
140
|
+
%W{#{config[:hostname_prefix]} #{config[:instance_name]} #{random_string(6)}}.uniq.compact.join("-")
|
118
141
|
end
|
119
142
|
|
120
143
|
def create_vnic_details(name)
|
data/lib/kitchen/driver/oci.rb
CHANGED
@@ -52,10 +52,14 @@ module Kitchen
|
|
52
52
|
default_config :compartment_name, nil
|
53
53
|
default_config :instance_type, "compute"
|
54
54
|
default_config :image_id, nil
|
55
|
+
default_config :boot_volume_id, nil
|
55
56
|
default_config :image_name, nil
|
56
57
|
default_config :hostname_prefix do |hnp|
|
57
58
|
hnp.instance.name
|
58
59
|
end
|
60
|
+
default_config :instance_name do |inst|
|
61
|
+
inst.instance.name
|
62
|
+
end
|
59
63
|
default_keypath = File.expand_path(File.join(%w{~ .ssh id_rsa.pub}))
|
60
64
|
default_config :ssh_keypath, default_keypath
|
61
65
|
default_config :post_create_script, nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-oci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Pearson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-05-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oci
|