ShortURL: Graduate api v1alpha1 to v1beta1 (#113597)
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/client-go/dynamic"
|
||||
|
||||
"github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
"github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
@@ -325,7 +325,7 @@ func (srv *CleanUpService) deleteStaleKubernetesShortURLs(ctx context.Context) {
|
||||
}
|
||||
|
||||
// Set up the GroupVersionResource for shortURLs
|
||||
gvr := v1alpha1.ShortURLKind().GroupVersionResource()
|
||||
gvr := v1beta1.ShortURLKind().GroupVersionResource()
|
||||
|
||||
// Calculate the expiration time
|
||||
expirationTime := time.Now().Add(-time.Duration(srv.Cfg.ShortLinkExpiration*24) * time.Hour)
|
||||
@@ -350,7 +350,7 @@ func (srv *CleanUpService) deleteStaleKubernetesShortURLs(ctx context.Context) {
|
||||
// Check each shortURL for expiration
|
||||
for _, item := range shortURLs.Items {
|
||||
// Convert unstructured object to ShortURL struct
|
||||
var shortURL v1alpha1.ShortURL
|
||||
var shortURL v1beta1.ShortURL
|
||||
err := runtime.DefaultUnstructuredConverter.FromUnstructured(item.Object, &shortURL)
|
||||
if err != nil {
|
||||
logger.Error("Failed to convert unstructured object to ShortURL", "name", item.GetName(), "namespace", item.GetNamespace(), "error", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user