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

if nothing to build, do not push #3876

Merged
merged 1 commit into from Nov 20, 2022

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Nov 15, 2022

Signed-off-by: Avi Deitcher avi@deitcher.net

- What I did

With the earlier PR #3863 , for pkg build, if the image exists in the remote registry we don't bother pulling it unless they explicitly requested --pull. This is much more efficient.

However, this might break pkg push in the following scenario:

  1. lkt pkg push pkg/foo
  2. The image is not in cache at all, but is entirely in registry
  3. Nothing gets built (correctly), nothing gets pulled (correctly)
  4. It now tries to push from cache and finds nothing there.
  5. This fixes it so that it does not try to push if it did not build anything or find anything local

- How I did it

Added logic to check if we built anything or found anything locally.

I would add that there might be a cleaner way to do this, specifically just check before pushing, "do we have anything in cache". The net result, though, is the same.

- How to verify it

CI

- Description for the changelog

Handle pkg push when nothing is built or pulled.

Signed-off-by: Avi Deitcher <avi@deitcher.net>
Copy link
Contributor

@giggsoff giggsoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It solves the problems in CI of EVE-OS (at least on my fork with updated linuxkit and removal of additional pull steps before push).

@deitch deitch merged commit bbd6231 into linuxkit:master Nov 20, 2022
@deitch deitch deleted the fix-push-without-pull branch November 20, 2022 15:29
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

2 participants