Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/cli/image/imagesource/file: Use relative paths in symlinks #348

Closed

Conversation

wking
Copy link
Member

@wking wking commented Mar 15, 2020

Fix:

$ oc version --client
Client Version: openshift-clients-4.3.0-201910250623-88-g6a937dfe
$ oc adm release mirror --to-dir=mirror quay.io/openshift-release-dev/ocp-release:4.3.0-x86_64
To upload local images to a registry, run:

    oc image mirror --from-dir=mirror file://openshift/release:4.3.0* REGISTRY/REPOSITORY

$ oc image mirror --from-dir=mirror file://openshift/release:4.3.0* registry.svc.ci.openshift.org/wking/whatever
error: you must specify at least one source image to pull and the destination to push to as SRC=DST or SRC DST [DST2 DST3 ...]
$ ls -l mirror/v2/openshift/release/manifests/
total 808
lrwxrwxrwx. 1 wking wking  109 Mar 12 21:27 4.3.0 -> mirror/v2/openshift/release/manifests/sha256:3a516480dfd68e0f87f702b4d7bdd6f6a0acfdac5cd2e9767b838ceede34d70d
...

when that symlinks should really be 4.3.0 -> sha256:3a516480... (in the same directory).

This allows for relative paths in --to-dir, but even with absolute paths in --to-dir, there is a benefit to creating a directory structure that can be shifted around (e.g. unmounted and then remounted to a different location) without breaking the symlinks.

Fix:

  $ oc version --client
  Client Version: openshift-clients-4.3.0-201910250623-88-g6a937dfe
  $ oc adm release mirror --to-dir=mirror quay.io/openshift-release-dev/ocp-release:4.3.0-x86_64
  To upload local images to a registry, run:

      oc image mirror --from-dir=mirror file://openshift/release:4.3.0* REGISTRY/REPOSITORY

  $ oc image mirror --from-dir=mirror file://openshift/release:4.3.0* registry.svc.ci.openshift.org/wking/whatever
  error: you must specify at least one source image to pull and the destination to push to as SRC=DST or SRC DST [DST2 DST3 ...]
  $ ls -l mirror/v2/openshift/release/manifests/
  total 808
  lrwxrwxrwx. 1 wking wking  109 Mar 12 21:27 4.3.0 -> mirror/v2/openshift/release/manifests/sha256:3a516480dfd68e0f87f702b4d7bdd6f6a0acfdac5cd2e9767b838ceede34d70d
  ...

when that symlinks should really be 4.3.0 -> sha256:3a516480... (in
the same directory).

This allows for relative paths in --to-dir, but even with absolute
paths in --to-dir, there is a benefit to creating a directory
structure that can be shifted around (e.g. unmounted and then
remounted to a different location) without breaking the symlinks.
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wking
To complete the pull request process, please assign mfojtik
You can assign the PR to them by writing /assign @mfojtik in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot
Copy link

@wking: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws 1657d18 link /test e2e-aws

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@shaneboulden
Copy link
Contributor

Is this the same functionality as #317?

@soltysh
Copy link
Member

soltysh commented Mar 17, 2020

I'll leave it up to @smarterclayton to pick which solution he prefers
/assign @smarterclayton

@smarterclayton
Copy link
Contributor

#317 was preferred.

@soltysh soltysh closed this Mar 24, 2020
@wking wking deleted the image-to-disk-relative-tag-symlinks branch March 30, 2020 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants