Skip to content

Commit

Permalink
WIP: more small adaptations
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Jul 26, 2023
1 parent 6469521 commit 2f41a60
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 152 deletions.
1 change: 1 addition & 0 deletions service/lib/agama/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
require "agama/storage/callbacks"
require "agama/storage/iscsi/manager"
require "agama/storage/finisher"
require "agama/storage/proposal_settings_reader"
require "agama/issue"
require "agama/with_issues"
require "agama/with_progress"
Expand Down
1 change: 1 addition & 0 deletions service/lib/agama/storage/proposal_settings_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def read
config.data.fetch("storage", {}).each do |key, value|
send(READERS[key], settings, value)
end
settings
end

private
Expand Down
4 changes: 2 additions & 2 deletions service/test/agama/storage/manager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

let(:raw_devicegraph) { instance_double(Y2Storage::Devicegraph, probing_issues: []) }

let(:proposal) { Agama::Storage::Proposal.new(logger, config) }
let(:proposal) { Agama::Storage::Proposal.new(config, logger: logger) }

let(:callback) { proc {} }

Expand Down Expand Up @@ -163,7 +163,7 @@
instance_double(Y2Storage::Devicegraph, probing_issues: probing_issues)
end

let(:proposal) { Agama::Storage::Proposal.new(logger, config) }
let(:proposal) { Agama::Storage::Proposal.new(config, logger: logger) }

let(:iscsi) { Agama::Storage::ISCSI::Manager.new }

Expand Down
305 changes: 155 additions & 150 deletions service/test/fixtures/root_dir/etc/agama.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,72 +57,71 @@ Tumbleweed:

storage:
volumes:
- mount_point: "/"
fs_type: btrfs
desired_size: 10 GiB
min_size: 5 GiB
max_size: unlimited
weight: 30
- "/"
- "swap"
volume_templates:
- mount_path: "/"
filesystem: btrfs
btrfs:
snapshots: true
read_only_root: true
default_subvolume: "@"
subvolumes:
- path: home
- path: opt
- path: root
- path: srv
- path: usr/local
# Unified var subvolume - https://lists.opensuse.org/opensuse-packaging/2017-11/msg00017.html
- path: var
copy_on_write: false

# There must always be a root
proposed_configurable: false
# Architecture specific subvolumes
- path: boot/grub2/arm64-efi
archs: aarch64
- path: boot/grub2/arm-efi
archs: arm
- path: boot/grub2/i386-pc
archs: x86_64
- path: boot/grub2/powerpc-ieee1275
archs: ppc,!board_powernv
- path: boot/grub2/s390x-emu
archs: s390
- path: boot/grub2/x86_64-efi
archs: x86_64
- path: boot/grub2/riscv64-efi
archs: riscv64

snapshots: true
snapshots_percentage: 250
snapshots_configurable: true
# Disable snapshots if there is not enough room
disable_order: 3
size:
auto: true
outline:
required: true
auto_size:
base_min: 5 GiB
base_max: 20 GiB
snapshots_increment: 10 GiB
min_fallback_for:
- "/home"
- "/home"
snapshots_configurable: true

btrfs_default_subvolume: "@"
subvolumes:
- path: home
- path: opt
- path: root
- path: srv
- path: usr/local
# Unified var subvolume - https://lists.opensuse.org/opensuse-packaging/2017-11/msg00017.html
- path: var
copy_on_write: false
- mount_path: "/home"
filesystem: xfs
size:
auto: false
min: 10 GiB
max: unlimited
outline:
required: false

# Architecture specific subvolumes
- path: boot/grub2/arm64-efi
archs: aarch64
- path: boot/grub2/arm-efi
archs: arm
- path: boot/grub2/i386-pc
archs: x86_64
- path: boot/grub2/powerpc-ieee1275
archs: ppc,!board_powernv
- path: boot/grub2/s390x-emu
archs: s390
- path: boot/grub2/x86_64-efi
archs: x86_64
- path: boot/grub2/riscv64-efi
archs: riscv64

- mount_point: "/home"
fs_type: xfs
desired_size: 40 GiB
min_size: 10 GiB
max_size: unlimited
weight: 60

proposed: false
proposed_configurable: true
disable_order: 1

- mount_point: "swap"
fs_type: swap
desired_size: 2 GiB
min_size: 1 GiB
max_size: 2 GiB
weight: 10

adjust_by_ram: false
adjust_by_ram_configurable: true

proposed_configurable: true
disable_order: 2
- mount_path: "swap"
filesystem: swap
size:
auto: false
min: 1 GiB
max: 2 GiB
outline:
required: false

