mirror of
https://github.com/grafana/grafana.git
synced 2025-12-22 04:34:27 +08:00
Compare commits
44 Commits
flaky-conf
...
zoltan/pos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8555bcba5b | ||
|
|
4c601944e1 | ||
|
|
a632f1f26a | ||
|
|
4d82e4295f | ||
|
|
a91f64b9f5 | ||
|
|
b0e1ff8073 | ||
|
|
5c455ec2bc | ||
|
|
d5215a5be2 | ||
|
|
15c93100ab | ||
|
|
ab9b070eb0 | ||
|
|
e40673b298 | ||
|
|
7ea009c7f8 | ||
|
|
fef6196195 | ||
|
|
b50cf6e067 | ||
|
|
ccdb6ff261 | ||
|
|
692712961b | ||
|
|
b2e1b257b3 | ||
|
|
5bd73f3264 | ||
|
|
5a8a730cfe | ||
|
|
7c5457a75e | ||
|
|
dab64addf8 | ||
|
|
310662a4d0 | ||
|
|
3490c3b0fd | ||
|
|
8bf3ac9710 | ||
|
|
d0977b5245 | ||
|
|
78b1ae4f27 | ||
|
|
592c599ca6 | ||
|
|
8e11851bb0 | ||
|
|
e9ba45ca4f | ||
|
|
0f9d0317dc | ||
|
|
d1cbef9157 | ||
|
|
5b89d3b807 | ||
|
|
74c7b5a292 | ||
|
|
0adb2461e9 | ||
|
|
7cd10aa49e | ||
|
|
bf042afa98 | ||
|
|
b19e546254 | ||
|
|
5ac702a4c1 | ||
|
|
8a0fa93aec | ||
|
|
65817794b5 | ||
|
|
b719aea078 | ||
|
|
75eb820c73 | ||
|
|
be99781176 | ||
|
|
0a51779107 |
6
.github/workflows/add-to-whats-new.yml
vendored
6
.github/workflows/add-to-whats-new.yml
vendored
@@ -1,11 +1,11 @@
|
|||||||
name: Add comment about adding a What's new note
|
name: Add comment about adding a What's new note for either what's new or breaking changes
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add-comment:
|
add-comment:
|
||||||
if: ${{ ! github.event.pull_request.head.repo.fork && contains(github.event.pull_request.labels.*.name, 'add to what''s new') }}
|
if: ${{ ! github.event.pull_request.head.repo.fork && (contains(github.event.pull_request.labels.*.name, 'add to what''s new') || contains(github.event.pull_request.labels.*.name, 'breaking change') || contains(github.event.pull_request.labels.*.name, 'levitate breaking change')) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -13,4 +13,4 @@ jobs:
|
|||||||
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
|
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
|
||||||
with:
|
with:
|
||||||
message: |
|
message: |
|
||||||
Since you've added the `Add to what's new` label, consider drafting a [What's new note](https://admin.grafana.com/content-admin/#/collections/whats-new/new) for this feature.
|
Since you've added the `What's New` or a breaking change label, consider drafting a [What's new note](https://admin.grafana.com/content-admin/#/collections/whats-new/new) for this feature.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ require (
|
|||||||
github.com/google/go-github/v70 v70.0.0
|
github.com/google/go-github/v70 v70.0.0
|
||||||
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4
|
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4
|
||||||
github.com/grafana/grafana v0.0.0-00010101000000-000000000000
|
github.com/grafana/grafana v0.0.0-00010101000000-000000000000
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
github.com/grafana/grafana-plugin-sdk-go v0.284.0
|
github.com/grafana/grafana-plugin-sdk-go v0.284.0
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0
|
||||||
|
|||||||
@@ -618,8 +618,8 @@ github.com/grafana/dataplane/sdata v0.0.9 h1:AGL1LZnCUG4MnQtnWpBPbQ8ZpptaZs14w6k
|
|||||||
github.com/grafana/dataplane/sdata v0.0.9/go.mod h1:Jvs5ddpGmn6vcxT7tCTWAZ1mgi4sbcdFt9utQx5uMAU=
|
github.com/grafana/dataplane/sdata v0.0.9/go.mod h1:Jvs5ddpGmn6vcxT7tCTWAZ1mgi4sbcdFt9utQx5uMAU=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/grafana-aws-sdk v1.3.0 h1:/bfJzP93rCel1GbWoRSq0oUo424MZXt8jAp2BK9w8tM=
|
github.com/grafana/grafana-aws-sdk v1.3.0 h1:/bfJzP93rCel1GbWoRSq0oUo424MZXt8jAp2BK9w8tM=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/advisor/kinds"
|
module: "github.com/grafana/grafana/apps/advisor/kinds"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/alerting/alertenrichment
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7O
|
|||||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28 h1:PgMfX4OPENz/iXmtDDIW9+poZY4UD0hhmXm7flVclDo=
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28 h1:PgMfX4OPENz/iXmtDDIW9+poZY4UD0hhmXm7flVclDo=
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28/go.mod h1:av5N0Naq+8VV9MLF7zAkihy/mVq5UbS2EvRSJukDHlY=
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250901080157-a0280d701b28/go.mod h1:av5N0Naq+8VV9MLF7zAkihy/mVq5UbS2EvRSJukDHlY=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ require (
|
|||||||
github.com/go-kit/log v0.2.1
|
github.com/go-kit/log v0.2.1
|
||||||
github.com/grafana/alerting v0.0.0-20251204145817-de8c2bbf9eba
|
github.com/grafana/alerting v0.0.0-20251204145817-de8c2bbf9eba
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
github.com/prometheus/client_golang v1.23.2
|
github.com/prometheus/client_golang v1.23.2
|
||||||
github.com/spf13/pflag v1.0.10
|
github.com/spf13/pflag v1.0.10
|
||||||
|
|||||||
@@ -216,14 +216,14 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC
|
|||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
github.com/grafana/alerting v0.0.0-20251204145817-de8c2bbf9eba h1:psKWNETD5nGxmFAlqnWsXoRyUwSa2GHNEMSEDKGKfQ4=
|
github.com/grafana/alerting v0.0.0-20251204145817-de8c2bbf9eba h1:psKWNETD5nGxmFAlqnWsXoRyUwSa2GHNEMSEDKGKfQ4=
|
||||||
github.com/grafana/alerting v0.0.0-20251204145817-de8c2bbf9eba/go.mod h1:l7v67cgP7x72ajB9UPZlumdrHqNztpKoqQ52cU8T3LU=
|
github.com/grafana/alerting v0.0.0-20251204145817-de8c2bbf9eba/go.mod h1:l7v67cgP7x72ajB9UPZlumdrHqNztpKoqQ52cU8T3LU=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/loki/pkg/push v0.0.0-20250823105456-332df2b20000 h1:/5LKSYgLmAhwA4m6iGUD4w1YkydEWWjazn9qxCFT8W0=
|
github.com/grafana/loki/pkg/push v0.0.0-20250823105456-332df2b20000 h1:/5LKSYgLmAhwA4m6iGUD4w1YkydEWWjazn9qxCFT8W0=
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/alerting/historian/kinds"
|
module: "github.com/grafana/grafana/apps/alerting/historian/kinds"
|
||||||
language: version: "v0.8.2"
|
language: {
|
||||||
|
version: "v0.11.0"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -15,9 +16,14 @@ const (
|
|||||||
lokiDefaultMaxQuerySize = 65536 // 64kb
|
lokiDefaultMaxQuerySize = 65536 // 64kb
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type LokiConfig struct {
|
||||||
|
lokiclient.LokiConfig
|
||||||
|
Transport http.RoundTripper
|
||||||
|
}
|
||||||
|
|
||||||
type NotificationConfig struct {
|
type NotificationConfig struct {
|
||||||
Enabled bool
|
Enabled bool
|
||||||
Loki lokiclient.LokiConfig
|
Loki LokiConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
type RuntimeConfig struct {
|
type RuntimeConfig struct {
|
||||||
@@ -27,7 +33,7 @@ type RuntimeConfig struct {
|
|||||||
|
|
||||||
func (n *NotificationConfig) AddFlagsWithPrefix(prefix string, flags *pflag.FlagSet) {
|
func (n *NotificationConfig) AddFlagsWithPrefix(prefix string, flags *pflag.FlagSet) {
|
||||||
flags.BoolVar(&n.Enabled, prefix+".enabled", false, "Enable notification query endpoints")
|
flags.BoolVar(&n.Enabled, prefix+".enabled", false, "Enable notification query endpoints")
|
||||||
addLokiFlags(&n.Loki, prefix+".loki", flags)
|
addLokiFlags(&n.Loki.LokiConfig, prefix+".loki", flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RuntimeConfig) AddFlagsWithPrefix(prefix string, flags *pflag.FlagSet) {
|
func (r *RuntimeConfig) AddFlagsWithPrefix(prefix string, flags *pflag.FlagSet) {
|
||||||
|
|||||||
@@ -24,10 +24,12 @@ func TestRuntimeConfig(t *testing.T) {
|
|||||||
expected: RuntimeConfig{
|
expected: RuntimeConfig{
|
||||||
Notification: NotificationConfig{
|
Notification: NotificationConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Loki: lokiclient.LokiConfig{
|
Loki: LokiConfig{
|
||||||
ReadPathURL: nil,
|
LokiConfig: lokiclient.LokiConfig{
|
||||||
MaxQueryLength: 721 * time.Hour,
|
ReadPathURL: nil,
|
||||||
MaxQuerySize: 65536,
|
MaxQueryLength: 721 * time.Hour,
|
||||||
|
MaxQuerySize: 65536,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -38,10 +40,12 @@ func TestRuntimeConfig(t *testing.T) {
|
|||||||
expected: RuntimeConfig{
|
expected: RuntimeConfig{
|
||||||
Notification: NotificationConfig{
|
Notification: NotificationConfig{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
Loki: lokiclient.LokiConfig{
|
Loki: LokiConfig{
|
||||||
ReadPathURL: nil,
|
LokiConfig: lokiclient.LokiConfig{
|
||||||
MaxQueryLength: 721 * time.Hour,
|
ReadPathURL: nil,
|
||||||
MaxQuerySize: 65536,
|
MaxQueryLength: 721 * time.Hour,
|
||||||
|
MaxQuerySize: 65536,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -57,13 +61,15 @@ func TestRuntimeConfig(t *testing.T) {
|
|||||||
expected: RuntimeConfig{
|
expected: RuntimeConfig{
|
||||||
Notification: NotificationConfig{
|
Notification: NotificationConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Loki: lokiclient.LokiConfig{
|
Loki: LokiConfig{
|
||||||
ReadPathURL: lokiURL,
|
LokiConfig: lokiclient.LokiConfig{
|
||||||
BasicAuthUser: "foo",
|
ReadPathURL: lokiURL,
|
||||||
BasicAuthPassword: "bar",
|
BasicAuthUser: "foo",
|
||||||
TenantID: "baz",
|
BasicAuthPassword: "bar",
|
||||||
MaxQueryLength: 721 * time.Hour,
|
TenantID: "baz",
|
||||||
MaxQuerySize: 65536,
|
MaxQueryLength: 721 * time.Hour,
|
||||||
|
MaxQuerySize: 65536,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -19,6 +20,7 @@ import (
|
|||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
|
||||||
"github.com/grafana/grafana/apps/alerting/historian/pkg/apis/alertinghistorian/v0alpha1"
|
"github.com/grafana/grafana/apps/alerting/historian/pkg/apis/alertinghistorian/v0alpha1"
|
||||||
|
"github.com/grafana/grafana/apps/alerting/historian/pkg/app/config"
|
||||||
"github.com/grafana/grafana/apps/alerting/historian/pkg/app/logutil"
|
"github.com/grafana/grafana/apps/alerting/historian/pkg/app/logutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ type LokiReader struct {
|
|||||||
logger logging.Logger
|
logger logging.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLokiReader(cfg lokiclient.LokiConfig, reg prometheus.Registerer, logger logging.Logger, tracer trace.Tracer) *LokiReader {
|
func NewLokiReader(cfg config.LokiConfig, reg prometheus.Registerer, logger logging.Logger, tracer trace.Tracer) *LokiReader {
|
||||||
duration := instrument.NewHistogramCollector(promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
|
duration := instrument.NewHistogramCollector(promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
|
||||||
Namespace: Namespace,
|
Namespace: Namespace,
|
||||||
Subsystem: Subsystem,
|
Subsystem: Subsystem,
|
||||||
@@ -56,9 +58,13 @@ func NewLokiReader(cfg lokiclient.LokiConfig, reg prometheus.Registerer, logger
|
|||||||
Buckets: instrument.DefBuckets,
|
Buckets: instrument.DefBuckets,
|
||||||
}, instrument.HistogramCollectorBuckets))
|
}, instrument.HistogramCollectorBuckets))
|
||||||
|
|
||||||
|
requester := &http.Client{
|
||||||
|
Transport: cfg.Transport,
|
||||||
|
}
|
||||||
|
|
||||||
gkLogger := logutil.ToGoKitLogger(logger)
|
gkLogger := logutil.ToGoKitLogger(logger)
|
||||||
return &LokiReader{
|
return &LokiReader{
|
||||||
client: lokiclient.NewLokiClient(cfg, lokiclient.NewRequester(), nil, duration, gkLogger, tracer, LokiClientSpanName),
|
client: lokiclient.NewLokiClient(cfg.LokiConfig, requester, nil, duration, gkLogger, tracer, LokiClientSpanName),
|
||||||
logger: logger,
|
logger: logger,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/alerting/notifications
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/apiserver v0.34.2
|
k8s.io/apiserver v0.34.2
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
|||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
|
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
|
||||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
|
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o=
|
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/alerting/notifications/kinds"
|
module: "github.com/grafana/grafana/apps/alerting/notifications/kinds"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ type Receiver struct {
|
|||||||
Spec ReceiverSpec `json:"spec" yaml:"spec"`
|
Spec ReceiverSpec `json:"spec" yaml:"spec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewReceiver() *Receiver {
|
||||||
|
return &Receiver{
|
||||||
|
Spec: *NewReceiverSpec(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Receiver) GetSpec() any {
|
func (o *Receiver) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaReceiver = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", &Receiver{}, &ReceiverList{}, resource.WithKind("Receiver"),
|
schemaReceiver = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", NewReceiver(), &ReceiverList{}, resource.WithKind("Receiver"),
|
||||||
resource.WithPlural("receivers"), resource.WithScope(resource.NamespacedScope), resource.WithSelectableFields([]resource.SelectableField{{
|
resource.WithPlural("receivers"), resource.WithScope(resource.NamespacedScope), resource.WithSelectableFields([]resource.SelectableField{{
|
||||||
FieldSelector: "spec.title",
|
FieldSelector: "spec.title",
|
||||||
FieldValueFunc: func(o resource.Object) (string, error) {
|
FieldValueFunc: func(o resource.Object) (string, error) {
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ type RoutingTree struct {
|
|||||||
Spec RoutingTreeSpec `json:"spec" yaml:"spec"`
|
Spec RoutingTreeSpec `json:"spec" yaml:"spec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewRoutingTree() *RoutingTree {
|
||||||
|
return &RoutingTree{
|
||||||
|
Spec: *NewRoutingTreeSpec(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *RoutingTree) GetSpec() any {
|
func (o *RoutingTree) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaRoutingTree = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", &RoutingTree{}, &RoutingTreeList{}, resource.WithKind("RoutingTree"),
|
schemaRoutingTree = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", NewRoutingTree(), &RoutingTreeList{}, resource.WithKind("RoutingTree"),
|
||||||
resource.WithPlural("routingtrees"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("routingtrees"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindRoutingTree = resource.Kind{
|
kindRoutingTree = resource.Kind{
|
||||||
Schema: schemaRoutingTree,
|
Schema: schemaRoutingTree,
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ type TemplateGroup struct {
|
|||||||
Spec TemplateGroupSpec `json:"spec" yaml:"spec"`
|
Spec TemplateGroupSpec `json:"spec" yaml:"spec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewTemplateGroup() *TemplateGroup {
|
||||||
|
return &TemplateGroup{
|
||||||
|
Spec: *NewTemplateGroupSpec(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *TemplateGroup) GetSpec() any {
|
func (o *TemplateGroup) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaTemplateGroup = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", &TemplateGroup{}, &TemplateGroupList{}, resource.WithKind("TemplateGroup"),
|
schemaTemplateGroup = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", NewTemplateGroup(), &TemplateGroupList{}, resource.WithKind("TemplateGroup"),
|
||||||
resource.WithPlural("templategroups"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("templategroups"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindTemplateGroup = resource.Kind{
|
kindTemplateGroup = resource.Kind{
|
||||||
Schema: schemaTemplateGroup,
|
Schema: schemaTemplateGroup,
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ type TimeInterval struct {
|
|||||||
Spec TimeIntervalSpec `json:"spec" yaml:"spec"`
|
Spec TimeIntervalSpec `json:"spec" yaml:"spec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewTimeInterval() *TimeInterval {
|
||||||
|
return &TimeInterval{
|
||||||
|
Spec: *NewTimeIntervalSpec(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *TimeInterval) GetSpec() any {
|
func (o *TimeInterval) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaTimeInterval = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", &TimeInterval{}, &TimeIntervalList{}, resource.WithKind("TimeInterval"),
|
schemaTimeInterval = resource.NewSimpleSchema("notifications.alerting.grafana.app", "v0alpha1", NewTimeInterval(), &TimeIntervalList{}, resource.WithKind("TimeInterval"),
|
||||||
resource.WithPlural("timeintervals"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("timeintervals"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindTimeInterval = resource.Kind{
|
kindTimeInterval = resource.Kind{
|
||||||
Schema: schemaTimeInterval,
|
Schema: schemaTimeInterval,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/alerting/rules
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
github.com/prometheus/common v0.67.3
|
github.com/prometheus/common v0.67.3
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
|
|||||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/annotation
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
|
|||||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/annotation/kinds"
|
module: "github.com/grafana/grafana/apps/annotation/kinds"
|
||||||
language: version: "v0.8.2"
|
language: {
|
||||||
|
version: "v0.11.0"
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/collections
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250804150913-990f1c69ecc2
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250804150913-990f1c69ecc2
|
||||||
github.com/stretchr/testify v1.11.1
|
github.com/stretchr/testify v1.11.1
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
|
|||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250804150913-990f1c69ecc2 h1:X0cnaFdR+iz+sDSuoZmkryFSjOirchHe2MdKSRwBWgM=
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250804150913-990f1c69ecc2 h1:X0cnaFdR+iz+sDSuoZmkryFSjOirchHe2MdKSRwBWgM=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/preferences/kinds"
|
module: "github.com/grafana/grafana/apps/preferences/kinds"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/correlations
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
|
|||||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/correlations/kinds"
|
module: "github.com/grafana/grafana/apps/correlations/kinds"
|
||||||
language: version: "v0.8.2"
|
language: {
|
||||||
|
version: "v0.11.0"
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ do-generate: install-app-sdk update-app-sdk ## Run Grafana App SDK code generati
|
|||||||
--tsgenpath=../../packages/grafana-schema/src/schema \
|
--tsgenpath=../../packages/grafana-schema/src/schema \
|
||||||
--grouping=group \
|
--grouping=group \
|
||||||
--defencoding=none \
|
--defencoding=none \
|
||||||
--genoperatorstate=false \
|
--genoperatorstate=false
|
||||||
--noschemasinmanifest \
|
|
||||||
--useoldmanifestkinds
|
|
||||||
|
|
||||||
.PHONY: post-generate-cleanup
|
.PHONY: post-generate-cleanup
|
||||||
post-generate-cleanup: ## Clean up the generated code
|
post-generate-cleanup: ## Clean up the generated code
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ go 1.25.5
|
|||||||
require (
|
require (
|
||||||
cuelang.org/go v0.11.1
|
cuelang.org/go v0.11.1
|
||||||
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4
|
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
github.com/grafana/grafana-plugin-sdk-go v0.284.0
|
github.com/grafana/grafana-plugin-sdk-go v0.284.0
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250514132646-acbc7b54ed9e
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250514132646-acbc7b54ed9e
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4 h1:Muoy+FMGr
|
|||||||
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4/go.mod h1:qeWYbnWzaYGl88JlL9+DsP1GT2Cudm58rLtx13fKZdw=
|
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4/go.mod h1:qeWYbnWzaYGl88JlL9+DsP1GT2Cudm58rLtx13fKZdw=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/grafana-plugin-sdk-go v0.284.0 h1:1bK7eWsnPBLUWDcWJWe218Ik5ad0a5JpEL4mH9ry7Ws=
|
github.com/grafana/grafana-plugin-sdk-go v0.284.0 h1:1bK7eWsnPBLUWDcWJWe218Ik5ad0a5JpEL4mH9ry7Ws=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/sdkkinds/dashboard"
|
module: "github.com/grafana/grafana/sdkkinds/dashboard"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
package kinds
|
package kinds
|
||||||
|
|
||||||
import (
|
|
||||||
v0 "github.com/grafana/grafana/sdkkinds/dashboard/v0alpha1"
|
|
||||||
v1 "github.com/grafana/grafana/sdkkinds/dashboard/v1beta1"
|
|
||||||
v2alpha1 "github.com/grafana/grafana/sdkkinds/dashboard/v2alpha1"
|
|
||||||
v2beta1 "github.com/grafana/grafana/sdkkinds/dashboard/v2beta1"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Status is the shared status of all dashboard versions.
|
// Status is the shared status of all dashboard versions.
|
||||||
DashboardStatus: {
|
DashboardStatus: {
|
||||||
// Optional conversion status.
|
// Optional conversion status.
|
||||||
@@ -31,50 +24,3 @@ ConversionStatus: {
|
|||||||
// The original value map[string]any
|
// The original value map[string]any
|
||||||
source?: _
|
source?: _
|
||||||
}
|
}
|
||||||
|
|
||||||
dashboard: {
|
|
||||||
kind: "Dashboard"
|
|
||||||
pluralName: "Dashboards"
|
|
||||||
current: "v1beta1"
|
|
||||||
codegen: {
|
|
||||||
ts: {
|
|
||||||
enabled: true
|
|
||||||
config: {
|
|
||||||
enumsAsUnionTypes: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
go: {
|
|
||||||
enabled: true
|
|
||||||
config: {
|
|
||||||
allowMarshalEmptyDisjunctions: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
versions: {
|
|
||||||
"v0alpha1": {
|
|
||||||
schema: {
|
|
||||||
spec: v0.DashboardSpec
|
|
||||||
status: DashboardStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"v1beta1": {
|
|
||||||
schema: {
|
|
||||||
spec: v1.DashboardSpec
|
|
||||||
status: DashboardStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"v2alpha1": {
|
|
||||||
schema: {
|
|
||||||
spec: v2alpha1.DashboardSpec
|
|
||||||
status: DashboardStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"v2beta1": {
|
|
||||||
schema: {
|
|
||||||
spec: v2beta1.DashboardSpec
|
|
||||||
status: DashboardStatus
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,10 +1,82 @@
|
|||||||
package kinds
|
package kinds
|
||||||
|
|
||||||
|
import (
|
||||||
|
v0 "github.com/grafana/grafana/sdkkinds/dashboard/v0alpha1"
|
||||||
|
v1 "github.com/grafana/grafana/sdkkinds/dashboard/v1beta1"
|
||||||
|
v2alpha1 "github.com/grafana/grafana/sdkkinds/dashboard/v2alpha1"
|
||||||
|
v2beta1 "github.com/grafana/grafana/sdkkinds/dashboard/v2beta1"
|
||||||
|
)
|
||||||
|
|
||||||
manifest: {
|
manifest: {
|
||||||
appName: "dashboard"
|
appName: "dashboard"
|
||||||
groupOverride: "dashboard.grafana.app"
|
groupOverride: "dashboard.grafana.app"
|
||||||
kinds: [
|
preferredVersion: "v1beta1"
|
||||||
dashboard,
|
|
||||||
snapshot,
|
versions: {
|
||||||
]
|
"v0alpha1": {
|
||||||
|
codegen: {
|
||||||
|
ts: {enabled: false}
|
||||||
|
go: {enabled: true}
|
||||||
|
}
|
||||||
|
kinds: [
|
||||||
|
{
|
||||||
|
kind: "Dashboard"
|
||||||
|
pluralName: "Dashboards"
|
||||||
|
schema: {
|
||||||
|
spec: v0.DashboardSpec
|
||||||
|
status: DashboardStatus
|
||||||
|
}
|
||||||
|
},
|
||||||
|
snapshotV0alpha1, // Only exists in v0alpha (for now)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"v1beta1": {
|
||||||
|
codegen: {
|
||||||
|
ts: {enabled: false}
|
||||||
|
go: {enabled: true}
|
||||||
|
}
|
||||||
|
kinds: [
|
||||||
|
{
|
||||||
|
kind: "Dashboard"
|
||||||
|
pluralName: "Dashboards"
|
||||||
|
schema: {
|
||||||
|
spec: v1.DashboardSpec
|
||||||
|
status: DashboardStatus
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"v2alpha1": {
|
||||||
|
codegen: {
|
||||||
|
ts: {enabled: false}
|
||||||
|
go: {enabled: true}
|
||||||
|
}
|
||||||
|
kinds: [
|
||||||
|
{
|
||||||
|
kind: "Dashboard"
|
||||||
|
pluralName: "Dashboards"
|
||||||
|
schema: {
|
||||||
|
spec: v2alpha1.DashboardSpec
|
||||||
|
status: DashboardStatus
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"v2beta1": {
|
||||||
|
codegen: {
|
||||||
|
ts: {enabled: false}
|
||||||
|
go: {enabled: true}
|
||||||
|
}
|
||||||
|
kinds: [
|
||||||
|
{
|
||||||
|
kind: "Dashboard"
|
||||||
|
pluralName: "Dashboards"
|
||||||
|
schema: {
|
||||||
|
spec: v2beta1.DashboardSpec
|
||||||
|
status: DashboardStatus
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,46 +1,30 @@
|
|||||||
package kinds
|
package kinds
|
||||||
|
|
||||||
snapshot: {
|
snapshotV0alpha1: {
|
||||||
kind: "Snapshot"
|
kind: "Snapshot"
|
||||||
pluralName: "Snapshots"
|
pluralName: "Snapshots"
|
||||||
scope: "Namespaced"
|
schema: {
|
||||||
current: "v0alpha1"
|
spec: {
|
||||||
|
// Snapshot title
|
||||||
|
title?: string
|
||||||
|
|
||||||
codegen: {
|
// Optionally auto-remove the snapshot at a future date (Unix timestamp in seconds)
|
||||||
ts: {
|
expires?: int64 | *0
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
go: {
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
versions: {
|
// When set to true, the snapshot exists in a remote server
|
||||||
"v0alpha1": {
|
external?: bool | *false
|
||||||
schema: {
|
|
||||||
spec: {
|
|
||||||
// Snapshot title
|
|
||||||
title?: string
|
|
||||||
|
|
||||||
// Optionally auto-remove the snapshot at a future date (Unix timestamp in seconds)
|
// The external URL where the snapshot can be seen
|
||||||
expires?: int64 | *0
|
externalUrl?: string
|
||||||
|
|
||||||
// When set to true, the snapshot exists in a remote server
|
// The URL that created the dashboard originally
|
||||||
external?: bool | *false
|
originalUrl?: string
|
||||||
|
|
||||||
// The external URL where the snapshot can be seen
|
// Snapshot creation timestamp
|
||||||
externalUrl?: string
|
timestamp?: string
|
||||||
|
|
||||||
// The URL that created the dashboard originally
|
// The raw dashboard (unstructured for now)
|
||||||
originalUrl?: string
|
dashboard?: [string]: _
|
||||||
|
|
||||||
// Snapshot creation timestamp
|
|
||||||
timestamp?: string
|
|
||||||
|
|
||||||
// The raw dashboard (unstructured for now)
|
|
||||||
dashboard?: [string]: _
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
"github.com/grafana/grafana/pkg/apimachinery/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const GrafanaDatasourceUID = "grafana"
|
||||||
|
|
||||||
// SetPluginIDMeta sets the repo name to "plugin" and the path to the plugin ID
|
// SetPluginIDMeta sets the repo name to "plugin" and the path to the plugin ID
|
||||||
func SetPluginIDMeta(obj *unstructured.Unstructured, pluginID string) {
|
func SetPluginIDMeta(obj *unstructured.Unstructured, pluginID string) {
|
||||||
if pluginID == "" {
|
if pluginID == "" {
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ type Dashboard struct {
|
|||||||
Status DashboardStatus `json:"status" yaml:"status"`
|
Status DashboardStatus `json:"status" yaml:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDashboard() *Dashboard {
|
||||||
|
return &Dashboard{
|
||||||
|
Spec: *NewDashboardSpec(),
|
||||||
|
Status: *NewDashboardStatus(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Dashboard) GetSpec() any {
|
func (o *Dashboard) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v0alpha1", &Dashboard{}, &DashboardList{}, resource.WithKind("Dashboard"),
|
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v0alpha1", NewDashboard(), &DashboardList{}, resource.WithKind("Dashboard"),
|
||||||
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindDashboard = resource.Kind{
|
kindDashboard = resource.Kind{
|
||||||
Schema: schemaDashboard,
|
Schema: schemaDashboard,
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ type Snapshot struct {
|
|||||||
Spec SnapshotSpec `json:"spec" yaml:"spec"`
|
Spec SnapshotSpec `json:"spec" yaml:"spec"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewSnapshot() *Snapshot {
|
||||||
|
return &Snapshot{
|
||||||
|
Spec: *NewSnapshotSpec(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Snapshot) GetSpec() any {
|
func (o *Snapshot) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaSnapshot = resource.NewSimpleSchema("dashboard.grafana.app", "v0alpha1", &Snapshot{}, &SnapshotList{}, resource.WithKind("Snapshot"),
|
schemaSnapshot = resource.NewSimpleSchema("dashboard.grafana.app", "v0alpha1", NewSnapshot(), &SnapshotList{}, resource.WithKind("Snapshot"),
|
||||||
resource.WithPlural("snapshots"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("snapshots"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindSnapshot = resource.Kind{
|
kindSnapshot = resource.Kind{
|
||||||
Schema: schemaSnapshot,
|
Schema: schemaSnapshot,
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ type Dashboard struct {
|
|||||||
Status DashboardStatus `json:"status" yaml:"status"`
|
Status DashboardStatus `json:"status" yaml:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDashboard() *Dashboard {
|
||||||
|
return &Dashboard{
|
||||||
|
Spec: *NewDashboardSpec(),
|
||||||
|
Status: *NewDashboardStatus(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Dashboard) GetSpec() any {
|
func (o *Dashboard) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v1beta1", &Dashboard{}, &DashboardList{}, resource.WithKind("Dashboard"),
|
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v1beta1", NewDashboard(), &DashboardList{}, resource.WithKind("Dashboard"),
|
||||||
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindDashboard = resource.Kind{
|
kindDashboard = resource.Kind{
|
||||||
Schema: schemaDashboard,
|
Schema: schemaDashboard,
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ type Dashboard struct {
|
|||||||
Status DashboardStatus `json:"status" yaml:"status"`
|
Status DashboardStatus `json:"status" yaml:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDashboard() *Dashboard {
|
||||||
|
return &Dashboard{
|
||||||
|
Spec: *NewDashboardSpec(),
|
||||||
|
Status: *NewDashboardStatus(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Dashboard) GetSpec() any {
|
func (o *Dashboard) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v2alpha1", &Dashboard{}, &DashboardList{}, resource.WithKind("Dashboard"),
|
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v2alpha1", NewDashboard(), &DashboardList{}, resource.WithKind("Dashboard"),
|
||||||
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindDashboard = resource.Kind{
|
kindDashboard = resource.Kind{
|
||||||
Schema: schemaDashboard,
|
Schema: schemaDashboard,
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ type Dashboard struct {
|
|||||||
Status DashboardStatus `json:"status" yaml:"status"`
|
Status DashboardStatus `json:"status" yaml:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewDashboard() *Dashboard {
|
||||||
|
return &Dashboard{
|
||||||
|
Spec: *NewDashboardSpec(),
|
||||||
|
Status: *NewDashboardStatus(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (o *Dashboard) GetSpec() any {
|
func (o *Dashboard) GetSpec() any {
|
||||||
return o.Spec
|
return o.Spec
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v2beta1", &Dashboard{}, &DashboardList{}, resource.WithKind("Dashboard"),
|
schemaDashboard = resource.NewSimpleSchema("dashboard.grafana.app", "v2beta1", NewDashboard(), &DashboardList{}, resource.WithKind("Dashboard"),
|
||||||
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("dashboards"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindDashboard = resource.Kind{
|
kindDashboard = resource.Kind{
|
||||||
Schema: schemaDashboard,
|
Schema: schemaDashboard,
|
||||||
|
|||||||
24
apps/dashboard/pkg/apis/dashboard_manifest.go
generated
24
apps/dashboard/pkg/apis/dashboard_manifest.go
generated
File diff suppressed because one or more lines are too long
@@ -7234,9 +7234,9 @@
|
|||||||
"type": "elasticsearch",
|
"type": "elasticsearch",
|
||||||
"uid": "gdev-elasticsearch"
|
"uid": "gdev-elasticsearch"
|
||||||
},
|
},
|
||||||
"baseFilters": null,
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -7335,9 +7335,9 @@
|
|||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"name": "adhoc",
|
"name": "adhoc",
|
||||||
"baseFilters": null,
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -307,9 +307,9 @@
|
|||||||
"kind": "AdhocVariable",
|
"kind": "AdhocVariable",
|
||||||
"spec": {
|
"spec": {
|
||||||
"name": "adhoc",
|
"name": "adhoc",
|
||||||
"baseFilters": null,
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -317,9 +317,9 @@
|
|||||||
"datasource": {},
|
"datasource": {},
|
||||||
"spec": {
|
"spec": {
|
||||||
"name": "adhoc",
|
"name": "adhoc",
|
||||||
"baseFilters": null,
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -604,9 +604,9 @@
|
|||||||
"type": "loki",
|
"type": "loki",
|
||||||
"uid": "PDDA8E780A17E7EF1"
|
"uid": "PDDA8E780A17E7EF1"
|
||||||
},
|
},
|
||||||
"baseFilters": null,
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"label": "Ad-hoc",
|
"label": "Ad-hoc",
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
|
|||||||
@@ -616,9 +616,9 @@
|
|||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"name": "adhoc",
|
"name": "adhoc",
|
||||||
"baseFilters": null,
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"label": "Ad-hoc",
|
"label": "Ad-hoc",
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
|
|||||||
@@ -1885,7 +1885,7 @@
|
|||||||
"name": "Filters",
|
"name": "Filters",
|
||||||
"baseFilters": [],
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -1931,7 +1931,7 @@
|
|||||||
"name": "Filters",
|
"name": "Filters",
|
||||||
"baseFilters": [],
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -2184,7 +2184,7 @@
|
|||||||
"name": "Filters",
|
"name": "Filters",
|
||||||
"baseFilters": [],
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -2219,7 +2219,7 @@
|
|||||||
"name": "Filters",
|
"name": "Filters",
|
||||||
"baseFilters": [],
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -2499,7 +2499,7 @@
|
|||||||
"name": "Filters",
|
"name": "Filters",
|
||||||
"baseFilters": [],
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -2542,7 +2542,7 @@
|
|||||||
"name": "Filters",
|
"name": "Filters",
|
||||||
"baseFilters": [],
|
"baseFilters": [],
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"defaultKeys": null,
|
"defaultKeys": [],
|
||||||
"hide": "dontHide",
|
"hide": "dontHide",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
"allowCustomValue": true
|
"allowCustomValue": true
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import (
|
|||||||
"k8s.io/apiserver/pkg/endpoints/request"
|
"k8s.io/apiserver/pkg/endpoints/request"
|
||||||
|
|
||||||
"github.com/grafana/authlib/types"
|
"github.com/grafana/authlib/types"
|
||||||
|
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard"
|
||||||
dashv1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
dashv1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||||
dashv2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
dashv2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
||||||
schemaversion "github.com/grafana/grafana/apps/dashboard/pkg/migration/schemaversion"
|
schemaversion "github.com/grafana/grafana/apps/dashboard/pkg/migration/schemaversion"
|
||||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||||
"github.com/grafana/grafana/pkg/tsdb/grafanads"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// getDefaultDatasourceType gets the default datasource type using the datasource provider
|
// getDefaultDatasourceType gets the default datasource type using the datasource provider
|
||||||
@@ -58,7 +58,7 @@ func getDatasourceTypeByUID(ctx context.Context, uid string, provider schemavers
|
|||||||
// datasource: { type: "datasource" } with no UID, it should resolve to uid: "grafana".
|
// datasource: { type: "datasource" } with no UID, it should resolve to uid: "grafana".
|
||||||
func resolveGrafanaDatasourceUID(dsType, dsUID string) string {
|
func resolveGrafanaDatasourceUID(dsType, dsUID string) string {
|
||||||
if dsType == "datasource" && dsUID == "" {
|
if dsType == "datasource" && dsUID == "" {
|
||||||
return grafanads.DatasourceUID
|
return dashboard.GrafanaDatasourceUID
|
||||||
}
|
}
|
||||||
return dsUID
|
return dsUID
|
||||||
}
|
}
|
||||||
@@ -1539,26 +1539,38 @@ func buildAdhocVariable(ctx context.Context, varMap map[string]interface{}, comm
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transform baseFilters if they exist
|
// Transform baseFilters if they exist, otherwise default to empty array
|
||||||
if baseFilters, exists := varMap["baseFilters"]; exists {
|
if baseFilters, exists := varMap["baseFilters"]; exists {
|
||||||
if baseFiltersArray, ok := baseFilters.([]interface{}); ok {
|
if baseFiltersArray, ok := baseFilters.([]interface{}); ok {
|
||||||
adhocVar.Spec.BaseFilters = transformAdHocFilters(baseFiltersArray)
|
adhocVar.Spec.BaseFilters = transformAdHocFilters(baseFiltersArray)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Ensure baseFilters is always set (default to empty array if not present or invalid)
|
||||||
|
if adhocVar.Spec.BaseFilters == nil {
|
||||||
|
adhocVar.Spec.BaseFilters = []dashv2alpha1.DashboardAdHocFilterWithLabels{}
|
||||||
|
}
|
||||||
|
|
||||||
// Transform filters if they exist
|
// Transform filters if they exist, otherwise default to empty array
|
||||||
if filters, exists := varMap["filters"]; exists {
|
if filters, exists := varMap["filters"]; exists {
|
||||||
if filtersArray, ok := filters.([]interface{}); ok {
|
if filtersArray, ok := filters.([]interface{}); ok {
|
||||||
adhocVar.Spec.Filters = transformAdHocFilters(filtersArray)
|
adhocVar.Spec.Filters = transformAdHocFilters(filtersArray)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Ensure filters is always set (default to empty array if not present or invalid)
|
||||||
|
if adhocVar.Spec.Filters == nil {
|
||||||
|
adhocVar.Spec.Filters = []dashv2alpha1.DashboardAdHocFilterWithLabels{}
|
||||||
|
}
|
||||||
|
|
||||||
// Transform defaultKeys if they exist
|
// Transform defaultKeys if they exist, otherwise default to empty array
|
||||||
if defaultKeys, exists := varMap["defaultKeys"]; exists {
|
if defaultKeys, exists := varMap["defaultKeys"]; exists {
|
||||||
if defaultKeysArray, ok := defaultKeys.([]interface{}); ok {
|
if defaultKeysArray, ok := defaultKeys.([]interface{}); ok {
|
||||||
adhocVar.Spec.DefaultKeys = transformMetricFindValues(defaultKeysArray)
|
adhocVar.Spec.DefaultKeys = transformMetricFindValues(defaultKeysArray)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Ensure defaultKeys is always set (default to empty array if not present or invalid)
|
||||||
|
if adhocVar.Spec.DefaultKeys == nil {
|
||||||
|
adhocVar.Spec.DefaultKeys = []dashv2alpha1.DashboardMetricFindValue{}
|
||||||
|
}
|
||||||
|
|
||||||
// Only include datasource if datasourceUID exists (matching frontend behavior)
|
// Only include datasource if datasourceUID exists (matching frontend behavior)
|
||||||
if datasourceUID != "" {
|
if datasourceUID != "" {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import (
|
|||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
|
||||||
|
"github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard"
|
||||||
dashv1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
dashv1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1beta1"
|
||||||
dashv2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
dashv2alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v2alpha1"
|
||||||
"github.com/grafana/grafana/apps/dashboard/pkg/migration"
|
"github.com/grafana/grafana/apps/dashboard/pkg/migration"
|
||||||
migrationtestutil "github.com/grafana/grafana/apps/dashboard/pkg/migration/testutil"
|
migrationtestutil "github.com/grafana/grafana/apps/dashboard/pkg/migration/testutil"
|
||||||
"github.com/grafana/grafana/pkg/tsdb/grafanads"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestV1beta1ToV2alpha1 tests conversion from v1beta1 to v2alpha1 with various datasource scenarios
|
// TestV1beta1ToV2alpha1 tests conversion from v1beta1 to v2alpha1 with various datasource scenarios
|
||||||
@@ -77,7 +77,7 @@ func TestV1beta1ToV2alpha1(t *testing.T) {
|
|||||||
|
|
||||||
// Verify datasource UID is resolved to "grafana"
|
// Verify datasource UID is resolved to "grafana"
|
||||||
assert.NotNil(t, query.Spec.Datasource.Uid)
|
assert.NotNil(t, query.Spec.Datasource.Uid)
|
||||||
assert.Equal(t, grafanads.DatasourceUID, *query.Spec.Datasource.Uid, "type: 'datasource' with no UID should resolve to uid: 'grafana'")
|
assert.Equal(t, dashboard.GrafanaDatasourceUID, *query.Spec.Datasource.Uid, "type: 'datasource' with no UID should resolve to uid: 'grafana'")
|
||||||
|
|
||||||
// Verify query kind matches datasource type
|
// Verify query kind matches datasource type
|
||||||
assert.Equal(t, "datasource", query.Spec.Query.Kind)
|
assert.Equal(t, "datasource", query.Spec.Query.Kind)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/example
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20251017153501-8512b219c5fe
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20251017153501-8512b219c5fe
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4 h1:Muoy+FMGr
|
|||||||
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4/go.mod h1:qeWYbnWzaYGl88JlL9+DsP1GT2Cudm58rLtx13fKZdw=
|
github.com/grafana/authlib/types v0.0.0-20251119142549-be091cf2f4d4/go.mod h1:qeWYbnWzaYGl88JlL9+DsP1GT2Cudm58rLtx13fKZdw=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4 h1:jSojuc7njleS3UOz223WDlXOinmuLAIPI0z2vtq8EgI=
|
||||||
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
github.com/grafana/dskit v0.0.0-20250908063411-6b6da59b5cc4/go.mod h1:VahT+GtfQIM+o8ht2StR6J9g+Ef+C2Vokh5uuSmOD/4=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20251017153501-8512b219c5fe h1:pPoFj2bQKDBg5EyEdOU+Jn+0hQN+M775Qihk73RbdSs=
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20251017153501-8512b219c5fe h1:pPoFj2bQKDBg5EyEdOU+Jn+0hQN+M775Qihk73RbdSs=
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/example/kinds"
|
module: "github.com/grafana/grafana/apps/example/kinds"
|
||||||
language: version: "v0.8.2"
|
language: {
|
||||||
|
version: "v0.11.0"
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ generate: install-app-sdk update-app-sdk ## Run Grafana App SDK code generation
|
|||||||
--grouping=group \
|
--grouping=group \
|
||||||
--defencoding=none \
|
--defencoding=none \
|
||||||
--genoperatorstate=false \
|
--genoperatorstate=false \
|
||||||
--noschemasinmanifest \
|
--noschemasinmanifest
|
||||||
--useoldmanifestkinds
|
|
||||||
|
|
||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/folder
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250514132646-acbc7b54ed9e
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250514132646-acbc7b54ed9e
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX
|
|||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250514132646-acbc7b54ed9e h1:BTKk7LHuG1kmAkucwTA7DuMbKpKvJTKrGdBmUNO4dfQ=
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250514132646-acbc7b54ed9e h1:BTKk7LHuG1kmAkucwTA7DuMbKpKvJTKrGdBmUNO4dfQ=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/folder/kinds"
|
module: "github.com/grafana/grafana/apps/folder/kinds"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,13 @@
|
|||||||
package folder
|
package folder
|
||||||
|
|
||||||
folder: {
|
foldersV1beta1: {
|
||||||
kind: "Folder"
|
kind: "Folder"
|
||||||
pluralName: "Folders"
|
pluralName: "Folders"
|
||||||
current: "v1beta1"
|
|
||||||
versions: {
|
schema: {
|
||||||
"v1beta1": {
|
spec: {
|
||||||
codegen: {
|
title: string
|
||||||
ts: {
|
description?: string
|
||||||
enabled: false // Not sure if it should be enabled or not, currently it is.
|
|
||||||
}
|
|
||||||
go: {
|
|
||||||
enabled: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
schema: {
|
|
||||||
spec: {
|
|
||||||
title: string
|
|
||||||
description?: string
|
|
||||||
}
|
|
||||||
status: {} // nothing
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,15 @@ package folder
|
|||||||
manifest: {
|
manifest: {
|
||||||
appName: "folder"
|
appName: "folder"
|
||||||
groupOverride: "folder.grafana.app"
|
groupOverride: "folder.grafana.app"
|
||||||
kinds: [
|
versions: {
|
||||||
folder,
|
"v1beta1": {
|
||||||
]
|
codegen: {
|
||||||
|
ts: {enabled: false}
|
||||||
|
go: {enabled: true}
|
||||||
|
}
|
||||||
|
kinds: [
|
||||||
|
foldersV1beta1,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/grafana/grafana-app-sdk/resource"
|
"github.com/grafana/grafana-app-sdk/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type FolderClient struct {
|
type FolderClient struct {
|
||||||
@@ -76,24 +75,6 @@ func (c *FolderClient) Patch(ctx context.Context, identifier resource.Identifier
|
|||||||
return c.client.Patch(ctx, identifier, req, opts)
|
return c.client.Patch(ctx, identifier, req, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FolderClient) UpdateStatus(ctx context.Context, identifier resource.Identifier, newStatus FolderStatus, opts resource.UpdateOptions) (*Folder, error) {
|
|
||||||
return c.client.Update(ctx, &Folder{
|
|
||||||
TypeMeta: metav1.TypeMeta{
|
|
||||||
Kind: FolderKind().Kind(),
|
|
||||||
APIVersion: GroupVersion.Identifier(),
|
|
||||||
},
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
ResourceVersion: opts.ResourceVersion,
|
|
||||||
Namespace: identifier.Namespace,
|
|
||||||
Name: identifier.Name,
|
|
||||||
},
|
|
||||||
Status: newStatus,
|
|
||||||
}, resource.UpdateOptions{
|
|
||||||
Subresource: "status",
|
|
||||||
ResourceVersion: opts.ResourceVersion,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *FolderClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
|
func (c *FolderClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
|
||||||
return c.client.Delete(ctx, identifier, opts)
|
return c.client.Delete(ctx, identifier, opts)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,8 +21,12 @@ type Folder struct {
|
|||||||
|
|
||||||
// Spec is the spec of the Folder
|
// Spec is the spec of the Folder
|
||||||
Spec FolderSpec `json:"spec" yaml:"spec"`
|
Spec FolderSpec `json:"spec" yaml:"spec"`
|
||||||
|
}
|
||||||
|
|
||||||
Status FolderStatus `json:"status" yaml:"status"`
|
func NewFolder() *Folder {
|
||||||
|
return &Folder{
|
||||||
|
Spec: *NewFolderSpec(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Folder) GetSpec() any {
|
func (o *Folder) GetSpec() any {
|
||||||
@@ -39,15 +43,11 @@ func (o *Folder) SetSpec(spec any) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *Folder) GetSubresources() map[string]any {
|
func (o *Folder) GetSubresources() map[string]any {
|
||||||
return map[string]any{
|
return map[string]any{}
|
||||||
"status": o.Status,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Folder) GetSubresource(name string) (any, bool) {
|
func (o *Folder) GetSubresource(name string) (any, bool) {
|
||||||
switch name {
|
switch name {
|
||||||
case "status":
|
|
||||||
return o.Status, true
|
|
||||||
default:
|
default:
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
@@ -55,13 +55,6 @@ func (o *Folder) GetSubresource(name string) (any, bool) {
|
|||||||
|
|
||||||
func (o *Folder) SetSubresource(name string, value any) error {
|
func (o *Folder) SetSubresource(name string, value any) error {
|
||||||
switch name {
|
switch name {
|
||||||
case "status":
|
|
||||||
cast, ok := value.(FolderStatus)
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("cannot set status type %#v, not of type FolderStatus", value)
|
|
||||||
}
|
|
||||||
o.Status = cast
|
|
||||||
return nil
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("subresource '%s' does not exist", name)
|
return fmt.Errorf("subresource '%s' does not exist", name)
|
||||||
}
|
}
|
||||||
@@ -233,7 +226,6 @@ func (o *Folder) DeepCopyInto(dst *Folder) {
|
|||||||
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||||
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
|
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
|
||||||
o.Spec.DeepCopyInto(&dst.Spec)
|
o.Spec.DeepCopyInto(&dst.Spec)
|
||||||
o.Status.DeepCopyInto(&dst.Status)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interface compliance compile-time check
|
// Interface compliance compile-time check
|
||||||
@@ -305,15 +297,3 @@ func (s *FolderSpec) DeepCopy() *FolderSpec {
|
|||||||
func (s *FolderSpec) DeepCopyInto(dst *FolderSpec) {
|
func (s *FolderSpec) DeepCopyInto(dst *FolderSpec) {
|
||||||
resource.CopyObjectInto(dst, s)
|
resource.CopyObjectInto(dst, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeepCopy creates a full deep copy of FolderStatus
|
|
||||||
func (s *FolderStatus) DeepCopy() *FolderStatus {
|
|
||||||
cpy := &FolderStatus{}
|
|
||||||
s.DeepCopyInto(cpy)
|
|
||||||
return cpy
|
|
||||||
}
|
|
||||||
|
|
||||||
// DeepCopyInto deep copies FolderStatus into another FolderStatus object
|
|
||||||
func (s *FolderStatus) DeepCopyInto(dst *FolderStatus) {
|
|
||||||
resource.CopyObjectInto(dst, s)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
// schema is unexported to prevent accidental overwrites
|
// schema is unexported to prevent accidental overwrites
|
||||||
var (
|
var (
|
||||||
schemaFolder = resource.NewSimpleSchema("folder.grafana.app", "v1beta1", &Folder{}, &FolderList{}, resource.WithKind("Folder"),
|
schemaFolder = resource.NewSimpleSchema("folder.grafana.app", "v1beta1", NewFolder(), &FolderList{}, resource.WithKind("Folder"),
|
||||||
resource.WithPlural("folders"), resource.WithScope(resource.NamespacedScope))
|
resource.WithPlural("folders"), resource.WithScope(resource.NamespacedScope))
|
||||||
kindFolder = resource.Kind{
|
kindFolder = resource.Kind{
|
||||||
Schema: schemaFolder,
|
Schema: schemaFolder,
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
|
||||||
|
|
||||||
package v1beta1
|
|
||||||
@@ -104,18 +104,12 @@ func schema_pkg_apis_folder_v1beta1_Folder(ref common.ReferenceCallback) common.
|
|||||||
Ref: ref("github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1.FolderSpec"),
|
Ref: ref("github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1.FolderSpec"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"status": {
|
|
||||||
SchemaProps: spec.SchemaProps{
|
|
||||||
Default: map[string]interface{}{},
|
|
||||||
Ref: ref("github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1.FolderStatus"),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Required: []string{"metadata", "spec", "status"},
|
Required: []string{"metadata", "spec"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Dependencies: []string{
|
Dependencies: []string{
|
||||||
"github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1.FolderSpec", "github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1.FolderStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
|
"github.com/grafana/grafana/apps/folder/pkg/apis/folder/v1beta1.FolderSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// DO NOT EDIT
|
// DO NOT EDIT
|
||||||
//
|
//
|
||||||
|
|
||||||
package apis
|
package manifestdata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -52,7 +52,7 @@ replace github.com/prometheus/alertmanager => github.com/grafana/prometheus-aler
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana v0.0.0-00010101000000-000000000000
|
github.com/grafana/grafana v0.0.0-00010101000000-000000000000
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
github.com/grafana/grafana/apps/folder v0.0.0
|
github.com/grafana/grafana/apps/folder v0.0.0
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0
|
||||||
|
|||||||
@@ -835,8 +835,8 @@ github.com/grafana/gofpdf v0.0.0-20250307124105-3b9c5d35577f h1:5xkjl5Y/j2QefJKO
|
|||||||
github.com/grafana/gofpdf v0.0.0-20250307124105-3b9c5d35577f/go.mod h1:+O5QxOwwgP10jedZHapzXY+IPKTnzHBtIs5UUb9G+kI=
|
github.com/grafana/gofpdf v0.0.0-20250307124105-3b9c5d35577f/go.mod h1:+O5QxOwwgP10jedZHapzXY+IPKTnzHBtIs5UUb9G+kI=
|
||||||
github.com/grafana/gomemcache v0.0.0-20250828162811-a96f6acee2fe h1:q+QaVANzNZxvTovycpQvDTfsNZ2rHh4XIIaccMnrIR4=
|
github.com/grafana/gomemcache v0.0.0-20250828162811-a96f6acee2fe h1:q+QaVANzNZxvTovycpQvDTfsNZ2rHh4XIIaccMnrIR4=
|
||||||
github.com/grafana/gomemcache v0.0.0-20250828162811-a96f6acee2fe/go.mod h1:j/s0jkda4UXTemDs7Pgw/vMT06alWc42CHisvYac0qw=
|
github.com/grafana/gomemcache v0.0.0-20250828162811-a96f6acee2fe/go.mod h1:j/s0jkda4UXTemDs7Pgw/vMT06alWc42CHisvYac0qw=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grafana/grafana-aws-sdk v1.3.0 h1:/bfJzP93rCel1GbWoRSq0oUo424MZXt8jAp2BK9w8tM=
|
github.com/grafana/grafana-aws-sdk v1.3.0 h1:/bfJzP93rCel1GbWoRSq0oUo424MZXt8jAp2BK9w8tM=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/iam/kinds"
|
module: "github.com/grafana/grafana/apps/iam/kinds"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,32 @@ v0alpha1: {
|
|||||||
serviceaccountv0alpha1,
|
serviceaccountv0alpha1,
|
||||||
externalGroupMappingv0alpha1
|
externalGroupMappingv0alpha1
|
||||||
]
|
]
|
||||||
|
routes: {
|
||||||
|
namespaced: {
|
||||||
|
"/searchTeams": {
|
||||||
|
"GET": {
|
||||||
|
request: {
|
||||||
|
query: {
|
||||||
|
query?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
response: {
|
||||||
|
#TeamHit: {
|
||||||
|
name: string
|
||||||
|
title: string
|
||||||
|
email: string
|
||||||
|
provisioned: bool
|
||||||
|
externalUID: string
|
||||||
|
}
|
||||||
|
offset: int64
|
||||||
|
totalHits: int64
|
||||||
|
hits: [...#TeamHit]
|
||||||
|
queryCost: float64
|
||||||
|
maxScore: float64
|
||||||
|
}
|
||||||
|
responseMetadata: objectMeta: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
33
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_request_params_object_gen.go
generated
Normal file
33
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_request_params_object_gen.go
generated
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v0alpha1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/grafana/grafana-app-sdk/resource"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetSearchTeamsRequestParamsObject struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
GetSearchTeamsRequestParams `json:",inline"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGetSearchTeamsRequestParamsObject() *GetSearchTeamsRequestParamsObject {
|
||||||
|
return &GetSearchTeamsRequestParamsObject{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSearchTeamsRequestParamsObject) DeepCopyObject() runtime.Object {
|
||||||
|
dst := NewGetSearchTeamsRequestParamsObject()
|
||||||
|
o.DeepCopyInto(dst)
|
||||||
|
return dst
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSearchTeamsRequestParamsObject) DeepCopyInto(dst *GetSearchTeamsRequestParamsObject) {
|
||||||
|
dst.TypeMeta.APIVersion = o.TypeMeta.APIVersion
|
||||||
|
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||||
|
dstGetSearchTeamsRequestParams := GetSearchTeamsRequestParams{}
|
||||||
|
_ = resource.CopyObjectInto(&dstGetSearchTeamsRequestParams, &o.GetSearchTeamsRequestParams)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ runtime.Object = NewGetSearchTeamsRequestParamsObject()
|
||||||
12
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_request_params_types_gen.go
generated
Normal file
12
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_request_params_types_gen.go
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v0alpha1
|
||||||
|
|
||||||
|
type GetSearchTeamsRequestParams struct {
|
||||||
|
Query *string `json:"query,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetSearchTeamsRequestParams creates a new GetSearchTeamsRequestParams object.
|
||||||
|
func NewGetSearchTeamsRequestParams() *GetSearchTeamsRequestParams {
|
||||||
|
return &GetSearchTeamsRequestParams{}
|
||||||
|
}
|
||||||
33
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_response_body_types_gen.go
generated
Normal file
33
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_response_body_types_gen.go
generated
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v0alpha1
|
||||||
|
|
||||||
|
// +k8s:openapi-gen=true
|
||||||
|
type VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
Email string `json:"email"`
|
||||||
|
Provisioned bool `json:"provisioned"`
|
||||||
|
ExternalUID string `json:"externalUID"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewVersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit creates a new VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit object.
|
||||||
|
func NewVersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit() *VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit {
|
||||||
|
return &VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:openapi-gen=true
|
||||||
|
type GetSearchTeamsBody struct {
|
||||||
|
Offset int64 `json:"offset"`
|
||||||
|
TotalHits int64 `json:"totalHits"`
|
||||||
|
Hits []VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit `json:"hits"`
|
||||||
|
QueryCost float64 `json:"queryCost"`
|
||||||
|
MaxScore float64 `json:"maxScore"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewGetSearchTeamsBody creates a new GetSearchTeamsBody object.
|
||||||
|
func NewGetSearchTeamsBody() *GetSearchTeamsBody {
|
||||||
|
return &GetSearchTeamsBody{
|
||||||
|
Hits: []VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit{},
|
||||||
|
}
|
||||||
|
}
|
||||||
37
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_response_object_types_gen.go
generated
Normal file
37
apps/iam/pkg/apis/iam/v0alpha1/getsearchteams_response_object_types_gen.go
generated
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v0alpha1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/grafana/grafana-app-sdk/resource"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// +k8s:openapi-gen=true
|
||||||
|
type GetSearchTeams struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
GetSearchTeamsBody `json:",inline"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGetSearchTeams() *GetSearchTeams {
|
||||||
|
return &GetSearchTeams{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *GetSearchTeamsBody) DeepCopyInto(dst *GetSearchTeamsBody) {
|
||||||
|
_ = resource.CopyObjectInto(dst, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSearchTeams) DeepCopyObject() runtime.Object {
|
||||||
|
dst := NewGetSearchTeams()
|
||||||
|
o.DeepCopyInto(dst)
|
||||||
|
return dst
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *GetSearchTeams) DeepCopyInto(dst *GetSearchTeams) {
|
||||||
|
dst.TypeMeta.APIVersion = o.TypeMeta.APIVersion
|
||||||
|
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||||
|
o.GetSearchTeamsBody.DeepCopyInto(&dst.GetSearchTeamsBody)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ runtime.Object = NewGetSearchTeams()
|
||||||
@@ -317,6 +317,7 @@ func AddAuthNKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
&ServiceAccountList{},
|
&ServiceAccountList{},
|
||||||
&Team{},
|
&Team{},
|
||||||
&TeamList{},
|
&TeamList{},
|
||||||
|
&GetSearchTeams{},
|
||||||
&TeamBinding{},
|
&TeamBinding{},
|
||||||
&TeamBindingList{},
|
&TeamBindingList{},
|
||||||
&ExternalGroupMapping{},
|
&ExternalGroupMapping{},
|
||||||
|
|||||||
35
apps/iam/pkg/apis/iam/v0alpha1/team_search.go
Normal file
35
apps/iam/pkg/apis/iam/v0alpha1/team_search.go
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
package v0alpha1
|
||||||
|
|
||||||
|
import (
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen=true
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
type TeamSearchResults struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
|
||||||
|
// Where the query started from
|
||||||
|
Offset int64 `json:"offset,omitempty"`
|
||||||
|
|
||||||
|
// The number of matching results
|
||||||
|
TotalHits int64 `json:"totalHits"`
|
||||||
|
|
||||||
|
// The team body
|
||||||
|
Hits []TeamHit `json:"hits"`
|
||||||
|
|
||||||
|
// Cost of running the query
|
||||||
|
QueryCost float64 `json:"queryCost,omitempty"`
|
||||||
|
|
||||||
|
// Max score
|
||||||
|
MaxScore float64 `json:"maxScore,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen=true
|
||||||
|
type TeamHit struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
Email string `json:"email,omitempty"`
|
||||||
|
Provisioned bool `json:"provisioned,omitempty"`
|
||||||
|
ExternalUID string `json:"externalUID,omitempty"`
|
||||||
|
}
|
||||||
177
apps/iam/pkg/apis/iam/v0alpha1/zz_openapi_gen.go
generated
177
apps/iam/pkg/apis/iam/v0alpha1/zz_openapi_gen.go
generated
@@ -24,6 +24,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
|
|||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.ExternalGroupMappingTeamRef": schema_pkg_apis_iam_v0alpha1_ExternalGroupMappingTeamRef(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.ExternalGroupMappingTeamRef": schema_pkg_apis_iam_v0alpha1_ExternalGroupMappingTeamRef(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GetGroups": schema_pkg_apis_iam_v0alpha1_GetGroups(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GetGroups": schema_pkg_apis_iam_v0alpha1_GetGroups(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GetGroupsBody": schema_pkg_apis_iam_v0alpha1_GetGroupsBody(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GetGroupsBody": schema_pkg_apis_iam_v0alpha1_GetGroupsBody(ref),
|
||||||
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GetSearchTeams": schema_pkg_apis_iam_v0alpha1_GetSearchTeams(ref),
|
||||||
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GetSearchTeamsBody": schema_pkg_apis_iam_v0alpha1_GetSearchTeamsBody(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GlobalRole": schema_pkg_apis_iam_v0alpha1_GlobalRole(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GlobalRole": schema_pkg_apis_iam_v0alpha1_GlobalRole(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GlobalRoleBinding": schema_pkg_apis_iam_v0alpha1_GlobalRoleBinding(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GlobalRoleBinding": schema_pkg_apis_iam_v0alpha1_GlobalRoleBinding(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GlobalRoleBindingList": schema_pkg_apis_iam_v0alpha1_GlobalRoleBindingList(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.GlobalRoleBindingList": schema_pkg_apis_iam_v0alpha1_GlobalRoleBindingList(ref),
|
||||||
@@ -80,6 +82,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
|
|||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.UserStatus": schema_pkg_apis_iam_v0alpha1_UserStatus(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.UserStatus": schema_pkg_apis_iam_v0alpha1_UserStatus(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.UserstatusOperatorState": schema_pkg_apis_iam_v0alpha1_UserstatusOperatorState(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.UserstatusOperatorState": schema_pkg_apis_iam_v0alpha1_UserstatusOperatorState(ref),
|
||||||
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1Kinds7RoutesGroupsGETResponseExternalGroupMapping": schema_pkg_apis_iam_v0alpha1_VersionsV0alpha1Kinds7RoutesGroupsGETResponseExternalGroupMapping(ref),
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1Kinds7RoutesGroupsGETResponseExternalGroupMapping": schema_pkg_apis_iam_v0alpha1_VersionsV0alpha1Kinds7RoutesGroupsGETResponseExternalGroupMapping(ref),
|
||||||
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit": schema_pkg_apis_iam_v0alpha1_VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit(ref),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,6 +567,132 @@ func schema_pkg_apis_iam_v0alpha1_GetGroupsBody(ref common.ReferenceCallback) co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func schema_pkg_apis_iam_v0alpha1_GetSearchTeams(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||||
|
return common.OpenAPIDefinition{
|
||||||
|
Schema: spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"object"},
|
||||||
|
Properties: map[string]spec.Schema{
|
||||||
|
"kind": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
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{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"apiVersion": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
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{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"offset": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"integer"},
|
||||||
|
Format: "int64",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"totalHits": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"integer"},
|
||||||
|
Format: "int64",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"hits": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"array"},
|
||||||
|
Items: &spec.SchemaOrArray{
|
||||||
|
Schema: &spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: map[string]interface{}{},
|
||||||
|
Ref: ref("github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"queryCost": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"number"},
|
||||||
|
Format: "double",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"maxScore": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"number"},
|
||||||
|
Format: "double",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Required: []string{"offset", "totalHits", "hits", "queryCost", "maxScore"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Dependencies: []string{
|
||||||
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func schema_pkg_apis_iam_v0alpha1_GetSearchTeamsBody(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||||
|
return common.OpenAPIDefinition{
|
||||||
|
Schema: spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"object"},
|
||||||
|
Properties: map[string]spec.Schema{
|
||||||
|
"offset": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"integer"},
|
||||||
|
Format: "int64",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"totalHits": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"integer"},
|
||||||
|
Format: "int64",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"hits": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"array"},
|
||||||
|
Items: &spec.SchemaOrArray{
|
||||||
|
Schema: &spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: map[string]interface{}{},
|
||||||
|
Ref: ref("github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"queryCost": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"number"},
|
||||||
|
Format: "double",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"maxScore": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: 0,
|
||||||
|
Type: []string{"number"},
|
||||||
|
Format: "double",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Required: []string{"offset", "totalHits", "hits", "queryCost", "maxScore"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Dependencies: []string{
|
||||||
|
"github.com/grafana/grafana/apps/iam/pkg/apis/iam/v0alpha1.VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func schema_pkg_apis_iam_v0alpha1_GlobalRole(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
func schema_pkg_apis_iam_v0alpha1_GlobalRole(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||||
return common.OpenAPIDefinition{
|
return common.OpenAPIDefinition{
|
||||||
Schema: spec.Schema{
|
Schema: spec.Schema{
|
||||||
@@ -2956,3 +3085,51 @@ func schema_pkg_apis_iam_v0alpha1_VersionsV0alpha1Kinds7RoutesGroupsGETResponseE
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func schema_pkg_apis_iam_v0alpha1_VersionsV0alpha1RoutesNamespacedSearchTeamsGETResponseTeamHit(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||||
|
return common.OpenAPIDefinition{
|
||||||
|
Schema: spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"object"},
|
||||||
|
Properties: map[string]spec.Schema{
|
||||||
|
"name": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: "",
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: "",
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"email": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: "",
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"provisioned": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: false,
|
||||||
|
Type: []string{"boolean"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"externalUID": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: "",
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Required: []string{"name", "title", "email", "provisioned", "externalUID"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
138
apps/iam/pkg/apis/iam_manifest.go
generated
138
apps/iam/pkg/apis/iam_manifest.go
generated
@@ -157,9 +157,139 @@ var appManifestData = app.ManifestData{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Routes: app.ManifestVersionRoutes{
|
Routes: app.ManifestVersionRoutes{
|
||||||
Namespaced: map[string]spec3.PathProps{},
|
Namespaced: map[string]spec3.PathProps{
|
||||||
Cluster: map[string]spec3.PathProps{},
|
"/searchTeams": {
|
||||||
Schemas: map[string]spec.Schema{},
|
Get: &spec3.Operation{
|
||||||
|
OperationProps: spec3.OperationProps{
|
||||||
|
|
||||||
|
OperationId: "getSearchTeams",
|
||||||
|
|
||||||
|
Parameters: []*spec3.Parameter{
|
||||||
|
|
||||||
|
{
|
||||||
|
ParameterProps: spec3.ParameterProps{
|
||||||
|
Name: "query",
|
||||||
|
In: "query",
|
||||||
|
Schema: &spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
Responses: &spec3.Responses{
|
||||||
|
ResponsesProps: spec3.ResponsesProps{
|
||||||
|
Default: &spec3.Response{
|
||||||
|
ResponseProps: spec3.ResponseProps{
|
||||||
|
Description: "Default OK response",
|
||||||
|
Content: map[string]*spec3.MediaType{
|
||||||
|
"application/json": {
|
||||||
|
MediaTypeProps: spec3.MediaTypeProps{
|
||||||
|
Schema: &spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"object"},
|
||||||
|
Properties: map[string]spec.Schema{
|
||||||
|
"apiVersion": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"hits": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"array"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"kind": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"maxScore": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"number"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"offset": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"integer"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"queryCost": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"number"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"totalHits": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"integer"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Required: []string{
|
||||||
|
"offset",
|
||||||
|
"totalHits",
|
||||||
|
"hits",
|
||||||
|
"queryCost",
|
||||||
|
"maxScore",
|
||||||
|
"apiVersion",
|
||||||
|
"kind",
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Cluster: map[string]spec3.PathProps{},
|
||||||
|
Schemas: map[string]spec.Schema{
|
||||||
|
"getSearchTeamsTeamHit": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"object"},
|
||||||
|
Properties: map[string]spec.Schema{
|
||||||
|
"email": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"externalUID": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"provisioned": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"boolean"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Type: []string{"string"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Required: []string{
|
||||||
|
"name",
|
||||||
|
"title",
|
||||||
|
"email",
|
||||||
|
"provisioned",
|
||||||
|
"externalUID",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -196,6 +326,8 @@ func ManifestGoTypeAssociator(kind, version string) (goType resource.Kind, exist
|
|||||||
|
|
||||||
var customRouteToGoResponseType = map[string]any{
|
var customRouteToGoResponseType = map[string]any{
|
||||||
"v0alpha1|Team|groups|GET": v0alpha1.GetGroups{},
|
"v0alpha1|Team|groups|GET": v0alpha1.GetGroups{},
|
||||||
|
|
||||||
|
"v0alpha1||<namespace>/searchTeams|GET": v0alpha1.GetSearchTeams{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// ManifestCustomRouteResponsesAssociator returns the associated response go type for a given kind, version, custom route path, and method, if one exists.
|
// ManifestCustomRouteResponsesAssociator returns the associated response go type for a given kind, version, custom route path, and method, if one exists.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/investigations
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/klog/v2 v2.130.1
|
k8s.io/klog/v2 v2.130.1
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
|
|||||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/investigations"
|
module: "github.com/grafana/grafana/apps/investigations"
|
||||||
language: {
|
language: {
|
||||||
version: "v0.9.0"
|
version: "v0.11.0"
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ module github.com/grafana/grafana/apps/logsdrilldown
|
|||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4
|
github.com/grafana/grafana-app-sdk v0.48.5
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
github.com/grafana/grafana-app-sdk/logging v0.48.3
|
||||||
k8s.io/apimachinery v0.34.2
|
k8s.io/apimachinery v0.34.2
|
||||||
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
|
|||||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4 h1:t9r+Y6E7D832ZxQ2c1n0lp6cvsYKhhrAodVYzE1y0s0=
|
github.com/grafana/grafana-app-sdk v0.48.5 h1:MS8l9fTZz+VbTfgApn09jw27GxhQ6fNOWGhC4ydvZmM=
|
||||||
github.com/grafana/grafana-app-sdk v0.48.4/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
github.com/grafana/grafana-app-sdk v0.48.5/go.mod h1:HJsMOSBmt/D/Ihs1SvagOwmXKi0coBMVHlfvdd+qe9Y=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3 h1:72NUpGNiJXCNQz/on++YSsl38xuVYYBKv5kKQaOClX4=
|
||||||
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
github.com/grafana/grafana-app-sdk/logging v0.48.3/go.mod h1:Gh/nBWnspK3oDNWtiM5qUF/fardHzOIEez+SPI3JeHA=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
module: "github.com/grafana/grafana/apps/logsdrilldown/kinds"
|
module: "github.com/grafana/grafana/apps/logsdrilldown/kinds"
|
||||||
language: version: "v0.8.2"
|
language: {
|
||||||
|
version: "v0.11.0"
|
||||||
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user