Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Correctly store Excluded manifests #1304

Merged
merged 1 commit into from
Sep 12, 2018
Merged

Conversation

squaremo
Copy link
Member

I noticed that fluxd was continually fetching image manifests that
were "excluded", that is, had the wrong arch or otherwise weren't
suitable.

The design in #1265 was to mark those manifests as excluded, but count
them as successful fetches; and, to save the fact in memcached. The
implementation failed on three counts:

  • it would unconditionally use a cached result, even if excluded;

  • it was using the ID from excluded results (which have no ID value)
    as a key, so they got effectively thrown away anyway;

  • the encoding of results to JSON omitted the ExcludedReason field,
    because they embed the image.Info struct and thus inherit its JSON
    encoding methods.

This commit corrects those problems.

I noticed that fluxd was continually fetching image manifests that
were "excluded", that is, had the wrong arch or otherwise weren't
suitable.

The design in #1265 was to mark those manifests as excluded, but count
them as successful fetches; and, to save the fact in memcached. The
implementation failed on three counts:

 - it would unconditionally use a cached result, even if excluded;

 - it was using the ID from excluded results (which have no ID value)
   as a key, so they got effectively thrown away anyway;

 - the encoding of results to JSON omitted the ExcludedReason field,
   because they embed the image.Info struct and thus inherit its JSON
   encoding methods.

This commit corrects those problems.
@squaremo squaremo requested a review from aaron7 August 23, 2018 10:24
@squaremo squaremo requested a review from rndstr August 31, 2018 15:22
@squaremo
Copy link
Member Author

@rndstr Would you have a look at this when you have some review-time, please?

Copy link
Contributor

@rndstr rndstr left a comment

Choose a reason for hiding this comment

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

code checks out doing what the description says it should ✌️

@squaremo squaremo merged commit ec2178b into master Sep 12, 2018
@squaremo squaremo deleted the rewrite/image-fetch-backoff branch September 12, 2018 09:13
@squaremo
Copy link
Member Author

Thanks for the review, Roli 🍏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants