Commit Graph

14 Commits

Author SHA1 Message Date
Sascha Grunert d0597a31b6
Fix ffjson compilation
The ffjson generated sources were broken since quite some time, which is
now fixed again.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-31 10:15:20 +01:00
Sascha Grunert ecb04cf484
Add names-history support
This commit adds a new `NamesHistory` field to the `images.json`, which
is basically a deduped list of names the image had in the past. The
first entry of the list is the latest history entry.

The main use case for this feature is to tell the end-user which
names/tags an image had in the past if it does not contain any `names`
any more.

Detailed use case:
1. Pulling `image:v1` into the local registry: `names: [ "image:v1" ]`
2. Pushing a new image as `image:v1` into the remote registry
3. Pulling `image:v1` again into the local registry:
    - first image: `names: [ "image:v1" ]`
    - previous v1 image: `names: [], names-history: [ "image:v1" ]`
4. An consumer of the storage API can now process the image name and
   still display `image` as REPOSITORY, like:
   * Before:
   ```
   > podman images
   REPOSITORY      TAG      IMAGE ID       CREATED          SIZE
   image           v1       25b62d1b654a   13 seconds ago   2.07 kB
   <none>          <none>   b134eff7b955   17 seconds ago   2.07 kB
   ```
   * After:
   ```
   > podman images
   REPOSITORY      TAG      IMAGE ID       CREATED          SIZE
   image           v1       25b62d1b654a   13 seconds ago   2.07 kB
   image           <none>   b134eff7b955   17 seconds ago   2.07 kB
   ```
5. Since the `NamesHistory` is a slice we would be able to tell the
   end-user which names an image ID had before.

The change should be backwards compatible with previous versions of
containers/storage.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-11-11 10:21:14 +01:00
Nalin Dahyabhai 700d058d71 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-09-25 10:44:01 -04:00
Valentin Rothberg 8017d7a735 add digest locks
Add a method to generate a lock file for a specific digest.  Such a
digest-specific lock file is needed to synchronize threads and processes
when copying blobs from a registry to the containers-storage.

Whenever a layer is about to get copied, the lock must be acquired which
indicates to other processes and threads that the layer/blob is already
being copied.

To avoid leaking file descriptors for long-living users of
containers/storage, such as CRI-O, open and close the file on demand
during Lock() and Unlock().  The internal reference counters allows to
determine if we are the first or last user.

Note: as deleting the lock files is subject to race conditions, we place
the lock files in a graph-specific directory in the runroot.  Since the
runroot is a tmpfs, the files will be cleanup during reboot.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-03-28 09:53:02 +01:00
Nalin Dahyabhai 852c5a4a5d Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-03-06 15:06:35 -05:00
Nalin Dahyabhai 096e5b23e7 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-02-07 10:27:36 -05:00
Nalin Dahyabhai e87802be3e Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-01-17 14:30:04 -05:00
Nalin Dahyabhai e358e50c67 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-05-30 17:18:10 -04:00
Nalin Dahyabhai 0a4c1e32ca Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-05-07 10:38:17 -04:00
Nalin Dahyabhai 08b614b4c8 Update generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-04-03 10:34:32 -04:00
Nalin Dahyabhai 986c508887 Update ffjson-generated files
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-03-07 17:07:39 -05:00
Nalin Dahyabhai 1824cf917a Add explicitly-settable digest values for images
Add explicitly-settable digest values for images that are treated mostly
like the implicit digests that we track for manifests, for the sake of
v1 images which have manifests that need to be preprocessed before being
digested to produce an image's digest value.  We'll still have the
digest of the unprocessed manifest, but that shouldn't hurt.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-12-11 16:16:46 -05:00
Nalin Dahyabhai 2a564455fd Add a notion of image "digests" based on their "manifest" data
Add a "digest" of an image that is equal to the digest of its big data
item named "manifest", if it has one, that we can index and use for
locating images.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-11-16 11:52:25 -05:00
Nalin Dahyabhai f109e5ac0c Make sure layers_ffjson.go is always current
Add a rule to make sure that layers_ffjson.go is regenerated whenever
we've updated layers.go, and do the same for images.go and containers.go.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-10-13 14:18:40 -04:00