Compare commits
22 Commits
plugin-jso
...
dual-write
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5df03e531 | ||
|
|
2308b5458e | ||
|
|
bd0140b6f0 | ||
|
|
215d25ef69 | ||
|
|
d3beed7dd2 | ||
|
|
e2f2011d9e | ||
|
|
6db51cbdb9 | ||
|
|
1a2c3bdbc9 | ||
|
|
8af89b1210 | ||
|
|
4b24e63e0b | ||
|
|
68e7d66e54 | ||
|
|
ef0601b85e | ||
|
|
e25d09ff3e | ||
|
|
b7269073b2 | ||
|
|
29dfdafad5 | ||
|
|
b7da61c260 | ||
|
|
0e6ad2e7c8 | ||
|
|
aae69c1e75 | ||
|
|
89dd3870b3 | ||
|
|
3b577e2c42 | ||
|
|
7ff004f775 | ||
|
|
4d26d0cd5c |
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@@ -658,6 +658,7 @@ i18next.config.ts @grafana/grafana-frontend-platform
|
||||
/packages/grafana-runtime/src/services/LocationService.tsx @grafana/grafana-search-navigate-organise
|
||||
/packages/grafana-runtime/src/services/LocationSrv.ts @grafana/grafana-search-navigate-organise
|
||||
/packages/grafana-runtime/src/services/live.ts @grafana/dashboards-squad
|
||||
/packages/grafana-runtime/src/services/pluginMeta @grafana/plugins-platform-frontend
|
||||
/packages/grafana-runtime/src/utils/chromeHeaderHeight.ts @grafana/grafana-search-navigate-organise
|
||||
/packages/grafana-runtime/src/utils/DataSourceWithBackend* @grafana/grafana-datasources-core-services
|
||||
/packages/grafana-runtime/src/utils/licensing.ts @grafana/grafana-operator-experience-squad
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
],
|
||||
"legend": {
|
||||
"displayMode": "table",
|
||||
"placement": "right",
|
||||
"placement": "bottom",
|
||||
"showLegend": true,
|
||||
"values": [
|
||||
"percent"
|
||||
@@ -304,7 +304,7 @@
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"showLegend": true,
|
||||
"showLegend": false,
|
||||
"strokeWidth": 1,
|
||||
"text": {}
|
||||
},
|
||||
@@ -323,15 +323,6 @@
|
||||
}
|
||||
],
|
||||
"title": "Percent",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "renameByRegex",
|
||||
"options": {
|
||||
"regex": "^Backend-(.*)$",
|
||||
"renamePattern": "b-$1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "piechart"
|
||||
},
|
||||
{
|
||||
@@ -375,7 +366,7 @@
|
||||
],
|
||||
"legend": {
|
||||
"displayMode": "table",
|
||||
"placement": "right",
|
||||
"placement": "bottom",
|
||||
"showLegend": true,
|
||||
"values": [
|
||||
"value"
|
||||
@@ -389,7 +380,7 @@
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"showLegend": true,
|
||||
"showLegend": false,
|
||||
"strokeWidth": 1,
|
||||
"text": {}
|
||||
},
|
||||
@@ -408,15 +399,6 @@
|
||||
}
|
||||
],
|
||||
"title": "Value",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "renameByRegex",
|
||||
"options": {
|
||||
"regex": "(.*)",
|
||||
"renamePattern": "$1-how-much-wood-could-a-woodchuck-chuck-if-a-woodchuck-could-chuck-wood"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "piechart"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
include ../sdk.mk
|
||||
|
||||
.PHONY: generate # Run Grafana App SDK code generation
|
||||
generate: install-app-sdk update-app-sdk
|
||||
.PHONY: internal-generate # Run Grafana App SDK code generation
|
||||
internal-generate: install-app-sdk update-app-sdk
|
||||
@$(APP_SDK_BIN) generate \
|
||||
--source=./kinds/ \
|
||||
--gogenpath=./pkg/apis \
|
||||
--grouping=group \
|
||||
--defencoding=none
|
||||
--defencoding=none
|
||||
|
||||
.PHONY: generate
|
||||
generate: internal-generate # copy files to packages/grafana-runtime/src/services/pluginMeta/types
|
||||
rm -f ./packages/grafana-runtime/src/services/pluginMeta/types/*.ts
|
||||
cp plugin/src/generated/meta/v0alpha1/meta_object_gen.ts ../../packages/grafana-runtime/src/services/pluginMeta/types/meta_object_gen.ts
|
||||
cp plugin/src/generated/meta/v0alpha1/types.spec.gen.ts ../../packages/grafana-runtime/src/services/pluginMeta/types/types.spec.gen.ts
|
||||
cp plugin/src/generated/meta/v0alpha1/types.status.gen.ts ../../packages/grafana-runtime/src/services/pluginMeta/types/types.status.gen.ts
|
||||
@@ -4,8 +4,7 @@ API documentation is available at http://localhost:3000/swagger?api=plugins.graf
|
||||
|
||||
## Codegen
|
||||
|
||||
- Go: `make generate`
|
||||
- Frontend: Follow instructions in this [README](../..//packages/grafana-api-clients/README.md)
|
||||
- Go and TypeScript: `make generate`
|
||||
|
||||
## Plugin sync
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ manifest: {
|
||||
v0alpha1Version: {
|
||||
served: true
|
||||
codegen: {
|
||||
ts: {enabled: false}
|
||||
ts: {enabled: true}
|
||||
go: {enabled: true}
|
||||
}
|
||||
kinds: [
|
||||
|
||||
49
apps/plugins/plugin/src/generated/meta/v0alpha1/meta_object_gen.ts
generated
Normal file
49
apps/plugins/plugin/src/generated/meta/v0alpha1/meta_object_gen.ts
generated
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file was generated by grafana-app-sdk. DO NOT EDIT.
|
||||
*/
|
||||
import { Spec } from './types.spec.gen';
|
||||
import { Status } from './types.status.gen';
|
||||
|
||||
export interface Metadata {
|
||||
name: string;
|
||||
namespace: string;
|
||||
generateName?: string;
|
||||
selfLink?: string;
|
||||
uid?: string;
|
||||
resourceVersion?: string;
|
||||
generation?: number;
|
||||
creationTimestamp?: string;
|
||||
deletionTimestamp?: string;
|
||||
deletionGracePeriodSeconds?: number;
|
||||
labels?: Record<string, string>;
|
||||
annotations?: Record<string, string>;
|
||||
ownerReferences?: OwnerReference[];
|
||||
finalizers?: string[];
|
||||
managedFields?: ManagedFieldsEntry[];
|
||||
}
|
||||
|
||||
export interface OwnerReference {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
uid: string;
|
||||
controller?: boolean;
|
||||
blockOwnerDeletion?: boolean;
|
||||
}
|
||||
|
||||
export interface ManagedFieldsEntry {
|
||||
manager?: string;
|
||||
operation?: string;
|
||||
apiVersion?: string;
|
||||
time?: string;
|
||||
fieldsType?: string;
|
||||
subresource?: string;
|
||||
}
|
||||
|
||||
export interface Meta {
|
||||
kind: string;
|
||||
apiVersion: string;
|
||||
metadata: Metadata;
|
||||
spec: Spec;
|
||||
status: Status;
|
||||
}
|
||||
30
apps/plugins/plugin/src/generated/meta/v0alpha1/types.metadata.gen.ts
generated
Normal file
30
apps/plugins/plugin/src/generated/meta/v0alpha1/types.metadata.gen.ts
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
export interface Metadata {
|
||||
updateTimestamp: string;
|
||||
createdBy: string;
|
||||
uid: string;
|
||||
creationTimestamp: string;
|
||||
deletionTimestamp?: string;
|
||||
finalizers: string[];
|
||||
resourceVersion: string;
|
||||
generation: number;
|
||||
updatedBy: string;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
export const defaultMetadata = (): Metadata => ({
|
||||
updateTimestamp: "",
|
||||
createdBy: "",
|
||||
uid: "",
|
||||
creationTimestamp: "",
|
||||
finalizers: [],
|
||||
resourceVersion: "",
|
||||
generation: 0,
|
||||
updatedBy: "",
|
||||
labels: {},
|
||||
});
|
||||
|
||||
278
apps/plugins/plugin/src/generated/meta/v0alpha1/types.spec.gen.ts
generated
Normal file
278
apps/plugins/plugin/src/generated/meta/v0alpha1/types.spec.gen.ts
generated
Normal file
@@ -0,0 +1,278 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
// JSON configuration schema for Grafana plugins
|
||||
// Converted from: https://github.com/grafana/grafana/blob/main/docs/sources/developers/plugins/plugin.schema.json
|
||||
export interface JSONData {
|
||||
// Unique name of the plugin
|
||||
id: string;
|
||||
// Plugin type
|
||||
type: "app" | "datasource" | "panel" | "renderer";
|
||||
// Human-readable name of the plugin
|
||||
name: string;
|
||||
// Metadata for the plugin
|
||||
info: Info;
|
||||
// Dependency information
|
||||
dependencies: Dependencies;
|
||||
// Optional fields
|
||||
alerting?: boolean;
|
||||
annotations?: boolean;
|
||||
autoEnabled?: boolean;
|
||||
backend?: boolean;
|
||||
buildMode?: string;
|
||||
builtIn?: boolean;
|
||||
category?: "tsdb" | "logging" | "cloud" | "tracing" | "profiling" | "sql" | "enterprise" | "iot" | "other";
|
||||
enterpriseFeatures?: EnterpriseFeatures;
|
||||
executable?: string;
|
||||
hideFromList?: boolean;
|
||||
// +listType=atomic
|
||||
includes?: Include[];
|
||||
logs?: boolean;
|
||||
metrics?: boolean;
|
||||
multiValueFilterOperators?: boolean;
|
||||
pascalName?: string;
|
||||
preload?: boolean;
|
||||
queryOptions?: QueryOptions;
|
||||
// +listType=atomic
|
||||
routes?: Route[];
|
||||
skipDataQuery?: boolean;
|
||||
state?: "alpha" | "beta";
|
||||
streaming?: boolean;
|
||||
suggestions?: boolean;
|
||||
tracing?: boolean;
|
||||
iam?: IAM;
|
||||
// +listType=atomic
|
||||
roles?: Role[];
|
||||
extensions?: Extensions;
|
||||
}
|
||||
|
||||
export const defaultJSONData = (): JSONData => ({
|
||||
id: "",
|
||||
type: "app",
|
||||
name: "",
|
||||
info: defaultInfo(),
|
||||
dependencies: defaultDependencies(),
|
||||
});
|
||||
|
||||
export interface Info {
|
||||
// Required fields
|
||||
// +listType=set
|
||||
keywords: string[];
|
||||
logos: {
|
||||
small: string;
|
||||
large: string;
|
||||
};
|
||||
updated: string;
|
||||
version: string;
|
||||
// Optional fields
|
||||
author?: {
|
||||
name?: string;
|
||||
email?: string;
|
||||
url?: string;
|
||||
};
|
||||
description?: string;
|
||||
// +listType=atomic
|
||||
links?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
// +listType=atomic
|
||||
screenshots?: {
|
||||
name?: string;
|
||||
path?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultInfo = (): Info => ({
|
||||
keywords: [],
|
||||
logos: {
|
||||
small: "",
|
||||
large: "",
|
||||
},
|
||||
updated: "",
|
||||
version: "",
|
||||
});
|
||||
|
||||
export interface Dependencies {
|
||||
// Required field
|
||||
grafanaDependency: string;
|
||||
// Optional fields
|
||||
grafanaVersion?: string;
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
plugins?: {
|
||||
id: string;
|
||||
type: "app" | "datasource" | "panel";
|
||||
name: string;
|
||||
}[];
|
||||
extensions?: {
|
||||
// +listType=set
|
||||
exposedComponents?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export const defaultDependencies = (): Dependencies => ({
|
||||
grafanaDependency: "",
|
||||
});
|
||||
|
||||
export interface EnterpriseFeatures {
|
||||
// Allow additional properties
|
||||
healthDiagnosticsErrors?: boolean;
|
||||
}
|
||||
|
||||
export const defaultEnterpriseFeatures = (): EnterpriseFeatures => ({
|
||||
healthDiagnosticsErrors: false,
|
||||
});
|
||||
|
||||
export interface Include {
|
||||
uid?: string;
|
||||
type?: "dashboard" | "page" | "panel" | "datasource";
|
||||
name?: string;
|
||||
component?: string;
|
||||
role?: "Admin" | "Editor" | "Viewer" | "None";
|
||||
action?: string;
|
||||
path?: string;
|
||||
addToNav?: boolean;
|
||||
defaultNav?: boolean;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
export const defaultInclude = (): Include => ({
|
||||
});
|
||||
|
||||
export interface QueryOptions {
|
||||
maxDataPoints?: boolean;
|
||||
minInterval?: boolean;
|
||||
cacheTimeout?: boolean;
|
||||
}
|
||||
|
||||
export const defaultQueryOptions = (): QueryOptions => ({
|
||||
});
|
||||
|
||||
export interface Route {
|
||||
path?: string;
|
||||
method?: string;
|
||||
url?: string;
|
||||
reqSignedIn?: boolean;
|
||||
reqRole?: string;
|
||||
reqAction?: string;
|
||||
// +listType=atomic
|
||||
headers?: string[];
|
||||
body?: Record<string, any>;
|
||||
tokenAuth?: {
|
||||
url?: string;
|
||||
// +listType=set
|
||||
scopes?: string[];
|
||||
params?: Record<string, any>;
|
||||
};
|
||||
jwtTokenAuth?: {
|
||||
url?: string;
|
||||
// +listType=set
|
||||
scopes?: string[];
|
||||
params?: Record<string, any>;
|
||||
};
|
||||
// +listType=atomic
|
||||
urlParams?: {
|
||||
name?: string;
|
||||
content?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultRoute = (): Route => ({
|
||||
});
|
||||
|
||||
export interface IAM {
|
||||
// +listType=atomic
|
||||
permissions?: {
|
||||
action?: string;
|
||||
scope?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultIAM = (): IAM => ({
|
||||
});
|
||||
|
||||
export interface Role {
|
||||
role?: {
|
||||
name?: string;
|
||||
description?: string;
|
||||
// +listType=atomic
|
||||
permissions?: {
|
||||
action?: string;
|
||||
scope?: string;
|
||||
}[];
|
||||
};
|
||||
// +listType=set
|
||||
grants?: string[];
|
||||
}
|
||||
|
||||
export const defaultRole = (): Role => ({
|
||||
});
|
||||
|
||||
export interface Extensions {
|
||||
// +listType=atomic
|
||||
addedComponents?: {
|
||||
// +listType=set
|
||||
targets: string[];
|
||||
title: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=atomic
|
||||
addedLinks?: {
|
||||
// +listType=set
|
||||
targets: string[];
|
||||
title: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=atomic
|
||||
addedFunctions?: {
|
||||
// +listType=set
|
||||
targets: string[];
|
||||
title: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
exposedComponents?: {
|
||||
id: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
extensionPoints?: {
|
||||
id: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultExtensions = (): Extensions => ({
|
||||
});
|
||||
|
||||
export interface Spec {
|
||||
pluginJson: JSONData;
|
||||
class: "core" | "external";
|
||||
module?: {
|
||||
path: string;
|
||||
hash?: string;
|
||||
loadingStrategy?: "fetch" | "script";
|
||||
};
|
||||
baseURL?: string;
|
||||
signature?: {
|
||||
status: "internal" | "valid" | "invalid" | "modified" | "unsigned";
|
||||
type?: "grafana" | "commercial" | "community" | "private" | "private-glob";
|
||||
org?: string;
|
||||
};
|
||||
angular?: {
|
||||
detected: boolean;
|
||||
};
|
||||
translations?: Record<string, string>;
|
||||
// +listType=atomic
|
||||
children?: string[];
|
||||
}
|
||||
|
||||
export const defaultSpec = (): Spec => ({
|
||||
pluginJson: defaultJSONData(),
|
||||
class: "core",
|
||||
});
|
||||
|
||||
30
apps/plugins/plugin/src/generated/meta/v0alpha1/types.status.gen.ts
generated
Normal file
30
apps/plugins/plugin/src/generated/meta/v0alpha1/types.status.gen.ts
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
export interface OperatorState {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
lastEvaluation: string;
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
state: "success" | "in_progress" | "failed";
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
descriptiveState?: string;
|
||||
// details contains any extra information that is operator-specific
|
||||
details?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultOperatorState = (): OperatorState => ({
|
||||
lastEvaluation: "",
|
||||
state: "success",
|
||||
});
|
||||
|
||||
export interface Status {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
operatorStates?: Record<string, OperatorState>;
|
||||
// additionalFields is reserved for future use
|
||||
additionalFields?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultStatus = (): Status => ({
|
||||
});
|
||||
|
||||
49
apps/plugins/plugin/src/generated/plugin/v0alpha1/plugin_object_gen.ts
generated
Normal file
49
apps/plugins/plugin/src/generated/plugin/v0alpha1/plugin_object_gen.ts
generated
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file was generated by grafana-app-sdk. DO NOT EDIT.
|
||||
*/
|
||||
import { Spec } from './types.spec.gen';
|
||||
import { Status } from './types.status.gen';
|
||||
|
||||
export interface Metadata {
|
||||
name: string;
|
||||
namespace: string;
|
||||
generateName?: string;
|
||||
selfLink?: string;
|
||||
uid?: string;
|
||||
resourceVersion?: string;
|
||||
generation?: number;
|
||||
creationTimestamp?: string;
|
||||
deletionTimestamp?: string;
|
||||
deletionGracePeriodSeconds?: number;
|
||||
labels?: Record<string, string>;
|
||||
annotations?: Record<string, string>;
|
||||
ownerReferences?: OwnerReference[];
|
||||
finalizers?: string[];
|
||||
managedFields?: ManagedFieldsEntry[];
|
||||
}
|
||||
|
||||
export interface OwnerReference {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
uid: string;
|
||||
controller?: boolean;
|
||||
blockOwnerDeletion?: boolean;
|
||||
}
|
||||
|
||||
export interface ManagedFieldsEntry {
|
||||
manager?: string;
|
||||
operation?: string;
|
||||
apiVersion?: string;
|
||||
time?: string;
|
||||
fieldsType?: string;
|
||||
subresource?: string;
|
||||
}
|
||||
|
||||
export interface Plugin {
|
||||
kind: string;
|
||||
apiVersion: string;
|
||||
metadata: Metadata;
|
||||
spec: Spec;
|
||||
status: Status;
|
||||
}
|
||||
30
apps/plugins/plugin/src/generated/plugin/v0alpha1/types.metadata.gen.ts
generated
Normal file
30
apps/plugins/plugin/src/generated/plugin/v0alpha1/types.metadata.gen.ts
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
export interface Metadata {
|
||||
updateTimestamp: string;
|
||||
createdBy: string;
|
||||
uid: string;
|
||||
creationTimestamp: string;
|
||||
deletionTimestamp?: string;
|
||||
finalizers: string[];
|
||||
resourceVersion: string;
|
||||
generation: number;
|
||||
updatedBy: string;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
export const defaultMetadata = (): Metadata => ({
|
||||
updateTimestamp: "",
|
||||
createdBy: "",
|
||||
uid: "",
|
||||
creationTimestamp: "",
|
||||
finalizers: [],
|
||||
resourceVersion: "",
|
||||
generation: 0,
|
||||
updatedBy: "",
|
||||
labels: {},
|
||||
});
|
||||
|
||||
13
apps/plugins/plugin/src/generated/plugin/v0alpha1/types.spec.gen.ts
generated
Normal file
13
apps/plugins/plugin/src/generated/plugin/v0alpha1/types.spec.gen.ts
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
export interface Spec {
|
||||
id: string;
|
||||
version: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export const defaultSpec = (): Spec => ({
|
||||
id: "",
|
||||
version: "",
|
||||
});
|
||||
|
||||
30
apps/plugins/plugin/src/generated/plugin/v0alpha1/types.status.gen.ts
generated
Normal file
30
apps/plugins/plugin/src/generated/plugin/v0alpha1/types.status.gen.ts
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
export interface OperatorState {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
lastEvaluation: string;
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
state: "success" | "in_progress" | "failed";
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
descriptiveState?: string;
|
||||
// details contains any extra information that is operator-specific
|
||||
details?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultOperatorState = (): OperatorState => ({
|
||||
lastEvaluation: "",
|
||||
state: "success",
|
||||
});
|
||||
|
||||
export interface Status {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
operatorStates?: Record<string, OperatorState>;
|
||||
// additionalFields is reserved for future use
|
||||
additionalFields?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultStatus = (): Status => ({
|
||||
});
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
"legend": {
|
||||
"values": ["percent"],
|
||||
"displayMode": "table",
|
||||
"placement": "right"
|
||||
"placement": "bottom"
|
||||
},
|
||||
"pieType": "pie",
|
||||
"reduceOptions": {
|
||||
@@ -256,7 +256,7 @@
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"showLegend": true,
|
||||
"showLegend": false,
|
||||
"strokeWidth": 1,
|
||||
"text": {}
|
||||
},
|
||||
@@ -272,15 +272,6 @@
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Percent",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "renameByRegex",
|
||||
"options": {
|
||||
"regex": "^Backend-(.*)$",
|
||||
"renamePattern": "b-$1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "piechart"
|
||||
},
|
||||
{
|
||||
@@ -320,7 +311,7 @@
|
||||
"legend": {
|
||||
"values": ["value"],
|
||||
"displayMode": "table",
|
||||
"placement": "right"
|
||||
"placement": "bottom"
|
||||
},
|
||||
"pieType": "pie",
|
||||
"reduceOptions": {
|
||||
@@ -328,7 +319,7 @@
|
||||
"fields": "",
|
||||
"values": false
|
||||
},
|
||||
"showLegend": true,
|
||||
"showLegend": false,
|
||||
"strokeWidth": 1,
|
||||
"text": {}
|
||||
},
|
||||
@@ -344,15 +335,6 @@
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Value",
|
||||
"transformations": [
|
||||
{
|
||||
"id": "renameByRegex",
|
||||
"options": {
|
||||
"regex": "(.*)",
|
||||
"renamePattern": "$1-how-much-wood-could-a-woodchuck-chuck-if-a-woodchuck-could-chuck-wood"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": "piechart"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2030,6 +2030,44 @@ For example: `disabled_labels=grafana_folder`
|
||||
|
||||
<hr>
|
||||
|
||||
### `[unified_alerting.state_history]`
|
||||
|
||||
This section configures where Grafana Alerting writes alert state history. Refer to [Configure alert state history](/docs/grafana/<GRAFANA_VERSION>/alerting/set-up/configure-alert-state-history/) for end-to-end setup and examples.
|
||||
|
||||
#### `enabled `
|
||||
|
||||
Enables recording alert state history. Default is `false`.
|
||||
|
||||
#### `backend `
|
||||
|
||||
Select the backend used to store alert state history. Supported values: `loki`, `prometheus`, `multiple`.
|
||||
|
||||
#### `loki_remote_url `
|
||||
|
||||
The URL of the Loki server used when `backend = loki` (or when `backend = multiple` and Loki is a primary/secondary).
|
||||
|
||||
#### `prometheus_target_datasource_uid `
|
||||
|
||||
Target Prometheus data source UID used for writing alert state changes when `backend = prometheus` (or when `backend = multiple` and Prometheus is a secondary).
|
||||
|
||||
#### `prometheus_metric_name `
|
||||
|
||||
Optional. Metric name for the alert state metric. Default is `GRAFANA_ALERTS`.
|
||||
|
||||
#### `prometheus_write_timeout `
|
||||
|
||||
Optional. Timeout for writing alert state data to the target data source. Default is `10s`.
|
||||
|
||||
#### `primary `
|
||||
|
||||
Used only when `backend = multiple`. Selects the primary backend (for example `loki`).
|
||||
|
||||
#### `secondaries `
|
||||
|
||||
Used only when `backend = multiple`. Comma-separated list of secondary backends (for example `prometheus`).
|
||||
|
||||
<hr>
|
||||
|
||||
### `[unified_alerting.state_history.annotations]`
|
||||
|
||||
This section controls retention of annotations automatically created while evaluating alert rules when alerting state history backend is configured to be annotations (see setting [unified_alerting.state_history].backend)
|
||||
|
||||
@@ -1337,6 +1337,11 @@
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/api/onCallApi.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/components/AnnotationDetailsField.tsx": {
|
||||
"@typescript-eslint/consistent-type-assertions": {
|
||||
"count": 1
|
||||
@@ -1377,6 +1382,11 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/components/import-to-gma/ConfirmConvertModal.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/components/import-to-gma/NamespaceAndGroupFilter.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
@@ -1617,11 +1627,31 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/mocks/server/configure.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/mocks/server/handlers/plugins.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/rule-editor/clone.utils.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/rule-editor/formDefaults.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/rule-list/hooks/grafanaFilter.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/types/alerting.ts": {
|
||||
"@typescript-eslint/no-explicit-any": {
|
||||
"count": 5
|
||||
@@ -1632,6 +1662,16 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/utils/config.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/utils/config.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/utils/datasource.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
@@ -1663,12 +1703,20 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/utils/rules.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/alerting/unified/utils/rules.ts": {
|
||||
"@typescript-eslint/consistent-type-assertions": {
|
||||
"count": 3
|
||||
},
|
||||
"@typescript-eslint/no-explicit-any": {
|
||||
"count": 1
|
||||
},
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx": {
|
||||
@@ -1724,6 +1772,16 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/connections/components/AdvisorRedirectNotice/AdvisorRedirectNotice.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/connections/components/AdvisorRedirectNotice/AdvisorRedirectNotice.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/connections/tabs/ConnectData/ConnectData.tsx": {
|
||||
"@typescript-eslint/consistent-type-assertions": {
|
||||
"count": 1
|
||||
@@ -2063,6 +2121,11 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/dashboard/components/GenAI/utils.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 3
|
||||
@@ -2889,6 +2952,71 @@
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/registry/AddedComponentsRegistry.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/registry/AddedFunctionsRegistry.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/registry/AddedLinksRegistry.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/registry/ExposedComponentsRegistry.test.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 6
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/usePluginComponent.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 3
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/usePluginComponents.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/usePluginFunctions.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/usePluginLinks.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 2
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/utils.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 27
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/utils.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 7
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/validators.test.tsx": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 30
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/extensions/validators.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 4
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/sandbox/codeLoader.ts": {
|
||||
"no-restricted-syntax": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"public/app/features/plugins/sandbox/distortions.ts": {
|
||||
"@typescript-eslint/consistent-type-assertions": {
|
||||
"count": 1
|
||||
|
||||
@@ -117,6 +117,8 @@ module.exports = [
|
||||
'scripts/grafana-server/tmp',
|
||||
'packages/grafana-ui/src/graveyard', // deprecated UI components slated for removal
|
||||
'public/build-swagger', // swagger build output
|
||||
'apps/plugins/plugin/src/generated/meta/v0alpha1',
|
||||
'apps/plugins/plugin/src/generated/plugin/v0alpha1',
|
||||
],
|
||||
},
|
||||
...grafanaConfig,
|
||||
@@ -575,6 +577,42 @@ module.exports = [
|
||||
"Property[key.name='a11y'][value.type='ObjectExpression'] Property[key.name='test'][value.value='off']",
|
||||
message: 'Skipping a11y tests is not allowed. Please fix the component or story instead.',
|
||||
},
|
||||
{
|
||||
selector: 'MemberExpression[object.name="config"][property.name="apps"]',
|
||||
message:
|
||||
'Usage of config.apps is not allowed. Use the function getAppPluginMetas or useAppPluginMetas from @grafana/runtime instead',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [...commonTestIgnores],
|
||||
ignores: [
|
||||
// FIXME: Remove once all enterprise issues are fixed -
|
||||
// we don't have a suppressions file/approach for enterprise code yet
|
||||
...enterpriseIgnores,
|
||||
],
|
||||
rules: {
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: 'MemberExpression[object.name="config"][property.name="apps"]',
|
||||
message:
|
||||
'Usage of config.apps is not allowed. Use the function getAppPluginMetas or useAppPluginMetas from @grafana/runtime instead',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [...enterpriseIgnores],
|
||||
rules: {
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: 'MemberExpression[object.name="config"][property.name="apps"]',
|
||||
message:
|
||||
'Usage of config.apps is not allowed. Use the function getAppPluginMetas or useAppPluginMetas from @grafana/runtime instead',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
@@ -32,6 +32,7 @@ export type AppPluginConfig = {
|
||||
path: string;
|
||||
version: string;
|
||||
preload: boolean;
|
||||
/** @deprecated it will be removed in a future release */
|
||||
angular: AngularMeta;
|
||||
loadingStrategy: PluginLoadingStrategy;
|
||||
dependencies: PluginDependencies;
|
||||
@@ -219,6 +220,7 @@ export interface GrafanaConfig {
|
||||
snapshotEnabled: boolean;
|
||||
datasources: { [str: string]: DataSourceInstanceSettings };
|
||||
panels: { [key: string]: PanelPluginMeta };
|
||||
/** @deprecated it will be removed in a future release */
|
||||
apps: Record<string, AppPluginConfig>;
|
||||
auth: AuthSettings;
|
||||
minRefreshInterval: string;
|
||||
|
||||
@@ -53,6 +53,7 @@ export interface PluginError {
|
||||
pluginType?: PluginType;
|
||||
}
|
||||
|
||||
/** @deprecated it will be removed in a future release */
|
||||
export interface AngularMeta {
|
||||
detected: boolean;
|
||||
hideDeprecation: boolean;
|
||||
|
||||
@@ -86,6 +86,7 @@ export class GrafanaBootConfig {
|
||||
snapshotEnabled = true;
|
||||
datasources: { [str: string]: DataSourceInstanceSettings } = {};
|
||||
panels: { [key: string]: PanelPluginMeta } = {};
|
||||
/** @deprecated it will be removed in a future release, use isAppPluginInstalled or getAppPluginVersion instead */
|
||||
apps: Record<string, AppPluginConfigGrafanaData> = {};
|
||||
auth: AuthSettings = {};
|
||||
minRefreshInterval = '';
|
||||
|
||||
@@ -77,3 +77,5 @@ export {
|
||||
getCorrelationsService,
|
||||
setCorrelationsService,
|
||||
} from './services/CorrelationsService';
|
||||
export { getAppPluginVersion, isAppPluginInstalled } from './services/pluginMeta/apps';
|
||||
export { useAppPluginInstalled, useAppPluginVersion } from './services/pluginMeta/hooks';
|
||||
|
||||
@@ -29,3 +29,5 @@ export {
|
||||
export { UserStorage } from '../utils/userStorage';
|
||||
|
||||
export { initOpenFeature, evaluateBooleanFlag } from './openFeature';
|
||||
export { getAppPluginMeta, getAppPluginMetas, setAppPluginMetas } from '../services/pluginMeta/apps';
|
||||
export { useAppPluginMeta, useAppPluginMetas } from '../services/pluginMeta/hooks';
|
||||
|
||||
258
packages/grafana-runtime/src/services/pluginMeta/apps.test.ts
Normal file
258
packages/grafana-runtime/src/services/pluginMeta/apps.test.ts
Normal file
@@ -0,0 +1,258 @@
|
||||
import { evaluateBooleanFlag } from '../../internal/openFeature';
|
||||
|
||||
import {
|
||||
getAppPluginMeta,
|
||||
getAppPluginMetas,
|
||||
getAppPluginVersion,
|
||||
isAppPluginInstalled,
|
||||
setAppPluginMetas,
|
||||
} from './apps';
|
||||
import { initPluginMetas } from './plugins';
|
||||
import { app } from './test-fixtures/config.apps';
|
||||
|
||||
jest.mock('./plugins', () => ({ ...jest.requireActual('./plugins'), initPluginMetas: jest.fn() }));
|
||||
jest.mock('../../internal/openFeature', () => ({
|
||||
...jest.requireActual('../../internal/openFeature'),
|
||||
evaluateBooleanFlag: jest.fn(),
|
||||
}));
|
||||
|
||||
const initPluginMetasMock = jest.mocked(initPluginMetas);
|
||||
const evaluateBooleanFlagMock = jest.mocked(evaluateBooleanFlag);
|
||||
|
||||
describe('when useMTPlugins flag is enabled and apps is not initialized', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas({});
|
||||
jest.resetAllMocks();
|
||||
initPluginMetasMock.mockResolvedValue({ items: [] });
|
||||
evaluateBooleanFlagMock.mockReturnValue(true);
|
||||
});
|
||||
|
||||
it('getAppPluginMetas should call initPluginMetas and return correct result', async () => {
|
||||
const apps = await getAppPluginMetas();
|
||||
|
||||
expect(apps).toEqual([]);
|
||||
expect(initPluginMetasMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginMeta('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
expect(initPluginMetasMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('isAppPluginInstalled should call initPluginMetas and return false', async () => {
|
||||
const installed = await isAppPluginInstalled('myorg-someplugin-app');
|
||||
|
||||
expect(installed).toEqual(false);
|
||||
expect(initPluginMetasMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('getAppPluginVersion should call initPluginMetas and return null', async () => {
|
||||
const result = await getAppPluginVersion('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
expect(initPluginMetasMock).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useMTPlugins flag is enabled and apps is initialized', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas({ 'myorg-someplugin-app': app });
|
||||
jest.resetAllMocks();
|
||||
evaluateBooleanFlagMock.mockReturnValue(true);
|
||||
});
|
||||
|
||||
it('getAppPluginMetas should not call initPluginMetas and return correct result', async () => {
|
||||
const apps = await getAppPluginMetas();
|
||||
|
||||
expect(apps).toEqual([app]);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should not call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginMeta('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(app);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should return null if the pluginId is not found', async () => {
|
||||
const result = await getAppPluginMeta('otherorg-otherplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
});
|
||||
|
||||
it('isAppPluginInstalled should not call initPluginMetas and return true', async () => {
|
||||
const installed = await isAppPluginInstalled('myorg-someplugin-app');
|
||||
|
||||
expect(installed).toEqual(true);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('isAppPluginInstalled should return false if the pluginId is not found', async () => {
|
||||
const result = await isAppPluginInstalled('otherorg-otherplugin-app');
|
||||
|
||||
expect(result).toEqual(false);
|
||||
});
|
||||
|
||||
it('getAppPluginVersion should not call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginVersion('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual('1.0.0');
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginVersion should return null if the pluginId is not found', async () => {
|
||||
const result = await getAppPluginVersion('otherorg-otherplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useMTPlugins flag is disabled and apps is not initialized', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas({});
|
||||
jest.resetAllMocks();
|
||||
evaluateBooleanFlagMock.mockReturnValue(false);
|
||||
});
|
||||
|
||||
it('getAppPluginMetas should not call initPluginMetas and return correct result', async () => {
|
||||
const apps = await getAppPluginMetas();
|
||||
|
||||
expect(apps).toEqual([]);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should not call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginMeta('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('isAppPluginInstalled should not call initPluginMetas and return false', async () => {
|
||||
const result = await isAppPluginInstalled('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(false);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginVersion should not call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginVersion('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useMTPlugins flag is disabled and apps is initialized', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas({ 'myorg-someplugin-app': app });
|
||||
jest.resetAllMocks();
|
||||
evaluateBooleanFlagMock.mockReturnValue(false);
|
||||
});
|
||||
|
||||
it('getAppPluginMetas should not call initPluginMetas and return correct result', async () => {
|
||||
const apps = await getAppPluginMetas();
|
||||
|
||||
expect(apps).toEqual([app]);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should not call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginMeta('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(app);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should return null if the pluginId is not found', async () => {
|
||||
const result = await getAppPluginMeta('otherorg-otherplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
});
|
||||
|
||||
it('isAppPluginInstalled should not call initPluginMetas and return true', async () => {
|
||||
const result = await isAppPluginInstalled('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual(true);
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('isAppPluginInstalled should return false if the pluginId is not found', async () => {
|
||||
const result = await isAppPluginInstalled('otherorg-otherplugin-app');
|
||||
|
||||
expect(result).toEqual(false);
|
||||
});
|
||||
|
||||
it('getAppPluginVersion should not call initPluginMetas and return correct result', async () => {
|
||||
const result = await getAppPluginVersion('myorg-someplugin-app');
|
||||
|
||||
expect(result).toEqual('1.0.0');
|
||||
expect(initPluginMetasMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('getAppPluginVersion should return null if the pluginId is not found', async () => {
|
||||
const result = await getAppPluginVersion('otherorg-otherplugin-app');
|
||||
|
||||
expect(result).toEqual(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('immutability', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas({ 'myorg-someplugin-app': app });
|
||||
jest.resetAllMocks();
|
||||
evaluateBooleanFlagMock.mockReturnValue(false);
|
||||
});
|
||||
|
||||
it('getAppPluginMetas should return a deep clone', async () => {
|
||||
const mutatedApps = await getAppPluginMetas();
|
||||
|
||||
// assert we have correct props
|
||||
expect(mutatedApps).toHaveLength(1);
|
||||
expect(mutatedApps[0].dependencies.grafanaDependency).toEqual('>=10.4.0');
|
||||
expect(mutatedApps[0].extensions.addedLinks).toHaveLength(0);
|
||||
|
||||
// mutate deep props
|
||||
mutatedApps[0].dependencies.grafanaDependency = '';
|
||||
mutatedApps[0].extensions.addedLinks.push({ targets: [], title: '', description: '' });
|
||||
|
||||
// assert we have mutated props
|
||||
expect(mutatedApps[0].dependencies.grafanaDependency).toEqual('');
|
||||
expect(mutatedApps[0].extensions.addedLinks).toHaveLength(1);
|
||||
expect(mutatedApps[0].extensions.addedLinks[0]).toEqual({ targets: [], title: '', description: '' });
|
||||
|
||||
const apps = await getAppPluginMetas();
|
||||
|
||||
// assert that we have not mutated the source
|
||||
expect(apps[0].dependencies.grafanaDependency).toEqual('>=10.4.0');
|
||||
expect(apps[0].extensions.addedLinks).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('getAppPluginMeta should return a deep clone', async () => {
|
||||
const mutatedApp = await getAppPluginMeta('myorg-someplugin-app');
|
||||
|
||||
// assert we have correct props
|
||||
expect(mutatedApp).toBeDefined();
|
||||
expect(mutatedApp!.dependencies.grafanaDependency).toEqual('>=10.4.0');
|
||||
expect(mutatedApp!.extensions.addedLinks).toHaveLength(0);
|
||||
|
||||
// mutate deep props
|
||||
mutatedApp!.dependencies.grafanaDependency = '';
|
||||
mutatedApp!.extensions.addedLinks.push({ targets: [], title: '', description: '' });
|
||||
|
||||
// assert we have mutated props
|
||||
expect(mutatedApp!.dependencies.grafanaDependency).toEqual('');
|
||||
expect(mutatedApp!.extensions.addedLinks).toHaveLength(1);
|
||||
expect(mutatedApp!.extensions.addedLinks[0]).toEqual({ targets: [], title: '', description: '' });
|
||||
|
||||
const result = await getAppPluginMeta('myorg-someplugin-app');
|
||||
|
||||
// assert that we have not mutated the source
|
||||
expect(result).toBeDefined();
|
||||
expect(result!.dependencies.grafanaDependency).toEqual('>=10.4.0');
|
||||
expect(result!.extensions.addedLinks).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
71
packages/grafana-runtime/src/services/pluginMeta/apps.ts
Normal file
71
packages/grafana-runtime/src/services/pluginMeta/apps.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import type { AppPluginConfig } from '@grafana/data';
|
||||
|
||||
import { config } from '../../config';
|
||||
import { evaluateBooleanFlag } from '../../internal/openFeature';
|
||||
|
||||
import { getAppPluginMapper } from './mappers/mappers';
|
||||
import { initPluginMetas } from './plugins';
|
||||
import type { AppPluginMetas } from './types';
|
||||
|
||||
let apps: AppPluginMetas = {};
|
||||
|
||||
function initialized(): boolean {
|
||||
return Boolean(Object.keys(apps).length);
|
||||
}
|
||||
|
||||
async function initAppPluginMetas(): Promise<void> {
|
||||
if (!evaluateBooleanFlag('useMTPlugins', false)) {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
apps = config.apps;
|
||||
return;
|
||||
}
|
||||
|
||||
const metas = await initPluginMetas();
|
||||
const mapper = getAppPluginMapper();
|
||||
apps = mapper(metas);
|
||||
}
|
||||
|
||||
export async function getAppPluginMetas(): Promise<AppPluginConfig[]> {
|
||||
if (!initialized()) {
|
||||
await initAppPluginMetas();
|
||||
}
|
||||
|
||||
return Object.values(structuredClone(apps));
|
||||
}
|
||||
|
||||
export async function getAppPluginMeta(pluginId: string): Promise<AppPluginConfig | null> {
|
||||
if (!initialized()) {
|
||||
await initAppPluginMetas();
|
||||
}
|
||||
|
||||
const app = apps[pluginId];
|
||||
return app ? structuredClone(app) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an app plugin is installed. The function does not check if the app plugin is enabled.
|
||||
* @param pluginId - The id of the app plugin.
|
||||
* @returns True if the app plugin is installed, false otherwise.
|
||||
*/
|
||||
export async function isAppPluginInstalled(pluginId: string): Promise<boolean> {
|
||||
const app = await getAppPluginMeta(pluginId);
|
||||
return Boolean(app);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the version of an app plugin.
|
||||
* @param pluginId - The id of the app plugin.
|
||||
* @returns The version of the app plugin, or null if the plugin is not installed.
|
||||
*/
|
||||
export async function getAppPluginVersion(pluginId: string): Promise<string | null> {
|
||||
const app = await getAppPluginMeta(pluginId);
|
||||
return app?.version ?? null;
|
||||
}
|
||||
|
||||
export function setAppPluginMetas(override: AppPluginMetas): void {
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
throw new Error('setAppPluginMetas() function can only be called from tests.');
|
||||
}
|
||||
|
||||
apps = structuredClone(override);
|
||||
}
|
||||
214
packages/grafana-runtime/src/services/pluginMeta/hooks.test.tsx
Normal file
214
packages/grafana-runtime/src/services/pluginMeta/hooks.test.tsx
Normal file
@@ -0,0 +1,214 @@
|
||||
import { renderHook, waitFor } from '@testing-library/react';
|
||||
|
||||
import {
|
||||
getAppPluginMeta,
|
||||
getAppPluginMetas,
|
||||
getAppPluginVersion,
|
||||
isAppPluginInstalled,
|
||||
setAppPluginMetas,
|
||||
} from './apps';
|
||||
import { useAppPluginMeta, useAppPluginMetas, useAppPluginInstalled, useAppPluginVersion } from './hooks';
|
||||
import { apps } from './test-fixtures/config.apps';
|
||||
|
||||
const actualApps = jest.requireActual<typeof import('./apps')>('./apps');
|
||||
jest.mock('./apps', () => ({
|
||||
...jest.requireActual('./apps'),
|
||||
getAppPluginMetas: jest.fn(),
|
||||
getAppPluginMeta: jest.fn(),
|
||||
isAppPluginInstalled: jest.fn(),
|
||||
getAppPluginVersion: jest.fn(),
|
||||
}));
|
||||
const getAppPluginMetaMock = jest.mocked(getAppPluginMeta);
|
||||
const getAppPluginMetasMock = jest.mocked(getAppPluginMetas);
|
||||
const isAppPluginInstalledMock = jest.mocked(isAppPluginInstalled);
|
||||
const getAppPluginVersionMock = jest.mocked(getAppPluginVersion);
|
||||
|
||||
describe('useAppPluginMeta', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas(apps);
|
||||
jest.resetAllMocks();
|
||||
getAppPluginMetaMock.mockImplementation(actualApps.getAppPluginMeta);
|
||||
});
|
||||
|
||||
it('should return correct default values', async () => {
|
||||
const { result } = renderHook(() => useAppPluginMeta('grafana-exploretraces-app'));
|
||||
|
||||
expect(result.current.loading).toEqual(true);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toBeUndefined();
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(true));
|
||||
});
|
||||
|
||||
it('should return correct values after loading', async () => {
|
||||
const { result } = renderHook(() => useAppPluginMeta('grafana-exploretraces-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual(apps['grafana-exploretraces-app']);
|
||||
});
|
||||
|
||||
it('should return correct values if the pluginId does not exist', async () => {
|
||||
const { result } = renderHook(() => useAppPluginMeta('otherorg-otherplugin-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual(null);
|
||||
});
|
||||
|
||||
it('should return correct values if useAppPluginMeta throws', async () => {
|
||||
getAppPluginMetaMock.mockRejectedValue(new Error('Some error'));
|
||||
|
||||
const { result } = renderHook(() => useAppPluginMeta('otherorg-otherplugin-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toEqual(new Error('Some error'));
|
||||
expect(result.current.value).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('useAppPluginMetas', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas(apps);
|
||||
jest.resetAllMocks();
|
||||
getAppPluginMetasMock.mockImplementation(actualApps.getAppPluginMetas);
|
||||
});
|
||||
|
||||
it('should return correct default values', async () => {
|
||||
const { result } = renderHook(() => useAppPluginMetas());
|
||||
|
||||
expect(result.current.loading).toEqual(true);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toBeUndefined();
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(true));
|
||||
});
|
||||
|
||||
it('should return correct values after loading', async () => {
|
||||
const { result } = renderHook(() => useAppPluginMetas());
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual(Object.values(apps));
|
||||
});
|
||||
|
||||
it('should return correct values if useAppPluginMetas throws', async () => {
|
||||
getAppPluginMetasMock.mockRejectedValue(new Error('Some error'));
|
||||
|
||||
const { result } = renderHook(() => useAppPluginMetas());
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toEqual(new Error('Some error'));
|
||||
expect(result.current.value).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('useAppPluginInstalled', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas(apps);
|
||||
jest.resetAllMocks();
|
||||
isAppPluginInstalledMock.mockImplementation(actualApps.isAppPluginInstalled);
|
||||
});
|
||||
|
||||
it('should return correct default values', async () => {
|
||||
const { result } = renderHook(() => useAppPluginInstalled('grafana-exploretraces-app'));
|
||||
|
||||
expect(result.current.loading).toEqual(true);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toBeUndefined();
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(true));
|
||||
});
|
||||
|
||||
it('should return correct values after loading', async () => {
|
||||
const { result } = renderHook(() => useAppPluginInstalled('grafana-exploretraces-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return correct values if the pluginId does not exist', async () => {
|
||||
const { result } = renderHook(() => useAppPluginInstalled('otherorg-otherplugin-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual(false);
|
||||
});
|
||||
|
||||
it('should return correct values if isAppPluginInstalled throws', async () => {
|
||||
isAppPluginInstalledMock.mockRejectedValue(new Error('Some error'));
|
||||
|
||||
const { result } = renderHook(() => useAppPluginInstalled('otherorg-otherplugin-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toEqual(new Error('Some error'));
|
||||
expect(result.current.value).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('useAppPluginVersion', () => {
|
||||
beforeEach(() => {
|
||||
setAppPluginMetas(apps);
|
||||
jest.resetAllMocks();
|
||||
getAppPluginVersionMock.mockImplementation(actualApps.getAppPluginVersion);
|
||||
});
|
||||
|
||||
it('should return correct default values', async () => {
|
||||
const { result } = renderHook(() => useAppPluginVersion('grafana-exploretraces-app'));
|
||||
|
||||
expect(result.current.loading).toEqual(true);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toBeUndefined();
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(true));
|
||||
});
|
||||
|
||||
it('should return correct values after loading', async () => {
|
||||
const { result } = renderHook(() => useAppPluginVersion('grafana-exploretraces-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual('1.2.2');
|
||||
});
|
||||
|
||||
it('should return correct values if the pluginId does not exist', async () => {
|
||||
const { result } = renderHook(() => useAppPluginVersion('otherorg-otherplugin-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toBeUndefined();
|
||||
expect(result.current.value).toEqual(null);
|
||||
});
|
||||
|
||||
it('should return correct values if getAppPluginVersion throws', async () => {
|
||||
getAppPluginVersionMock.mockRejectedValue(new Error('Some error'));
|
||||
|
||||
const { result } = renderHook(() => useAppPluginVersion('otherorg-otherplugin-app'));
|
||||
|
||||
await waitFor(() => expect(result.current.loading).toEqual(false));
|
||||
|
||||
expect(result.current.loading).toEqual(false);
|
||||
expect(result.current.error).toEqual(new Error('Some error'));
|
||||
expect(result.current.value).toBeUndefined();
|
||||
});
|
||||
});
|
||||
35
packages/grafana-runtime/src/services/pluginMeta/hooks.tsx
Normal file
35
packages/grafana-runtime/src/services/pluginMeta/hooks.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { useAsync } from 'react-use';
|
||||
|
||||
import { getAppPluginMeta, getAppPluginMetas, getAppPluginVersion, isAppPluginInstalled } from './apps';
|
||||
|
||||
export function useAppPluginMetas() {
|
||||
const { loading, error, value } = useAsync(async () => getAppPluginMetas());
|
||||
return { loading, error, value };
|
||||
}
|
||||
|
||||
export function useAppPluginMeta(pluginId: string) {
|
||||
const { loading, error, value } = useAsync(async () => getAppPluginMeta(pluginId));
|
||||
return { loading, error, value };
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook that checks if an app plugin is installed. The hook does not check if the app plugin is enabled.
|
||||
* @param pluginId - The ID of the app plugin.
|
||||
* @returns loading, error, value of the app plugin installed status.
|
||||
* The value is true if the app plugin is installed, false otherwise.
|
||||
*/
|
||||
export function useAppPluginInstalled(pluginId: string) {
|
||||
const { loading, error, value } = useAsync(async () => isAppPluginInstalled(pluginId));
|
||||
return { loading, error, value };
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook that gets the version of an app plugin.
|
||||
* @param pluginId - The ID of the app plugin.
|
||||
* @returns loading, error, value of the app plugin version.
|
||||
* The value is the version of the app plugin, or null if the plugin is not installed.
|
||||
*/
|
||||
export function useAppPluginVersion(pluginId: string) {
|
||||
const { loading, error, value } = useAsync(async () => getAppPluginVersion(pluginId));
|
||||
return { loading, error, value };
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { AppPluginMetasMapper, PluginMetasResponse } from '../types';
|
||||
|
||||
import { v0alpha1AppMapper } from './v0alpha1AppMapper';
|
||||
|
||||
export function getAppPluginMapper(): AppPluginMetasMapper<PluginMetasResponse> {
|
||||
return v0alpha1AppMapper;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import { apps } from '../test-fixtures/config.apps';
|
||||
import { v0alpha1Response } from '../test-fixtures/v0alpha1Response';
|
||||
|
||||
import { v0alpha1AppMapper } from './v0alpha1AppMapper';
|
||||
|
||||
const PLUGIN_IDS = v0alpha1Response.items
|
||||
.filter((i) => i.spec.pluginJson.type === 'app')
|
||||
.map((i) => ({ pluginId: i.spec.pluginJson.id }));
|
||||
|
||||
describe('v0alpha1AppMapper', () => {
|
||||
describe.each(PLUGIN_IDS)('when called for pluginId:$pluginId', ({ pluginId }) => {
|
||||
it('should map id property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].id).toEqual(apps[pluginId].id);
|
||||
});
|
||||
|
||||
it('should map path property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].path).toEqual(apps[pluginId].path);
|
||||
});
|
||||
|
||||
it('should map version property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].version).toEqual(apps[pluginId].version);
|
||||
});
|
||||
|
||||
it('should map preload property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].preload).toEqual(apps[pluginId].preload);
|
||||
});
|
||||
|
||||
it('should map angular property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].angular).toEqual({});
|
||||
});
|
||||
|
||||
it('should map loadingStrategy property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].loadingStrategy).toEqual(apps[pluginId].loadingStrategy);
|
||||
});
|
||||
|
||||
it('should map dependencies property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].dependencies).toEqual(apps[pluginId].dependencies);
|
||||
});
|
||||
|
||||
it('should map extensions property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].extensions.addedComponents).toEqual(apps[pluginId].extensions.addedComponents);
|
||||
expect(result[pluginId].extensions.addedFunctions).toEqual(apps[pluginId].extensions.addedFunctions);
|
||||
expect(result[pluginId].extensions.addedLinks).toEqual(apps[pluginId].extensions.addedLinks);
|
||||
expect(result[pluginId].extensions.exposedComponents).toEqual(apps[pluginId].extensions.exposedComponents);
|
||||
expect(result[pluginId].extensions.extensionPoints).toEqual(apps[pluginId].extensions.extensionPoints);
|
||||
});
|
||||
|
||||
it('should map moduleHash property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].moduleHash).toEqual(apps[pluginId].moduleHash);
|
||||
});
|
||||
|
||||
it('should map buildMode property correctly', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(result[pluginId].buildMode).toEqual(apps[pluginId].buildMode);
|
||||
});
|
||||
});
|
||||
|
||||
it('should only map specs with type app', () => {
|
||||
const result = v0alpha1AppMapper(v0alpha1Response);
|
||||
|
||||
expect(v0alpha1Response.items).toHaveLength(58);
|
||||
expect(Object.keys(result)).toHaveLength(5);
|
||||
expect(Object.keys(result)).toEqual(Object.keys(apps));
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,111 @@
|
||||
import {
|
||||
type AngularMeta,
|
||||
type AppPluginConfig,
|
||||
type PluginDependencies,
|
||||
type PluginExtensions,
|
||||
PluginLoadingStrategy,
|
||||
type PluginType,
|
||||
} from '@grafana/data';
|
||||
|
||||
import type { AppPluginMetas, AppPluginMetasMapper, PluginMetasResponse } from '../types';
|
||||
import type { Spec as v0alpha1Spec } from '../types/types.spec.gen';
|
||||
|
||||
function angularyMapper(spec: v0alpha1Spec): AngularMeta {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
return {} as AngularMeta;
|
||||
}
|
||||
|
||||
function dependenciesMapper(spec: v0alpha1Spec): PluginDependencies {
|
||||
const plugins = (spec.pluginJson.dependencies?.plugins ?? []).map((v) => ({
|
||||
...v,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
type: v.type as PluginType,
|
||||
version: '',
|
||||
}));
|
||||
|
||||
const dependencies: PluginDependencies = {
|
||||
...spec.pluginJson.dependencies,
|
||||
extensions: {
|
||||
exposedComponents: spec.pluginJson.dependencies.extensions?.exposedComponents ?? [],
|
||||
},
|
||||
grafanaDependency: spec.pluginJson.dependencies.grafanaDependency,
|
||||
grafanaVersion: spec.pluginJson.dependencies.grafanaVersion ?? '',
|
||||
plugins,
|
||||
};
|
||||
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
function extensionsMapper(spec: v0alpha1Spec): PluginExtensions {
|
||||
const addedComponents = spec.pluginJson.extensions?.addedComponents ?? [];
|
||||
const addedFunctions = spec.pluginJson.extensions?.addedFunctions ?? [];
|
||||
const addedLinks = spec.pluginJson.extensions?.addedLinks ?? [];
|
||||
const exposedComponents = (spec.pluginJson.extensions?.exposedComponents ?? []).map((v) => ({
|
||||
...v,
|
||||
description: v.description ?? '',
|
||||
title: v.title ?? '',
|
||||
}));
|
||||
const extensionPoints = (spec.pluginJson.extensions?.extensionPoints ?? []).map((v) => ({
|
||||
...v,
|
||||
description: v.description ?? '',
|
||||
title: v.title ?? '',
|
||||
}));
|
||||
|
||||
const extensions: PluginExtensions = {
|
||||
addedComponents,
|
||||
addedFunctions,
|
||||
addedLinks,
|
||||
exposedComponents,
|
||||
extensionPoints,
|
||||
};
|
||||
|
||||
return extensions;
|
||||
}
|
||||
|
||||
function loadingStrategyMapper(spec: v0alpha1Spec): PluginLoadingStrategy {
|
||||
const loadingStrategy = spec.module?.loadingStrategy ?? PluginLoadingStrategy.fetch;
|
||||
if (loadingStrategy === PluginLoadingStrategy.script) {
|
||||
return PluginLoadingStrategy.script;
|
||||
}
|
||||
|
||||
return PluginLoadingStrategy.fetch;
|
||||
}
|
||||
|
||||
function specMapper(spec: v0alpha1Spec): AppPluginConfig {
|
||||
const { id, info, preload = false } = spec.pluginJson;
|
||||
const angular = angularyMapper(spec);
|
||||
const dependencies = dependenciesMapper(spec);
|
||||
const extensions = extensionsMapper(spec);
|
||||
const loadingStrategy = loadingStrategyMapper(spec);
|
||||
const path = spec.module?.path ?? '';
|
||||
const version = info.version;
|
||||
const buildMode = spec.pluginJson.buildMode ?? 'production';
|
||||
const moduleHash = spec.module?.hash;
|
||||
|
||||
return {
|
||||
id,
|
||||
angular,
|
||||
dependencies,
|
||||
extensions,
|
||||
loadingStrategy,
|
||||
path,
|
||||
preload,
|
||||
version,
|
||||
buildMode,
|
||||
moduleHash,
|
||||
};
|
||||
}
|
||||
|
||||
export const v0alpha1AppMapper: AppPluginMetasMapper<PluginMetasResponse> = (response) => {
|
||||
const result: AppPluginMetas = {};
|
||||
|
||||
return response.items.reduce((acc, curr) => {
|
||||
if (curr.spec.pluginJson.type !== 'app') {
|
||||
return acc;
|
||||
}
|
||||
|
||||
const config = specMapper(curr.spec);
|
||||
acc[config.id] = config;
|
||||
return acc;
|
||||
}, result);
|
||||
};
|
||||
153
packages/grafana-runtime/src/services/pluginMeta/plugins.test.ts
Normal file
153
packages/grafana-runtime/src/services/pluginMeta/plugins.test.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
import { evaluateBooleanFlag } from '../../internal/openFeature';
|
||||
|
||||
import { clearCache, initPluginMetas } from './plugins';
|
||||
import { v0alpha1Meta } from './test-fixtures/v0alpha1Response';
|
||||
|
||||
jest.mock('../../internal/openFeature', () => ({
|
||||
...jest.requireActual('../../internal/openFeature'),
|
||||
evaluateBooleanFlag: jest.fn(),
|
||||
}));
|
||||
|
||||
const evaluateBooleanFlagMock = jest.mocked(evaluateBooleanFlag);
|
||||
|
||||
describe('when useMTPlugins toggle is enabled and cache is not initialized', () => {
|
||||
const originalFetch = global.fetch;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
clearCache();
|
||||
evaluateBooleanFlagMock.mockReturnValue(true);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.fetch = originalFetch;
|
||||
});
|
||||
|
||||
it('initPluginMetas should call loadPluginMetas and return correct result if response is ok', async () => {
|
||||
global.fetch = jest.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: () => Promise.resolve({ items: [v0alpha1Meta] }),
|
||||
});
|
||||
|
||||
const response = await initPluginMetas();
|
||||
|
||||
expect(response.items).toHaveLength(1);
|
||||
expect(response.items[0]).toEqual(v0alpha1Meta);
|
||||
expect(global.fetch).toHaveBeenCalledTimes(1);
|
||||
expect(global.fetch).toHaveBeenCalledWith('/apis/plugins.grafana.app/v0alpha1/namespaces/default/metas');
|
||||
});
|
||||
|
||||
it('initPluginMetas should call loadPluginMetas and return correct result if response is not ok', async () => {
|
||||
global.fetch = jest.fn().mockResolvedValue({
|
||||
ok: false,
|
||||
status: 404,
|
||||
statusText: 'Not found',
|
||||
});
|
||||
|
||||
await expect(initPluginMetas()).rejects.toThrow(new Error(`Failed to load plugin metas 404:Not found`));
|
||||
expect(global.fetch).toHaveBeenCalledTimes(1);
|
||||
expect(global.fetch).toHaveBeenCalledWith('/apis/plugins.grafana.app/v0alpha1/namespaces/default/metas');
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useMTPlugins toggle is enabled and cache is initialized', () => {
|
||||
const originalFetch = global.fetch;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
clearCache();
|
||||
evaluateBooleanFlagMock.mockReturnValue(true);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.fetch = originalFetch;
|
||||
});
|
||||
|
||||
it('initPluginMetas should return cache', async () => {
|
||||
global.fetch = jest.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: () => Promise.resolve({ items: [v0alpha1Meta] }),
|
||||
});
|
||||
|
||||
const original = await initPluginMetas();
|
||||
const cached = await initPluginMetas();
|
||||
|
||||
expect(original).toEqual(cached);
|
||||
expect(global.fetch).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('initPluginMetas should return inflight promise', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
global.fetch = jest.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: () => Promise.resolve({ items: [v0alpha1Meta] }),
|
||||
});
|
||||
|
||||
const original = initPluginMetas();
|
||||
const cached = initPluginMetas();
|
||||
await jest.runAllTimersAsync();
|
||||
|
||||
expect(original).toEqual(cached);
|
||||
expect(global.fetch).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useMTPlugins toggle is disabled and cache is not initialized', () => {
|
||||
const originalFetch = global.fetch;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
clearCache();
|
||||
global.fetch = jest.fn();
|
||||
evaluateBooleanFlagMock.mockReturnValue(false);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.fetch = originalFetch;
|
||||
});
|
||||
|
||||
it('initPluginMetas should call loadPluginMetas and return correct result if response is ok', async () => {
|
||||
const response = await initPluginMetas();
|
||||
|
||||
expect(response.items).toHaveLength(0);
|
||||
expect(global.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when useMTPlugins toggle is disabled and cache is initialized', () => {
|
||||
const originalFetch = global.fetch;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
clearCache();
|
||||
global.fetch = jest.fn();
|
||||
evaluateBooleanFlagMock.mockReturnValue(false);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.fetch = originalFetch;
|
||||
});
|
||||
|
||||
it('initPluginMetas should return cache', async () => {
|
||||
const original = await initPluginMetas();
|
||||
const cached = await initPluginMetas();
|
||||
|
||||
expect(original).toEqual(cached);
|
||||
expect(global.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('initPluginMetas should return inflight promise', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
const original = initPluginMetas();
|
||||
const cached = initPluginMetas();
|
||||
await jest.runAllTimersAsync();
|
||||
|
||||
expect(original).toEqual(cached);
|
||||
expect(global.fetch).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
41
packages/grafana-runtime/src/services/pluginMeta/plugins.ts
Normal file
41
packages/grafana-runtime/src/services/pluginMeta/plugins.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import { config } from '../../config';
|
||||
import { evaluateBooleanFlag } from '../../internal/openFeature';
|
||||
|
||||
import type { PluginMetasResponse } from './types';
|
||||
|
||||
let initPromise: Promise<PluginMetasResponse> | null = null;
|
||||
|
||||
function getApiVersion(): string {
|
||||
return 'v0alpha1';
|
||||
}
|
||||
|
||||
async function loadPluginMetas(): Promise<PluginMetasResponse> {
|
||||
if (!evaluateBooleanFlag('useMTPlugins', false)) {
|
||||
const result = { items: [] };
|
||||
return result;
|
||||
}
|
||||
|
||||
const metas = await fetch(`/apis/plugins.grafana.app/${getApiVersion()}/namespaces/${config.namespace}/metas`);
|
||||
if (!metas.ok) {
|
||||
throw new Error(`Failed to load plugin metas ${metas.status}:${metas.statusText}`);
|
||||
}
|
||||
|
||||
const result = await metas.json();
|
||||
return result;
|
||||
}
|
||||
|
||||
export function initPluginMetas(): Promise<PluginMetasResponse> {
|
||||
if (!initPromise) {
|
||||
initPromise = loadPluginMetas();
|
||||
}
|
||||
|
||||
return initPromise;
|
||||
}
|
||||
|
||||
export function clearCache() {
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
throw new Error('clearCache() function can only be called from tests.');
|
||||
}
|
||||
|
||||
initPromise = null;
|
||||
}
|
||||
@@ -0,0 +1,303 @@
|
||||
import { cloneDeep } from 'lodash';
|
||||
|
||||
import { AngularMeta, AppPluginConfig, PluginLoadingStrategy } from '@grafana/data';
|
||||
|
||||
import { AppPluginMetas } from '../types';
|
||||
|
||||
export const app: AppPluginConfig = cloneDeep({
|
||||
id: 'myorg-someplugin-app',
|
||||
path: 'public/plugins/myorg-someplugin-app/module.js',
|
||||
version: '1.0.0',
|
||||
preload: false,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
angular: { detected: false } as AngularMeta,
|
||||
loadingStrategy: PluginLoadingStrategy.script,
|
||||
extensions: {
|
||||
addedLinks: [],
|
||||
addedComponents: [],
|
||||
exposedComponents: [],
|
||||
extensionPoints: [],
|
||||
addedFunctions: [],
|
||||
},
|
||||
dependencies: {
|
||||
grafanaDependency: '>=10.4.0',
|
||||
grafanaVersion: '*',
|
||||
plugins: [],
|
||||
extensions: {
|
||||
exposedComponents: [],
|
||||
},
|
||||
},
|
||||
buildMode: 'production',
|
||||
});
|
||||
|
||||
export const apps: AppPluginMetas = cloneDeep({
|
||||
'grafana-exploretraces-app': {
|
||||
id: 'grafana-exploretraces-app',
|
||||
path: 'public/plugins/grafana-exploretraces-app/module.js',
|
||||
version: '1.2.2',
|
||||
preload: true,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
angular: { detected: false } as AngularMeta,
|
||||
loadingStrategy: PluginLoadingStrategy.script,
|
||||
extensions: {
|
||||
addedLinks: [
|
||||
{
|
||||
targets: ['grafana/dashboard/panel/menu'],
|
||||
title: 'Open in Traces Drilldown',
|
||||
description: 'Open current query in the Traces Drilldown app',
|
||||
},
|
||||
{
|
||||
targets: ['grafana/explore/toolbar/action'],
|
||||
title: 'Open in Grafana Traces Drilldown',
|
||||
description: 'Try our new queryless experience for traces',
|
||||
},
|
||||
],
|
||||
addedComponents: [
|
||||
{
|
||||
targets: ['grafana-asserts-app/entity-assertions-widget/v1'],
|
||||
title: 'Asserts widget',
|
||||
description: 'A block with assertions for a given service',
|
||||
},
|
||||
{
|
||||
targets: ['grafana-asserts-app/insights-timeline-widget/v1'],
|
||||
title: 'Insights Timeline Widget',
|
||||
description: 'Widget for displaying insights timeline in other apps',
|
||||
},
|
||||
],
|
||||
exposedComponents: [
|
||||
{
|
||||
id: 'grafana-exploretraces-app/open-in-explore-traces-button/v1',
|
||||
title: 'Open in Traces Drilldown button',
|
||||
description: 'A button that opens a traces view in the Traces Drilldown app.',
|
||||
},
|
||||
{
|
||||
id: 'grafana-exploretraces-app/embedded-trace-exploration/v1',
|
||||
title: 'Embedded Trace Exploration',
|
||||
description:
|
||||
'A component that renders a trace exploration view that can be embedded in other parts of Grafana.',
|
||||
},
|
||||
],
|
||||
extensionPoints: [
|
||||
{
|
||||
id: 'grafana-exploretraces-app/investigation/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
{
|
||||
id: 'grafana-exploretraces-app/get-logs-drilldown-link/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
],
|
||||
addedFunctions: [],
|
||||
},
|
||||
dependencies: {
|
||||
grafanaDependency: '>=11.5.0',
|
||||
grafanaVersion: '*',
|
||||
plugins: [],
|
||||
extensions: {
|
||||
exposedComponents: [
|
||||
'grafana-asserts-app/entity-assertions-widget/v1',
|
||||
'grafana-asserts-app/insights-timeline-widget/v1',
|
||||
],
|
||||
},
|
||||
},
|
||||
buildMode: 'production',
|
||||
},
|
||||
'grafana-lokiexplore-app': {
|
||||
id: 'grafana-lokiexplore-app',
|
||||
path: 'public/plugins/grafana-lokiexplore-app/module.js',
|
||||
version: '1.0.32',
|
||||
preload: true,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
angular: { detected: false } as AngularMeta,
|
||||
loadingStrategy: PluginLoadingStrategy.script,
|
||||
extensions: {
|
||||
addedLinks: [
|
||||
{
|
||||
targets: [
|
||||
'grafana/dashboard/panel/menu',
|
||||
'grafana/explore/toolbar/action',
|
||||
'grafana-metricsdrilldown-app/open-in-logs-drilldown/v1',
|
||||
'grafana-assistant-app/navigateToDrilldown/v1',
|
||||
],
|
||||
title: 'Open in Grafana Logs Drilldown',
|
||||
description: 'Open current query in the Grafana Logs Drilldown view',
|
||||
},
|
||||
],
|
||||
addedComponents: [
|
||||
{
|
||||
targets: ['grafana-asserts-app/insights-timeline-widget/v1'],
|
||||
title: 'Insights Timeline Widget',
|
||||
description: 'Widget for displaying insights timeline in other apps',
|
||||
},
|
||||
],
|
||||
exposedComponents: [
|
||||
{
|
||||
id: 'grafana-lokiexplore-app/open-in-explore-logs-button/v1',
|
||||
title: 'Open in Logs Drilldown button',
|
||||
description: 'A button that opens a logs view in the Logs Drilldown app.',
|
||||
},
|
||||
{
|
||||
id: 'grafana-lokiexplore-app/embedded-logs-exploration/v1',
|
||||
title: 'Embedded Logs Exploration',
|
||||
description:
|
||||
'A component that renders a logs exploration view that can be embedded in other parts of Grafana.',
|
||||
},
|
||||
],
|
||||
extensionPoints: [
|
||||
{
|
||||
id: 'grafana-lokiexplore-app/investigation/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
],
|
||||
addedFunctions: [
|
||||
{
|
||||
targets: ['grafana-exploretraces-app/get-logs-drilldown-link/v1'],
|
||||
title: 'Open Logs Drilldown',
|
||||
description: 'Returns url to logs drilldown app',
|
||||
},
|
||||
],
|
||||
},
|
||||
dependencies: {
|
||||
grafanaDependency: '>=11.6.0',
|
||||
grafanaVersion: '*',
|
||||
plugins: [],
|
||||
extensions: {
|
||||
exposedComponents: [
|
||||
'grafana-adaptivelogs-app/temporary-exemptions/v1',
|
||||
'grafana-lokiexplore-app/embedded-logs-exploration/v1',
|
||||
'grafana-asserts-app/insights-timeline-widget/v1',
|
||||
'grafana/add-to-dashboard-form/v1',
|
||||
],
|
||||
},
|
||||
},
|
||||
buildMode: 'production',
|
||||
},
|
||||
'grafana-metricsdrilldown-app': {
|
||||
id: 'grafana-metricsdrilldown-app',
|
||||
path: 'public/plugins/grafana-metricsdrilldown-app/module.js',
|
||||
version: '1.0.26',
|
||||
preload: true,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
angular: { detected: false } as AngularMeta,
|
||||
loadingStrategy: PluginLoadingStrategy.script,
|
||||
extensions: {
|
||||
addedLinks: [
|
||||
{
|
||||
targets: [
|
||||
'grafana/dashboard/panel/menu',
|
||||
'grafana/explore/toolbar/action',
|
||||
'grafana-assistant-app/navigateToDrilldown/v1',
|
||||
'grafana/alerting/alertingrule/queryeditor',
|
||||
],
|
||||
title: 'Open in Grafana Metrics Drilldown',
|
||||
description: 'Open current query in the Grafana Metrics Drilldown view',
|
||||
},
|
||||
{
|
||||
targets: ['grafana-metricsdrilldown-app/grafana-assistant-app/navigateToDrilldown/v0-alpha'],
|
||||
title: 'Navigate to metrics drilldown',
|
||||
description: 'Build a url path to the metrics drilldown',
|
||||
},
|
||||
{
|
||||
targets: ['grafana/datasources/config/actions', 'grafana/datasources/config/status'],
|
||||
title: 'Open in Metrics Drilldown',
|
||||
description: 'Browse metrics in Grafana Metrics Drilldown',
|
||||
},
|
||||
],
|
||||
addedComponents: [],
|
||||
exposedComponents: [
|
||||
{
|
||||
id: 'grafana-metricsdrilldown-app/label-breakdown-component/v1',
|
||||
title: 'Label Breakdown',
|
||||
description: 'A metrics label breakdown view from the Metrics Drilldown app.',
|
||||
},
|
||||
{
|
||||
id: 'grafana-metricsdrilldown-app/knowledge-graph-insight-metrics/v1',
|
||||
title: 'Knowledge Graph Source Metrics',
|
||||
description: 'Explore the underlying metrics related to a Knowledge Graph insight',
|
||||
},
|
||||
],
|
||||
extensionPoints: [
|
||||
{
|
||||
id: 'grafana-exploremetrics-app/investigation/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
{
|
||||
id: 'grafana-metricsdrilldown-app/open-in-logs-drilldown/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
],
|
||||
addedFunctions: [],
|
||||
},
|
||||
dependencies: {
|
||||
grafanaDependency: '>=11.6.0',
|
||||
grafanaVersion: '*',
|
||||
plugins: [],
|
||||
extensions: {
|
||||
exposedComponents: ['grafana/add-to-dashboard-form/v1'],
|
||||
},
|
||||
},
|
||||
buildMode: 'production',
|
||||
},
|
||||
'grafana-pyroscope-app': {
|
||||
id: 'grafana-pyroscope-app',
|
||||
path: 'public/plugins/grafana-pyroscope-app/module.js',
|
||||
version: '1.14.2',
|
||||
preload: true,
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
||||
angular: { detected: false } as AngularMeta,
|
||||
loadingStrategy: PluginLoadingStrategy.script,
|
||||
extensions: {
|
||||
addedLinks: [
|
||||
{
|
||||
targets: [
|
||||
'grafana/explore/toolbar/action',
|
||||
'grafana/traceview/details',
|
||||
'grafana-assistant-app/navigateToDrilldown/v1',
|
||||
],
|
||||
title: 'Open in Grafana Profiles Drilldown',
|
||||
description: 'Try our new queryless experience for profiles',
|
||||
},
|
||||
],
|
||||
addedComponents: [],
|
||||
exposedComponents: [
|
||||
{
|
||||
id: 'grafana-pyroscope-app/embedded-profiles-exploration/v1',
|
||||
title: 'Embedded Profiles Exploration',
|
||||
description:
|
||||
'A component that renders a profiles exploration view that can be embedded in other parts of Grafana.',
|
||||
},
|
||||
],
|
||||
extensionPoints: [
|
||||
{
|
||||
id: 'grafana-pyroscope-app/investigation/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
{
|
||||
id: 'grafana-pyroscope-app/settings/v1',
|
||||
title: '',
|
||||
description: '',
|
||||
},
|
||||
],
|
||||
addedFunctions: [],
|
||||
},
|
||||
dependencies: {
|
||||
grafanaDependency: '>=11.5.0',
|
||||
grafanaVersion: '*',
|
||||
plugins: [],
|
||||
extensions: {
|
||||
exposedComponents: [
|
||||
'grafana-o11yinsights-app/insights-launcher/v1',
|
||||
'grafana-adaptiveprofiles-app/resolution-boost/v1',
|
||||
],
|
||||
},
|
||||
},
|
||||
buildMode: 'production',
|
||||
},
|
||||
[app.id]: app,
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
10
packages/grafana-runtime/src/services/pluginMeta/types.ts
Normal file
10
packages/grafana-runtime/src/services/pluginMeta/types.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { AppPluginConfig } from '@grafana/data';
|
||||
|
||||
import type { Meta } from './types/meta_object_gen';
|
||||
|
||||
export type AppPluginMetas = Record<string, AppPluginConfig>;
|
||||
|
||||
export type AppPluginMetasMapper<T> = (response: T) => AppPluginMetas;
|
||||
export interface PluginMetasResponse {
|
||||
items: Meta[];
|
||||
}
|
||||
49
packages/grafana-runtime/src/services/pluginMeta/types/meta_object_gen.ts
generated
Normal file
49
packages/grafana-runtime/src/services/pluginMeta/types/meta_object_gen.ts
generated
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* This file was generated by grafana-app-sdk. DO NOT EDIT.
|
||||
*/
|
||||
import { Spec } from './types.spec.gen';
|
||||
import { Status } from './types.status.gen';
|
||||
|
||||
export interface Metadata {
|
||||
name: string;
|
||||
namespace: string;
|
||||
generateName?: string;
|
||||
selfLink?: string;
|
||||
uid?: string;
|
||||
resourceVersion?: string;
|
||||
generation?: number;
|
||||
creationTimestamp?: string;
|
||||
deletionTimestamp?: string;
|
||||
deletionGracePeriodSeconds?: number;
|
||||
labels?: Record<string, string>;
|
||||
annotations?: Record<string, string>;
|
||||
ownerReferences?: OwnerReference[];
|
||||
finalizers?: string[];
|
||||
managedFields?: ManagedFieldsEntry[];
|
||||
}
|
||||
|
||||
export interface OwnerReference {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
uid: string;
|
||||
controller?: boolean;
|
||||
blockOwnerDeletion?: boolean;
|
||||
}
|
||||
|
||||
export interface ManagedFieldsEntry {
|
||||
manager?: string;
|
||||
operation?: string;
|
||||
apiVersion?: string;
|
||||
time?: string;
|
||||
fieldsType?: string;
|
||||
subresource?: string;
|
||||
}
|
||||
|
||||
export interface Meta {
|
||||
kind: string;
|
||||
apiVersion: string;
|
||||
metadata: Metadata;
|
||||
spec: Spec;
|
||||
status: Status;
|
||||
}
|
||||
278
packages/grafana-runtime/src/services/pluginMeta/types/types.spec.gen.ts
generated
Normal file
278
packages/grafana-runtime/src/services/pluginMeta/types/types.spec.gen.ts
generated
Normal file
@@ -0,0 +1,278 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
// JSON configuration schema for Grafana plugins
|
||||
// Converted from: https://github.com/grafana/grafana/blob/main/docs/sources/developers/plugins/plugin.schema.json
|
||||
export interface JSONData {
|
||||
// Unique name of the plugin
|
||||
id: string;
|
||||
// Plugin type
|
||||
type: "app" | "datasource" | "panel" | "renderer";
|
||||
// Human-readable name of the plugin
|
||||
name: string;
|
||||
// Metadata for the plugin
|
||||
info: Info;
|
||||
// Dependency information
|
||||
dependencies: Dependencies;
|
||||
// Optional fields
|
||||
alerting?: boolean;
|
||||
annotations?: boolean;
|
||||
autoEnabled?: boolean;
|
||||
backend?: boolean;
|
||||
buildMode?: string;
|
||||
builtIn?: boolean;
|
||||
category?: "tsdb" | "logging" | "cloud" | "tracing" | "profiling" | "sql" | "enterprise" | "iot" | "other";
|
||||
enterpriseFeatures?: EnterpriseFeatures;
|
||||
executable?: string;
|
||||
hideFromList?: boolean;
|
||||
// +listType=atomic
|
||||
includes?: Include[];
|
||||
logs?: boolean;
|
||||
metrics?: boolean;
|
||||
multiValueFilterOperators?: boolean;
|
||||
pascalName?: string;
|
||||
preload?: boolean;
|
||||
queryOptions?: QueryOptions;
|
||||
// +listType=atomic
|
||||
routes?: Route[];
|
||||
skipDataQuery?: boolean;
|
||||
state?: "alpha" | "beta";
|
||||
streaming?: boolean;
|
||||
suggestions?: boolean;
|
||||
tracing?: boolean;
|
||||
iam?: IAM;
|
||||
// +listType=atomic
|
||||
roles?: Role[];
|
||||
extensions?: Extensions;
|
||||
}
|
||||
|
||||
export const defaultJSONData = (): JSONData => ({
|
||||
id: "",
|
||||
type: "app",
|
||||
name: "",
|
||||
info: defaultInfo(),
|
||||
dependencies: defaultDependencies(),
|
||||
});
|
||||
|
||||
export interface Info {
|
||||
// Required fields
|
||||
// +listType=set
|
||||
keywords: string[];
|
||||
logos: {
|
||||
small: string;
|
||||
large: string;
|
||||
};
|
||||
updated: string;
|
||||
version: string;
|
||||
// Optional fields
|
||||
author?: {
|
||||
name?: string;
|
||||
email?: string;
|
||||
url?: string;
|
||||
};
|
||||
description?: string;
|
||||
// +listType=atomic
|
||||
links?: {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}[];
|
||||
// +listType=atomic
|
||||
screenshots?: {
|
||||
name?: string;
|
||||
path?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultInfo = (): Info => ({
|
||||
keywords: [],
|
||||
logos: {
|
||||
small: "",
|
||||
large: "",
|
||||
},
|
||||
updated: "",
|
||||
version: "",
|
||||
});
|
||||
|
||||
export interface Dependencies {
|
||||
// Required field
|
||||
grafanaDependency: string;
|
||||
// Optional fields
|
||||
grafanaVersion?: string;
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
plugins?: {
|
||||
id: string;
|
||||
type: "app" | "datasource" | "panel";
|
||||
name: string;
|
||||
}[];
|
||||
extensions?: {
|
||||
// +listType=set
|
||||
exposedComponents?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
export const defaultDependencies = (): Dependencies => ({
|
||||
grafanaDependency: "",
|
||||
});
|
||||
|
||||
export interface EnterpriseFeatures {
|
||||
// Allow additional properties
|
||||
healthDiagnosticsErrors?: boolean;
|
||||
}
|
||||
|
||||
export const defaultEnterpriseFeatures = (): EnterpriseFeatures => ({
|
||||
healthDiagnosticsErrors: false,
|
||||
});
|
||||
|
||||
export interface Include {
|
||||
uid?: string;
|
||||
type?: "dashboard" | "page" | "panel" | "datasource";
|
||||
name?: string;
|
||||
component?: string;
|
||||
role?: "Admin" | "Editor" | "Viewer" | "None";
|
||||
action?: string;
|
||||
path?: string;
|
||||
addToNav?: boolean;
|
||||
defaultNav?: boolean;
|
||||
icon?: string;
|
||||
}
|
||||
|
||||
export const defaultInclude = (): Include => ({
|
||||
});
|
||||
|
||||
export interface QueryOptions {
|
||||
maxDataPoints?: boolean;
|
||||
minInterval?: boolean;
|
||||
cacheTimeout?: boolean;
|
||||
}
|
||||
|
||||
export const defaultQueryOptions = (): QueryOptions => ({
|
||||
});
|
||||
|
||||
export interface Route {
|
||||
path?: string;
|
||||
method?: string;
|
||||
url?: string;
|
||||
reqSignedIn?: boolean;
|
||||
reqRole?: string;
|
||||
reqAction?: string;
|
||||
// +listType=atomic
|
||||
headers?: string[];
|
||||
body?: Record<string, any>;
|
||||
tokenAuth?: {
|
||||
url?: string;
|
||||
// +listType=set
|
||||
scopes?: string[];
|
||||
params?: Record<string, any>;
|
||||
};
|
||||
jwtTokenAuth?: {
|
||||
url?: string;
|
||||
// +listType=set
|
||||
scopes?: string[];
|
||||
params?: Record<string, any>;
|
||||
};
|
||||
// +listType=atomic
|
||||
urlParams?: {
|
||||
name?: string;
|
||||
content?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultRoute = (): Route => ({
|
||||
});
|
||||
|
||||
export interface IAM {
|
||||
// +listType=atomic
|
||||
permissions?: {
|
||||
action?: string;
|
||||
scope?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultIAM = (): IAM => ({
|
||||
});
|
||||
|
||||
export interface Role {
|
||||
role?: {
|
||||
name?: string;
|
||||
description?: string;
|
||||
// +listType=atomic
|
||||
permissions?: {
|
||||
action?: string;
|
||||
scope?: string;
|
||||
}[];
|
||||
};
|
||||
// +listType=set
|
||||
grants?: string[];
|
||||
}
|
||||
|
||||
export const defaultRole = (): Role => ({
|
||||
});
|
||||
|
||||
export interface Extensions {
|
||||
// +listType=atomic
|
||||
addedComponents?: {
|
||||
// +listType=set
|
||||
targets: string[];
|
||||
title: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=atomic
|
||||
addedLinks?: {
|
||||
// +listType=set
|
||||
targets: string[];
|
||||
title: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=atomic
|
||||
addedFunctions?: {
|
||||
// +listType=set
|
||||
targets: string[];
|
||||
title: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
exposedComponents?: {
|
||||
id: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}[];
|
||||
// +listType=set
|
||||
// +listMapKey=id
|
||||
extensionPoints?: {
|
||||
id: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
export const defaultExtensions = (): Extensions => ({
|
||||
});
|
||||
|
||||
export interface Spec {
|
||||
pluginJson: JSONData;
|
||||
class: "core" | "external";
|
||||
module?: {
|
||||
path: string;
|
||||
hash?: string;
|
||||
loadingStrategy?: "fetch" | "script";
|
||||
};
|
||||
baseURL?: string;
|
||||
signature?: {
|
||||
status: "internal" | "valid" | "invalid" | "modified" | "unsigned";
|
||||
type?: "grafana" | "commercial" | "community" | "private" | "private-glob";
|
||||
org?: string;
|
||||
};
|
||||
angular?: {
|
||||
detected: boolean;
|
||||
};
|
||||
translations?: Record<string, string>;
|
||||
// +listType=atomic
|
||||
children?: string[];
|
||||
}
|
||||
|
||||
export const defaultSpec = (): Spec => ({
|
||||
pluginJson: defaultJSONData(),
|
||||
class: "core",
|
||||
});
|
||||
|
||||
30
packages/grafana-runtime/src/services/pluginMeta/types/types.status.gen.ts
generated
Normal file
30
packages/grafana-runtime/src/services/pluginMeta/types/types.status.gen.ts
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
export interface OperatorState {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
lastEvaluation: string;
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
state: "success" | "in_progress" | "failed";
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
descriptiveState?: string;
|
||||
// details contains any extra information that is operator-specific
|
||||
details?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultOperatorState = (): OperatorState => ({
|
||||
lastEvaluation: "",
|
||||
state: "success",
|
||||
});
|
||||
|
||||
export interface Status {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
operatorStates?: Record<string, OperatorState>;
|
||||
// additionalFields is reserved for future use
|
||||
additionalFields?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultStatus = (): Status => ({
|
||||
});
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
|
||||
import { VizLegendTable } from './VizLegendTable';
|
||||
import { VizLegendItem } from './types';
|
||||
|
||||
describe('VizLegendTable', () => {
|
||||
const mockItems: VizLegendItem[] = [
|
||||
{ label: 'Series 1', color: 'red', yAxis: 1 },
|
||||
{ label: 'Series 2', color: 'blue', yAxis: 1 },
|
||||
{ label: 'Series 3', color: 'green', yAxis: 1 },
|
||||
];
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const { container } = render(<VizLegendTable items={mockItems} placement="bottom" />);
|
||||
expect(container.querySelector('table')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders all items', () => {
|
||||
render(<VizLegendTable items={mockItems} placement="bottom" />);
|
||||
expect(screen.getByText('Series 1')).toBeInTheDocument();
|
||||
expect(screen.getByText('Series 2')).toBeInTheDocument();
|
||||
expect(screen.getByText('Series 3')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders table headers when items have display values', () => {
|
||||
const itemsWithStats: VizLegendItem[] = [
|
||||
{
|
||||
label: 'Series 1',
|
||||
color: 'red',
|
||||
yAxis: 1,
|
||||
getDisplayValues: () => [
|
||||
{ numeric: 100, text: '100', title: 'Max' },
|
||||
{ numeric: 50, text: '50', title: 'Min' },
|
||||
],
|
||||
},
|
||||
];
|
||||
render(<VizLegendTable items={itemsWithStats} placement="bottom" />);
|
||||
expect(screen.getByText('Max')).toBeInTheDocument();
|
||||
expect(screen.getByText('Min')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders sort icon when sorted', () => {
|
||||
const { container } = render(
|
||||
<VizLegendTable items={mockItems} placement="bottom" sortBy="Name" sortDesc={false} />
|
||||
);
|
||||
expect(container.querySelector('svg')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('calls onToggleSort when header is clicked', () => {
|
||||
const onToggleSort = jest.fn();
|
||||
render(<VizLegendTable items={mockItems} placement="bottom" onToggleSort={onToggleSort} isSortable={true} />);
|
||||
const header = screen.getByText('Name');
|
||||
header.click();
|
||||
expect(onToggleSort).toHaveBeenCalledWith('Name');
|
||||
});
|
||||
|
||||
it('does not call onToggleSort when not sortable', () => {
|
||||
const onToggleSort = jest.fn();
|
||||
render(<VizLegendTable items={mockItems} placement="bottom" onToggleSort={onToggleSort} isSortable={false} />);
|
||||
const header = screen.getByText('Name');
|
||||
header.click();
|
||||
expect(onToggleSort).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('renders with long labels', () => {
|
||||
const itemsWithLongLabels: VizLegendItem[] = [
|
||||
{
|
||||
label: 'This is a very long series name that should be scrollable within its table cell',
|
||||
color: 'red',
|
||||
yAxis: 1,
|
||||
},
|
||||
];
|
||||
render(<VizLegendTable items={itemsWithLongLabels} placement="bottom" />);
|
||||
expect(
|
||||
screen.getByText('This is a very long series name that should be scrollable within its table cell')
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -1,112 +0,0 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
|
||||
import { LegendTableItem } from './VizLegendTableItem';
|
||||
import { VizLegendItem } from './types';
|
||||
|
||||
describe('LegendTableItem', () => {
|
||||
const mockItem: VizLegendItem = {
|
||||
label: 'Series 1',
|
||||
color: 'red',
|
||||
yAxis: 1,
|
||||
};
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const { container } = render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={mockItem} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(container.querySelector('tr')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders label text', () => {
|
||||
render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={mockItem} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(screen.getByText('Series 1')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders with long label text', () => {
|
||||
const longLabelItem: VizLegendItem = {
|
||||
...mockItem,
|
||||
label: 'This is a very long series name that should be scrollable in the table cell',
|
||||
};
|
||||
render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={longLabelItem} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(
|
||||
screen.getByText('This is a very long series name that should be scrollable in the table cell')
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders stat values when provided', () => {
|
||||
const itemWithStats: VizLegendItem = {
|
||||
...mockItem,
|
||||
getDisplayValues: () => [
|
||||
{ numeric: 100, text: '100', title: 'Max' },
|
||||
{ numeric: 50, text: '50', title: 'Min' },
|
||||
],
|
||||
};
|
||||
render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={itemWithStats} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(screen.getByText('100')).toBeInTheDocument();
|
||||
expect(screen.getByText('50')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders right y-axis indicator when yAxis is 2', () => {
|
||||
const rightAxisItem: VizLegendItem = {
|
||||
...mockItem,
|
||||
yAxis: 2,
|
||||
};
|
||||
render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={rightAxisItem} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
expect(screen.getByText('(right y-axis)')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('calls onLabelClick when label is clicked', () => {
|
||||
const onLabelClick = jest.fn();
|
||||
render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={mockItem} onLabelClick={onLabelClick} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
const button = screen.getByRole('button');
|
||||
button.click();
|
||||
expect(onLabelClick).toHaveBeenCalledWith(mockItem, expect.any(Object));
|
||||
});
|
||||
|
||||
it('does not call onClick when readonly', () => {
|
||||
const onLabelClick = jest.fn();
|
||||
render(
|
||||
<table>
|
||||
<tbody>
|
||||
<LegendTableItem item={mockItem} onLabelClick={onLabelClick} readonly={true} />
|
||||
</tbody>
|
||||
</table>
|
||||
);
|
||||
const button = screen.getByRole('button');
|
||||
expect(button).toBeDisabled();
|
||||
});
|
||||
});
|
||||
@@ -69,7 +69,7 @@ export const LegendTableItem = ({
|
||||
|
||||
return (
|
||||
<tr className={cx(styles.row, className)}>
|
||||
<td className={styles.labelCell}>
|
||||
<td>
|
||||
<span className={styles.itemWrapper}>
|
||||
<VizLegendSeriesIcon
|
||||
color={item.color}
|
||||
@@ -77,26 +77,24 @@ export const LegendTableItem = ({
|
||||
readonly={readonly}
|
||||
lineStyle={item.lineStyle}
|
||||
/>
|
||||
<div className={styles.labelCellInner}>
|
||||
<button
|
||||
disabled={readonly}
|
||||
type="button"
|
||||
title={item.label}
|
||||
onBlur={onMouseOut}
|
||||
onFocus={onMouseOver}
|
||||
onMouseOver={onMouseOver}
|
||||
onMouseOut={onMouseOut}
|
||||
onClick={!readonly ? onClick : undefined}
|
||||
className={cx(styles.label, item.disabled && styles.labelDisabled)}
|
||||
>
|
||||
{item.label}{' '}
|
||||
{item.yAxis === 2 && (
|
||||
<span className={styles.yAxisLabel}>
|
||||
<Trans i18nKey="grafana-ui.viz-legend.right-axis-indicator">(right y-axis)</Trans>
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
disabled={readonly}
|
||||
type="button"
|
||||
title={item.label}
|
||||
onBlur={onMouseOut}
|
||||
onFocus={onMouseOver}
|
||||
onMouseOver={onMouseOver}
|
||||
onMouseOut={onMouseOut}
|
||||
onClick={!readonly ? onClick : undefined}
|
||||
className={cx(styles.label, item.disabled && styles.labelDisabled)}
|
||||
>
|
||||
{item.label}{' '}
|
||||
{item.yAxis === 2 && (
|
||||
<span className={styles.yAxisLabel}>
|
||||
<Trans i18nKey="grafana-ui.viz-legend.right-axis-indicator">(right y-axis)</Trans>
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
</span>
|
||||
</td>
|
||||
{item.getDisplayValues &&
|
||||
@@ -130,28 +128,6 @@ const getStyles = (theme: GrafanaTheme2) => {
|
||||
background: rowHoverBg,
|
||||
},
|
||||
}),
|
||||
labelCell: css({
|
||||
label: 'LegendLabelCell',
|
||||
maxWidth: 0,
|
||||
width: '100%',
|
||||
minWidth: theme.spacing(16),
|
||||
}),
|
||||
labelCellInner: css({
|
||||
label: 'LegendLabelCellInner',
|
||||
display: 'block',
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
overflowX: 'auto',
|
||||
overflowY: 'hidden',
|
||||
paddingRight: theme.spacing(3),
|
||||
scrollbarWidth: 'none',
|
||||
msOverflowStyle: 'none',
|
||||
maskImage: `linear-gradient(to right, black calc(100% - ${theme.spacing(3)}), transparent 100%)`,
|
||||
WebkitMaskImage: `linear-gradient(to right, black calc(100% - ${theme.spacing(3)}), transparent 100%)`,
|
||||
'&::-webkit-scrollbar': {
|
||||
display: 'none',
|
||||
},
|
||||
}),
|
||||
label: css({
|
||||
label: 'LegendLabel',
|
||||
whiteSpace: 'nowrap',
|
||||
@@ -159,6 +135,9 @@ const getStyles = (theme: GrafanaTheme2) => {
|
||||
border: 'none',
|
||||
fontSize: 'inherit',
|
||||
padding: 0,
|
||||
maxWidth: '600px',
|
||||
textOverflow: 'ellipsis',
|
||||
overflow: 'hidden',
|
||||
userSelect: 'text',
|
||||
}),
|
||||
labelDisabled: css({
|
||||
|
||||
@@ -42,7 +42,7 @@ func (r *converter) asDataSource(ds *datasources.DataSource) (*datasourceV0.Data
|
||||
Generation: int64(ds.Version),
|
||||
},
|
||||
Spec: datasourceV0.UnstructuredSpec{},
|
||||
Secure: ToInlineSecureValues(ds.Type, ds.UID, maps.Keys(ds.SecureJsonData)),
|
||||
Secure: ToInlineSecureValues("", ds.UID, maps.Keys(ds.SecureJsonData)),
|
||||
}
|
||||
obj.UID = gapiutil.CalculateClusterWideUID(obj)
|
||||
obj.Spec.SetTitle(ds.Name).
|
||||
@@ -82,18 +82,11 @@ func (r *converter) asDataSource(ds *datasources.DataSource) (*datasourceV0.Data
|
||||
|
||||
// ToInlineSecureValues converts secure json into InlineSecureValues with reference names
|
||||
// The names are predictable and can be used while we implement dual writing for secrets
|
||||
func ToInlineSecureValues(dsType string, dsUID string, keys iter.Seq[string]) common.InlineSecureValues {
|
||||
func ToInlineSecureValues(_ string, dsUID string, keys iter.Seq[string]) common.InlineSecureValues {
|
||||
values := make(common.InlineSecureValues)
|
||||
for k := range keys {
|
||||
h := sha256.New()
|
||||
h.Write([]byte(dsType)) // plugin id
|
||||
h.Write([]byte("|"))
|
||||
h.Write([]byte(dsUID)) // unique identifier
|
||||
h.Write([]byte("|"))
|
||||
h.Write([]byte(k)) // property name
|
||||
n := hex.EncodeToString(h.Sum(nil))
|
||||
values[k] = common.InlineSecureValue{
|
||||
Name: "ds-" + n[0:10], // predictable name for dual writing
|
||||
Name: getLegacySecureValueName(dsUID, k),
|
||||
}
|
||||
}
|
||||
if len(values) == 0 {
|
||||
@@ -102,6 +95,15 @@ func ToInlineSecureValues(dsType string, dsUID string, keys iter.Seq[string]) co
|
||||
return values
|
||||
}
|
||||
|
||||
func getLegacySecureValueName(dsUID string, key string) string {
|
||||
h := sha256.New()
|
||||
h.Write([]byte(dsUID)) // unique identifier
|
||||
h.Write([]byte("|"))
|
||||
h.Write([]byte(key)) // property name
|
||||
n := hex.EncodeToString(h.Sum(nil))
|
||||
return "ds-" + n[0:10] // predictable name for dual writing
|
||||
}
|
||||
|
||||
func (r *converter) toAddCommand(ds *datasourceV0.DataSource) (*datasources.AddDataSourceCommand, error) {
|
||||
if r.group != "" && ds.APIVersion != "" && !strings.HasPrefix(ds.APIVersion, r.group) {
|
||||
return nil, fmt.Errorf("expecting APIGroup: %s", r.group)
|
||||
|
||||
@@ -11,9 +11,11 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
|
||||
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
||||
"github.com/grafana/grafana/pkg/apis/datasource/v0alpha1"
|
||||
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
|
||||
"github.com/grafana/grafana/pkg/storage/legacysql/dualwrite"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -90,6 +92,20 @@ func (s *legacyStorage) Create(ctx context.Context, obj runtime.Object, createVa
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("expected a datasource object")
|
||||
}
|
||||
|
||||
// Verify the secure value commands
|
||||
for _, v := range ds.Secure {
|
||||
if v.Create.IsZero() {
|
||||
return nil, fmt.Errorf("secure values must use create when creating a new datasource")
|
||||
}
|
||||
if v.Remove {
|
||||
return nil, fmt.Errorf("secure values can not use remove when creating a new datasource")
|
||||
}
|
||||
if v.Name != "" {
|
||||
return nil, fmt.Errorf("secure values can not specify a name when creating a new datasource")
|
||||
}
|
||||
}
|
||||
|
||||
return s.datasources.CreateDataSource(ctx, ds)
|
||||
}
|
||||
|
||||
@@ -122,6 +138,26 @@ func (s *legacyStorage) Update(ctx context.Context, name string, objInfo rest.Up
|
||||
return nil, false, fmt.Errorf("expected a datasource object (old)")
|
||||
}
|
||||
|
||||
// Expose any secure value changes to the dual writer
|
||||
var secureChanges common.InlineSecureValues
|
||||
for k, v := range ds.Secure {
|
||||
if v.Remove || v.Create != "" {
|
||||
if secureChanges == nil {
|
||||
secureChanges = make(common.InlineSecureValues)
|
||||
}
|
||||
secureChanges[k] = v
|
||||
dualwrite.SetUpdatedSecureValues(ctx, ds.Secure)
|
||||
continue
|
||||
}
|
||||
|
||||
// The legacy store must use fixed names generated by the internal system
|
||||
// we can not support external shared secrets when using the SQL backing for datasources
|
||||
validName := getLegacySecureValueName(name, k)
|
||||
if v.Name != validName {
|
||||
return nil, false, fmt.Errorf("invalid secure value name %q, expected %q", v.Name, validName)
|
||||
}
|
||||
}
|
||||
|
||||
// Keep all the old secure values
|
||||
if len(oldDS.Secure) > 0 {
|
||||
for k, v := range oldDS.Secure {
|
||||
|
||||
@@ -30,6 +30,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/builder"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/apistore"
|
||||
"github.com/grafana/grafana/pkg/tsdb/grafana-testdata-datasource/kinds"
|
||||
)
|
||||
|
||||
@@ -102,10 +103,10 @@ func RegisterAPIService(
|
||||
datasources.GetDatasourceProvider(pluginJSON),
|
||||
contextProvider,
|
||||
accessControl,
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
DataSourceAPIBuilderConfig{
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
LoadQueryTypes: features.IsEnabledGlobally(featuremgmt.FlagDatasourceQueryTypes),
|
||||
UseDualWriter: false,
|
||||
UseDualWriter: features.IsEnabledGlobally(featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -224,6 +225,12 @@ func (b *DataSourceAPIBuilder) AllowedV0Alpha1Resources() []string {
|
||||
}
|
||||
|
||||
func (b *DataSourceAPIBuilder) UpdateAPIGroupInfo(apiGroupInfo *genericapiserver.APIGroupInfo, opts builder.APIGroupOptions) error {
|
||||
opts.StorageOptsRegister(b.datasourceResourceInfo.GroupResource(), apistore.StorageOptions{
|
||||
EnableFolderSupport: false,
|
||||
|
||||
Scheme: opts.Scheme, // allows for generic Type applied to multiple groups
|
||||
})
|
||||
|
||||
storage := map[string]rest.Storage{}
|
||||
|
||||
// Register the raw datasource connection
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
},
|
||||
"secure": {
|
||||
"password": {
|
||||
"name": "ds-d5c1b093af"
|
||||
"name": "ds-0d27eff323"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,10 +22,10 @@
|
||||
},
|
||||
"secure": {
|
||||
"extra": {
|
||||
"name": "ds-bb8b5d8b32"
|
||||
"name": "ds-6ed1b76e5d"
|
||||
},
|
||||
"password": {
|
||||
"name": "ds-973a1eb29d"
|
||||
"name": "ds-edc8fde0ac"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func (s *LocalInlineSecureValueService) CanReference(ctx context.Context, owner
|
||||
}
|
||||
|
||||
if owner.APIGroup == "" || owner.APIVersion == "" || owner.Kind == "" || owner.Name == "" {
|
||||
return fmt.Errorf("owner reference must have a valid API group, API version, kind and name")
|
||||
return fmt.Errorf("owner reference must have a valid API group, API version, kind and name [CanReference]")
|
||||
}
|
||||
|
||||
if len(names) == 0 {
|
||||
@@ -167,7 +167,7 @@ func (s *LocalInlineSecureValueService) verifyOwnerAndAuth(ctx context.Context,
|
||||
}
|
||||
|
||||
if owner.Namespace == "" || owner.APIGroup == "" || owner.APIVersion == "" || owner.Kind == "" || owner.Name == "" {
|
||||
return nil, fmt.Errorf("owner reference must have a valid API group, API version, kind, namespace and name")
|
||||
return nil, fmt.Errorf("owner reference must have a valid API group, API version, kind, namespace and name [verifyOwnerAndAuth:%+v]", owner)
|
||||
}
|
||||
|
||||
return authInfo, nil
|
||||
|
||||
35
pkg/storage/legacysql/dualwrite/context.go
Normal file
35
pkg/storage/legacysql/dualwrite/context.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package dualwrite
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
|
||||
)
|
||||
|
||||
type ctxKey struct{}
|
||||
|
||||
type dualWriteContext struct {
|
||||
updatedSecureValues common.InlineSecureValues
|
||||
}
|
||||
|
||||
func addToContext(ctx context.Context) context.Context {
|
||||
return context.WithValue(ctx, ctxKey{}, &dualWriteContext{})
|
||||
}
|
||||
|
||||
// Get the Requester from context
|
||||
func SetUpdatedSecureValues(ctx context.Context, sv common.InlineSecureValues) {
|
||||
u, ok := ctx.Value(ctxKey{}).(*dualWriteContext)
|
||||
if !ok || u == nil {
|
||||
return // OK, this can happen when things are in mode 0 (legacy only)
|
||||
}
|
||||
u.updatedSecureValues = sv
|
||||
}
|
||||
|
||||
// Get the Requester from context
|
||||
func getUpdatedSecureValues(ctx context.Context) common.InlineSecureValues {
|
||||
u, ok := ctx.Value(ctxKey{}).(*dualWriteContext)
|
||||
if !ok || u == nil {
|
||||
return nil
|
||||
}
|
||||
return u.updatedSecureValues
|
||||
}
|
||||
@@ -16,14 +16,15 @@ import (
|
||||
"k8s.io/apiserver/pkg/registry/rest"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/logging"
|
||||
|
||||
common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
)
|
||||
|
||||
var (
|
||||
_ grafanarest.Storage = (*dualWriter)(nil)
|
||||
tracer = otel.Tracer("github.com/grafana/grafana/pkg/storage/legacysql/dualwrite")
|
||||
_ grafanarest.Storage = (*dualWriter)(nil)
|
||||
|
||||
tracer = otel.Tracer("github.com/grafana/grafana/pkg/storage/legacysql/dualwrite")
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -203,7 +204,7 @@ func (d *dualWriter) Create(ctx context.Context, in runtime.Object, createValida
|
||||
|
||||
log := logging.FromContext(ctx).With("method", "Create")
|
||||
|
||||
accIn, err := meta.Accessor(in)
|
||||
accIn, err := utils.MetaAccessor(in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -216,19 +217,19 @@ func (d *dualWriter) Create(ctx context.Context, in runtime.Object, createValida
|
||||
return nil, fmt.Errorf("name or generatename have to be set")
|
||||
}
|
||||
|
||||
secure, err := accIn.GetSecureValues()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to read secure values %w", err)
|
||||
}
|
||||
|
||||
readFromUnifiedWriteToBothStorages := d.readUnified && d.legacy != nil && d.unified != nil
|
||||
|
||||
permissions := ""
|
||||
if readFromUnifiedWriteToBothStorages {
|
||||
objIn, err := utils.MetaAccessor(in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// keep permissions, we will set it back after the object is created
|
||||
permissions = objIn.GetAnnotation(utils.AnnoKeyGrantPermissions)
|
||||
permissions = accIn.GetAnnotation(utils.AnnoKeyGrantPermissions)
|
||||
if permissions != "" {
|
||||
objIn.SetAnnotation(utils.AnnoKeyGrantPermissions, "") // remove the annotation for now
|
||||
accIn.SetAnnotation(utils.AnnoKeyGrantPermissions, "") // remove the annotation for now
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,35 +242,36 @@ func (d *dualWriter) Create(ctx context.Context, in runtime.Object, createValida
|
||||
}
|
||||
|
||||
createdCopy := createdFromLegacy.DeepCopyObject()
|
||||
accCreated, err := meta.Accessor(createdCopy)
|
||||
accCreated, err := utils.MetaAccessor(createdCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
accCreated.SetResourceVersion("")
|
||||
accCreated.SetUID("")
|
||||
if secure != nil {
|
||||
if err = accCreated.SetSecureValues(secure); err != nil {
|
||||
return nil, fmt.Errorf("unable to set secure values on duplicate object %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if readFromUnifiedWriteToBothStorages {
|
||||
objCopy, err := utils.MetaAccessor(createdCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// restore the permissions annotation, as we removed it before creating in legacy
|
||||
if permissions != "" {
|
||||
objCopy.SetAnnotation(utils.AnnoKeyGrantPermissions, permissions)
|
||||
accCreated.SetAnnotation(utils.AnnoKeyGrantPermissions, permissions)
|
||||
}
|
||||
|
||||
// Propagate annotations and labels to the object saved in
|
||||
// unified storage, making sure the `deprecatedID` is saved
|
||||
// as well as provisioning metadata, when present.
|
||||
for name, val := range accIn.GetAnnotations() {
|
||||
objCopy.SetAnnotation(name, val)
|
||||
accCreated.SetAnnotation(name, val)
|
||||
}
|
||||
|
||||
legacyAcc, err := meta.Accessor(createdFromLegacy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objCopy.SetLabels(legacyAcc.GetLabels())
|
||||
accCreated.SetLabels(legacyAcc.GetLabels())
|
||||
}
|
||||
|
||||
// If unified storage is the primary storage, let's just create it in the foreground and return it.
|
||||
@@ -384,6 +386,7 @@ func (d *dualWriter) Update(ctx context.Context, name string, objInfo rest.Updat
|
||||
// but legacy failed, the user would get a failure, but see the update did apply to the source
|
||||
// of truth, and be less likely to retry to save (and get the stores in sync again)
|
||||
|
||||
ctx = addToContext(ctx)
|
||||
legacyInfo := objInfo
|
||||
legacyForceCreate := forceAllowCreate
|
||||
unifiedInfo := objInfo
|
||||
@@ -417,6 +420,14 @@ func (d *dualWriter) Update(ctx context.Context, name string, objInfo rest.Updat
|
||||
}
|
||||
}
|
||||
|
||||
// Propagate secure values from the update request to the unified storage update.
|
||||
if secure := getUpdatedSecureValues(ctx); secure != nil {
|
||||
wrapped, ok := unifiedInfo.(*wrappedUpdateInfo)
|
||||
if ok {
|
||||
wrapped.updatedSecureValues = secure
|
||||
}
|
||||
}
|
||||
|
||||
if d.readUnified {
|
||||
return d.unified.Update(ctx, name, unifiedInfo, createValidation, updateValidation, unifiedForceCreate, options)
|
||||
} else if d.errorIsOK {
|
||||
@@ -515,9 +526,10 @@ func (d *dualWriter) ConvertToTable(ctx context.Context, object runtime.Object,
|
||||
}
|
||||
|
||||
type wrappedUpdateInfo struct {
|
||||
objInfo rest.UpdatedObjectInfo
|
||||
legacyLabels map[string]string
|
||||
legacyAnnotations map[string]string
|
||||
objInfo rest.UpdatedObjectInfo
|
||||
legacyLabels map[string]string
|
||||
legacyAnnotations map[string]string
|
||||
updatedSecureValues common.InlineSecureValues
|
||||
}
|
||||
|
||||
// Preconditions implements rest.UpdatedObjectInfo.
|
||||
@@ -560,6 +572,13 @@ func (w *wrappedUpdateInfo) UpdatedObject(ctx context.Context, oldObj runtime.Ob
|
||||
|
||||
meta.SetResourceVersion("")
|
||||
meta.SetUID("")
|
||||
|
||||
if w.updatedSecureValues != nil {
|
||||
if err = meta.SetSecureValues(w.updatedSecureValues); err != nil {
|
||||
return nil, fmt.Errorf("unable to set secure values on duplicate object %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return obj, err
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@ package apistore
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
@@ -83,6 +85,9 @@ func (s *Storage) prepareObjectForStorage(ctx context.Context, newObject runtime
|
||||
if !ok {
|
||||
return v, errors.New("missing auth info")
|
||||
}
|
||||
if err := s.checkGVK(newObject); err != nil {
|
||||
return v, err
|
||||
}
|
||||
|
||||
obj, err := utils.MetaAccessor(newObject)
|
||||
if err != nil {
|
||||
@@ -138,8 +143,7 @@ func (s *Storage) prepareObjectForStorage(ctx context.Context, newObject runtime
|
||||
return v, err
|
||||
}
|
||||
|
||||
err = s.codec.Encode(newObject, &v.raw)
|
||||
if err == nil {
|
||||
if err = s.encode(newObject, &v.raw); err == nil {
|
||||
err = s.handleLargeResources(ctx, obj, &v.raw)
|
||||
}
|
||||
return v, err
|
||||
@@ -152,6 +156,9 @@ func (s *Storage) prepareObjectForUpdate(ctx context.Context, updateObject runti
|
||||
if !ok {
|
||||
return v, errors.New("missing auth info")
|
||||
}
|
||||
if err := s.checkGVK(updateObject); err != nil {
|
||||
return v, err
|
||||
}
|
||||
|
||||
obj, err := utils.MetaAccessor(updateObject)
|
||||
if err != nil {
|
||||
@@ -233,8 +240,7 @@ func (s *Storage) prepareObjectForUpdate(ctx context.Context, updateObject runti
|
||||
obj.SetAnnotation(utils.AnnoKeyUpdatedTimestamp, previous.GetAnnotation(utils.AnnoKeyUpdatedTimestamp))
|
||||
}
|
||||
|
||||
err = s.codec.Encode(updateObject, &v.raw)
|
||||
if err == nil {
|
||||
if err = s.encode(updateObject, &v.raw); err == nil {
|
||||
err = s.handleLargeResources(ctx, obj, &v.raw)
|
||||
}
|
||||
return v, err
|
||||
@@ -268,7 +274,51 @@ func (s *Storage) handleLargeResources(ctx context.Context, obj utils.GrafanaMet
|
||||
}
|
||||
|
||||
// Now encode the smaller version
|
||||
return s.codec.Encode(orig, buf)
|
||||
return s.encode(orig, buf)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Storage) checkGVK(obj runtime.Object) error {
|
||||
if s.opts.Scheme == nil {
|
||||
return nil // we can not do anything
|
||||
}
|
||||
|
||||
// Ensure group+version+kind are configured
|
||||
info := obj.GetObjectKind()
|
||||
gvk := info.GroupVersionKind()
|
||||
if gvk.Group == "" || gvk.Kind == "" || gvk.Version == "" {
|
||||
gvks, _, err := s.opts.Scheme.ObjectKinds(obj)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unknown object kind %w", err)
|
||||
}
|
||||
for _, v := range gvks {
|
||||
if v.Group != s.gr.Group {
|
||||
continue // skip values not in this group
|
||||
}
|
||||
gvk.Group = v.Group
|
||||
gvk.Kind = v.Kind
|
||||
if gvk.Version == "" {
|
||||
gvk.Version = v.Version
|
||||
}
|
||||
info.SetGroupVersionKind(gvk)
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Storage) encode(obj runtime.Object, w io.Writer) error {
|
||||
// The standard encoder is fine when only one type maps to a group
|
||||
if s.opts.Scheme == nil {
|
||||
return s.codec.Encode(obj, w)
|
||||
}
|
||||
if err := s.checkGVK(obj); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// This will always write the saved GVK, unlike:
|
||||
// https://github.com/kubernetes/kubernetes/blob/v1.34.3/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/versioning/versioning.go#L267
|
||||
// that picks an arbitrary GVK that may not match the same group!
|
||||
return json.NewEncoder(w).Encode(obj)
|
||||
}
|
||||
|
||||
@@ -33,9 +33,11 @@ func TestPrepareObjectForStorage(t *testing.T) {
|
||||
node, err := snowflake.NewNode(rand.Int64N(1024))
|
||||
require.NoError(t, err)
|
||||
s := &Storage{
|
||||
gr: dashv1.DashboardResourceInfo.GroupResource(),
|
||||
codec: apitesting.TestCodec(rtcodecs, dashv1.DashboardResourceInfo.GroupVersion()),
|
||||
snowflake: node,
|
||||
opts: StorageOptions{
|
||||
Scheme: rtscheme,
|
||||
EnableFolderSupport: true,
|
||||
LargeObjectSupport: nil,
|
||||
MaximumNameLength: 100,
|
||||
|
||||
@@ -57,6 +57,8 @@ type DefaultPermissionSetter = func(ctx context.Context, key *resourcepb.Resourc
|
||||
|
||||
// Optional settings that apply to a single resource
|
||||
type StorageOptions struct {
|
||||
Scheme *runtime.Scheme
|
||||
|
||||
// ????: should we constrain this to only dashboards for now?
|
||||
// Not yet clear if this is a good general solution, or just a stop-gap
|
||||
LargeObjectSupport LargeObjectSupport
|
||||
|
||||
@@ -5,6 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@@ -13,9 +15,11 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
||||
grafanarest "github.com/grafana/grafana/pkg/apiserver/rest"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/tests/apis"
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
"github.com/grafana/grafana/pkg/tests/testsuite"
|
||||
@@ -28,112 +32,192 @@ func TestMain(m *testing.M) {
|
||||
|
||||
func TestIntegrationTestDatasource(t *testing.T) {
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
expectedAPIVersion := "grafana-testdata-datasource.datasource.grafana.app/v0alpha1"
|
||||
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
AppModeProduction: false, // dev mode required for datasource connections
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the example service
|
||||
},
|
||||
})
|
||||
for _, mode := range []grafanarest.DualWriterMode{
|
||||
grafanarest.Mode0, // Legacy only
|
||||
grafanarest.Mode2, // write both, read legacy
|
||||
grafanarest.Mode3, // write both, read unified
|
||||
grafanarest.Mode5, // Unified only
|
||||
} {
|
||||
t.Run(fmt.Sprintf("testdata (mode:%d)", mode), func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
helper := apis.NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
DisableAnonymous: true,
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagGrafanaAPIServerWithExperimentalAPIs, // Required to start the datasource api servers
|
||||
featuremgmt.FlagQueryServiceWithConnections, // enables CRUD endpoints
|
||||
},
|
||||
UnifiedStorageConfig: map[string]setting.UnifiedStorageConfig{
|
||||
"datasources.grafana-testdata-datasource.datasource.grafana.app": {
|
||||
DualWriterMode: mode,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Create a single datasource
|
||||
ds := helper.CreateDS(&datasources.AddDataSourceCommand{
|
||||
Name: "test",
|
||||
Type: datasources.DS_TESTDATA,
|
||||
UID: "test",
|
||||
OrgID: int64(1),
|
||||
client := helper.Org1.Admin.ResourceClient(t, schema.GroupVersionResource{
|
||||
Group: "grafana-testdata-datasource.datasource.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
Resource: "datasources",
|
||||
}).Namespace("default")
|
||||
|
||||
// These settings are not actually used, but testing that they get saved
|
||||
Database: "testdb",
|
||||
URL: "http://fake.url",
|
||||
Access: datasources.DS_ACCESS_PROXY,
|
||||
User: "example",
|
||||
ReadOnly: true,
|
||||
JsonData: simplejson.NewFromAny(map[string]any{
|
||||
"hello": "world",
|
||||
}),
|
||||
SecureJsonData: map[string]string{
|
||||
"aaa": "AAA",
|
||||
"bbb": "BBB",
|
||||
},
|
||||
})
|
||||
require.Equal(t, "test", ds.UID)
|
||||
t.Run("create", func(t *testing.T) {
|
||||
out, err := client.Create(ctx, &unstructured.Unstructured{
|
||||
Object: map[string]any{
|
||||
"apiVersion": "grafana-testdata-datasource.datasource.grafana.app/v0alpha1",
|
||||
"kind": "DataSource",
|
||||
"metadata": map[string]any{
|
||||
"name": "test",
|
||||
},
|
||||
"spec": map[string]any{
|
||||
"title": "test",
|
||||
},
|
||||
"secure": map[string]any{
|
||||
"aaa": map[string]any{
|
||||
"create": "AAA",
|
||||
},
|
||||
"bbb": map[string]any{
|
||||
"create": "BBB",
|
||||
},
|
||||
},
|
||||
},
|
||||
}, metav1.CreateOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "test", out.GetName())
|
||||
require.Equal(t, expectedAPIVersion, out.GetAPIVersion())
|
||||
|
||||
t.Run("Admin configs", func(t *testing.T) {
|
||||
client := helper.Org1.Admin.ResourceClient(t, schema.GroupVersionResource{
|
||||
Group: "grafana-testdata-datasource.datasource.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
Resource: "datasources",
|
||||
}).Namespace("default")
|
||||
ctx := context.Background()
|
||||
obj, err := utils.MetaAccessor(out)
|
||||
require.NoError(t, err)
|
||||
|
||||
list, err := client.List(ctx, metav1.ListOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Len(t, list.Items, 1, "expected a single connection")
|
||||
require.Equal(t, "test", list.Items[0].GetName(), "with the test uid")
|
||||
secure, err := obj.GetSecureValues()
|
||||
require.NoError(t, err)
|
||||
|
||||
spec, _, _ := unstructured.NestedMap(list.Items[0].Object, "spec")
|
||||
jj, _ := json.MarshalIndent(spec, "", " ")
|
||||
fmt.Printf("%s\n", string(jj))
|
||||
require.JSONEq(t, `{
|
||||
"access": "proxy",
|
||||
"database": "testdb",
|
||||
"isDefault": true,
|
||||
"jsonData": {
|
||||
"hello": "world"
|
||||
},
|
||||
"readOnly": true,
|
||||
"title": "test",
|
||||
"url": "http://fake.url",
|
||||
"user": "example"
|
||||
}`, string(jj))
|
||||
})
|
||||
keys := slices.Collect(maps.Keys(secure))
|
||||
require.ElementsMatch(t, []string{"aaa", "bbb"}, keys)
|
||||
})
|
||||
|
||||
t.Run("Call subresources", func(t *testing.T) {
|
||||
client := helper.Org1.Admin.ResourceClient(t, schema.GroupVersionResource{
|
||||
Group: "grafana-testdata-datasource.datasource.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
Resource: "datasources",
|
||||
}).Namespace("default")
|
||||
ctx := context.Background()
|
||||
t.Run("update", func(t *testing.T) {
|
||||
out, err := client.Update(ctx, &unstructured.Unstructured{
|
||||
Object: map[string]any{
|
||||
"apiVersion": "grafana-testdata-datasource.datasource.grafana.app/v0alpha1",
|
||||
"metadata": map[string]any{
|
||||
"name": "test",
|
||||
},
|
||||
"spec": map[string]any{
|
||||
"title": "test",
|
||||
"database": "testdb",
|
||||
"url": "http://fake.url",
|
||||
"access": datasources.DS_ACCESS_PROXY,
|
||||
"user": "example",
|
||||
"isDefault": true,
|
||||
"readOnly": true,
|
||||
"jsonData": map[string]any{
|
||||
"hello": "world",
|
||||
},
|
||||
},
|
||||
"secure": map[string]any{
|
||||
// "aaa": map[string]any{
|
||||
// "remove": true, // remove does not really remove in legacy!
|
||||
// },
|
||||
"ccc": map[string]any{
|
||||
"create": "CCC", // add a third value
|
||||
},
|
||||
},
|
||||
},
|
||||
}, metav1.UpdateOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "test", out.GetName())
|
||||
require.Equal(t, expectedAPIVersion, out.GetAPIVersion())
|
||||
|
||||
list, err := client.List(ctx, metav1.ListOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Len(t, list.Items, 1, "expected a single connection")
|
||||
require.Equal(t, "test", list.Items[0].GetName(), "with the test uid")
|
||||
obj, err := utils.MetaAccessor(out)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = client.Get(ctx, "test", metav1.GetOptions{}, "health")
|
||||
// endpoint is disabled currently because it has not been
|
||||
// sufficiently tested.
|
||||
// for more info see pkg/registry/apis/datasource/sub_health.go
|
||||
require.Error(t, err)
|
||||
var statusErr *apierrors.StatusError
|
||||
require.True(t, errors.As(err, &statusErr))
|
||||
require.Equal(t, int32(501), statusErr.ErrStatus.Code)
|
||||
// require.NoError(t, err)
|
||||
// body, err := rsp.MarshalJSON()
|
||||
// require.NoError(t, err)
|
||||
// //fmt.Printf("GOT: %v\n", string(body))
|
||||
// require.JSONEq(t, `{
|
||||
// "apiVersion": "testdata.datasource.grafana.app/v0alpha1",
|
||||
// "code": 1,
|
||||
// "kind": "HealthCheckResult",
|
||||
// "message": "Data source is working",
|
||||
// "status": "OK"
|
||||
// }
|
||||
// `, string(body))
|
||||
secure, err := obj.GetSecureValues()
|
||||
require.NoError(t, err)
|
||||
|
||||
// Test connecting to non-JSON marshaled data
|
||||
raw := apis.DoRequest[any](helper, apis.RequestParams{
|
||||
User: helper.Org1.Admin,
|
||||
Method: "GET",
|
||||
Path: "/apis/grafana-testdata-datasource.datasource.grafana.app/v0alpha1/namespaces/default/datasources/test/resource",
|
||||
}, nil)
|
||||
// endpoint is disabled currently because it has not been
|
||||
// sufficiently tested.
|
||||
// for more info see pkg/registry/apis/datasource/sub_resource.go
|
||||
require.Equal(t, int32(501), raw.Status.Code)
|
||||
// require.Equal(t, `Hello world from test datasource!`, string(raw.Body))
|
||||
})
|
||||
keys := slices.Collect(maps.Keys(secure))
|
||||
require.ElementsMatch(t, []string{"aaa", "bbb", "ccc"}, keys)
|
||||
})
|
||||
|
||||
t.Run("list", func(t *testing.T) {
|
||||
list, err := client.List(ctx, metav1.ListOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expectedAPIVersion, list.GetAPIVersion())
|
||||
require.Len(t, list.Items, 1, "expected a single datasource")
|
||||
require.Equal(t, "test", list.Items[0].GetName(), "with the test uid")
|
||||
|
||||
spec, _, _ := unstructured.NestedMap(list.Items[0].Object, "spec")
|
||||
jj, _ := json.MarshalIndent(spec, "", " ")
|
||||
// fmt.Printf("%s\n", string(jj))
|
||||
require.JSONEq(t, `{
|
||||
"access": "proxy",
|
||||
"database": "testdb",
|
||||
"isDefault": true,
|
||||
"jsonData": {
|
||||
"hello": "world"
|
||||
},
|
||||
"readOnly": true,
|
||||
"title": "test",
|
||||
"url": "http://fake.url",
|
||||
"user": "example"
|
||||
}`, string(jj))
|
||||
})
|
||||
|
||||
t.Run("execute", func(t *testing.T) {
|
||||
client := helper.Org1.Admin.ResourceClient(t, schema.GroupVersionResource{
|
||||
Group: "grafana-testdata-datasource.datasource.grafana.app",
|
||||
Version: "v0alpha1",
|
||||
Resource: "datasources",
|
||||
}).Namespace("default")
|
||||
ctx := context.Background()
|
||||
|
||||
list, err := client.List(ctx, metav1.ListOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Len(t, list.Items, 1, "expected a single connection")
|
||||
require.Equal(t, "test", list.Items[0].GetName(), "with the test uid")
|
||||
|
||||
_, err = client.Get(ctx, "test", metav1.GetOptions{}, "health")
|
||||
// endpoint is disabled currently because it has not been
|
||||
// sufficiently tested.
|
||||
// for more info see pkg/registry/apis/datasource/sub_health.go
|
||||
require.Error(t, err)
|
||||
var statusErr *apierrors.StatusError
|
||||
require.True(t, errors.As(err, &statusErr))
|
||||
require.Equal(t, int32(501), statusErr.ErrStatus.Code)
|
||||
// require.NoError(t, err)
|
||||
// body, err := rsp.MarshalJSON()
|
||||
// require.NoError(t, err)
|
||||
// //fmt.Printf("GOT: %v\n", string(body))
|
||||
// require.JSONEq(t, `{
|
||||
// "apiVersion": "grafana-testdata-datasource.datasource.grafana.app/v0alpha1",
|
||||
// "code": 1,
|
||||
// "kind": "HealthCheckResult",
|
||||
// "message": "Data source is working",
|
||||
// "status": "OK"
|
||||
// }
|
||||
// `, string(body))
|
||||
|
||||
// Test connecting to non-JSON marshaled data
|
||||
raw := apis.DoRequest[any](helper, apis.RequestParams{
|
||||
User: helper.Org1.Admin,
|
||||
Method: "GET",
|
||||
Path: "/apis/grafana-testdata-datasource.datasource.grafana.app/v0alpha1/namespaces/default/datasources/test/resource",
|
||||
}, nil)
|
||||
// endpoint is disabled currently because it has not been
|
||||
// sufficiently tested.
|
||||
// for more info see pkg/registry/apis/datasource/sub_resource.go
|
||||
require.Equal(t, int32(501), raw.Status.Code)
|
||||
// require.Equal(t, `Hello world from test datasource!`, string(raw.Body))
|
||||
})
|
||||
|
||||
t.Run("delete", func(t *testing.T) {
|
||||
err := client.Delete(ctx, "test", metav1.DeleteOptions{})
|
||||
require.NoError(t, err)
|
||||
|
||||
list, err := client.List(ctx, metav1.ListOptions{})
|
||||
require.NoError(t, err)
|
||||
require.Empty(t, list.Items)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,98 @@
|
||||
],
|
||||
"description": "list objects of kind DataSource",
|
||||
"operationId": "listDataSource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "allowWatchBookmarks",
|
||||
"in": "query",
|
||||
"description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "continue",
|
||||
"in": "query",
|
||||
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldSelector",
|
||||
"in": "query",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "labelSelector",
|
||||
"in": "query",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resourceVersion",
|
||||
"in": "query",
|
||||
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resourceVersionMatch",
|
||||
"in": "query",
|
||||
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sendInitialEvents",
|
||||
"in": "query",
|
||||
"description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query",
|
||||
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "watch",
|
||||
"in": "query",
|
||||
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
@@ -142,52 +234,285 @@
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"tags": [
|
||||
"DataSource"
|
||||
],
|
||||
"description": "create a DataSource",
|
||||
"operationId": "createDataSource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "dryRun",
|
||||
"in": "query",
|
||||
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldManager",
|
||||
"in": "query",
|
||||
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldValidation",
|
||||
"in": "query",
|
||||
"description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"202": {
|
||||
"description": "Accepted",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "post",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "grafana-testdata-datasource.datasource.grafana.app",
|
||||
"version": "v0alpha1",
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"tags": [
|
||||
"DataSource"
|
||||
],
|
||||
"description": "delete collection of DataSource",
|
||||
"operationId": "deletecollectionDataSource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "continue",
|
||||
"in": "query",
|
||||
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dryRun",
|
||||
"in": "query",
|
||||
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldSelector",
|
||||
"in": "query",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "gracePeriodSeconds",
|
||||
"in": "query",
|
||||
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ignoreStoreReadErrorWithClusterBreakingPotential",
|
||||
"in": "query",
|
||||
"description": "if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "labelSelector",
|
||||
"in": "query",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "orphanDependents",
|
||||
"in": "query",
|
||||
"description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "propagationPolicy",
|
||||
"in": "query",
|
||||
"description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resourceVersion",
|
||||
"in": "query",
|
||||
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resourceVersionMatch",
|
||||
"in": "query",
|
||||
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sendInitialEvents",
|
||||
"in": "query",
|
||||
"description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query",
|
||||
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "deletecollection",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "grafana-testdata-datasource.datasource.grafana.app",
|
||||
"version": "v0alpha1",
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "allowWatchBookmarks",
|
||||
"in": "query",
|
||||
"description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "continue",
|
||||
"in": "query",
|
||||
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldSelector",
|
||||
"in": "query",
|
||||
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "labelSelector",
|
||||
"in": "query",
|
||||
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "namespace",
|
||||
"in": "path",
|
||||
@@ -206,51 +531,6 @@
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resourceVersion",
|
||||
"in": "query",
|
||||
"description": "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "resourceVersionMatch",
|
||||
"in": "query",
|
||||
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "sendInitialEvents",
|
||||
"in": "query",
|
||||
"description": "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "timeoutSeconds",
|
||||
"in": "query",
|
||||
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "watch",
|
||||
"in": "query",
|
||||
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -290,6 +570,330 @@
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"tags": [
|
||||
"DataSource"
|
||||
],
|
||||
"description": "replace the specified DataSource",
|
||||
"operationId": "replaceDataSource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "dryRun",
|
||||
"in": "query",
|
||||
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldManager",
|
||||
"in": "query",
|
||||
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldValidation",
|
||||
"in": "query",
|
||||
"description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "put",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "grafana-testdata-datasource.datasource.grafana.app",
|
||||
"version": "v0alpha1",
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"tags": [
|
||||
"DataSource"
|
||||
],
|
||||
"description": "delete a DataSource",
|
||||
"operationId": "deleteDataSource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "dryRun",
|
||||
"in": "query",
|
||||
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "gracePeriodSeconds",
|
||||
"in": "query",
|
||||
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ignoreStoreReadErrorWithClusterBreakingPotential",
|
||||
"in": "query",
|
||||
"description": "if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "orphanDependents",
|
||||
"in": "query",
|
||||
"description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "propagationPolicy",
|
||||
"in": "query",
|
||||
"description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"202": {
|
||||
"description": "Accepted",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Status"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "delete",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "grafana-testdata-datasource.datasource.grafana.app",
|
||||
"version": "v0alpha1",
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"patch": {
|
||||
"tags": [
|
||||
"DataSource"
|
||||
],
|
||||
"description": "partially update the specified DataSource",
|
||||
"operationId": "updateDataSource",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "dryRun",
|
||||
"in": "query",
|
||||
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldManager",
|
||||
"in": "query",
|
||||
"description": "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "fieldValidation",
|
||||
"in": "query",
|
||||
"description": "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "force",
|
||||
"in": "query",
|
||||
"description": "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.",
|
||||
"schema": {
|
||||
"type": "boolean",
|
||||
"uniqueItems": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/apply-patch+yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
|
||||
}
|
||||
},
|
||||
"application/json-patch+json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
|
||||
}
|
||||
},
|
||||
"application/merge-patch+json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
|
||||
}
|
||||
},
|
||||
"application/strategic-merge-patch+json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Patch"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"201": {
|
||||
"description": "Created",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/vnd.kubernetes.protobuf": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
},
|
||||
"application/yaml": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/com.github.grafana.grafana.pkg.apis.datasource.v0alpha1.DataSource"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-kubernetes-action": "patch",
|
||||
"x-kubernetes-group-version-kind": {
|
||||
"group": "grafana-testdata-datasource.datasource.grafana.app",
|
||||
"version": "v0alpha1",
|
||||
"kind": "DataSource"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "name",
|
||||
@@ -946,6 +1550,54 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": {
|
||||
"description": "DeleteOptions may be provided when deleting an API object.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
|
||||
"type": "string"
|
||||
},
|
||||
"dryRun": {
|
||||
"description": "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"gracePeriodSeconds": {
|
||||
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"ignoreStoreReadErrorWithClusterBreakingPotential": {
|
||||
"description": "if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it",
|
||||
"type": "boolean"
|
||||
},
|
||||
"kind": {
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
|
||||
"type": "string"
|
||||
},
|
||||
"orphanDependents": {
|
||||
"description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"preconditions": {
|
||||
"description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions"
|
||||
}
|
||||
]
|
||||
},
|
||||
"propagationPolicy": {
|
||||
"description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1": {
|
||||
"description": "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff",
|
||||
"type": "object"
|
||||
@@ -1169,6 +1821,131 @@
|
||||
},
|
||||
"x-kubernetes-map-type": "atomic"
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.Patch": {
|
||||
"description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.",
|
||||
"type": "object"
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": {
|
||||
"description": "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resourceVersion": {
|
||||
"description": "Specifies the target ResourceVersion",
|
||||
"type": "string"
|
||||
},
|
||||
"uid": {
|
||||
"description": "Specifies the target UID.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.Status": {
|
||||
"description": "Status is a return value for calls that don't return other objects.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"apiVersion": {
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"description": "Suggested HTTP return code for this status, 0 if not set.",
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"details": {
|
||||
"description": "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails"
|
||||
}
|
||||
],
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"kind": {
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"description": "A human-readable description of the status of this operation.",
|
||||
"type": "string"
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
|
||||
"default": {},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
|
||||
}
|
||||
]
|
||||
},
|
||||
"reason": {
|
||||
"description": "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.",
|
||||
"type": "string"
|
||||
},
|
||||
"status": {
|
||||
"description": "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause": {
|
||||
"description": "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"field": {
|
||||
"description": "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"",
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"description": "A human-readable description of the cause of the error. This field may be presented as-is to a reader.",
|
||||
"type": "string"
|
||||
},
|
||||
"reason": {
|
||||
"description": "A machine-readable description of the cause of the error. If this value is empty there is no information available.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.StatusDetails": {
|
||||
"description": "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"causes": {
|
||||
"description": "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"default": {},
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.StatusCause"
|
||||
}
|
||||
]
|
||||
},
|
||||
"x-kubernetes-list-type": "atomic"
|
||||
},
|
||||
"group": {
|
||||
"description": "The group attribute of the resource associated with the status StatusReason.",
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"description": "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"description": "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).",
|
||||
"type": "string"
|
||||
},
|
||||
"retryAfterSeconds": {
|
||||
"description": "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.",
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"uid": {
|
||||
"description": "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"io.k8s.apimachinery.pkg.apis.meta.v1.Time": {
|
||||
"description": "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.",
|
||||
"type": "string",
|
||||
|
||||
@@ -1108,12 +1108,7 @@ export class ElementState implements LayerElement {
|
||||
tabIndex={0}
|
||||
style={{ userSelect: 'none' }}
|
||||
>
|
||||
<item.display
|
||||
key={`${this.UID}/${this.revId}`}
|
||||
config={this.options.config}
|
||||
data={this.data}
|
||||
isSelected={isSelected}
|
||||
/>
|
||||
<item.display key={this.UID} config={this.options.config} data={this.data} isSelected={isSelected} />
|
||||
</div>
|
||||
{this.showActionConfirmation && this.renderActionsConfirmModal(this.getPrimaryAction())}
|
||||
{this.showActionVarsModal && this.renderVariablesInputModal(this.getPrimaryAction())}
|
||||
|
||||
@@ -11906,7 +11906,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Odstranit",
|
||||
"confirm-delete-keep-resources": "Opravdu chcete odstranit konfiguraci úložiště, ale ponechat jeho zdroje?",
|
||||
"confirm-delete-with-resources": "Opravdu chcete odstranit konfiguraci úložiště a všechny jeho zdroje?",
|
||||
@@ -12174,6 +12220,7 @@
|
||||
"jobs": "Práce"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Nastavení",
|
||||
"source-code": "Zdrojový kód"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Löschen",
|
||||
"confirm-delete-keep-resources": "Sind Sie sicher, dass Sie die Repository-Konfiguration löschen, aber ihre Ressourcen behalten möchten?",
|
||||
"confirm-delete-with-resources": "Sind Sie sicher, dass Sie die Repository-Konfiguration und alle ihre Ressourcen löschen möchten?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Aufträge"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Einstellungen",
|
||||
"source-code": "Quellcode"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Eliminar",
|
||||
"confirm-delete-keep-resources": "¿Seguro que quieres eliminar la configuración del repositorio pero conservar sus recursos?",
|
||||
"confirm-delete-with-resources": "¿Seguro que quieres eliminar la configuración del repositorio y todos sus recursos?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Trabajos"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Configuración",
|
||||
"source-code": "Código fuente"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Supprimer",
|
||||
"confirm-delete-keep-resources": "Voulez-vous vraiment supprimer la configuration du référentiel tout en conservant ses ressources ?",
|
||||
"confirm-delete-with-resources": "Voulez-vous vraiment supprimer la configuration du référentiel ainsi que toutes ses ressources ?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Missions"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Paramètres",
|
||||
"source-code": "Code source"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Törlés",
|
||||
"confirm-delete-keep-resources": "Biztosan törli az adattár konfigurációját, és megtartja az erőforrásait?",
|
||||
"confirm-delete-with-resources": "Biztosan törli az adattár konfigurációját és az összes erőforrását?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Feladatok"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Beállítások",
|
||||
"source-code": "Forráskód"
|
||||
},
|
||||
|
||||
@@ -11756,7 +11756,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Hapus",
|
||||
"confirm-delete-keep-resources": "Anda yakin ingin menghapus konfigurasi repositori, tetapi menyimpan sumber dayanya?",
|
||||
"confirm-delete-with-resources": "Anda yakin ingin menghapus konfigurasi repositori dan semua sumber dayanya?",
|
||||
@@ -12018,6 +12064,7 @@
|
||||
"jobs": "Pekerjaan"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Pengaturan",
|
||||
"source-code": "Kode sumber"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Elimina",
|
||||
"confirm-delete-keep-resources": "Vuoi davvero eliminare la configurazione del repository ma conservarne le risorse?",
|
||||
"confirm-delete-with-resources": "Vuoi davvero eliminare la configurazione del repository e tutte le sue risorse?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Attività"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Impostazioni",
|
||||
"source-code": "Codice sorgente"
|
||||
},
|
||||
|
||||
@@ -11756,7 +11756,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "削除",
|
||||
"confirm-delete-keep-resources": "リポジトリ設定を削除するものの、そのリソースを保持してもよろしいですか?",
|
||||
"confirm-delete-with-resources": "リポジトリ設定とそのすべてのリソースを削除してもよろしいですか?",
|
||||
@@ -12018,6 +12064,7 @@
|
||||
"jobs": "ジョブ"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "設定",
|
||||
"source-code": "ソースコード"
|
||||
},
|
||||
|
||||
@@ -11756,7 +11756,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "삭제",
|
||||
"confirm-delete-keep-resources": "정말 리포지토리 구성만 삭제하고 해당 리소스는 그대로 유지하시겠어요?",
|
||||
"confirm-delete-with-resources": "정말 리포지토리 구성과 해당하는 모든 리소스를 삭제하시겠어요?",
|
||||
@@ -12018,6 +12064,7 @@
|
||||
"jobs": "작업"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "설정",
|
||||
"source-code": "소스 코드"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Verwijderen",
|
||||
"confirm-delete-keep-resources": "Weet je zeker dat je de repository-configuratie wilt verwijderen, maar de bronnen wilt behouden?",
|
||||
"confirm-delete-with-resources": "Weet je zeker dat je de repository-configuratie en alle bronnen wilt verwijderen?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Taken"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Instellingen",
|
||||
"source-code": "Broncode"
|
||||
},
|
||||
|
||||
@@ -11906,7 +11906,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Usuń",
|
||||
"confirm-delete-keep-resources": "Na pewno chcesz usunąć konfigurację repozytorium, ale zachować jego zasoby?",
|
||||
"confirm-delete-with-resources": "Na pewno chcesz usunąć konfigurację repozytorium i wszystkie jego zasoby?",
|
||||
@@ -12174,6 +12220,7 @@
|
||||
"jobs": "Zadania"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Ustawienia",
|
||||
"source-code": "Kod źródłowy"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Excluir",
|
||||
"confirm-delete-keep-resources": "Tem certeza de que deseja excluir a configuração do repositório, mas manter seus recursos?",
|
||||
"confirm-delete-with-resources": "Tem certeza de que deseja excluir a configuração do repositório e todos os recursos dele?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Tarefas"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Configurações",
|
||||
"source-code": "Código fonte"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Eliminar",
|
||||
"confirm-delete-keep-resources": "Tem a certeza de que pretende eliminar a configuração do repositório, mas manter os seus recursos?",
|
||||
"confirm-delete-with-resources": "Tem a certeza de que pretende eliminar a configuração do repositório e todos os seus recursos?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Trabalhos"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Definições",
|
||||
"source-code": "Código-fonte"
|
||||
},
|
||||
|
||||
@@ -11906,7 +11906,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Удалить",
|
||||
"confirm-delete-keep-resources": "Вы уверены, что хотите удалить конфигурацию репозитория, но сохранить его ресурсы?",
|
||||
"confirm-delete-with-resources": "Вы уверены, что хотите удалить конфигурацию репозитория и все его ресурсы?",
|
||||
@@ -12174,6 +12220,7 @@
|
||||
"jobs": "Задания"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Параметры",
|
||||
"source-code": "Исходный код"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Ta bort",
|
||||
"confirm-delete-keep-resources": "Är du säker på att du vill radera lagringsplatskonfigurationen men behålla dess resurser?",
|
||||
"confirm-delete-with-resources": "Är du säker på att du vill radera lagringsplatskonfigurationen och alla dess resurser?",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "Jobb"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Inställningar",
|
||||
"source-code": "Källkod"
|
||||
},
|
||||
|
||||
@@ -11806,7 +11806,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "Sil",
|
||||
"confirm-delete-keep-resources": "",
|
||||
"confirm-delete-with-resources": "",
|
||||
@@ -12070,6 +12116,7 @@
|
||||
"jobs": "İşler"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "Ayarlar",
|
||||
"source-code": "Kaynak kodu"
|
||||
},
|
||||
|
||||
@@ -11756,7 +11756,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "删除",
|
||||
"confirm-delete-keep-resources": "您确定要删除存储库配置但保留其资源吗?",
|
||||
"confirm-delete-with-resources": "您确定要删除存储库配置及其所有资源吗?",
|
||||
@@ -12018,6 +12064,7 @@
|
||||
"jobs": "作业"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "设置",
|
||||
"source-code": "源代码"
|
||||
},
|
||||
|
||||
@@ -11756,7 +11756,53 @@
|
||||
"free-tier-limit-tooltip": "",
|
||||
"instance-fully-managed-tooltip": ""
|
||||
},
|
||||
"connection-form": {
|
||||
"alert-connection-deleted": "",
|
||||
"alert-connection-saved": "",
|
||||
"alert-connection-updated": "",
|
||||
"back-to-connections": "",
|
||||
"button-save": "",
|
||||
"button-saving": "",
|
||||
"description-app-id": "",
|
||||
"description-installation-id": "",
|
||||
"description-private-key": "",
|
||||
"description-provider": "",
|
||||
"error-delete-connection": "",
|
||||
"error-required": "",
|
||||
"error-save-connection": "",
|
||||
"label-app-id": "",
|
||||
"label-installation-id": "",
|
||||
"label-private-key": "",
|
||||
"label-provider": "",
|
||||
"not-found": "",
|
||||
"not-found-description": "",
|
||||
"page-subtitle": "",
|
||||
"page-title-create": "",
|
||||
"page-title-edit": "",
|
||||
"placeholder-app-id": "",
|
||||
"placeholder-installation-id": "",
|
||||
"placeholder-private-key": ""
|
||||
},
|
||||
"connections": {
|
||||
"add-connection": "",
|
||||
"cancel": "",
|
||||
"delete": "",
|
||||
"delete-confirm": "",
|
||||
"delete-title": "",
|
||||
"error-loading": "",
|
||||
"no-connections": "",
|
||||
"no-connections-message": "",
|
||||
"no-results": "",
|
||||
"page-subtitle": "",
|
||||
"page-title": "",
|
||||
"search-placeholder": "",
|
||||
"status-connected": "",
|
||||
"status-disconnected": "",
|
||||
"status-unknown": "",
|
||||
"view": ""
|
||||
},
|
||||
"delete-repository-button": {
|
||||
"button-cancel": "",
|
||||
"button-delete": "刪除",
|
||||
"confirm-delete-keep-resources": "確定要刪除儲存庫設定,但保留其資源嗎?",
|
||||
"confirm-delete-with-resources": "確定要刪除儲存庫設定及其所有資源嗎?",
|
||||
@@ -12018,6 +12064,7 @@
|
||||
"jobs": "作業"
|
||||
},
|
||||
"repository-actions": {
|
||||
"connections": "",
|
||||
"settings": "設定",
|
||||
"source-code": "原始碼"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user