Skip to content

Commit

Permalink
Use all projects parameter to resolve image fingerprints in permissio…
Browse files Browse the repository at this point in the history
…n config (#1017)

## Done

- Use all projects parameter to resolve image fingerprints in permission
config
- Show project for images in permission selector
- Since canonical/lxd#14126 got merged, this
is now unblocked. For older versions (non latest/edge) the parameter
won't harm so we don't need to consume the api extension for this
feature.

## QA

1. Run the LXD-UI:
- On the demo server via the link posted by @webteam-app below. This is
only available for PRs created by collaborators of the repo. Ask
@mas-who or @edlerd for access.
- With a local copy of this branch, [build and run as described in the
docs](../CONTRIBUTING.md#setting-up-for-development).
2. Perform the following QA steps:
- configure image permissions for a lxd deployment that has images in
different projects
- the images from all projects should be resolved to names in the
permission selection and editing when assigning permissions to groups.
  • Loading branch information
edlerd authored Nov 29, 2024
2 parents 02e668d + 2afc11f commit fa007c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/api/images.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const fetchImage = (

export const fetchImageList = (project?: string): Promise<LxdImage[]> => {
const url =
"/1.0/images?recursion=1" + (project ? `&project=${project}` : "");
"/1.0/images?recursion=1" +
(project ? `&project=${project}` : "&all-projects=1");
return new Promise((resolve, reject) => {
fetch(url)
.then(handleResponse)
Expand Down
4 changes: 2 additions & 2 deletions src/util/permissions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,15 @@ export const enablePermissionsFeature = (): boolean => {
// each resource type has specific columns to display, which should uniquely identify the resource
export const getResourceOptionColumns = (type: string) => {
const resourceOptionColumns: Record<string, (keyof ResourceDetail)[]> = {
image: ["description", "aliases", "fingerprint", "imageType"],
image: ["description", "aliases", "fingerprint", "imageType", "project"],
image_alias: ["name", "project"],
instance: ["name", "project"],
network: ["name", "project"],
network_acl: ["name", "project"],
network_zone: ["name", "project"],
profile: ["name", "project"],
storage_bucket: ["name", "project"],
storage_volume: ["name", "project", "pool"],
storage_volume: ["name", "pool", "project"],
default: ["name"],
};

Expand Down

0 comments on commit fa007c4

Please sign in to comment.