Skip to content

Create temporary registry cache alongside intended destination#1183

Merged
jromero merged 1 commit intobuildpacks:mainfrom
briandealwis:patch-1
May 13, 2021
Merged

Create temporary registry cache alongside intended destination#1183
jromero merged 1 commit intobuildpacks:mainfrom
briandealwis:patch-1

Conversation

@briandealwis
Copy link
Copy Markdown
Contributor

Summary

Cause the temporary registry cache to be created alongside its eventual destination. If creating the temp directory fails, then the rename will likely fail too.

Before

$ TMPDIR=/run/user/609477/ pack build --builder=gcr.io/buildpacks/builder:v1 --buildpack=google.go.runtime@0.9.1 --buildpack google.go.build@0.9.0 --buildpack google.utils.label@0.0.1 --buildpack=cage1016/jq-cnb@1.1.0  -v testimg
[...[
Refreshing registry cache for github.com//buildpacks/registry-index
Creating registry cache for github.com//buildpacks/registry-index
ERROR: failed to build: locating in registry cage1016/jq-cnb@1.1.0: refreshing cache: initializing (/usr/local/google/home/bdealwis/.pack/registry-a932275bd19c2d9e1b88fa06698fd2f5427a363d25bf87fa500691c373089381): creating registry cache: rename /run/user/609477/registry038609750 /usr/local/google/home/bdealwis/.pack/registry-a932275bd19c2d9e1b88fa06698fd2f5427a363d25bf87fa500691c373089381: invalid cross-device link

After

$ TMPDIR=/run/user/609477/ ~/Projects/Buildpacks/repo-pack/pack build --builder=gcr.io/buildpacks/builder:v1 --buildpack=google.go.runtime@0.9.1 --buildpack google.go.build@0.9.0 --buildpack google.utils.label@0.0.1 --buildpack=cage1016/jq-cnb@1.1.0  -v testimg
[...]
Refreshing registry cache for github.com//buildpacks/registry-index
Creating registry cache for github.com//buildpacks/registry-index
Validating registry cache for github.com//buildpacks/registry-index
Creating registry cache for github.com//buildpacks/registry-index
Pulling image ghcr.io/cage1016/buildpacks/cage1016_jq-cnb@sha256:48755cd2fb2a18d9f6553791337d0141b220c69d711cbd8383f2cc94a0bcbb7e
[...continues to success...]

Documentation

  • Should this change be documented?
    • Yes, see #___
    • No

Related

Resolves #1182

@briandealwis briandealwis requested a review from a team as a code owner May 12, 2021 15:03
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label May 12, 2021
@github-actions github-actions Bot added this to the 0.19.0 milestone May 12, 2021
Fixes buildpacks#1182

Signed-off-by: Brian de Alwis <bdealwis@google.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2021

Codecov Report

Merging #1183 (6d431d5) into main (4037c9c) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1183   +/-   ##
=======================================
  Coverage   80.83%   80.83%           
=======================================
  Files         136      136           
  Lines        8278     8278           
=======================================
  Hits         6691     6691           
  Misses       1159     1159           
  Partials      428      428           
Flag Coverage Δ
os_linux 80.38% <100.00%> (-0.04%) ⬇️
os_macos 77.95% <100.00%> (ø)
os_windows 80.75% <100.00%> (ø)
unit 80.43% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@jromero jromero added type/bug Issue that reports an unexpected behaviour. and removed type/enhancement Issue that requests a new feature or improvement. labels May 13, 2021
@jromero
Copy link
Copy Markdown
Member

jromero commented May 13, 2021

Thank you for the fix!

TIL: Rename limitations 😁

@jromero jromero merged commit ac36b52 into buildpacks:main May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug Issue that reports an unexpected behaviour.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building with explicit list of buildpacks may fail with invalid cross-device link

2 participants