Merge pull request #393 from abhi/labels

Adding kube pod and container labels to containerd
This commit is contained in:
Lantao Liu
2017-11-07 23:39:20 -08:00
committed by GitHub
3 changed files with 15 additions and 2 deletions

View File

@@ -223,6 +223,7 @@ func (c *criContainerdService) CreateContainer(ctx context.Context, r *runtime.C
if seccompSpecOpts != nil {
specOpts = append(specOpts, seccompSpecOpts)
}
containerLabels := buildLabels(config.Labels, containerKindContainer)
opts = append(opts,
containerd.WithSpec(spec, specOpts...),
@@ -232,7 +233,7 @@ func (c *criContainerdService) CreateContainer(ctx context.Context, r *runtime.C
Runtime: c.config.ContainerdConfig.RuntimeEngine,
RuntimeRoot: c.config.ContainerdConfig.RuntimeRoot,
SystemdCgroup: c.config.SystemdCgroup}), // TODO (mikebrow): add CriuPath when we add support for pause
containerd.WithContainerLabels(map[string]string{containerKindLabel: containerKindContainer}),
containerd.WithContainerLabels(containerLabels),
containerd.WithContainerExtension(containerMetadataExtension, &meta))
var cntr containerd.Container
if cntr, err = c.client.NewContainer(ctx, id, opts...); err != nil {