kitchen-oci 1.27.0 → 2.0.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 +4 -4
- data/lib/kitchen/driver/oci/mixin/actions.rb +32 -0
- data/lib/kitchen/driver/oci.rb +1 -0
- data/lib/kitchen/driver/oci_version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9946d2409c6ed9c114777132492015f7875cfe6e13edb0714042b9201ee5ea17
|
4
|
+
data.tar.gz: 6783581acf13d597aee3ec3adcdb7110582107c84e8e755df6144cfcf81c7244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fe83a9162360ab4e1896c0e8c4cb35d0d6af019fe386ab70562092b458f32b1cb0ab1700367d5fbfc7682045591c56bb08f904e928cc45cf51e8a1b51dfd909
|
7
|
+
data.tar.gz: abaed2993b82c06ada0255fedee6145157f3c6db32a870c6d281fb8386e0f86baed575b933f5a0cd7e05fc3e389a29fead4b2e35acdeab3d62e3f8d26e7b2cf3
|
@@ -33,6 +33,8 @@ module Kitchen
|
|
33
33
|
state_details = inst.launch
|
34
34
|
state.merge!(state_details)
|
35
35
|
instance.transport.connection(state).wait_until_ready
|
36
|
+
instance_options(state, inst)
|
37
|
+
are_legacy_imds_endpoints_disbled?(state, inst)
|
36
38
|
end
|
37
39
|
|
38
40
|
# Executes the post script on the instance.
|
@@ -68,6 +70,36 @@ module Kitchen
|
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
73
|
+
# Applies instance options.
|
74
|
+
#
|
75
|
+
# @param state [Hash] (see Kitchen::StateFile)
|
76
|
+
# @param inst [Class] the specific class of instance being rebooted.
|
77
|
+
def instance_options(state, inst)
|
78
|
+
return unless instance_options?
|
79
|
+
|
80
|
+
inst.logger.info("Applying the following instance options:")
|
81
|
+
config[:instance_options].each { |o, v| inst.logger.info("- #{o}: #{v}") }
|
82
|
+
inst.api.compute.update_instance(state[:server_id], OCI::Core::Models::UpdateInstanceDetails.new(instance_options: OCI::Core::Models::InstanceOptions.new(config[:instance_options])))
|
83
|
+
end
|
84
|
+
|
85
|
+
# Attempts to disable IMDSv1 even if not explicitly specified in the config. This is in line with current security guidance from OCI.
|
86
|
+
# Acts as a guard for setting instance options.
|
87
|
+
def instance_options?
|
88
|
+
return false unless config[:instance_type] == "compute"
|
89
|
+
|
90
|
+
config[:instance_options].merge!(are_legacy_imds_endpoints_disabled: true) unless config[:instance_options].key?(:are_legacy_imds_endpoints_disabled)
|
91
|
+
# Basically tell me if there's more stuff in there than `are_legacy_imds_endpoints_disabled: false`. If so, then proceed to setting it.
|
92
|
+
config[:instance_options].reject { |o, v| o == :are_legacy_imds_endpoints_disabled && !v }.any?
|
93
|
+
end
|
94
|
+
|
95
|
+
# Checks if legacy metadata is disabled.
|
96
|
+
def are_legacy_imds_endpoints_disbled?(state, inst)
|
97
|
+
return unless config[:instance_type] == "compute"
|
98
|
+
|
99
|
+
imds = inst.api.compute.get_instance(state[:server_id]).data.instance_options.are_legacy_imds_endpoints_disabled
|
100
|
+
inst.logger.warn("Legacy IMDSv1 endpoint is enabled.") unless imds
|
101
|
+
end
|
102
|
+
|
71
103
|
# Reboots an instance.
|
72
104
|
#
|
73
105
|
# @param state [Hash] (see Kitchen::StateFile)
|
data/lib/kitchen/driver/oci.rb
CHANGED
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:
|
4
|
+
version: 2.0.0
|
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: 2025-
|
12
|
+
date: 2025-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oci
|
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
176
|
- !ruby/object:Gem::Version
|
177
177
|
version: '0'
|
178
178
|
requirements: []
|
179
|
-
rubygems_version: 3.3.
|
179
|
+
rubygems_version: 3.3.27
|
180
180
|
signing_key:
|
181
181
|
specification_version: 4
|
182
182
|
summary: A Test Kitchen Driver for Oracle Cloud Infrastructure
|