Skip to content

nri,deprecation: record and emit warnings for NRI deprecations. - #13916

Merged
samuelkarp merged 1 commit into
containerd:mainfrom
klihub:devel/record-nri-deprecations
Aug 7, 2026
Merged

nri,deprecation: record and emit warnings for NRI deprecations.#13916
samuelkarp merged 1 commit into
containerd:mainfrom
klihub:devel/record-nri-deprecations

Conversation

@klihub

@klihub klihub commented Aug 7, 2026

Copy link
Copy Markdown
Member

Record a deprecation and emit a warning for old/unrecompiled plugins using deprecated NRI interfaces.

Copilot AI lite review requested due to automatic review settings August 7, 2026 10:04
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review Aug 7, 2026
@klihub
klihub requested review from mikebrow and samuelkarp August 7, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class tracking for deprecated NRI plugin interface usage by wiring the NRI subsystem into containerd’s deprecation warning service, so older/unrecompiled plugins can be detected and surfaced as deprecation warnings.

Changes:

  • Add a new deprecation warning ID (io.containerd.deprecation/nri-plugin-interface) and message.
  • Plumb the plugins.WarningPlugin service into NRI initialization and register an NRI deprecation recorder.
  • Introduce an NRI deprecation recorder that emits a warning (and logs) when deprecated NRI interfaces are used.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
plugins/nri/plugin.go Adds WarningPlugin as a dependency and passes the warning service into NRI initialization.
pkg/deprecation/deprecation.go Introduces the NRIPluginInterface deprecation warning ID and message.
internal/nri/nri.go Updates New signature to accept warning.Service and registers a deprecation recorder option.
internal/nri/deprecations.go Implements the NRI deprecation recorder that emits/records warnings for deprecated interfaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/nri/deprecations.go Outdated
Comment thread internal/nri/nri.go
)

cfg.ConfigureTimeouts()
opts = append(opts, nri.WithDeprecationRecorder(&recorder{ws: ws}))
Copilot AI review requested due to automatic review settings August 7, 2026 14:31
@klihub
klihub force-pushed the devel/record-nri-deprecations branch from 0e73d21 to 571ad67 Compare August 7, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

pkg/deprecation/deprecation.go:69

  • The new deprecation warning message is much less actionable than other entries in this map and also loses the specific guidance from the upstream NRI deprecation log (deprecated StateChange + recommendation to update/recompile plugins). Consider making the message explicitly describe the deprecated interface and what the operator should do.
	NRIPluginInterface: "NRI plugin uses a deprecated interface.",

internal/nri/deprecations.go:42

  • The new deprecation recorder behavior (emitting the warning service event on DeprecatedStateChange, and not emitting for unknown deprecations) is currently untested. Since this affects operator-visible warnings, please add unit tests for PluginWarning (e.g., with a small fake warning.Service that records emitted IDs) to prevent regressions.
func (r *recorder) PluginWarning(ctx context.Context, d nri.Deprecation, plugin, details string) {
	switch d {
	case nri.DeprecatedStateChange:
		r.ws.Emit(ctx, deprecation.NRIPluginInterface)
		msg, _ := deprecation.Message(deprecation.NRIPluginInterface)
		log.G(ctx).WithFields(log.Fields{
			"deprecated": "StateChange",
			"plugin":     plugin,
			"details":    details,
		}).Warn(msg)

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@mikebrow
mikebrow force-pushed the devel/record-nri-deprecations branch from 571ad67 to bf0111a Compare August 7, 2026 15:39

@mikebrow mikebrow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikebrow mikebrow added the cherry-pick/2.3.x Change to be cherry picked to release/2.3 label Aug 7, 2026
@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Aug 7, 2026
@samuelkarp
samuelkarp added this pull request to the merge queue Aug 7, 2026
Merged via the queue into containerd:main with commit 76bcc3f Aug 7, 2026
51 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Aug 7, 2026
@mikebrow

Copy link
Copy Markdown
Member

/cherry-pick release/2.3

@k8s-infra-cherrypick-robot

Copy link
Copy Markdown

@mikebrow: new pull request created: #13935

Details

In response to this:

/cherry-pick release/2.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mikebrow mikebrow added cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch and removed cherry-pick/2.3.x Change to be cherry picked to release/2.3 labels Aug 10, 2026
@klihub
klihub deleted the devel/record-nri-deprecations branch August 11, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/2.3.x PR commits are cherry picked into release/2.3 branch size/M

Projects

Development

Successfully merging this pull request may close these issues.

5 participants