Allow opts to flow to the backend snapshotter during snapshot creation.#3055
Allow opts to flow to the backend snapshotter during snapshot creation.#3055crosbymichael merged 1 commit intocontainerd:masterfrom ehotinger:ehotinger/flow-opts
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3055 +/- ##
==========================================
+ Coverage 44.75% 44.83% +0.07%
==========================================
Files 113 113
Lines 12513 12531 +18
==========================================
+ Hits 5600 5618 +18
Misses 6057 6057
Partials 856 856
Continue to review full report at Codecov.
|
|
The options need to be filtered. The pass through should be done based on whether the metadata sees labels that should apply to the backend and not just to the namespace. In the design issue I mentioned doing this based on prefixing, such as |
|
Makes sense. I didn't see #2907 before this, looks like I just hit the same problem. I'll rework it a bit to make it upstream-friendly. |
|
@dmcgowan was busy doing other things recently, but I'll get back to this now. Just to clarify, you just want a simple filter func that does a |
|
@ehotinger yes, I believe you are on the right track; @dmcgowan can confirm. We also need to document these prefixes somewhere so this design is clear to implementers/users. |
|
Yeah just let me know what you guys want and I can add in the filter + rebase. |
|
@ehotinger - Took me a minute to capture @dmcgowan's ask here. I believe to satisfy what @estesp said about documentation and to satisfy only forwarding Update: https://github.com/containerd/containerd/blob/master/snapshots/snapshotter.go#L92 // Labels for a snapshot
//
// Note: that only labels prefixed with `containerd.io/snapshot/` will be forwarded to the
// snapshotter's `Prepare`, `View`, or `Commit` calls.
Labels map[string]string `json:",omitempty"`And then in: We only forward func toSnapshotterLabels(labels map[string]string) map[string]string {
m := make(map[string]string)
for k, v := range labels {
if strings.HasPrefix(k, "containerd.io/snapshot/") {
m[k] = v
}
}
return m
}So basically, persist all labels, forward only prefix |
|
@jterry75 yeah I'm not sure still. The opts are being passed along with |
The interface does not allow passing the full spec. I think the way to do that would be to add the additional |
|
Build succeeded.
|
|
@ehotinger - Did you forget to add your changes? This is the same commit force-pushed ? |
|
@jterry75 I force-pushed just to do a rebase initially. 😃 I force-pushed again now with the changes.
|
|
Build succeeded.
|
|
@estesp - PTAL |
|
Test failure seems unrelated/flaky |
Error is for sure not related to this change. It failed in cri test |
|
@crosbymichael - How do you feel about this one as well? |
|
Code looks good, the only thing I would change is the terminology. fowarded/passthrought to just |
Signed-off-by: Eric Hotinger <[email protected]>
|
@crosbymichael I changed the terminology to "inherited" across the board, it seemed to fit better than "inherit" to me; PTAL - let me know if anything can be improved. Naming things is hard. 😄 |
|
Build succeeded.
|
|
LGTM |
/cc @dmcgowan
Closes #2907
Signed-off-by: Eric Hotinger [email protected]