Merge pull request #9764 from Fish-pro/patch-1

Clean up repeated package import
This commit is contained in:
Derek McGowan 2024-02-07 05:53:38 +00:00 committed by GitHub
commit 79a3b20a63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,6 @@
package run package run
import ( import (
"context"
gocontext "context" gocontext "context"
"errors" "errors"
"fmt" "fmt"
@ -465,7 +464,7 @@ func getNetNSPath(_ gocontext.Context, task containerd.Task) (string, error) {
// This is used from the `run` command to avoid creating a registry with auto-refresh enabled. // This is used from the `run` command to avoid creating a registry with auto-refresh enabled.
// It also provides a way to override the CDI spec file paths if required. // It also provides a way to override the CDI spec file paths if required.
func withStaticCDIRegistry() oci.SpecOpts { func withStaticCDIRegistry() oci.SpecOpts {
return func(ctx context.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error { return func(ctx gocontext.Context, _ oci.Client, _ *containers.Container, s *oci.Spec) error {
registry := cdi.GetRegistry(cdi.WithAutoRefresh(false)) registry := cdi.GetRegistry(cdi.WithAutoRefresh(false))
if err := registry.Refresh(); err != nil { if err := registry.Refresh(); err != nil {
// We don't consider registry refresh failure a fatal error. // We don't consider registry refresh failure a fatal error.