ShortURL: Graduate api v1alpha1 to v1beta1 (#113597)
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
|
||||
"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/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/api/routing"
|
||||
@@ -120,7 +120,7 @@ type shortURLK8sHandler struct {
|
||||
|
||||
func newShortURLK8sHandler(hs *HTTPServer) *shortURLK8sHandler {
|
||||
return &shortURLK8sHandler{
|
||||
gvr: v1alpha1.ShortURLKind().GroupVersionResource(),
|
||||
gvr: v1beta1.ShortURLKind().GroupVersionResource(),
|
||||
namespacer: request.GetNamespaceMapper(hs.Cfg),
|
||||
clientConfigProvider: hs.clientConfigProvider,
|
||||
cfg: hs.Cfg,
|
||||
@@ -164,9 +164,9 @@ func (sk8s *shortURLK8sHandler) getKubernetesRedirectFromShortURL(c *contextmode
|
||||
}
|
||||
|
||||
result := client.RESTClient().Get().
|
||||
Prefix("apis", v1alpha1.APIGroup, v1alpha1.APIVersion).
|
||||
Prefix("apis", v1beta1.APIGroup, v1beta1.APIVersion).
|
||||
Namespace(sk8s.namespacer(c.OrgID)).
|
||||
Resource(v1alpha1.ShortURLKind().Plural()).
|
||||
Resource(v1beta1.ShortURLKind().Plural()).
|
||||
Name(uid).
|
||||
SubResource("goto").
|
||||
Param("redirect", "false"). // returns the URL and then we will do the redirect
|
||||
@@ -183,7 +183,7 @@ func (sk8s *shortURLK8sHandler) getKubernetesRedirectFromShortURL(c *contextmode
|
||||
return
|
||||
}
|
||||
|
||||
value := &v1alpha1.GetGoto{}
|
||||
value := &v1beta1.GetGoto{}
|
||||
if err = json.Unmarshal(body, value); err != nil {
|
||||
c.JsonApiErr(500, "unmarshal", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user