kitchen-oci 1.26.0 → 1.27.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/api.rb +36 -7
- data/lib/kitchen/driver/oci/blockstorage.rb +64 -20
- data/lib/kitchen/driver/oci/config.rb +29 -4
- data/lib/kitchen/driver/oci/instance/common.rb +8 -2
- data/lib/kitchen/driver/oci/instance/compute.rb +13 -1
- data/lib/kitchen/driver/oci/instance/database.rb +12 -1
- data/lib/kitchen/driver/oci/instance/db_home.rb +9 -1
- data/lib/kitchen/driver/oci/instance/dbaas.rb +21 -6
- data/lib/kitchen/driver/oci/instance.rb +63 -17
- data/lib/kitchen/driver/oci/mixin/actions.rb +99 -0
- data/lib/kitchen/driver/oci/mixin/models.rb +70 -0
- data/lib/kitchen/driver/oci/mixin/volumes.rb +88 -0
- data/lib/kitchen/driver/oci/models/compute.rb +76 -7
- data/lib/kitchen/driver/oci/models/dbaas.rb +28 -11
- data/lib/kitchen/driver/oci/models/iscsi.rb +14 -4
- data/lib/kitchen/driver/oci/models/paravirtual.rb +14 -4
- data/lib/kitchen/driver/oci.rb +21 -46
- data/lib/kitchen/driver/oci_version.rb +3 -1
- metadata +26 -5
- data/lib/kitchen/driver/oci/models.rb +0 -48
- data/lib/kitchen/driver/oci/volumes.rb +0 -54
@@ -1,54 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
#
|
4
|
-
# Author:: Justin Steele (<justin.steele@oracle.com>)
|
5
|
-
#
|
6
|
-
# Copyright (C) 2024, Stephen Pearson
|
7
|
-
#
|
8
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
|
20
|
-
module Kitchen
|
21
|
-
module Driver
|
22
|
-
class Oci
|
23
|
-
# mixin for working with volumes and attachments
|
24
|
-
module Volumes
|
25
|
-
def create_and_attach_volumes(config, state, oci, api)
|
26
|
-
return if config[:volumes].empty?
|
27
|
-
|
28
|
-
volume_state = process_volumes(config, state, oci, api)
|
29
|
-
state.merge!(volume_state)
|
30
|
-
end
|
31
|
-
|
32
|
-
def process_volumes(config, state, oci, api)
|
33
|
-
volume_state = { volumes: [], volume_attachments: [] }
|
34
|
-
config[:volumes].each do |volume|
|
35
|
-
vol = volume_class(volume[:type], config, state, oci, api)
|
36
|
-
volume_details, vol_state = create_volume(vol, volume)
|
37
|
-
attach_state = vol.attach_volume(volume_details, state[:server_id], volume)
|
38
|
-
volume_state[:volumes] << vol_state
|
39
|
-
volume_state[:volume_attachments] << attach_state
|
40
|
-
end
|
41
|
-
volume_state
|
42
|
-
end
|
43
|
-
|
44
|
-
def create_volume(vol, volume)
|
45
|
-
if volume.key?(:volume_id)
|
46
|
-
vol.create_clone_volume(volume)
|
47
|
-
else
|
48
|
-
vol.create_volume(volume)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|