Skip to content

[NRI] Containerd 2.0 passes "v2" as the runtime name instead of "containerd" #11485

@rogowski-piotr

Description

@rogowski-piotr

Description

After upgrading to containerd 2.0, the runtime name provided to NRI plugins and potentially other components is now "v2" instead of "containerd".

In containerd 1.7, the name variable was derived from:
source

import (
	"path"
	"github.com/containerd/containerd/version"
)

var name = path.Base(version.Package)  // name == "containerd"

With containerd 2.0:
source

import (
	"path"
	"github.com/containerd/containerd/v2/version"
)

var name = path.Base(version.Package)  // name == "v2"

This leads to "v2" being used as the runtime name instead of "containerd".

Breaking changes commit

Steps to reproduce the issue

  1. Use containerd 2.0
  2. Implement an NRI plugin with the following Configure() method example
  3. Print value of runtime variable:
func (p *plugin) Configure(_ context.Context, config, runtime, version string) (stub.EventMask, error) {
    fmt.Printf("Runtime name: %s\n", runtime) // <-- should be "containerd" instead of "v2"
...
}

Describe the results you received and expected

Expected:

  • The runtime name passed to components like NRI should be "containerd".

Received:

  • The runtime name is now "v2".

What version of containerd are you using?

v2.0.2

Any other relevant information

No response

Show configuration if it is related to CRI plugin.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions