Skip to content

Commit

Permalink
FIXUP - survive with stratis2
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer committed Aug 10, 2023
1 parent f1602c2 commit a958246
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/storaged/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ function stratis3_start() {

client.features.stratis = true;
client.features.stratis_crypto_binding = true;
client.features.stratis_grow_blockdevs = true;
client.stratis_pools = client.stratis_manager.client.proxies("org.storage.stratis3.pool." +
stratis3_interface_revision,
"/org/storage/stratis3",
Expand Down
2 changes: 1 addition & 1 deletion pkg/storaged/lvol-tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function get_resize_info(client, block, to_fit) {
grow_excuse = cockpit.format(_("$0 filesystems can not be made larger."),
block.IdType);
}
} else if (client.blocks_stratis_blockdev[block.path]) {
} else if (client.blocks_stratis_blockdev[block.path] && client.features.stratis_grow_blockdevs) {
info = {
can_shrink: false,
can_grow: true,
Expand Down
6 changes: 5 additions & 1 deletion pkg/storaged/stratis-details.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ import { std_reply, with_keydesc, with_stored_passphrase, confirm_tang_trust, ge
const _ = cockpit.gettext;

export function check_stratis_warnings(client, enter_warning) {
if (!client.features.stratis_grow_blockdevs)
return;

for (const p in client.stratis_pools) {
const blockdevs = client.stratis_pool_blockdevs[p] || [];
if (blockdevs.some(bd => bd.NewPhysicalSize[0] && Number(bd.NewPhysicalSize[1]) > Number(bd.TotalPhysicalSize)))
Expand Down Expand Up @@ -199,7 +202,8 @@ export const StratisPoolDetails = ({ client, pool }) => {
}

let alert = null;
if (blockdevs.some(bd => bd.NewPhysicalSize[0] && Number(bd.NewPhysicalSize[1]) > Number(bd.TotalPhysicalSize))) {
if (client.features.stratis_grow_blockdevs &&
blockdevs.some(bd => bd.NewPhysicalSize[0] && Number(bd.NewPhysicalSize[1]) > Number(bd.TotalPhysicalSize))) {
alert = (<Alert key="unused-space"
isInline
variant="warning"
Expand Down
1 change: 1 addition & 0 deletions test/verify/check-storage-hidden
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class TestStorageHiddenLuks(storagelib.StorageCase):

# Now the filesystem is hidden because the LUKS device is
# locked. Doubly hide it by deactivating /dev/TEST/lvol
testlib.sit()
self.content_dropdown_action(1, "Deactivate")
self.content_row_wait_in_col(1, 2, "Inactive volume")

Expand Down

0 comments on commit a958246

Please sign in to comment.