From 23ca0e1ef23ce6e50c1b43300dc8e97885f3ff0a Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Mon, 6 Apr 2026 18:10:15 -0700 Subject: [PATCH] skip invoking toolkit.Install when NRI Plugin is enabled Signed-off-by: Tariq Ibrahim --- cmd/nvidia-ctk-installer/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/nvidia-ctk-installer/main.go b/cmd/nvidia-ctk-installer/main.go index 3ca251ef6..624d3a41a 100644 --- a/cmd/nvidia-ctk-installer/main.go +++ b/cmd/nvidia-ctk-installer/main.go @@ -283,9 +283,14 @@ func (a *app) Run(ctx context.Context, c *cli.Command, o *options) error { o.toolkitOptions.ContainerRuntimeRuntimes = lowlevelRuntimePaths } - err = a.toolkit.Install(c, &o.toolkitOptions, o.runtime) - if err != nil { - return fmt.Errorf("unable to install toolkit: %v", err) + // Skip installing toolkit artifacts if NRI Plugin is enabled. This allows for the switch to transition to NRI plugin + // mode in an already running cluster, as the previous toolkit config toml can continue to be used. This is required + // when deleting pods that reference the runtime classes made stale since the switch to NRI Plugin mode. + if !o.enableNRIPlugin { + err = a.toolkit.Install(c, &o.toolkitOptions, o.runtime) + if err != nil { + return fmt.Errorf("unable to install toolkit: %w", err) + } } err = runtimeConfigurer.Setup(c, &o.runtimeOptions)