Chore: Use Kind().GroupVersionResource() (#113133)

This commit is contained in:
Ryan McKinley
2025-10-28 14:54:10 -07:00
committed by GitHub
parent 329d6a11fa
commit d72e048bfe
11 changed files with 27 additions and 102 deletions
+1 -6
View File
@@ -14,7 +14,6 @@ import (
k8serrors "k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
"github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
@@ -326,11 +325,7 @@ func (srv *CleanUpService) deleteStaleKubernetesShortURLs(ctx context.Context) {
}
// Set up the GroupVersionResource for shortURLs
gvr := schema.GroupVersionResource{
Group: v1alpha1.ShortURLKind().Group(),
Version: v1alpha1.ShortURLKind().Version(),
Resource: v1alpha1.ShortURLKind().Plural(),
}
gvr := v1alpha1.ShortURLKind().GroupVersionResource()
// Calculate the expiration time
expirationTime := time.Now().Add(-time.Duration(srv.Cfg.ShortLinkExpiration*24) * time.Hour)