ShortURL: Graduate api v1alpha1 to v1beta1 (#113597)
This commit is contained in:
@@ -1,68 +1,11 @@
|
||||
package kinds
|
||||
|
||||
manifest: {
|
||||
// appName is the unique name of your app. It is used to reference the app from other config objects,
|
||||
// and to generate the group used by your app in the app platform API.
|
||||
appName: "shorturl"
|
||||
groupOverride: "shorturl.grafana.app"
|
||||
// groupOverride can be used to specify a non-appName-based API group.
|
||||
// By default, an app's API group is LOWER(REPLACE(appName, '-', '')).ext.grafana.com,
|
||||
// but there are cases where this needs to be changed.
|
||||
// Keep in mind that changing this after an app is deployed can cause problems with clients and/or kind data.
|
||||
// groupOverride: foo.ext.grafana.app
|
||||
|
||||
// versions is a map of versions supported by your app. Version names should follow the format "v<integer>" or
|
||||
// "v<integer>(alpha|beta)<integer>". Each version contains the kinds your app manages for that version.
|
||||
// If your app needs access to kinds managed by another app, use permissions.accessKinds to allow your app access.
|
||||
versions: {
|
||||
"v1alpha1": v1alpha1
|
||||
}
|
||||
// extraPermissions contains any additional permissions your app may require to function.
|
||||
// Your app will always have all permissions for each kind it manages (the items defined in 'kinds').
|
||||
extraPermissions: {
|
||||
// If your app needs access to additional kinds supplied by other apps, you can list them here
|
||||
accessKinds: [
|
||||
// Here is an example for your app accessing the playlist kind for reads and watch
|
||||
// {
|
||||
// group: "playlist.grafana.app"
|
||||
// resource: "playlists"
|
||||
// actions: ["get","list","watch"]
|
||||
// }
|
||||
]
|
||||
"v1beta1": {
|
||||
kinds: [shorturl]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// v1alpha1 is the v1alpha1 version of the app's API.
|
||||
// It includes kinds which the v1alpha1 API serves, and (future) custom routes served globally from the v1alpha1 version.
|
||||
v1alpha1: {
|
||||
// kinds is the list of kinds served by this version
|
||||
kinds: [shorturl]
|
||||
// [OPTIONAL]
|
||||
// served indicates whether this particular version is served by the API server.
|
||||
// served should be set to false before a version is removed from the manifest entirely.
|
||||
// served defaults to true if not present.
|
||||
served: true
|
||||
// [OPTIONAL]
|
||||
// Codegen is a trait that tells the grafana-app-sdk, or other code generation tooling, how to process this kind.
|
||||
// If not present, default values within the codegen trait are used.
|
||||
// If you wish to specify codegen per-version, put this section in the version's object
|
||||
// (for example, <no value>v1alpha1) instead.
|
||||
codegen: {
|
||||
// [OPTIONAL]
|
||||
// ts contains TypeScript code generation properties for the kind
|
||||
ts: {
|
||||
// [OPTIONAL]
|
||||
// enabled indicates whether the CLI should generate front-end TypeScript code for the kind.
|
||||
// Defaults to true if not present.
|
||||
enabled: true
|
||||
}
|
||||
// [OPTIONAL]
|
||||
// go contains go code generation properties for the kind
|
||||
go: {
|
||||
// [OPTIONAL]
|
||||
// enabled indicates whether the CLI should generate back-end go code for the kind.
|
||||
// Defaults to true if not present.
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
@@ -6,7 +6,7 @@ const (
|
||||
// APIGroup is the API group used by all kinds in this package
|
||||
APIGroup = "shorturl.grafana.app"
|
||||
// APIVersion is the API version used by all kinds in this package
|
||||
APIVersion = "v1alpha1"
|
||||
APIVersion = "v1beta1"
|
||||
)
|
||||
|
||||
var (
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type GetGoto struct {
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// schema is unexported to prevent accidental overwrites
|
||||
var (
|
||||
schemaShortURL = resource.NewSimpleSchema("shorturl.grafana.app", "v1alpha1", &ShortURL{}, &ShortURLList{}, resource.WithKind("ShortURL"),
|
||||
schemaShortURL = resource.NewSimpleSchema("shorturl.grafana.app", "v1beta1", &ShortURL{}, &ShortURLList{}, resource.WithKind("ShortURL"),
|
||||
resource.WithPlural("shorturls"), resource.WithScope(resource.NamespacedScope))
|
||||
kindShortURL = resource.Kind{
|
||||
Schema: schemaShortURL,
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type ShortURLSpec struct {
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v1alpha1
|
||||
package v1beta1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type ShortURLstatusOperatorState struct {
|
||||
+9
-9
@@ -16,22 +16,22 @@ import (
|
||||
"k8s.io/kube-openapi/pkg/spec3"
|
||||
"k8s.io/kube-openapi/pkg/validation/spec"
|
||||
|
||||
v1alpha1 "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
v1beta1 "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
)
|
||||
|
||||
var (
|
||||
rawSchemaShortURLv1alpha1 = []byte(`{"OperatorState":{"additionalProperties":false,"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"details contains any extra information that is operator-specific","type":"object"},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"ShortURL":{"properties":{"spec":{"$ref":"#/components/schemas/spec"},"status":{"$ref":"#/components/schemas/status"}},"required":["spec"]},"spec":{"additionalProperties":false,"properties":{"path":{"description":"The original path to where the short url is linking too e.g. https://localhost:3000/eer8i1kictngga/new-dashboard-with-lib-panel","type":"string"}},"required":["path"],"type":"object"},"status":{"additionalProperties":false,"properties":{"additionalFields":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"additionalFields is reserved for future use","type":"object"},"lastSeenAt":{"description":"The last time the short URL was used, 0 is the initial value","type":"integer"},"operatorStates":{"additionalProperties":{"$ref":"#/components/schemas/OperatorState"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"required":["lastSeenAt"],"type":"object"}}`)
|
||||
versionSchemaShortURLv1alpha1 app.VersionSchema
|
||||
_ = json.Unmarshal(rawSchemaShortURLv1alpha1, &versionSchemaShortURLv1alpha1)
|
||||
rawSchemaShortURLv1beta1 = []byte(`{"OperatorState":{"additionalProperties":false,"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"details contains any extra information that is operator-specific","type":"object"},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"ShortURL":{"properties":{"spec":{"$ref":"#/components/schemas/spec"},"status":{"$ref":"#/components/schemas/status"}},"required":["spec"]},"spec":{"additionalProperties":false,"properties":{"path":{"description":"The original path to where the short url is linking too e.g. https://localhost:3000/eer8i1kictngga/new-dashboard-with-lib-panel","type":"string"}},"required":["path"],"type":"object"},"status":{"additionalProperties":false,"properties":{"additionalFields":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"additionalFields is reserved for future use","type":"object"},"lastSeenAt":{"description":"The last time the short URL was used, 0 is the initial value","type":"integer"},"operatorStates":{"additionalProperties":{"$ref":"#/components/schemas/OperatorState"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"required":["lastSeenAt"],"type":"object"}}`)
|
||||
versionSchemaShortURLv1beta1 app.VersionSchema
|
||||
_ = json.Unmarshal(rawSchemaShortURLv1beta1, &versionSchemaShortURLv1beta1)
|
||||
)
|
||||
|
||||
var appManifestData = app.ManifestData{
|
||||
AppName: "shorturl",
|
||||
Group: "shorturl.grafana.app",
|
||||
PreferredVersion: "v1alpha1",
|
||||
PreferredVersion: "v1beta1",
|
||||
Versions: []app.ManifestVersion{
|
||||
{
|
||||
Name: "v1alpha1",
|
||||
Name: "v1beta1",
|
||||
Served: true,
|
||||
Kinds: []app.ManifestVersionKind{
|
||||
{
|
||||
@@ -47,7 +47,7 @@ var appManifestData = app.ManifestData{
|
||||
},
|
||||
},
|
||||
},
|
||||
Schema: &versionSchemaShortURLv1alpha1,
|
||||
Schema: &versionSchemaShortURLv1beta1,
|
||||
Routes: map[string]spec3.PathProps{
|
||||
"/goto": {
|
||||
Get: &spec3.Operation{
|
||||
@@ -106,7 +106,7 @@ func RemoteManifest() app.Manifest {
|
||||
}
|
||||
|
||||
var kindVersionToGoType = map[string]resource.Kind{
|
||||
"ShortURL/v1alpha1": v1alpha1.ShortURLKind(),
|
||||
"ShortURL/v1beta1": v1beta1.ShortURLKind(),
|
||||
}
|
||||
|
||||
// ManifestGoTypeAssociator returns the associated resource.Kind instance for a given Kind and Version, if one exists.
|
||||
@@ -117,7 +117,7 @@ func ManifestGoTypeAssociator(kind, version string) (goType resource.Kind, exist
|
||||
}
|
||||
|
||||
var customRouteToGoResponseType = map[string]any{
|
||||
"v1alpha1|ShortURL|goto|GET": v1alpha1.GetGoto{},
|
||||
"v1beta1|ShortURL|goto|GET": v1beta1.GetGoto{},
|
||||
}
|
||||
|
||||
// ManifestCustomRouteResponsesAssociator returns the associated response go type for a given kind, version, custom route path, and method, if one exists.
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"github.com/grafana/grafana-app-sdk/operator"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
"github.com/grafana/grafana-app-sdk/simple"
|
||||
shorturlv1alpha1 "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
shorturlv1beta1 "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
)
|
||||
|
||||
@@ -31,11 +31,11 @@ var (
|
||||
func New(cfg app.Config) (app.App, error) {
|
||||
cfg.KubeConfig.APIPath = "apis"
|
||||
tmp, err := k8s.NewClientRegistry(cfg.KubeConfig, k8s.DefaultClientConfig()).
|
||||
ClientFor(shorturlv1alpha1.ShortURLKind())
|
||||
ClientFor(shorturlv1beta1.ShortURLKind())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to create client")
|
||||
}
|
||||
client := shorturlv1alpha1.NewShortURLClient(tmp)
|
||||
client := shorturlv1beta1.NewShortURLClient(tmp)
|
||||
|
||||
simpleConfig := simple.AppConfig{
|
||||
Name: "shorturl",
|
||||
@@ -49,11 +49,11 @@ func New(cfg app.Config) (app.App, error) {
|
||||
},
|
||||
ManagedKinds: []simple.AppManagedKind{
|
||||
{
|
||||
Kind: shorturlv1alpha1.ShortURLKind(),
|
||||
Kind: shorturlv1beta1.ShortURLKind(),
|
||||
Validator: &simple.Validator{
|
||||
ValidateFunc: func(ctx context.Context, req *app.AdmissionRequest) error {
|
||||
// Cast the incoming object to ShortURL for validation
|
||||
shortURL, ok := req.Object.(*shorturlv1alpha1.ShortURL)
|
||||
shortURL, ok := req.Object.(*shorturlv1beta1.ShortURL)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected ShortURL object, got %T", req.Object)
|
||||
}
|
||||
@@ -105,7 +105,7 @@ func New(cfg app.Config) (app.App, error) {
|
||||
|
||||
url = url + "/" + info.Spec.Path
|
||||
if req.URL.Query().Get("redirect") == "false" { // helpful for testing
|
||||
return json.NewEncoder(w).Encode(shorturlv1alpha1.GetGoto{
|
||||
return json.NewEncoder(w).Encode(shorturlv1beta1.GetGoto{
|
||||
Url: url,
|
||||
})
|
||||
}
|
||||
@@ -133,10 +133,10 @@ func New(cfg app.Config) (app.App, error) {
|
||||
|
||||
func GetKinds() map[schema.GroupVersion][]resource.Kind {
|
||||
gv := schema.GroupVersion{
|
||||
Group: shorturlv1alpha1.ShortURLKind().Group(),
|
||||
Version: shorturlv1alpha1.ShortURLKind().Version(),
|
||||
Group: shorturlv1beta1.ShortURLKind().Group(),
|
||||
Version: shorturlv1beta1.ShortURLKind().Version(),
|
||||
}
|
||||
return map[schema.GroupVersion][]resource.Kind{
|
||||
gv: {shorturlv1alpha1.ShortURLKind()},
|
||||
gv: {shorturlv1beta1.ShortURLKind()},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,9 +76,9 @@
|
||||
"import": "./src/clients/rtkq/provisioning/v0alpha1/index.ts",
|
||||
"require": "./src/clients/rtkq/provisioning/v0alpha1/index.ts"
|
||||
},
|
||||
"./rtkq/shorturl/v1alpha1": {
|
||||
"import": "./src/clients/rtkq/shorturl/v1alpha1/index.ts",
|
||||
"require": "./src/clients/rtkq/shorturl/v1alpha1/index.ts"
|
||||
"./rtkq/shorturl/v1beta1": {
|
||||
"import": "./src/clients/rtkq/shorturl/v1beta1/index.ts",
|
||||
"require": "./src/clients/rtkq/shorturl/v1beta1/index.ts"
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { generatedAPI as playlistAPIv0alpha1 } from './playlist/v0alpha1';
|
||||
import { generatedAPI as preferencesUserAPI } from './preferences/user';
|
||||
import { generatedAPI as preferencesAPIv1alpha1 } from './preferences/v1alpha1';
|
||||
import { generatedAPI as provisioningAPIv0alpha1 } from './provisioning/v0alpha1';
|
||||
import { generatedAPI as shortURLAPIv1alpha1 } from './shorturl/v1alpha1';
|
||||
import { generatedAPI as shortURLAPIv1beta1 } from './shorturl/v1beta1';
|
||||
import { generatedAPI as legacyUserAPI } from './user';
|
||||
// PLOP_INJECT_IMPORT
|
||||
|
||||
@@ -26,7 +26,7 @@ export const allMiddleware = [
|
||||
preferencesAPIv1alpha1.middleware,
|
||||
preferencesUserAPI.middleware,
|
||||
provisioningAPIv0alpha1.middleware,
|
||||
shortURLAPIv1alpha1.middleware,
|
||||
shortURLAPIv1beta1.middleware,
|
||||
correlationsAPIv0alpha1.middleware,
|
||||
legacyUserAPI.middleware,
|
||||
// PLOP_INJECT_MIDDLEWARE
|
||||
@@ -43,7 +43,7 @@ export const allReducers = {
|
||||
[preferencesAPIv1alpha1.reducerPath]: preferencesAPIv1alpha1.reducer,
|
||||
[preferencesUserAPI.reducerPath]: preferencesUserAPI.reducer,
|
||||
[provisioningAPIv0alpha1.reducerPath]: provisioningAPIv0alpha1.reducer,
|
||||
[shortURLAPIv1alpha1.reducerPath]: shortURLAPIv1alpha1.reducer,
|
||||
[shortURLAPIv1beta1.reducerPath]: shortURLAPIv1beta1.reducer,
|
||||
[correlationsAPIv0alpha1.reducerPath]: correlationsAPIv0alpha1.reducer,
|
||||
[legacyUserAPI.reducerPath]: legacyUserAPI.reducer,
|
||||
// PLOP_INJECT_REDUCER
|
||||
|
||||
+2
-2
@@ -4,11 +4,11 @@ import { getAPIBaseURL } from '../../../../utils/utils';
|
||||
import { createBaseQuery } from '../../createBaseQuery';
|
||||
|
||||
export const API_GROUP = 'shorturl.grafana.app' as const;
|
||||
export const API_VERSION = 'v1alpha1' as const;
|
||||
export const API_VERSION = 'v1beta1' as const;
|
||||
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
|
||||
|
||||
export const api = createApi({
|
||||
reducerPath: 'shortURLAPIv1alpha1',
|
||||
reducerPath: 'shortURLAPIv1beta1',
|
||||
baseQuery: createBaseQuery({
|
||||
baseURL: BASE_URL,
|
||||
}),
|
||||
+1
-1
@@ -7,7 +7,7 @@ const injectedRtkApi = api
|
||||
.injectEndpoints({
|
||||
endpoints: (build) => ({
|
||||
getApiResources: build.query<GetApiResourcesApiResponse, GetApiResourcesApiArg>({
|
||||
query: () => ({ url: `/apis/shorturl.grafana.app/v1alpha1/` }),
|
||||
query: () => ({ url: `/apis/shorturl.grafana.app/v1beta1/` }),
|
||||
providesTags: ['API Discovery'],
|
||||
}),
|
||||
listShortUrl: build.query<ListShortUrlApiResponse, ListShortUrlApiArg>({
|
||||
@@ -100,7 +100,9 @@ const config: ConfigFile = {
|
||||
...createAPIConfig('playlist', 'v0alpha1'),
|
||||
...createAPIConfig('preferences', 'v1alpha1'),
|
||||
...createAPIConfig('provisioning', 'v0alpha1'),
|
||||
...createAPIConfig('shorturl', 'v1alpha1'),
|
||||
...createAPIConfig('shorturl', 'v1beta1'),
|
||||
...createAPIConfig('shorturl', 'v1beta1'),
|
||||
...createAPIConfig('shorturl', 'v1beta1'),
|
||||
// PLOP_INJECT_API_CLIENT - Used by the API client generator
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
|
||||
"github.com/grafana/grafana/pkg/services/shorturls"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/endpoints/request"
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
appsdkapiserver "github.com/grafana/grafana-app-sdk/k8s/apiserver"
|
||||
"github.com/grafana/grafana-app-sdk/simple"
|
||||
"github.com/grafana/grafana/apps/shorturl/pkg/apis"
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
shorturlapp "github.com/grafana/grafana/apps/shorturl/pkg/app"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/k8s/apiserver"
|
||||
"github.com/grafana/grafana-app-sdk/logging"
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
shorturl "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/services/shorturls"
|
||||
)
|
||||
|
||||
@@ -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())
|
||||
|
||||
+83
-83
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"title": "shorturl.grafana.app/v1alpha1"
|
||||
"title": "shorturl.grafana.app/v1beta1"
|
||||
},
|
||||
"paths": {
|
||||
"/apis/shorturl.grafana.app/v1alpha1/": {
|
||||
"/apis/shorturl.grafana.app/v1beta1/": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"API Discovery"
|
||||
@@ -35,7 +35,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/apis/shorturl.grafana.app/v1alpha1/namespaces/{namespace}/shorturls": {
|
||||
"/apis/shorturl.grafana.app/v1beta1/namespaces/{namespace}/shorturls": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"ShortURL"
|
||||
@@ -140,27 +140,27 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLList"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLList"
|
||||
}
|
||||
},
|
||||
"application/json;stream=watch": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLList"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLList"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLList"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLList"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf;stream=watch": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLList"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLList"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLList"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLList"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@
|
||||
"x-kubernetes-action": "list",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -212,17 +212,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -234,17 +234,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,17 +254,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,17 +274,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,7 +293,7 @@
|
||||
"x-kubernetes-action": "post",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -447,7 +447,7 @@
|
||||
"x-kubernetes-action": "deletecollection",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -473,7 +473,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/shorturl.grafana.app/v1alpha1/namespaces/{namespace}/shorturls/{name}": {
|
||||
"/apis/shorturl.grafana.app/v1beta1/namespaces/{namespace}/shorturls/{name}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"ShortURL"
|
||||
@@ -486,17 +486,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -505,7 +505,7 @@
|
||||
"x-kubernetes-action": "get",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -548,17 +548,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -570,17 +570,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -590,17 +590,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@
|
||||
"x-kubernetes-action": "put",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -711,7 +711,7 @@
|
||||
"x-kubernetes-action": "delete",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -790,17 +790,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -810,17 +810,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -829,7 +829,7 @@
|
||||
"x-kubernetes-action": "patch",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -865,7 +865,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/shorturl.grafana.app/v1alpha1/namespaces/{namespace}/shorturls/{name}/goto": {
|
||||
"/apis/shorturl.grafana.app/v1beta1/namespaces/{namespace}/shorturls/{name}/goto": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"ShortURL"
|
||||
@@ -878,7 +878,7 @@
|
||||
"content": {
|
||||
"*/*": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.GetGoto"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.GetGoto"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -887,7 +887,7 @@
|
||||
"x-kubernetes-action": "connect",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ResourceCallOptions"
|
||||
}
|
||||
},
|
||||
@@ -914,7 +914,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"/apis/shorturl.grafana.app/v1alpha1/namespaces/{namespace}/shorturls/{name}/status": {
|
||||
"/apis/shorturl.grafana.app/v1beta1/namespaces/{namespace}/shorturls/{name}/status": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"ShortURL"
|
||||
@@ -927,17 +927,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -946,7 +946,7 @@
|
||||
"x-kubernetes-action": "get",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -989,17 +989,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1011,17 +1011,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1031,17 +1031,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@
|
||||
"x-kubernetes-action": "put",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -1129,17 +1129,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1149,17 +1149,17 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1168,7 +1168,7 @@
|
||||
"x-kubernetes-action": "patch",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "shorturl.grafana.app",
|
||||
"version": "v1alpha1",
|
||||
"version": "v1beta1",
|
||||
"kind": "ShortURL"
|
||||
}
|
||||
},
|
||||
@@ -1207,7 +1207,7 @@
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.GetGoto": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.GetGoto": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"url"
|
||||
@@ -1218,7 +1218,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"kind",
|
||||
@@ -1244,21 +1244,21 @@
|
||||
]
|
||||
},
|
||||
"spec": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLSpec"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLSpec"
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLStatus"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLStatus"
|
||||
}
|
||||
},
|
||||
"x-kubernetes-group-version-kind": [
|
||||
{
|
||||
"group": "shorturl.grafana.app",
|
||||
"kind": "ShortURL",
|
||||
"version": "v1alpha1"
|
||||
"version": "v1beta1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLList": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLList": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"metadata",
|
||||
@@ -1275,7 +1275,7 @@
|
||||
"default": {},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURL"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURL"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1297,11 +1297,11 @@
|
||||
{
|
||||
"group": "shorturl.grafana.app",
|
||||
"kind": "ShortURLList",
|
||||
"version": "v1alpha1"
|
||||
"version": "v1beta1"
|
||||
}
|
||||
]
|
||||
},
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLOperatorState": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLOperatorState": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"lastEvaluation",
|
||||
@@ -1336,7 +1336,7 @@
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLSpec": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLSpec": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"path"
|
||||
@@ -1349,7 +1349,7 @@
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLStatus": {
|
||||
"com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLStatus": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"lastSeenAt"
|
||||
@@ -1371,7 +1371,7 @@
|
||||
"description": "operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.",
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1alpha1.ShortURLOperatorState"
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.apps.shorturl.pkg.apis.shorturl.v1beta1.ShortURLOperatorState"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -108,7 +108,7 @@ func TestIntegrationOpenAPIs(t *testing.T) {
|
||||
Version: "v0alpha1",
|
||||
}, {
|
||||
Group: "shorturl.grafana.app",
|
||||
Version: "v1alpha1",
|
||||
Version: "v1beta1",
|
||||
}, {
|
||||
Group: "testdata.datasource.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
shorturlV1 "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1alpha1"
|
||||
shorturlV1 "github.com/grafana/grafana/apps/shorturl/pkg/apis/shorturl/v1beta1"
|
||||
"github.com/grafana/grafana/pkg/api/dtos"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/options"
|
||||
@@ -230,7 +230,7 @@ func doDualWriteTests(t *testing.T, helper *apis.K8sTestHelper, mode grafanarest
|
||||
obj := apis.DoRequest(helper, apis.RequestParams{
|
||||
User: client.Args.User,
|
||||
Method: http.MethodPost,
|
||||
Path: "/apis/shorturl.grafana.app/v1alpha1/namespaces/default/shorturls",
|
||||
Path: "/apis/shorturl.grafana.app/v1beta1/namespaces/default/shorturls",
|
||||
Body: []byte(`{ "metadata": { "generateName": "test-" }, "spec": { "path": "d/xCmMwXdVz/k8s-dual-write" } }`),
|
||||
}, &unstructured.Unstructured{})
|
||||
require.NotNil(t, obj.Result)
|
||||
@@ -266,7 +266,7 @@ func doDualWriteTests(t *testing.T, helper *apis.K8sTestHelper, mode grafanarest
|
||||
obj := apis.DoRequest(helper, apis.RequestParams{
|
||||
User: client.Args.User,
|
||||
Method: http.MethodPost,
|
||||
Path: "/apis/shorturl.grafana.app/v1alpha1/namespaces/default/shorturls",
|
||||
Path: "/apis/shorturl.grafana.app/v1beta1/namespaces/default/shorturls",
|
||||
Body: []byte(`{ "metadata": { "generateName": "redirect-" }, "spec": { "path": "d/test/redirect" } }`),
|
||||
}, &unstructured.Unstructured{})
|
||||
require.NotNil(t, obj.Result)
|
||||
@@ -319,7 +319,7 @@ func doUnifiedOnlyTests(t *testing.T, helper *apis.K8sTestHelper) {
|
||||
obj := apis.DoRequest(helper, apis.RequestParams{
|
||||
User: client.Args.User,
|
||||
Method: http.MethodPost,
|
||||
Path: "/apis/shorturl.grafana.app/v1alpha1/namespaces/default/shorturls",
|
||||
Path: "/apis/shorturl.grafana.app/v1beta1/namespaces/default/shorturls",
|
||||
Body: []byte(`{ "metadata": { "generateName": "unified-" }, "spec": { "path": "d/xCmMwXdVz/unified-only" } }`),
|
||||
}, &unstructured.Unstructured{})
|
||||
require.NotNil(t, obj.Result)
|
||||
@@ -381,7 +381,7 @@ func doUnifiedOnlyTests(t *testing.T, helper *apis.K8sTestHelper) {
|
||||
response := apis.DoRequest(helper, apis.RequestParams{
|
||||
User: client.Args.User,
|
||||
Method: http.MethodPost,
|
||||
Path: "/apis/shorturl.grafana.app/v1alpha1/namespaces/default/shorturls",
|
||||
Path: "/apis/shorturl.grafana.app/v1beta1/namespaces/default/shorturls",
|
||||
Body: []byte(invalidBody),
|
||||
}, (*unstructured.Unstructured)(nil))
|
||||
|
||||
@@ -418,7 +418,7 @@ func doUnifiedOnlyTests(t *testing.T, helper *apis.K8sTestHelper) {
|
||||
response := apis.DoRequest(helper, apis.RequestParams{
|
||||
User: client.Args.User,
|
||||
Method: http.MethodPost,
|
||||
Path: "/apis/shorturl.grafana.app/v1alpha1/namespaces/default/shorturls",
|
||||
Path: "/apis/shorturl.grafana.app/v1beta1/namespaces/default/shorturls",
|
||||
Body: []byte(validBody),
|
||||
}, &unstructured.Unstructured{})
|
||||
|
||||
@@ -448,7 +448,7 @@ func doUnifiedOnlyTests(t *testing.T, helper *apis.K8sTestHelper) {
|
||||
obj := apis.DoRequest[unstructured.Unstructured](helper, apis.RequestParams{
|
||||
User: client.Args.User,
|
||||
Method: http.MethodPost,
|
||||
Path: "/apis/shorturl.grafana.app/v1alpha1/namespaces/default/shorturls",
|
||||
Path: "/apis/shorturl.grafana.app/v1beta1/namespaces/default/shorturls",
|
||||
Body: []byte(`{ "metadata": { "generateName": "redirect-unified-" }, "spec": { "path": "d/test/unified-redirect" } }`),
|
||||
}, &unstructured.Unstructured{})
|
||||
require.NotNil(t, obj.Result)
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { generatedAPI } from '@grafana/api-clients/rtkq/shorturl/v1alpha1';
|
||||
import { generatedAPI } from '@grafana/api-clients/rtkq/shorturl/v1beta1';
|
||||
|
||||
export const shortURLAPIv1alpha1 = generatedAPI.enhanceEndpoints({
|
||||
export const shortURLAPIv1beta1 = generatedAPI.enhanceEndpoints({
|
||||
endpoints: {
|
||||
createShortUrl: (endpointDefinition) => {
|
||||
const originalQuery = endpointDefinition.query;
|
||||
@@ -2,9 +2,9 @@ import { LogRowModel } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { createLogRow } from 'app/features/logs/components/mocks/logRow';
|
||||
|
||||
import { ShortURL } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1alpha1/shorturl_object_gen';
|
||||
import { defaultSpec } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1alpha1/types.spec.gen';
|
||||
import { defaultStatus } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1alpha1/types.status.gen';
|
||||
import { ShortURL } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1beta1/shorturl_object_gen';
|
||||
import { defaultSpec } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1beta1/types.spec.gen';
|
||||
import { defaultStatus } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1beta1/types.status.gen';
|
||||
|
||||
import { createShortLink, createAndCopyShortLink, getLogsPermalinkRange, buildShortUrl } from './shortLinks';
|
||||
|
||||
@@ -122,7 +122,7 @@ describe('buildShortUrl', () => {
|
||||
it('builds short URL with metadata name and namespace', () => {
|
||||
const shortUrl: ShortURL = {
|
||||
kind: 'ShortURL',
|
||||
apiVersion: 'shorturl.grafana.app/v1alpha1',
|
||||
apiVersion: 'shorturl.grafana.app/v1beta1',
|
||||
metadata: {
|
||||
name: 'abc123def',
|
||||
namespace: 'org-5',
|
||||
@@ -140,7 +140,7 @@ describe('buildShortUrl', () => {
|
||||
|
||||
const shortUrl: ShortURL = {
|
||||
kind: 'ShortURL',
|
||||
apiVersion: 'shorturl.grafana.app/v1alpha1',
|
||||
apiVersion: 'shorturl.grafana.app/v1beta1',
|
||||
metadata: {
|
||||
name: 'xyz789',
|
||||
namespace: 'org-1',
|
||||
|
||||
@@ -4,14 +4,14 @@ import { AbsoluteTimeRange, LogRowModel, UrlQueryMap } from '@grafana/data';
|
||||
import { t } from '@grafana/i18n';
|
||||
import { getBackendSrv, config, locationService } from '@grafana/runtime';
|
||||
import { sceneGraph, SceneTimeRangeLike, VizPanel } from '@grafana/scenes';
|
||||
import { shortURLAPIv1alpha1 } from 'app/api/clients/shorturl/v1alpha1';
|
||||
import { shortURLAPIv1beta1 } from 'app/api/clients/shorturl/v1beta1';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import { createErrorNotification, createSuccessNotification } from 'app/core/copy/appNotification';
|
||||
import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene';
|
||||
import { getDashboardUrl } from 'app/features/dashboard-scene/utils/getDashboardUrl';
|
||||
import { dispatch } from 'app/store/store';
|
||||
|
||||
import { ShortURL } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1alpha1/shorturl_object_gen';
|
||||
import { ShortURL } from '../../../../apps/shorturl/plugin/src/generated/shorturl/v1beta1/shorturl_object_gen';
|
||||
import { extractErrorMessage } from '../../api/utils';
|
||||
import { ShareLinkConfiguration } from '../../features/dashboard-scene/sharing/ShareButton/utils';
|
||||
|
||||
@@ -46,9 +46,9 @@ export const createShortLink = async function (path: string) {
|
||||
if (config.featureToggles.useKubernetesShortURLsAPI) {
|
||||
// Use RTK API - it handles caching/failures/retries automatically
|
||||
const result = await dispatch(
|
||||
shortURLAPIv1alpha1.endpoints.createShortUrl.initiate({
|
||||
shortURLAPIv1beta1.endpoints.createShortUrl.initiate({
|
||||
shortUrl: {
|
||||
apiVersion: 'shorturl.grafana.app/v1alpha1',
|
||||
apiVersion: 'shorturl.grafana.app/v1beta1',
|
||||
kind: 'ShortURL',
|
||||
metadata: {},
|
||||
spec: {
|
||||
|
||||
Reference in New Issue
Block a user