Skip to content

Commit

Permalink
fix(instance) filter volume snapshots on selecting custom volume to a…
Browse files Browse the repository at this point in the history
…dd to an instance or profile. only show the custom volumes to select from. fixes #777
  • Loading branch information
edlerd committed May 23, 2024
1 parent 487ba59 commit a0e1cf9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/context/loadCustomVolumes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { fetchStoragePools, fetchStorageVolumes } from "api/storage-pools";
import { LxdStorageVolume } from "types/storage";
import { isSnapshot } from "util/storageVolume";

export const loadCustomVolumes = async (
project: string,
Expand All @@ -19,7 +20,7 @@ export const loadCustomVolumes = async (
const isFilesystemOrBlock = contentTypes.includes(volume.content_type);
const isCustom = volume.type === "custom";

if (isCustom && isFilesystemOrBlock) {
if (isCustom && isFilesystemOrBlock && !isSnapshot(volume)) {
result.push({ ...volume, pool: pool.name });
}
});
Expand Down

0 comments on commit a0e1cf9

Please sign in to comment.