Leap:
software:
Expand Down Expand Up @@ -155,69 +154,71 @@ Leap:

storage:
volumes:
- mount_point: "/"
fs_type: btrfs
desired_size: 10 GiB
min_size: 5 GiB
max_size: unlimited
weight: 30

# There must always be a root
proposed_configurable: false

snapshots: true
snapshots_percentage: 250
snapshots_configurable: true
# Disable snapshots if there is not enough room
disable_order: 3
- "/"
- "swap"
volume_templates:
- mount_path: "/"
filesystem: btrfs
btrfs:
snapshots: true
read_only_root: true
default_subvolume: "@"
subvolumes:
- path: home
- path: opt
- path: root
- path: srv
- path: usr/local
# Unified var subvolume - https://lists.opensuse.org/opensuse-packaging/2017-11/msg00017.html
- path: var
copy_on_write: false

btrfs_default_subvolume: "@"
subvolumes:
- path: home
- path: opt
- path: root
- path: srv
- path: usr/local
# Unified var subvolume - https://lists.opensuse.org/opensuse-packaging/2017-11/msg00017.html
- path: var
copy_on_write: false
# Architecture specific subvolumes
- path: boot/grub2/arm64-efi
archs: aarch64
- path: boot/grub2/arm-efi
archs: arm
- path: boot/grub2/i386-pc
archs: x86_64
- path: boot/grub2/powerpc-ieee1275
archs: ppc,!board_powernv
- path: boot/grub2/s390x-emu
archs: s390
- path: boot/grub2/x86_64-efi
archs: x86_64
- path: boot/grub2/riscv64-efi
archs: riscv64

# Architecture specific subvolumes
- path: boot/grub2/arm64-efi
archs: aarch64
- path: boot/grub2/i386-pc
archs: x86_64
- path: boot/grub2/powerpc-ieee1275
archs: ppc,!board_powernv
- path: boot/grub2/s390x-emu
archs: s390
- path: boot/grub2/x86_64-efi
archs: x86_64

- mount_point: "/home"
fs_type: xfs
desired_size: 40 GiB
min_size: 10 GiB
max_size: unlimited
weight: 60

proposed: false
proposed_configurable: true
disable_order: 1

- mount_point: "swap"
fs_type: swap
desired_size: 2 GiB
min_size: 1 GiB
max_size: 2 GiB
weight: 10
size:
auto: true
outline:
required: true
auto_size:
base_min: 5 GiB
base_max: 20 GiB
snapshots_increment: 10 GiB
min_fallback_for:
- "/home"
- "/home"
snapshots_configurable: true

adjust_by_ram: false
adjust_by_ram_configurable: true

proposed_configurable: true
disable_order: 2
- mount_path: "/home"
filesystem: xfs
size:
auto: false
min: 10 GiB
max: unlimited
outline:
required: false

- mount_path: "swap"
filesystem: swap
size:
auto: false
min: 1 GiB
max: 2 GiB
outline:
required: false

Leap Micro:
software:
Expand All @@ -243,21 +244,17 @@ Leap Micro:
patterns: null

storage:
volumes:
- mount_point: "/"
fs_type: btrfs
desired_size: 20 GiB
min_size: 5 GiB
max_size: 20 GiB
fs_types:
- btrfs
weight: 20
snapshots: true
snapshots_configurable: false
proposed_configurable: false
btrfs_default_subvolume: "@"
btrfs_read_only: true
subvolumes:
volumes:
- "/"
- "/var"
volume_templates:
- mount_path: "/"
filesystem: btrfs
btrfs:
snapshots: true
read_only_root: true
default_subvolume: "@"
subvolumes:
- path: root
- path: home
- path: opt
Expand All @@ -275,17 +272,25 @@ Leap Micro:
archs: s390
- path: boot/grub2/x86_64-efi
archs: x86_64
- mount_point: "/var"
fs_type: btrfs
fs_types:
- btrfs
desired_size: 19 GiB
min_size: 5 GiB
max_size: unlimited
weight: 40
snapshots: false
snapshots_configurable: false
disable_order: 1
fallback_for_desired_size: "/"
fallback_for_max_size: "/"
fallback_for_weight: "/"

size:
auto: true
outline:
required: true
auto_size:
base_min: 5 GiB
base_max: 20 GiB
snapshots_increment: 10 GiB
min_fallback_for:
- "/var"
- "/var"
snapshots_configurable: false

- mount_path: "/var"
filesystem: btrfs
size:
auto: false
min: 5 GiB
max: unlimited
outline:
required: false

0 comments on commit 2f41a60

Please sign in to comment.