-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat(oci): add new package with store implementation #2332
Conversation
Uffizzi Ephemeral Environment
|
Codecov Report
@@ Coverage Diff @@
## gm/fs-oci #2332 +/- ##
=============================================
- Coverage 70.94% 70.83% -0.12%
=============================================
Files 78 79 +1
Lines 7456 7613 +157
=============================================
+ Hits 5290 5393 +103
- Misses 1865 1906 +41
- Partials 301 314 +13
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wicket wicked 🧙🏻♀️
internal/config/storage.go
Outdated
return fmt.Errorf("getting user state dir: %w", err) | ||
} | ||
|
||
imageDir := filepath.Join(configDir, "flipt", "bundles") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we should have a helper func that we use to get the flipt
state dir, since we do it here now and i think in a couple other places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a commit for this. See what you think.
|
||
if mediaType != MediaTypeFliptNamespace { | ||
return nil, fmt.Errorf("layer %q: type %q: %w", layer.Digest, mediaType, ErrUnexpectedMediaType) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm when would this line happen? This is if they were to point towards an image that isnt flipt related I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be if the OCI image was malformed. Someone had written a layer in that we dont currently expect.
We're only going to support this kind of layer for now in an OCI artifact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Supports #2296
Fixes FLI-660
This adds a new package
oci
with a single typeStore
.The store manages reading from the new Flipt bundle OCI format.
It will be consumed by the new
oci.Source
type in a subsequent PR.It supports fetching with an optional
IfNoMatch
digest.The source will provide the previously observed digest between subsequent fetches.
Then it will skip producing a new snapshot when
Matched == true
as this means the reference hasn't changed contents target. It does so even in the face of created at timestamp change. It purely focusses on the contents state.