Skip to content

Commit cdb2f9c

Browse files
committed
Filter snapshotter labels passed to WithNewSnapshot
Made a change yesterday that passed through snapshotter labels into the wrapper of WithNewSnapshot, but it passed the entirety of the annotations into the snapshotter. This change just filters the set that we care about down to snapshotter specific labels. Will probably be future changes to add some more labels for LCOW/WCOW and the corresponding behavior for these new labels. Signed-off-by: Daniel Canter <[email protected]>
1 parent 22aea1e commit cdb2f9c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pkg/cri/server/container_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta
181181

182182
log.G(ctx).Debugf("Container %q spec: %#+v", id, spew.NewFormatter(spec))
183183

184-
snapshotterOpt := snapshots.WithLabels(config.Annotations)
184+
snapshotterOpt := snapshots.WithLabels(snapshots.FilterInheritedLabels(config.Annotations))
185185
// Set snapshotter before any other options.
186186
opts := []containerd.NewContainerOpts{
187187
containerd.WithSnapshotter(c.config.ContainerdConfig.Snapshotter),

pkg/cri/server/sandbox_run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
192192
return nil, errors.Wrap(err, "failed to generate runtime options")
193193
}
194194

195-
snapshotterOpt := snapshots.WithLabels(config.Annotations)
195+
snapshotterOpt := snapshots.WithLabels(snapshots.FilterInheritedLabels(config.Annotations))
196196
opts := []containerd.NewContainerOpts{
197197
containerd.WithSnapshotter(c.config.ContainerdConfig.Snapshotter),
198198
customopts.WithNewSnapshot(id, containerdImage, snapshotterOpt),

0 commit comments

Comments
 (0)