storage icon indicating copy to clipboard operation
storage copied to clipboard

GraphOptions mixes image store with additional image stores (which are not returned)

Open vrothberg opened this issue 1 year ago • 2 comments

Additional image stores are getting increasingly important for bootc. In https://github.com/containers/bootc/issues/644 I shared the desire to use podman info to query additional image stores to prevent bootc from parsing storage.conf files.

For testing, I configured /usr/share/containers/storage.conf as follows:

additionalimagestores = [
"/usr/lib/containers/storage",
"/var/lib/containers/storage",
"/var/lib/containers/storage123",
]

The returned data (sudo podman info --format=json | jq .store) looks as follows:

{
  "configFile": "/usr/share/containers/storage.conf",
  "containerStore": {
    "number": 0,
    "paused": 0,
    "running": 0,
    "stopped": 0
  },
  "graphDriverName": "overlay",
  "graphOptions": {
    "overlay.imagestore": "/var/lib/containers/storage123",
    "overlay.mountopt": "nodev,metacopy=on"
  },
  "graphRoot": "/var/lib/containers/storage",
  "graphRootAllocated": 106219679744,
  "graphRootUsed": 3021795328,
  "graphStatus": {
    "Backing Filesystem": "btrfs",
    "Native Overlay Diff": "false",
    "Supports d_type": "true",
    "Supports shifting": "true",
    "Supports volatile": "true",
    "Using metacopy": "true"
  },
  "imageCopyTmpDir": "/var/tmp",
  "imageStore": {
    "number": 2
  },
  "runRoot": "/run/containers/storage",
  "volumePath": "/var/lib/containers/storage/volumes",
  "transientStore": false
}

What I observe is that the overlay.imagestore points to the last entry in the list. That is because the "imagestore" key is returned three times and Podman takes the last one. However, an additional image store is not the "imagestore".

I suggest to fix that logic and add a new key for options.additionalimagestores.

Cc: @giuseppe

I may pick up the issue next week but feel free to assign it to someone else.

vrothberg avatar Sep 16 '24 09:09 vrothberg