From cdb2f9c66f1f9e27de3ebb64f429c68eaafe1a14 Mon Sep 17 00:00:00 2001 From: Daniel Canter Date: Thu, 15 Oct 2020 04:49:39 -0700 Subject: [PATCH] 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 --- pkg/cri/server/container_create.go | 2 +- pkg/cri/server/sandbox_run.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cri/server/container_create.go b/pkg/cri/server/container_create.go index eab05bf50..9360ba056 100644 --- a/pkg/cri/server/container_create.go +++ b/pkg/cri/server/container_create.go @@ -181,7 +181,7 @@ func (c *criService) CreateContainer(ctx context.Context, r *runtime.CreateConta log.G(ctx).Debugf("Container %q spec: %#+v", id, spew.NewFormatter(spec)) - snapshotterOpt := snapshots.WithLabels(config.Annotations) + snapshotterOpt := snapshots.WithLabels(snapshots.FilterInheritedLabels(config.Annotations)) // Set snapshotter before any other options. opts := []containerd.NewContainerOpts{ containerd.WithSnapshotter(c.config.ContainerdConfig.Snapshotter), diff --git a/pkg/cri/server/sandbox_run.go b/pkg/cri/server/sandbox_run.go index df27bf2e5..909122672 100644 --- a/pkg/cri/server/sandbox_run.go +++ b/pkg/cri/server/sandbox_run.go @@ -192,7 +192,7 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox return nil, errors.Wrap(err, "failed to generate runtime options") } - snapshotterOpt := snapshots.WithLabels(config.Annotations) + snapshotterOpt := snapshots.WithLabels(snapshots.FilterInheritedLabels(config.Annotations)) opts := []containerd.NewContainerOpts{ containerd.WithSnapshotter(c.config.ContainerdConfig.Snapshotter), customopts.WithNewSnapshot(id, containerdImage, snapshotterOpt),