diff --git a/pkg/apiserver/registry/system/supportbundle/rest.go b/pkg/apiserver/registry/system/supportbundle/rest.go index f855f695b12..222bacf66c7 100644 --- a/pkg/apiserver/registry/system/supportbundle/rest.go +++ b/pkg/apiserver/registry/system/supportbundle/rest.go @@ -159,7 +159,9 @@ func (r *supportBundleREST) Create(ctx context.Context, obj runtime.Object, _ re r.cache = b } }() - r.clean(ctx, b.Filepath, bundleExpireDuration) + if b != nil { + r.clean(ctx, b.Filepath, bundleExpireDuration) + } }() return r.cache, nil