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

Add Cache From feature #467

Merged
merged 4 commits into from
Jan 27, 2023
Merged

Add Cache From feature #467

merged 4 commits into from
Jan 27, 2023

Conversation

guineveresaenger
Copy link
Contributor

@guineveresaenger guineveresaenger commented Jan 27, 2023

Fixes #427
Fixes #426

The v3.x.x implementation of cacheFrom did not properly reflect its use as a Docker command flag.
This pull request enables the cacheFrom type on the build type of docker.Image resource.
It accepts a list of images that can be pulled from an authenticated registry to serve as a build cache.
These images must have caching metadata information associated; otherwise Docker won't find them and build without cache.

This PR in its current state removes the OneOf implementation for cacheFrom, requiring the developer to explicitly add any image names to the images list. I am happy to revert this removal if we consider it necessary.

There is also a slight tweak to log handling output to avoid printing bytes 😅

  • re-schematize cacheFrom to properly reflect its use in the context of Docker
  • Remove bool logic and update test to reflect new field name
  • Enable cache-from
  • Generate SDKS

Adds support for specifying images to use as a pull cache from a remote
registry.
Additionally adds log output to support surfacing of errors when cache pull is not
possible.
@guineveresaenger guineveresaenger requested a review from a team January 27, 2023 01:09
@github-actions
Copy link

Does the PR have any schema changes?

Found 2 breaking changes:
Type "docker:index/dockerBuild:DockerBuild" input "cacheFrom" type changed from "" to "#/types/docker:index/cacheFrom:CacheFrom"
Type "docker:index/cacheFrom:CacheFrom" missing property "stages"
No new resources/functions.

Copy link
Contributor

@aq17 aq17 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

Image: Deprecate OneOf implementation for cacheFrom Image: Implement behavior for cacheFrom
2 participants