Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 21bac58d51 | |||
| 97af86efb2 | |||
| f58ab2a6a1 | |||
| b96a1ae722 | |||
| a53875e621 | |||
| 9598ae6434 | |||
| ab0b05550f | |||
| 4518add556 | |||
| 00b89b0d29 | |||
| a3eedfeb73 | |||
| 1e8f1f74ea | |||
| 66b05914e2 |
@@ -1,9 +0,0 @@
|
||||
include ../sdk.mk
|
||||
|
||||
.PHONY: generate # Run Grafana App SDK code generation
|
||||
generate: install-app-sdk update-app-sdk
|
||||
@$(APP_SDK_BIN) generate \
|
||||
--source=./kinds/ \
|
||||
--gogenpath=./pkg/apis \
|
||||
--grouping=group \
|
||||
--defencoding=none
|
||||
@@ -1,102 +0,0 @@
|
||||
module github.com/grafana/grafana/apps/anno
|
||||
|
||||
go 1.25.5
|
||||
|
||||
require (
|
||||
github.com/grafana/grafana-app-sdk v0.48.7
|
||||
github.com/grafana/grafana-app-sdk/logging v0.48.7
|
||||
k8s.io/apimachinery v0.34.3
|
||||
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf // indirect
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
|
||||
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||
github.com/getkin/kin-openapi v0.133.0 // indirect
|
||||
github.com/go-logr/logr v1.4.3 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.22.4 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.4 // indirect
|
||||
github.com/go-openapi/swag v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/conv v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/loading v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/mangling v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/netutils v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/stringutils v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/typeutils v0.25.4 // indirect
|
||||
github.com/go-openapi/swag/yamlutils v0.25.4 // indirect
|
||||
github.com/go-test/deep v1.1.1 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/google/gnostic-models v0.7.1 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/mailru/easyjson v0.9.1 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect
|
||||
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
|
||||
github.com/onsi/gomega v1.36.2 // indirect
|
||||
github.com/perimeterx/marshmallow v1.1.5 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/prometheus/client_golang v1.23.2 // indirect
|
||||
github.com/prometheus/client_model v0.6.2 // indirect
|
||||
github.com/prometheus/common v0.67.4 // indirect
|
||||
github.com/prometheus/procfs v0.19.2 // indirect
|
||||
github.com/puzpuzpuz/xsync/v2 v2.5.1 // indirect
|
||||
github.com/spf13/pflag v1.0.10 // indirect
|
||||
github.com/woodsbury/decimal128 v1.4.0 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/otel v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.39.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.3 // indirect
|
||||
go.yaml.in/yaml/v3 v3.0.4 // indirect
|
||||
golang.org/x/net v0.48.0 // indirect
|
||||
golang.org/x/oauth2 v0.34.0 // indirect
|
||||
golang.org/x/sync v0.19.0 // indirect
|
||||
golang.org/x/sys v0.39.0 // indirect
|
||||
golang.org/x/term v0.38.0 // indirect
|
||||
golang.org/x/text v0.32.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2 // indirect
|
||||
google.golang.org/grpc v1.77.0 // indirect
|
||||
google.golang.org/protobuf v1.36.11 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/api v0.34.3 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.34.3 // indirect
|
||||
k8s.io/client-go v0.34.3 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||
)
|
||||
@@ -1,264 +0,0 @@
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf h1:TqhNAT4zKbTdLa62d2HDBFdvgSbIGB3eJE8HqhgiL9I=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
|
||||
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes=
|
||||
github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/evanphx/json-patch v5.9.11+incompatible h1:ixHHqfcGvxhWkniF1tWxBHA0yb4Z+d1UQi45df52xW8=
|
||||
github.com/evanphx/json-patch v5.9.11+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/getkin/kin-openapi v0.133.0 h1:pJdmNohVIJ97r4AUFtEXRXwESr8b0bD721u/Tz6k8PQ=
|
||||
github.com/getkin/kin-openapi v0.133.0/go.mod h1:boAciF6cXk5FhPqe/NQeBTeenbjqU4LhWBf09ILVvWE=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-openapi/jsonpointer v0.22.4 h1:dZtK82WlNpVLDW2jlA1YCiVJFVqkED1MegOUy9kR5T4=
|
||||
github.com/go-openapi/jsonpointer v0.22.4/go.mod h1:elX9+UgznpFhgBuaMQ7iu4lvvX1nvNsesQ3oxmYTw80=
|
||||
github.com/go-openapi/jsonreference v0.21.4 h1:24qaE2y9bx/q3uRK/qN+TDwbok1NhbSmGjjySRCHtC8=
|
||||
github.com/go-openapi/jsonreference v0.21.4/go.mod h1:rIENPTjDbLpzQmQWCj5kKj3ZlmEh+EFVbz3RTUh30/4=
|
||||
github.com/go-openapi/swag v0.25.4 h1:OyUPUFYDPDBMkqyxOTkqDYFnrhuhi9NR6QVUvIochMU=
|
||||
github.com/go-openapi/swag v0.25.4/go.mod h1:zNfJ9WZABGHCFg2RnY0S4IOkAcVTzJ6z2Bi+Q4i6qFQ=
|
||||
github.com/go-openapi/swag/cmdutils v0.25.4 h1:8rYhB5n6WawR192/BfUu2iVlxqVR9aRgGJP6WaBoW+4=
|
||||
github.com/go-openapi/swag/cmdutils v0.25.4/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0=
|
||||
github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4=
|
||||
github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU=
|
||||
github.com/go-openapi/swag/fileutils v0.25.4 h1:2oI0XNW5y6UWZTC7vAxC8hmsK/tOkWXHJQH4lKjqw+Y=
|
||||
github.com/go-openapi/swag/fileutils v0.25.4/go.mod h1:cdOT/PKbwcysVQ9Tpr0q20lQKH7MGhOEb6EwmHOirUk=
|
||||
github.com/go-openapi/swag/jsonname v0.25.4 h1:bZH0+MsS03MbnwBXYhuTttMOqk+5KcQ9869Vye1bNHI=
|
||||
github.com/go-openapi/swag/jsonname v0.25.4/go.mod h1:GPVEk9CWVhNvWhZgrnvRA6utbAltopbKwDu8mXNUMag=
|
||||
github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA=
|
||||
github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY=
|
||||
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo=
|
||||
github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM=
|
||||
github.com/go-openapi/swag/loading v0.25.4 h1:jN4MvLj0X6yhCDduRsxDDw1aHe+ZWoLjW+9ZQWIKn2s=
|
||||
github.com/go-openapi/swag/loading v0.25.4/go.mod h1:rpUM1ZiyEP9+mNLIQUdMiD7dCETXvkkC30z53i+ftTE=
|
||||
github.com/go-openapi/swag/mangling v0.25.4 h1:2b9kBJk9JvPgxr36V23FxJLdwBrpijI26Bx5JH4Hp48=
|
||||
github.com/go-openapi/swag/mangling v0.25.4/go.mod h1:6dxwu6QyORHpIIApsdZgb6wBk/DPU15MdyYj/ikn0Hg=
|
||||
github.com/go-openapi/swag/netutils v0.25.4 h1:Gqe6K71bGRb3ZQLusdI8p/y1KLgV4M/k+/HzVSqT8H0=
|
||||
github.com/go-openapi/swag/netutils v0.25.4/go.mod h1:m2W8dtdaoX7oj9rEttLyTeEFFEBvnAx9qHd5nJEBzYg=
|
||||
github.com/go-openapi/swag/stringutils v0.25.4 h1:O6dU1Rd8bej4HPA3/CLPciNBBDwZj9HiEpdVsb8B5A8=
|
||||
github.com/go-openapi/swag/stringutils v0.25.4/go.mod h1:GTsRvhJW5xM5gkgiFe0fV3PUlFm0dr8vki6/VSRaZK0=
|
||||
github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw=
|
||||
github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE=
|
||||
github.com/go-openapi/swag/yamlutils v0.25.4 h1:6jdaeSItEUb7ioS9lFoCZ65Cne1/RZtPBZ9A56h92Sw=
|
||||
github.com/go-openapi/swag/yamlutils v0.25.4/go.mod h1:MNzq1ulQu+yd8Kl7wPOut/YHAAU/H6hL91fF+E2RFwc=
|
||||
github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4=
|
||||
github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg=
|
||||
github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls=
|
||||
github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
|
||||
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/gnostic-models v0.7.1 h1:SisTfuFKJSKM5CPZkffwi6coztzzeYUhc3v4yxLWH8c=
|
||||
github.com/google/gnostic-models v0.7.1/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
|
||||
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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8=
|
||||
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/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grafana/grafana-app-sdk v0.48.7 h1:9mF7nqkqP0QUYYDlznoOt+GIyjzj45wGfUHB32u2ZMo=
|
||||
github.com/grafana/grafana-app-sdk v0.48.7/go.mod h1:DWsaaH39ZMHwSOSoUBaeW8paMrRaYsjRYlLwCJYd78k=
|
||||
github.com/grafana/grafana-app-sdk/logging v0.48.7 h1:Oa5qg473gka5+W/WQk61Xbw4YdAv+wV2Z4bJtzeCaQw=
|
||||
github.com/grafana/grafana-app-sdk/logging v0.48.7/go.mod h1:5u3KalezoBAAo2Y3ytDYDAIIPvEqFLLDSxeiK99QxDU=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8=
|
||||
github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
|
||||
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY=
|
||||
github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw=
|
||||
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c=
|
||||
github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o=
|
||||
github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU=
|
||||
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
|
||||
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
|
||||
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
|
||||
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
|
||||
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
|
||||
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
|
||||
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
|
||||
github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
|
||||
github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc=
|
||||
github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
|
||||
github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws=
|
||||
github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw=
|
||||
github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU=
|
||||
github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU=
|
||||
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
|
||||
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
|
||||
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
|
||||
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
|
||||
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc=
|
||||
github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
|
||||
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 h1:in9O8ESIOlwJAEGTkkf34DesGRAc/Pn8qJ7k3r/42LM=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0/go.mod h1:Rp0EXBm5tfnv0WL+ARyO/PHBEaEAT8UUHQ6AGJcSq6c=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU=
|
||||
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
|
||||
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
|
||||
go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18=
|
||||
go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew=
|
||||
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
|
||||
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
|
||||
go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A=
|
||||
go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
|
||||
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
|
||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
|
||||
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
|
||||
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
|
||||
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
||||
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
|
||||
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
||||
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
|
||||
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0=
|
||||
gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 h1:7LRqPCEdE4TP4/9psdaB7F2nhZFfBiGJomA5sojLWdU=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2 h1:2I6GHUeJ/4shcDpoUlLs/2WPnhg7yJwvXtqcMJt9liA=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20251213004720-97cd9d5aeac2/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
|
||||
google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=
|
||||
google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo=
|
||||
gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.34.3 h1:D12sTP257/jSH2vHV2EDYrb16bS7ULlHpdNdNhEw2S4=
|
||||
k8s.io/api v0.34.3/go.mod h1:PyVQBF886Q5RSQZOim7DybQjAbVs8g7gwJNhGtY5MBk=
|
||||
k8s.io/apiextensions-apiserver v0.34.3 h1:p10fGlkDY09eWKOTeUSioxwLukJnm+KuDZdrW71y40g=
|
||||
k8s.io/apiextensions-apiserver v0.34.3/go.mod h1:aujxvqGFRdb/cmXYfcRTeppN7S2XV/t7WMEc64zB5A0=
|
||||
k8s.io/apimachinery v0.34.3 h1:/TB+SFEiQvN9HPldtlWOTp0hWbJ+fjU+wkxysf/aQnE=
|
||||
k8s.io/apimachinery v0.34.3/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
|
||||
k8s.io/client-go v0.34.3 h1:wtYtpzy/OPNYf7WyNBTj3iUA0XaBHVqhv4Iv3tbrF5A=
|
||||
k8s.io/client-go v0.34.3/go.mod h1:OxxeYagaP9Kdf78UrKLa3YZixMCfP6bgPwPwNBQBzpM=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e h1:iW9ChlU0cU16w8MpVYjXk12dqQ4BPFBEgif+ap7/hqQ=
|
||||
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
|
||||
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
|
||||
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
|
||||
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.1 h1:JrhdFMqOd/+3ByqlP2I45kTOZmTRLBUm5pvRjeheg7E=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.1/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
||||
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||
@@ -1,23 +0,0 @@
|
||||
package kinds
|
||||
|
||||
annov0alpha1: {
|
||||
kind: "Annotation"
|
||||
pluralName: "Annotations"
|
||||
schema: {
|
||||
spec: {
|
||||
text: string
|
||||
time: int64
|
||||
timeEnd?: int64
|
||||
dashboardUID?: string
|
||||
panelID?: int64
|
||||
tags?: [...string]
|
||||
}
|
||||
}
|
||||
selectableFields: [
|
||||
"spec.time",
|
||||
"spec.timeEnd",
|
||||
"spec.dashboardUID",
|
||||
"spec.panelID",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
module: "anno.grafana.app/kinds"
|
||||
language: version: "v0.8.2"
|
||||
@@ -1,35 +0,0 @@
|
||||
package kinds
|
||||
|
||||
manifest: {
|
||||
appName: "anno"
|
||||
groupOverride: "anno.grafana.app"
|
||||
versions: {
|
||||
"v0alpha1": v0alpha1
|
||||
}
|
||||
}
|
||||
|
||||
v0alpha1: {
|
||||
kinds: [annov0alpha1]
|
||||
routes: {
|
||||
namespaced: {
|
||||
"/tags": {
|
||||
"GET": {
|
||||
response: {
|
||||
tags: [...{
|
||||
tag: string
|
||||
count: number
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
codegen: {
|
||||
ts: {
|
||||
enabled: true
|
||||
}
|
||||
go: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
type AnnotationClient struct {
|
||||
client *resource.TypedClient[*Annotation, *AnnotationList]
|
||||
}
|
||||
|
||||
func NewAnnotationClient(client resource.Client) *AnnotationClient {
|
||||
return &AnnotationClient{
|
||||
client: resource.NewTypedClient[*Annotation, *AnnotationList](client, AnnotationKind()),
|
||||
}
|
||||
}
|
||||
|
||||
func NewAnnotationClientFromGenerator(generator resource.ClientGenerator) (*AnnotationClient, error) {
|
||||
c, err := generator.ClientFor(AnnotationKind())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewAnnotationClient(c), nil
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) Get(ctx context.Context, identifier resource.Identifier) (*Annotation, error) {
|
||||
return c.client.Get(ctx, identifier)
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) List(ctx context.Context, namespace string, opts resource.ListOptions) (*AnnotationList, error) {
|
||||
return c.client.List(ctx, namespace, opts)
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) ListAll(ctx context.Context, namespace string, opts resource.ListOptions) (*AnnotationList, error) {
|
||||
resp, err := c.client.List(ctx, namespace, resource.ListOptions{
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Limit: opts.Limit,
|
||||
LabelFilters: opts.LabelFilters,
|
||||
FieldSelectors: opts.FieldSelectors,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for resp.GetContinue() != "" {
|
||||
page, err := c.client.List(ctx, namespace, resource.ListOptions{
|
||||
Continue: resp.GetContinue(),
|
||||
ResourceVersion: opts.ResourceVersion,
|
||||
Limit: opts.Limit,
|
||||
LabelFilters: opts.LabelFilters,
|
||||
FieldSelectors: opts.FieldSelectors,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp.SetContinue(page.GetContinue())
|
||||
resp.SetResourceVersion(page.GetResourceVersion())
|
||||
resp.SetItems(append(resp.GetItems(), page.GetItems()...))
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) Create(ctx context.Context, obj *Annotation, opts resource.CreateOptions) (*Annotation, error) {
|
||||
// Make sure apiVersion and kind are set
|
||||
obj.APIVersion = GroupVersion.Identifier()
|
||||
obj.Kind = AnnotationKind().Kind()
|
||||
return c.client.Create(ctx, obj, opts)
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) Update(ctx context.Context, obj *Annotation, opts resource.UpdateOptions) (*Annotation, error) {
|
||||
return c.client.Update(ctx, obj, opts)
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) Patch(ctx context.Context, identifier resource.Identifier, req resource.PatchRequest, opts resource.PatchOptions) (*Annotation, error) {
|
||||
return c.client.Patch(ctx, identifier, req, opts)
|
||||
}
|
||||
|
||||
func (c *AnnotationClient) UpdateStatus(ctx context.Context, identifier resource.Identifier, newStatus AnnotationStatus, opts resource.UpdateOptions) (*Annotation, error) {
|
||||
return c.client.Update(ctx, &Annotation{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
Kind: AnnotationKind().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 *AnnotationClient) Delete(ctx context.Context, identifier resource.Identifier, opts resource.DeleteOptions) error {
|
||||
return c.client.Delete(ctx, identifier, opts)
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
)
|
||||
|
||||
// AnnotationJSONCodec is an implementation of resource.Codec for kubernetes JSON encoding
|
||||
type AnnotationJSONCodec struct{}
|
||||
|
||||
// Read reads JSON-encoded bytes from `reader` and unmarshals them into `into`
|
||||
func (*AnnotationJSONCodec) Read(reader io.Reader, into resource.Object) error {
|
||||
return json.NewDecoder(reader).Decode(into)
|
||||
}
|
||||
|
||||
// Write writes JSON-encoded bytes into `writer` marshaled from `from`
|
||||
func (*AnnotationJSONCodec) Write(writer io.Writer, from resource.Object) error {
|
||||
return json.NewEncoder(writer).Encode(from)
|
||||
}
|
||||
|
||||
// Interface compliance checks
|
||||
var _ resource.Codec = &AnnotationJSONCodec{}
|
||||
@@ -1,31 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
time "time"
|
||||
)
|
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
type AnnotationMetadata struct {
|
||||
UpdateTimestamp time.Time `json:"updateTimestamp"`
|
||||
CreatedBy string `json:"createdBy"`
|
||||
Uid string `json:"uid"`
|
||||
CreationTimestamp time.Time `json:"creationTimestamp"`
|
||||
DeletionTimestamp *time.Time `json:"deletionTimestamp,omitempty"`
|
||||
Finalizers []string `json:"finalizers"`
|
||||
ResourceVersion string `json:"resourceVersion"`
|
||||
Generation int64 `json:"generation"`
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
Labels map[string]string `json:"labels"`
|
||||
}
|
||||
|
||||
// NewAnnotationMetadata creates a new AnnotationMetadata object.
|
||||
func NewAnnotationMetadata() *AnnotationMetadata {
|
||||
return &AnnotationMetadata{
|
||||
Finalizers: []string{},
|
||||
Labels: map[string]string{},
|
||||
}
|
||||
}
|
||||
@@ -1,326 +0,0 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type Annotation struct {
|
||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata" yaml:"metadata"`
|
||||
|
||||
// Spec is the spec of the Annotation
|
||||
Spec AnnotationSpec `json:"spec" yaml:"spec"`
|
||||
|
||||
Status AnnotationStatus `json:"status" yaml:"status"`
|
||||
}
|
||||
|
||||
func NewAnnotation() *Annotation {
|
||||
return &Annotation{
|
||||
Spec: *NewAnnotationSpec(),
|
||||
Status: *NewAnnotationStatus(),
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) GetSpec() any {
|
||||
return o.Spec
|
||||
}
|
||||
|
||||
func (o *Annotation) SetSpec(spec any) error {
|
||||
cast, ok := spec.(AnnotationSpec)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot set spec type %#v, not of type Spec", spec)
|
||||
}
|
||||
o.Spec = cast
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *Annotation) GetSubresources() map[string]any {
|
||||
return map[string]any{
|
||||
"status": o.Status,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) GetSubresource(name string) (any, bool) {
|
||||
switch name {
|
||||
case "status":
|
||||
return o.Status, true
|
||||
default:
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) SetSubresource(name string, value any) error {
|
||||
switch name {
|
||||
case "status":
|
||||
cast, ok := value.(AnnotationStatus)
|
||||
if !ok {
|
||||
return fmt.Errorf("cannot set status type %#v, not of type AnnotationStatus", value)
|
||||
}
|
||||
o.Status = cast
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("subresource '%s' does not exist", name)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) GetStaticMetadata() resource.StaticMetadata {
|
||||
gvk := o.GroupVersionKind()
|
||||
return resource.StaticMetadata{
|
||||
Name: o.ObjectMeta.Name,
|
||||
Namespace: o.ObjectMeta.Namespace,
|
||||
Group: gvk.Group,
|
||||
Version: gvk.Version,
|
||||
Kind: gvk.Kind,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) SetStaticMetadata(metadata resource.StaticMetadata) {
|
||||
o.Name = metadata.Name
|
||||
o.Namespace = metadata.Namespace
|
||||
o.SetGroupVersionKind(schema.GroupVersionKind{
|
||||
Group: metadata.Group,
|
||||
Version: metadata.Version,
|
||||
Kind: metadata.Kind,
|
||||
})
|
||||
}
|
||||
|
||||
func (o *Annotation) GetCommonMetadata() resource.CommonMetadata {
|
||||
dt := o.DeletionTimestamp
|
||||
var deletionTimestamp *time.Time
|
||||
if dt != nil {
|
||||
deletionTimestamp = &dt.Time
|
||||
}
|
||||
// Legacy ExtraFields support
|
||||
extraFields := make(map[string]any)
|
||||
if o.Annotations != nil {
|
||||
extraFields["annotations"] = o.Annotations
|
||||
}
|
||||
if o.ManagedFields != nil {
|
||||
extraFields["managedFields"] = o.ManagedFields
|
||||
}
|
||||
if o.OwnerReferences != nil {
|
||||
extraFields["ownerReferences"] = o.OwnerReferences
|
||||
}
|
||||
return resource.CommonMetadata{
|
||||
UID: string(o.UID),
|
||||
ResourceVersion: o.ResourceVersion,
|
||||
Generation: o.Generation,
|
||||
Labels: o.Labels,
|
||||
CreationTimestamp: o.CreationTimestamp.Time,
|
||||
DeletionTimestamp: deletionTimestamp,
|
||||
Finalizers: o.Finalizers,
|
||||
UpdateTimestamp: o.GetUpdateTimestamp(),
|
||||
CreatedBy: o.GetCreatedBy(),
|
||||
UpdatedBy: o.GetUpdatedBy(),
|
||||
ExtraFields: extraFields,
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) SetCommonMetadata(metadata resource.CommonMetadata) {
|
||||
o.UID = types.UID(metadata.UID)
|
||||
o.ResourceVersion = metadata.ResourceVersion
|
||||
o.Generation = metadata.Generation
|
||||
o.Labels = metadata.Labels
|
||||
o.CreationTimestamp = metav1.NewTime(metadata.CreationTimestamp)
|
||||
if metadata.DeletionTimestamp != nil {
|
||||
dt := metav1.NewTime(*metadata.DeletionTimestamp)
|
||||
o.DeletionTimestamp = &dt
|
||||
} else {
|
||||
o.DeletionTimestamp = nil
|
||||
}
|
||||
o.Finalizers = metadata.Finalizers
|
||||
if o.Annotations == nil {
|
||||
o.Annotations = make(map[string]string)
|
||||
}
|
||||
if !metadata.UpdateTimestamp.IsZero() {
|
||||
o.SetUpdateTimestamp(metadata.UpdateTimestamp)
|
||||
}
|
||||
if metadata.CreatedBy != "" {
|
||||
o.SetCreatedBy(metadata.CreatedBy)
|
||||
}
|
||||
if metadata.UpdatedBy != "" {
|
||||
o.SetUpdatedBy(metadata.UpdatedBy)
|
||||
}
|
||||
// Legacy support for setting Annotations, ManagedFields, and OwnerReferences via ExtraFields
|
||||
if metadata.ExtraFields != nil {
|
||||
if annotations, ok := metadata.ExtraFields["annotations"]; ok {
|
||||
if cast, ok := annotations.(map[string]string); ok {
|
||||
o.Annotations = cast
|
||||
}
|
||||
}
|
||||
if managedFields, ok := metadata.ExtraFields["managedFields"]; ok {
|
||||
if cast, ok := managedFields.([]metav1.ManagedFieldsEntry); ok {
|
||||
o.ManagedFields = cast
|
||||
}
|
||||
}
|
||||
if ownerReferences, ok := metadata.ExtraFields["ownerReferences"]; ok {
|
||||
if cast, ok := ownerReferences.([]metav1.OwnerReference); ok {
|
||||
o.OwnerReferences = cast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Annotation) GetCreatedBy() string {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
return o.ObjectMeta.Annotations["grafana.com/createdBy"]
|
||||
}
|
||||
|
||||
func (o *Annotation) SetCreatedBy(createdBy string) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/createdBy"] = createdBy
|
||||
}
|
||||
|
||||
func (o *Annotation) GetUpdateTimestamp() time.Time {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
parsed, _ := time.Parse(time.RFC3339, o.ObjectMeta.Annotations["grafana.com/updateTimestamp"])
|
||||
return parsed
|
||||
}
|
||||
|
||||
func (o *Annotation) SetUpdateTimestamp(updateTimestamp time.Time) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/updateTimestamp"] = updateTimestamp.Format(time.RFC3339)
|
||||
}
|
||||
|
||||
func (o *Annotation) GetUpdatedBy() string {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
return o.ObjectMeta.Annotations["grafana.com/updatedBy"]
|
||||
}
|
||||
|
||||
func (o *Annotation) SetUpdatedBy(updatedBy string) {
|
||||
if o.ObjectMeta.Annotations == nil {
|
||||
o.ObjectMeta.Annotations = make(map[string]string)
|
||||
}
|
||||
|
||||
o.ObjectMeta.Annotations["grafana.com/updatedBy"] = updatedBy
|
||||
}
|
||||
|
||||
func (o *Annotation) Copy() resource.Object {
|
||||
return resource.CopyObject(o)
|
||||
}
|
||||
|
||||
func (o *Annotation) DeepCopyObject() runtime.Object {
|
||||
return o.Copy()
|
||||
}
|
||||
|
||||
func (o *Annotation) DeepCopy() *Annotation {
|
||||
cpy := &Annotation{}
|
||||
o.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *Annotation) DeepCopyInto(dst *Annotation) {
|
||||
dst.TypeMeta.APIVersion = o.TypeMeta.APIVersion
|
||||
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||
o.ObjectMeta.DeepCopyInto(&dst.ObjectMeta)
|
||||
o.Spec.DeepCopyInto(&dst.Spec)
|
||||
o.Status.DeepCopyInto(&dst.Status)
|
||||
}
|
||||
|
||||
// Interface compliance compile-time check
|
||||
var _ resource.Object = &Annotation{}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type AnnotationList struct {
|
||||
metav1.TypeMeta `json:",inline" yaml:",inline"`
|
||||
metav1.ListMeta `json:"metadata" yaml:"metadata"`
|
||||
Items []Annotation `json:"items" yaml:"items"`
|
||||
}
|
||||
|
||||
func (o *AnnotationList) DeepCopyObject() runtime.Object {
|
||||
return o.Copy()
|
||||
}
|
||||
|
||||
func (o *AnnotationList) Copy() resource.ListObject {
|
||||
cpy := &AnnotationList{
|
||||
TypeMeta: o.TypeMeta,
|
||||
Items: make([]Annotation, len(o.Items)),
|
||||
}
|
||||
o.ListMeta.DeepCopyInto(&cpy.ListMeta)
|
||||
for i := 0; i < len(o.Items); i++ {
|
||||
if item, ok := o.Items[i].Copy().(*Annotation); ok {
|
||||
cpy.Items[i] = *item
|
||||
}
|
||||
}
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *AnnotationList) GetItems() []resource.Object {
|
||||
items := make([]resource.Object, len(o.Items))
|
||||
for i := 0; i < len(o.Items); i++ {
|
||||
items[i] = &o.Items[i]
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
func (o *AnnotationList) SetItems(items []resource.Object) {
|
||||
o.Items = make([]Annotation, len(items))
|
||||
for i := 0; i < len(items); i++ {
|
||||
o.Items[i] = *items[i].(*Annotation)
|
||||
}
|
||||
}
|
||||
|
||||
func (o *AnnotationList) DeepCopy() *AnnotationList {
|
||||
cpy := &AnnotationList{}
|
||||
o.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
func (o *AnnotationList) DeepCopyInto(dst *AnnotationList) {
|
||||
resource.CopyObjectInto(dst, o)
|
||||
}
|
||||
|
||||
// Interface compliance compile-time check
|
||||
var _ resource.ListObject = &AnnotationList{}
|
||||
|
||||
// Copy methods for all subresource types
|
||||
|
||||
// DeepCopy creates a full deep copy of Spec
|
||||
func (s *AnnotationSpec) DeepCopy() *AnnotationSpec {
|
||||
cpy := &AnnotationSpec{}
|
||||
s.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
// DeepCopyInto deep copies Spec into another Spec object
|
||||
func (s *AnnotationSpec) DeepCopyInto(dst *AnnotationSpec) {
|
||||
resource.CopyObjectInto(dst, s)
|
||||
}
|
||||
|
||||
// DeepCopy creates a full deep copy of AnnotationStatus
|
||||
func (s *AnnotationStatus) DeepCopy() *AnnotationStatus {
|
||||
cpy := &AnnotationStatus{}
|
||||
s.DeepCopyInto(cpy)
|
||||
return cpy
|
||||
}
|
||||
|
||||
// DeepCopyInto deep copies AnnotationStatus into another AnnotationStatus object
|
||||
func (s *AnnotationStatus) DeepCopyInto(dst *AnnotationStatus) {
|
||||
resource.CopyObjectInto(dst, s)
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
//
|
||||
// Code generated by grafana-app-sdk. DO NOT EDIT.
|
||||
//
|
||||
|
||||
package v0alpha1
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
)
|
||||
|
||||
// schema is unexported to prevent accidental overwrites
|
||||
var (
|
||||
schemaAnnotation = resource.NewSimpleSchema("anno.grafana.app", "v0alpha1", NewAnnotation(), &AnnotationList{}, resource.WithKind("Annotation"),
|
||||
resource.WithPlural("annotations"), resource.WithScope(resource.NamespacedScope), resource.WithSelectableFields([]resource.SelectableField{resource.SelectableField{
|
||||
FieldSelector: "spec.time",
|
||||
FieldValueFunc: func(o resource.Object) (string, error) {
|
||||
cast, ok := o.(*Annotation)
|
||||
if !ok {
|
||||
return "", errors.New("provided object must be of type *Annotation")
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%d", cast.Spec.Time), nil
|
||||
},
|
||||
},
|
||||
resource.SelectableField{
|
||||
FieldSelector: "spec.timeEnd",
|
||||
FieldValueFunc: func(o resource.Object) (string, error) {
|
||||
cast, ok := o.(*Annotation)
|
||||
if !ok {
|
||||
return "", errors.New("provided object must be of type *Annotation")
|
||||
}
|
||||
if cast.Spec.TimeEnd == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%d", *cast.Spec.TimeEnd), nil
|
||||
},
|
||||
},
|
||||
resource.SelectableField{
|
||||
FieldSelector: "spec.dashboardUID",
|
||||
FieldValueFunc: func(o resource.Object) (string, error) {
|
||||
cast, ok := o.(*Annotation)
|
||||
if !ok {
|
||||
return "", errors.New("provided object must be of type *Annotation")
|
||||
}
|
||||
if cast.Spec.DashboardUID == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return *cast.Spec.DashboardUID, nil
|
||||
},
|
||||
},
|
||||
resource.SelectableField{
|
||||
FieldSelector: "spec.panelID",
|
||||
FieldValueFunc: func(o resource.Object) (string, error) {
|
||||
cast, ok := o.(*Annotation)
|
||||
if !ok {
|
||||
return "", errors.New("provided object must be of type *Annotation")
|
||||
}
|
||||
if cast.Spec.PanelID == nil {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%d", *cast.Spec.PanelID), nil
|
||||
},
|
||||
},
|
||||
}))
|
||||
kindAnnotation = resource.Kind{
|
||||
Schema: schemaAnnotation,
|
||||
Codecs: map[resource.KindEncoding]resource.Codec{
|
||||
resource.KindEncodingJSON: &AnnotationJSONCodec{},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// Kind returns a resource.Kind for this Schema with a JSON codec
|
||||
func AnnotationKind() resource.Kind {
|
||||
return kindAnnotation
|
||||
}
|
||||
|
||||
// Schema returns a resource.SimpleSchema representation of Annotation
|
||||
func AnnotationSchema() *resource.SimpleSchema {
|
||||
return schemaAnnotation
|
||||
}
|
||||
|
||||
// Interface compliance checks
|
||||
var _ resource.Schema = kindAnnotation
|
||||
@@ -1,18 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type AnnotationSpec struct {
|
||||
Text string `json:"text"`
|
||||
Time int64 `json:"time"`
|
||||
TimeEnd *int64 `json:"timeEnd,omitempty"`
|
||||
DashboardUID *string `json:"dashboardUID,omitempty"`
|
||||
PanelID *int64 `json:"panelID,omitempty"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
}
|
||||
|
||||
// NewAnnotationSpec creates a new AnnotationSpec object.
|
||||
func NewAnnotationSpec() *AnnotationSpec {
|
||||
return &AnnotationSpec{}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type AnnotationstatusOperatorState struct {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
LastEvaluation string `json:"lastEvaluation"`
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
State AnnotationStatusOperatorStateState `json:"state"`
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
DescriptiveState *string `json:"descriptiveState,omitempty"`
|
||||
// details contains any extra information that is operator-specific
|
||||
Details map[string]interface{} `json:"details,omitempty"`
|
||||
}
|
||||
|
||||
// NewAnnotationstatusOperatorState creates a new AnnotationstatusOperatorState object.
|
||||
func NewAnnotationstatusOperatorState() *AnnotationstatusOperatorState {
|
||||
return &AnnotationstatusOperatorState{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type AnnotationStatus struct {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
OperatorStates map[string]AnnotationstatusOperatorState `json:"operatorStates,omitempty"`
|
||||
// additionalFields is reserved for future use
|
||||
AdditionalFields map[string]interface{} `json:"additionalFields,omitempty"`
|
||||
}
|
||||
|
||||
// NewAnnotationStatus creates a new AnnotationStatus object.
|
||||
func NewAnnotationStatus() *AnnotationStatus {
|
||||
return &AnnotationStatus{}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type AnnotationStatusOperatorStateState string
|
||||
|
||||
const (
|
||||
AnnotationStatusOperatorStateStateSuccess AnnotationStatusOperatorStateState = "success"
|
||||
AnnotationStatusOperatorStateStateInProgress AnnotationStatusOperatorStateState = "in_progress"
|
||||
AnnotationStatusOperatorStateStateFailed AnnotationStatusOperatorStateState = "failed"
|
||||
)
|
||||
@@ -1,18 +0,0 @@
|
||||
package v0alpha1
|
||||
|
||||
import "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
const (
|
||||
// APIGroup is the API group used by all kinds in this package
|
||||
APIGroup = "anno.grafana.app"
|
||||
// APIVersion is the API version used by all kinds in this package
|
||||
APIVersion = "v0alpha1"
|
||||
)
|
||||
|
||||
var (
|
||||
// GroupVersion is a schema.GroupVersion consisting of the Group and Version constants for this package
|
||||
GroupVersion = schema.GroupVersion{
|
||||
Group: APIGroup,
|
||||
Version: APIVersion,
|
||||
}
|
||||
)
|
||||
@@ -1,26 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
package v0alpha1
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type GetTagsBody struct {
|
||||
Tags []V0alpha1GetTagsBodyTags `json:"tags"`
|
||||
}
|
||||
|
||||
// NewGetTagsBody creates a new GetTagsBody object.
|
||||
func NewGetTagsBody() *GetTagsBody {
|
||||
return &GetTagsBody{
|
||||
Tags: []V0alpha1GetTagsBodyTags{},
|
||||
}
|
||||
}
|
||||
|
||||
// +k8s:openapi-gen=true
|
||||
type V0alpha1GetTagsBodyTags struct {
|
||||
Tag string `json:"tag"`
|
||||
Count float64 `json:"count"`
|
||||
}
|
||||
|
||||
// NewV0alpha1GetTagsBodyTags creates a new V0alpha1GetTagsBodyTags object.
|
||||
func NewV0alpha1GetTagsBodyTags() *V0alpha1GetTagsBodyTags {
|
||||
return &V0alpha1GetTagsBodyTags{}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// 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 GetTags struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
GetTagsBody `json:",inline"`
|
||||
}
|
||||
|
||||
func NewGetTags() *GetTags {
|
||||
return &GetTags{}
|
||||
}
|
||||
|
||||
func (t *GetTagsBody) DeepCopyInto(dst *GetTagsBody) {
|
||||
_ = resource.CopyObjectInto(dst, t)
|
||||
}
|
||||
|
||||
func (o *GetTags) DeepCopyObject() runtime.Object {
|
||||
dst := NewGetTags()
|
||||
o.DeepCopyInto(dst)
|
||||
return dst
|
||||
}
|
||||
|
||||
func (o *GetTags) DeepCopyInto(dst *GetTags) {
|
||||
dst.TypeMeta.APIVersion = o.TypeMeta.APIVersion
|
||||
dst.TypeMeta.Kind = o.TypeMeta.Kind
|
||||
o.GetTagsBody.DeepCopyInto(&dst.GetTagsBody)
|
||||
}
|
||||
|
||||
var _ runtime.Object = NewGetTags()
|
||||
@@ -1,205 +0,0 @@
|
||||
//
|
||||
// This file is generated by grafana-app-sdk
|
||||
// DO NOT EDIT
|
||||
//
|
||||
|
||||
package manifestdata
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/app"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kube-openapi/pkg/spec3"
|
||||
"k8s.io/kube-openapi/pkg/validation/spec"
|
||||
|
||||
v0alpha1 "github.com/grafana/grafana/apps/anno/pkg/apis/anno/v0alpha1"
|
||||
)
|
||||
|
||||
var (
|
||||
rawSchemaAnnotationv0alpha1 = []byte(`{"Annotation":{"properties":{"spec":{"$ref":"#/components/schemas/spec"},"status":{"$ref":"#/components/schemas/status"}},"required":["spec"]},"OperatorState":{"additionalProperties":false,"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"details contains any extra information that is operator-specific","type":"object"},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"spec":{"additionalProperties":false,"properties":{"dashboardUID":{"type":"string"},"panelID":{"type":"integer"},"tags":{"items":{"type":"string"},"type":"array"},"text":{"type":"string"},"time":{"type":"integer"},"timeEnd":{"type":"integer"}},"required":["text","time"],"type":"object"},"status":{"additionalProperties":false,"properties":{"additionalFields":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"additionalFields is reserved for future use","type":"object"},"operatorStates":{"additionalProperties":{"$ref":"#/components/schemas/OperatorState"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"type":"object"}}`)
|
||||
versionSchemaAnnotationv0alpha1 app.VersionSchema
|
||||
_ = json.Unmarshal(rawSchemaAnnotationv0alpha1, &versionSchemaAnnotationv0alpha1)
|
||||
)
|
||||
|
||||
var appManifestData = app.ManifestData{
|
||||
AppName: "anno",
|
||||
Group: "anno.grafana.app",
|
||||
PreferredVersion: "v0alpha1",
|
||||
Versions: []app.ManifestVersion{
|
||||
{
|
||||
Name: "v0alpha1",
|
||||
Served: true,
|
||||
Kinds: []app.ManifestVersionKind{
|
||||
{
|
||||
Kind: "Annotation",
|
||||
Plural: "Annotations",
|
||||
Scope: "Namespaced",
|
||||
Conversion: false,
|
||||
Schema: &versionSchemaAnnotationv0alpha1,
|
||||
SelectableFields: []string{
|
||||
"spec.time",
|
||||
"spec.timeEnd",
|
||||
"spec.dashboardUID",
|
||||
"spec.panelID",
|
||||
},
|
||||
},
|
||||
},
|
||||
Routes: app.ManifestVersionRoutes{
|
||||
Namespaced: map[string]spec3.PathProps{
|
||||
"/tags": {
|
||||
Get: &spec3.Operation{
|
||||
OperationProps: spec3.OperationProps{
|
||||
|
||||
OperationId: "getTags",
|
||||
|
||||
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",
|
||||
},
|
||||
},
|
||||
"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",
|
||||
},
|
||||
},
|
||||
"tags": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"count": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"number"},
|
||||
},
|
||||
},
|
||||
"tag": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Type: []string{"string"},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{
|
||||
"tag",
|
||||
"count",
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Required: []string{
|
||||
"tags",
|
||||
"apiVersion",
|
||||
"kind",
|
||||
},
|
||||
}},
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Cluster: map[string]spec3.PathProps{},
|
||||
Schemas: map[string]spec.Schema{},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func LocalManifest() app.Manifest {
|
||||
return app.NewEmbeddedManifest(appManifestData)
|
||||
}
|
||||
|
||||
func RemoteManifest() app.Manifest {
|
||||
return app.NewAPIServerManifest("anno")
|
||||
}
|
||||
|
||||
var kindVersionToGoType = map[string]resource.Kind{
|
||||
"Annotation/v0alpha1": v0alpha1.AnnotationKind(),
|
||||
}
|
||||
|
||||
// ManifestGoTypeAssociator returns the associated resource.Kind instance for a given Kind and Version, if one exists.
|
||||
// If there is no association for the provided Kind and Version, exists will return false.
|
||||
func ManifestGoTypeAssociator(kind, version string) (goType resource.Kind, exists bool) {
|
||||
goType, exists = kindVersionToGoType[fmt.Sprintf("%s/%s", kind, version)]
|
||||
return goType, exists
|
||||
}
|
||||
|
||||
var customRouteToGoResponseType = map[string]any{
|
||||
"v0alpha1||<namespace>/tags|GET": v0alpha1.GetTags{},
|
||||
}
|
||||
|
||||
// ManifestCustomRouteResponsesAssociator returns the associated response go type for a given kind, version, custom route path, and method, if one exists.
|
||||
// kind may be empty for custom routes which are not kind subroutes. Leading slashes are removed from subroute paths.
|
||||
// If there is no association for the provided kind, version, custom route path, and method, exists will return false.
|
||||
// Resource routes (those without a kind) should prefix their route with "<namespace>/" if the route is namespaced (otherwise the route is assumed to be cluster-scope)
|
||||
func ManifestCustomRouteResponsesAssociator(kind, version, path, verb string) (goType any, exists bool) {
|
||||
if len(path) > 0 && path[0] == '/' {
|
||||
path = path[1:]
|
||||
}
|
||||
goType, exists = customRouteToGoResponseType[fmt.Sprintf("%s|%s|%s|%s", version, kind, path, strings.ToUpper(verb))]
|
||||
return goType, exists
|
||||
}
|
||||
|
||||
var customRouteToGoParamsType = map[string]runtime.Object{}
|
||||
|
||||
func ManifestCustomRouteQueryAssociator(kind, version, path, verb string) (goType runtime.Object, exists bool) {
|
||||
if len(path) > 0 && path[0] == '/' {
|
||||
path = path[1:]
|
||||
}
|
||||
goType, exists = customRouteToGoParamsType[fmt.Sprintf("%s|%s|%s|%s", version, kind, path, strings.ToUpper(verb))]
|
||||
return goType, exists
|
||||
}
|
||||
|
||||
var customRouteToGoRequestBodyType = map[string]any{}
|
||||
|
||||
func ManifestCustomRouteRequestBodyAssociator(kind, version, path, verb string) (goType any, exists bool) {
|
||||
if len(path) > 0 && path[0] == '/' {
|
||||
path = path[1:]
|
||||
}
|
||||
goType, exists = customRouteToGoRequestBodyType[fmt.Sprintf("%s|%s|%s|%s", version, kind, path, strings.ToUpper(verb))]
|
||||
return goType, exists
|
||||
}
|
||||
|
||||
type GoTypeAssociator struct{}
|
||||
|
||||
func NewGoTypeAssociator() *GoTypeAssociator {
|
||||
return &GoTypeAssociator{}
|
||||
}
|
||||
|
||||
func (g *GoTypeAssociator) KindToGoType(kind, version string) (goType resource.Kind, exists bool) {
|
||||
return ManifestGoTypeAssociator(kind, version)
|
||||
}
|
||||
func (g *GoTypeAssociator) CustomRouteReturnGoType(kind, version, path, verb string) (goType any, exists bool) {
|
||||
return ManifestCustomRouteResponsesAssociator(kind, version, path, verb)
|
||||
}
|
||||
func (g *GoTypeAssociator) CustomRouteQueryGoType(kind, version, path, verb string) (goType runtime.Object, exists bool) {
|
||||
return ManifestCustomRouteQueryAssociator(kind, version, path, verb)
|
||||
}
|
||||
func (g *GoTypeAssociator) CustomRouteRequestBodyGoType(kind, version, path, verb string) (goType any, exists bool) {
|
||||
return ManifestCustomRouteRequestBodyAssociator(kind, version, path, verb)
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/app"
|
||||
"github.com/grafana/grafana-app-sdk/logging"
|
||||
"github.com/grafana/grafana-app-sdk/operator"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
"github.com/grafana/grafana-app-sdk/simple"
|
||||
|
||||
annov0alpha1 "github.com/grafana/grafana/apps/anno/pkg/apis/anno/v0alpha1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
func New(cfg app.Config) (app.App, error) {
|
||||
simpleConfig := simple.AppConfig{
|
||||
Name: "anno",
|
||||
KubeConfig: cfg.KubeConfig,
|
||||
InformerConfig: simple.AppInformerConfig{
|
||||
InformerOptions: operator.InformerOptions{
|
||||
ErrorHandler: func(ctx context.Context, err error) {
|
||||
logging.FromContext(ctx).Error("Informer processing error", "error", err)
|
||||
},
|
||||
},
|
||||
},
|
||||
ManagedKinds: []simple.AppManagedKind{{
|
||||
Kind: annov0alpha1.AnnotationKind(),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
a, err := simple.NewApp(simpleConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = a.ValidateManifest(cfg.ManifestData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func GetKinds() map[schema.GroupVersion][]resource.Kind {
|
||||
gv := schema.GroupVersion{
|
||||
Group: annov0alpha1.AnnotationKind().Group(),
|
||||
Version: annov0alpha1.AnnotationKind().Version(),
|
||||
}
|
||||
return map[schema.GroupVersion][]resource.Kind{
|
||||
gv: {annov0alpha1.AnnotationKind()},
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* This file was generated by grafana-app-sdk. DO NOT EDIT.
|
||||
*/
|
||||
import { Spec } from './types.spec.gen';
|
||||
import { Status } from './types.status.gen';
|
||||
|
||||
export interface Metadata {
|
||||
name: string;
|
||||
namespace: string;
|
||||
generateName?: string;
|
||||
selfLink?: string;
|
||||
uid?: string;
|
||||
resourceVersion?: string;
|
||||
generation?: number;
|
||||
creationTimestamp?: string;
|
||||
deletionTimestamp?: string;
|
||||
deletionGracePeriodSeconds?: number;
|
||||
labels?: Record<string, string>;
|
||||
annotations?: Record<string, string>;
|
||||
ownerReferences?: OwnerReference[];
|
||||
finalizers?: string[];
|
||||
managedFields?: ManagedFieldsEntry[];
|
||||
}
|
||||
|
||||
export interface OwnerReference {
|
||||
apiVersion: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
uid: string;
|
||||
controller?: boolean;
|
||||
blockOwnerDeletion?: boolean;
|
||||
}
|
||||
|
||||
export interface ManagedFieldsEntry {
|
||||
manager?: string;
|
||||
operation?: string;
|
||||
apiVersion?: string;
|
||||
time?: string;
|
||||
fieldsType?: string;
|
||||
subresource?: string;
|
||||
}
|
||||
|
||||
export interface Annotation {
|
||||
kind: string;
|
||||
apiVersion: string;
|
||||
metadata: Metadata;
|
||||
spec: Spec;
|
||||
status: Status;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
// metadata contains embedded CommonMetadata and can be extended with custom string fields
|
||||
// TODO: use CommonMetadata instead of redefining here; currently needs to be defined here
|
||||
// without external reference as using the CommonMetadata reference breaks thema codegen.
|
||||
export interface Metadata {
|
||||
updateTimestamp: string;
|
||||
createdBy: string;
|
||||
uid: string;
|
||||
creationTimestamp: string;
|
||||
deletionTimestamp?: string;
|
||||
finalizers: string[];
|
||||
resourceVersion: string;
|
||||
generation: number;
|
||||
updatedBy: string;
|
||||
labels: Record<string, string>;
|
||||
}
|
||||
|
||||
export const defaultMetadata = (): Metadata => ({
|
||||
updateTimestamp: "",
|
||||
createdBy: "",
|
||||
uid: "",
|
||||
creationTimestamp: "",
|
||||
finalizers: [],
|
||||
resourceVersion: "",
|
||||
generation: 0,
|
||||
updatedBy: "",
|
||||
labels: {},
|
||||
});
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
export interface Spec {
|
||||
text: string;
|
||||
time: number;
|
||||
timeEnd?: number;
|
||||
dashboardUID?: string;
|
||||
panelID?: number;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export const defaultSpec = (): Spec => ({
|
||||
text: "",
|
||||
time: 0,
|
||||
});
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
// Code generated - EDITING IS FUTILE. DO NOT EDIT.
|
||||
|
||||
export interface OperatorState {
|
||||
// lastEvaluation is the ResourceVersion last evaluated
|
||||
lastEvaluation: string;
|
||||
// state describes the state of the lastEvaluation.
|
||||
// It is limited to three possible states for machine evaluation.
|
||||
state: "success" | "in_progress" | "failed";
|
||||
// descriptiveState is an optional more descriptive state field which has no requirements on format
|
||||
descriptiveState?: string;
|
||||
// details contains any extra information that is operator-specific
|
||||
details?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultOperatorState = (): OperatorState => ({
|
||||
lastEvaluation: "",
|
||||
state: "success",
|
||||
});
|
||||
|
||||
export interface Status {
|
||||
// operatorStates is a map of operator ID to operator state evaluations.
|
||||
// Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
||||
operatorStates?: Record<string, OperatorState>;
|
||||
// additionalFields is reserved for future use
|
||||
additionalFields?: Record<string, any>;
|
||||
}
|
||||
|
||||
export const defaultStatus = (): Status => ({
|
||||
});
|
||||
|
||||
@@ -135,9 +135,12 @@ You can use the **Span Limit** field in **Options** section of the TraceQL query
|
||||
This field sets the maximum number of spans to return for each span set.
|
||||
By default, the maximum value that you can set for the **Span Limit** value (or the spss query) is 100.
|
||||
In Tempo configuration, this value is controlled by the `max_spans_per_span_set` parameter and can be modified by your Tempo administrator.
|
||||
Grafana Cloud users can contact Grafana Support to request a change.
|
||||
Entering a value higher than the default results in an error.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Changing the value of `max_spans_per_span_set` isn't supported in Grafana Cloud.
|
||||
{{< /admonition >}}
|
||||
|
||||
### Focus on traces or spans
|
||||
|
||||
Under **Options**, you can choose to display the table as **Traces** or **Spans** focused.
|
||||
|
||||
@@ -122,7 +122,7 @@ require (
|
||||
github.com/hashicorp/go-multierror v1.1.1 // @grafana/alerting-squad
|
||||
github.com/hashicorp/go-plugin v1.7.0 // @grafana/plugins-platform-backend
|
||||
github.com/hashicorp/go-secure-stdlib/plugincontainer v0.4.2 // @grafana/plugins-platform-backend
|
||||
github.com/hashicorp/go-version v1.7.0 // @grafana/grafana-backend-group
|
||||
github.com/hashicorp/go-version v1.8.0 // @grafana/grafana-backend-group
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // @grafana/alerting-backend
|
||||
github.com/hashicorp/hcl/v2 v2.24.0 // @grafana/alerting-backend
|
||||
github.com/huandu/xstrings v1.5.0 // @grafana/partner-datasources
|
||||
@@ -187,12 +187,12 @@ require (
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // @grafana/grafana-operator-experience-squad
|
||||
github.com/yudai/gojsondiff v1.0.0 // @grafana/grafana-backend-group
|
||||
go.etcd.io/bbolt v1.4.2 // @grafana/grafana-search-and-storage
|
||||
go.opentelemetry.io/collector/pdata v1.44.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/collector/pdata v1.49.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.64.0 // @grafana/plugins-platform-backend
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 // @grafana/grafana-operator-experience-squad
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.64.0 // @grafana/grafana-operator-experience-squad
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // @grafana/sharing-squad
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.38.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.32.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.39.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.33.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/otel v1.39.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // @grafana/grafana-backend-group
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 // @grafana/grafana-backend-group
|
||||
@@ -217,7 +217,7 @@ require (
|
||||
golang.org/x/tools v0.40.0 // indirect; @grafana/grafana-as-code
|
||||
gonum.org/v1/gonum v0.16.0 // @grafana/oss-big-tent
|
||||
google.golang.org/api v0.242.0 // @grafana/grafana-backend-group
|
||||
google.golang.org/grpc v1.77.0 // @grafana/plugins-platform-backend
|
||||
google.golang.org/grpc v1.78.0 // @grafana/plugins-platform-backend
|
||||
google.golang.org/protobuf v1.36.11 // @grafana/plugins-platform-backend
|
||||
gopkg.in/ini.v1 v1.67.0 // @grafana/alerting-backend
|
||||
gopkg.in/mail.v2 v2.3.1 // @grafana/grafana-backend-group
|
||||
@@ -481,7 +481,7 @@ require (
|
||||
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
|
||||
github.com/jackc/puddle/v2 v2.2.2 // indirect
|
||||
github.com/jaegertracing/jaeger v1.67.0 // indirect
|
||||
github.com/jaegertracing/jaeger-idl v0.5.0 // indirect
|
||||
github.com/jaegertracing/jaeger-idl v0.6.0 // indirect
|
||||
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
|
||||
github.com/jcmturner/gofork v1.7.6 // indirect
|
||||
@@ -609,7 +609,7 @@ require (
|
||||
go.etcd.io/etcd/client/v3 v3.6.6 // indirect
|
||||
go.mongodb.org/mongo-driver v1.17.4 // indirect
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
|
||||
go.opentelemetry.io/collector/featuregate v1.44.0 // indirect
|
||||
go.opentelemetry.io/collector/featuregate v1.49.0 // indirect
|
||||
go.opentelemetry.io/collector/semconv v0.124.0 // indirect
|
||||
go.opentelemetry.io/contrib/bridges/prometheus v0.61.0 // indirect
|
||||
go.opentelemetry.io/contrib/detectors/gcp v1.38.0 // indirect
|
||||
|
||||
@@ -1774,8 +1774,8 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
|
||||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
|
||||
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
|
||||
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/go-version v1.8.0 h1:KAkNb1HAiZd1ukkxDFGmokVZe1Xy9HG6NUp+bPle2i4=
|
||||
github.com/hashicorp/go-version v1.8.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
@@ -1849,8 +1849,8 @@ github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo
|
||||
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
|
||||
github.com/jaegertracing/jaeger v1.67.0 h1:t0BiJZVW9D3Z16y3uHqKzV9bKFTusooTH1Kgr77xF2Q=
|
||||
github.com/jaegertracing/jaeger v1.67.0/go.mod h1:tE/FEQfybCSdUbBgel51YaCSkc58O+Njih8oTl6j8vw=
|
||||
github.com/jaegertracing/jaeger-idl v0.5.0 h1:zFXR5NL3Utu7MhPg8ZorxtCBjHrL3ReM1VoB65FOFGE=
|
||||
github.com/jaegertracing/jaeger-idl v0.5.0/go.mod h1:ON90zFo9eoyXrt9F/KN8YeF3zxcnujaisMweFY/rg5k=
|
||||
github.com/jaegertracing/jaeger-idl v0.6.0 h1:LOVQfVby9ywdMPI9n3hMwKbyLVV3BL1XH2QqsP5KTMk=
|
||||
github.com/jaegertracing/jaeger-idl v0.6.0/go.mod h1:mpW0lZfG907/+o5w5OlnNnig7nHJGT3SfKmRqC42HGQ=
|
||||
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
|
||||
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
|
||||
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
|
||||
@@ -2648,10 +2648,11 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||
go.opentelemetry.io/collector v0.124.0 h1:g/dfdGFhBcQI0ggGxTmGlJnJ6Yl6T2gVxQoIj4UfXCc=
|
||||
go.opentelemetry.io/collector/featuregate v1.44.0 h1:/GeGhTD8f+FNWS7C4w1Dj0Ui9Jp4v2WAdlXyW1p3uG8=
|
||||
go.opentelemetry.io/collector/featuregate v1.44.0/go.mod h1:d0tiRzVYrytB6LkcYgz2ESFTv7OktRPQe0QEQcPt1L4=
|
||||
go.opentelemetry.io/collector/pdata v1.44.0 h1:q/EfWDDKrSaf4hjTIzyPeg1ZcCRg1Uj7VTFnGfNVdk8=
|
||||
go.opentelemetry.io/collector/pdata v1.44.0/go.mod h1:LnsjYysFc3AwMVh6KGNlkGKJUF2ReuWxtD9Hb3lSMZk=
|
||||
go.opentelemetry.io/collector/featuregate v1.49.0 h1:4UfnqTvSvm6GkeD/w39LYLPmnZDfk4f+grkWuyl0NPU=
|
||||
go.opentelemetry.io/collector/featuregate v1.49.0/go.mod h1:/1bclXgP91pISaEeNulRxzzmzMTm4I5Xih2SnI4HRSo=
|
||||
go.opentelemetry.io/collector/internal/testutil v0.143.0 h1:rp3vIsOhXg/H3YXuStdggGTLuU+Udf1BdDIF/I7+Tyk=
|
||||
go.opentelemetry.io/collector/pdata v1.49.0 h1:h6V3rdLNxweI3K8B5SZzjMiVdsPPBB1TPAWwZkCtGZE=
|
||||
go.opentelemetry.io/collector/pdata v1.49.0/go.mod h1:gidKN58CUnhd4DSM61UzPKWjXmG0vyoIn7dd+URZW9A=
|
||||
go.opentelemetry.io/collector/pdata/pprofile v0.124.0 h1:ZjL9wKqzP4BHj0/F1jfGxs1Va8B7xmYayipZeNVoWJE=
|
||||
go.opentelemetry.io/collector/pdata/pprofile v0.124.0/go.mod h1:1EN3Gw5LSI4fSVma/Yfv/6nqeuYgRTm1/kmG5nE5Oyo=
|
||||
go.opentelemetry.io/collector/semconv v0.124.0 h1:YTdo3UFwNyDQCh9DiSm2rbzAgBuwn/9dNZ0rv454goA=
|
||||
@@ -2665,15 +2666,15 @@ go.opentelemetry.io/contrib/exporters/autoexport v0.61.0/go.mod h1:N6otC+qXTD5bA
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.64.0 h1:RN3ifU8y4prNWeEnQp2kRRHz8UwonAEYZl8tUzHEXAk=
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.64.0/go.mod h1:habDz3tEWiFANTo6oUE99EmaFUrCNYAAg3wiVmusm70=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.55.0/go.mod h1:rsg1EO8LXSs2po50PB5CeY/MSVlhghuKBgXlKnqm6ks=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0 h1:2pn7OzMewmYRiNtv1doZnLo3gONcnMHlFnmOR8Vgt+8=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.63.0/go.mod h1:rjbQTDEPQymPE0YnRQp9/NuPwwtL0sesz/fnqRW/v84=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.64.0 h1:OXSUzgmIFkcC4An+mv+lqqZSndTffXpjAyoR+1f8k/A=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.64.0/go.mod h1:1A4GVLFIm54HFqVdOpWmukap7rgb0frrE3zWXohLPdM=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0/go.mod h1:DQAwmETtZV00skUwgD6+0U89g80NKsJE3DCKeLLPQMI=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 h1:ssfIgGNANqpVFCndZvcuyKbl0g+UAVcbBcqGkG28H0Y=
|
||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0/go.mod h1:GQ/474YrbE4Jx8gZ4q5I4hrhUzM6UPzyrqJYV2AqPoQ=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.38.0 h1:nXGeLvT1QtCAhkASkP/ksjkTKZALIaQBIW+JSIw1KIc=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.38.0/go.mod h1:oMvOXk78ZR3KEuPMBgp/ThAMDy9ku/eyUVztr+3G6Wo=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.32.0 h1:oPW/SRFyHgIgxrvNhSBzqvZER2N5kRlci3/rGTOuyWo=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.32.0/go.mod h1:B9Oka5QVD0bnmZNO6gBbBta6nohD/1Z+f9waH2oXyBs=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.39.0 h1:Gz3yKzfMSEFzF0Vy5eIpu9ndpo4DhXMCxsLMF0OOApo=
|
||||
go.opentelemetry.io/contrib/propagators/jaeger v1.39.0/go.mod h1:2D/cxxCqTlrday0rZrPujjg5aoAdqk1NaNyoXn8FJn8=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.33.0 h1:RcFp4UxGTE2VQQ0M7s24YRUShEJ5D5JDnd5g2EaTh6E=
|
||||
go.opentelemetry.io/contrib/samplers/jaegerremote v0.33.0/go.mod h1:y6oMwgsv+yWYCLRigU6Pp07/x4KZUEh8LIPTSUnQKbQ=
|
||||
go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0=
|
||||
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
|
||||
go.opentelemetry.io/otel v1.30.0/go.mod h1:tFw4Br9b7fOS+uEao81PJjVMjW/5fvNCbpsDIXqP0pc=
|
||||
@@ -2730,12 +2731,12 @@ go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI
|
||||
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
|
||||
go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A=
|
||||
go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4=
|
||||
go.opentelemetry.io/proto/slim/otlp v1.8.0 h1:afcLwp2XOeCbGrjufT1qWyruFt+6C9g5SOuymrSPUXQ=
|
||||
go.opentelemetry.io/proto/slim/otlp v1.8.0/go.mod h1:Yaa5fjYm1SMCq0hG0x/87wV1MP9H5xDuG/1+AhvBcsI=
|
||||
go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.1.0 h1:Uc+elixz922LHx5colXGi1ORbsW8DTIGM+gg+D9V7HE=
|
||||
go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.1.0/go.mod h1:VyU6dTWBWv6h9w/+DYgSZAPMabWbPTFTuxp25sM8+s0=
|
||||
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.1.0 h1:i8YpvWGm/Uq1koL//bnbJ/26eV3OrKWm09+rDYo7keU=
|
||||
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.1.0/go.mod h1:pQ70xHY/ZVxNUBPn+qUWPl8nwai87eWdqL3M37lNi9A=
|
||||
go.opentelemetry.io/proto/slim/otlp v1.9.0 h1:fPVMv8tP3TrsqlkH1HWYUpbCY9cAIemx184VGkS6vlE=
|
||||
go.opentelemetry.io/proto/slim/otlp v1.9.0/go.mod h1:xXdeJJ90Gqyll+orzUkY4bOd2HECo5JofeoLpymVqdI=
|
||||
go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.2.0 h1:o13nadWDNkH/quoDomDUClnQBpdQQ2Qqv0lQBjIXjE8=
|
||||
go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.2.0/go.mod h1:Gyb6Xe7FTi/6xBHwMmngGoHqL0w29Y4eW8TGFzpefGA=
|
||||
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.2.0 h1:EiUYvtwu6PMrMHVjcPfnsG3v+ajPkbUeH+IL93+QYyk=
|
||||
go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.2.0/go.mod h1:mUUHKFiN2SST3AhJ8XhJxEoeVW12oqfXog0Bo8W3Ec4=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
|
||||
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
|
||||
@@ -3590,8 +3591,8 @@ google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5v
|
||||
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
|
||||
google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
|
||||
google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
|
||||
google.golang.org/grpc v1.77.0 h1:wVVY6/8cGA6vvffn+wWK5ToddbgdU3d8MNENr4evgXM=
|
||||
google.golang.org/grpc v1.77.0/go.mod h1:z0BY1iVj0q8E1uSQCjL9cppRj+gnZjzDnzV0dHhrNig=
|
||||
google.golang.org/grpc v1.78.0 h1:K1XZG/yGDJnzMdd/uZHAkVqJE+xIDOcmdSFZkBUicNc=
|
||||
google.golang.org/grpc v1.78.0/go.mod h1:I47qjTo4OKbMkjA/aOOwxDIiPSBofUtQUI5EfpWvW7U=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
|
||||
@@ -10,7 +10,6 @@ use (
|
||||
./apps/alerting/historian
|
||||
./apps/alerting/notifications
|
||||
./apps/alerting/rules
|
||||
./apps/anno
|
||||
./apps/annotation
|
||||
./apps/collections
|
||||
./apps/correlations
|
||||
|
||||
@@ -165,9 +165,17 @@ describe('DateMath', () => {
|
||||
expect(date!.valueOf()).toEqual(dateTime([2014, 1, 3]).valueOf());
|
||||
});
|
||||
|
||||
it('should handle multiple math expressions', () => {
|
||||
const date = dateMath.parseDateMath('-2d-6h', dateTime([2014, 1, 5]));
|
||||
expect(date!.valueOf()).toEqual(dateTime([2014, 1, 2, 18]).valueOf());
|
||||
it.each([
|
||||
['-2d-6h', [2014, 1, 5], [2014, 1, 2, 18]],
|
||||
['-30m-2d', [2014, 1, 5], [2014, 1, 2, 23, 30]],
|
||||
['-2d-1d', [2014, 1, 5], [2014, 1, 2]],
|
||||
['-1h-30m', [2014, 1, 5, 12, 0], [2014, 1, 5, 10, 30]],
|
||||
['-1d-1h-30m', [2014, 1, 5, 12, 0], [2014, 1, 4, 10, 30]],
|
||||
['+1d-6h', [2014, 1, 5], [2014, 1, 5, 18]],
|
||||
['-1w-1d', [2014, 1, 14], [2014, 1, 6]],
|
||||
])('should handle multiple math expressions: %s', (expression, inputDate, expectedDate) => {
|
||||
const date = dateMath.parseDateMath(expression, dateTime(inputDate));
|
||||
expect(date!.valueOf()).toEqual(dateTime(expectedDate).valueOf());
|
||||
});
|
||||
|
||||
it('should return false when invalid expression', () => {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useId, memo, HTMLAttributes, ReactNode, SVGProps } from 'react';
|
||||
import { useId, memo, HTMLAttributes, SVGProps } from 'react';
|
||||
|
||||
import { FieldDisplay } from '@grafana/data';
|
||||
|
||||
import { getBarEndcapColors, getGradientCss, getEndpointMarkerColors } from './colors';
|
||||
import { RadialArcPathEndpointMarks } from './RadialArcPathEndpointMarks';
|
||||
import { getBarEndcapColors, getGradientCss } from './colors';
|
||||
import { RadialShape, RadialGaugeDimensions, GradientStop } from './types';
|
||||
import { drawRadialArcPath, toRad } from './utils';
|
||||
|
||||
@@ -29,11 +30,6 @@ interface RadialArcPathPropsWithGradient extends RadialArcPathPropsBase {
|
||||
|
||||
type RadialArcPathProps = RadialArcPathPropsWithColor | RadialArcPathPropsWithGradient;
|
||||
|
||||
const ENDPOINT_MARKER_MIN_ANGLE = 10;
|
||||
const DOT_OPACITY = 0.5;
|
||||
const DOT_RADIUS_FACTOR = 0.4;
|
||||
const MAX_DOT_RADIUS = 8;
|
||||
|
||||
export const RadialArcPath = memo(
|
||||
({
|
||||
arcLengthDeg,
|
||||
@@ -68,67 +64,25 @@ export const RadialArcPath = memo(
|
||||
const xEnd = centerX + radius * Math.cos(endRadians);
|
||||
const yEnd = centerY + radius * Math.sin(endRadians);
|
||||
|
||||
const dotRadius =
|
||||
endpointMarker === 'point' ? Math.min((barWidth / 2) * DOT_RADIUS_FACTOR, MAX_DOT_RADIUS) : barWidth / 2;
|
||||
|
||||
const bgDivStyle: HTMLAttributes<HTMLDivElement>['style'] = { width: boxSize, height: vizHeight, marginLeft: boxX };
|
||||
|
||||
const pathProps: SVGProps<SVGPathElement> = {};
|
||||
let barEndcapColors: [string, string] | undefined;
|
||||
let endpointMarks: ReactNode = null;
|
||||
if (isGradient) {
|
||||
bgDivStyle.backgroundImage = getGradientCss(rest.gradient, shape);
|
||||
|
||||
if (endpointMarker && (rest.gradient?.length ?? 0) > 0) {
|
||||
switch (endpointMarker) {
|
||||
case 'point':
|
||||
const [pointColorStart, pointColorEnd] = getEndpointMarkerColors(
|
||||
rest.gradient!,
|
||||
fieldDisplay.display.percent
|
||||
);
|
||||
endpointMarks = (
|
||||
<>
|
||||
{arcLengthDeg > ENDPOINT_MARKER_MIN_ANGLE && (
|
||||
<circle cx={xStart} cy={yStart} r={dotRadius} fill={pointColorStart} opacity={DOT_OPACITY} />
|
||||
)}
|
||||
<circle cx={xEnd} cy={yEnd} r={dotRadius} fill={pointColorEnd} opacity={DOT_OPACITY} />
|
||||
</>
|
||||
);
|
||||
break;
|
||||
case 'glow':
|
||||
const offsetAngle = toRad(ENDPOINT_MARKER_MIN_ANGLE);
|
||||
const xStartMark = centerX + radius * Math.cos(endRadians + offsetAngle);
|
||||
const yStartMark = centerY + radius * Math.sin(endRadians + offsetAngle);
|
||||
endpointMarks =
|
||||
arcLengthDeg > ENDPOINT_MARKER_MIN_ANGLE ? (
|
||||
<path
|
||||
d={['M', xStartMark, yStartMark, 'A', radius, radius, 0, 0, 1, xEnd, yEnd].join(' ')}
|
||||
fill="none"
|
||||
strokeWidth={barWidth}
|
||||
stroke={endpointMarkerGlowFilter}
|
||||
strokeLinecap={roundedBars ? 'round' : 'butt'}
|
||||
filter={glowFilter}
|
||||
/>
|
||||
) : null;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (barEndcaps) {
|
||||
barEndcapColors = getBarEndcapColors(rest.gradient, fieldDisplay.display.percent);
|
||||
}
|
||||
|
||||
pathProps.fill = 'none';
|
||||
pathProps.stroke = 'white';
|
||||
} else {
|
||||
bgDivStyle.backgroundColor = rest.color;
|
||||
|
||||
pathProps.fill = 'none';
|
||||
pathProps.stroke = rest.color;
|
||||
}
|
||||
|
||||
let barEndcapColors: [string, string] | undefined;
|
||||
if (barEndcaps) {
|
||||
barEndcapColors = isGradient
|
||||
? getBarEndcapColors(rest.gradient, fieldDisplay.display.percent)
|
||||
: [rest.color, rest.color];
|
||||
}
|
||||
|
||||
const pathEl = (
|
||||
<path d={path} strokeWidth={barWidth} strokeLinecap={roundedBars ? 'round' : 'butt'} {...pathProps} />
|
||||
);
|
||||
@@ -158,7 +112,23 @@ export const RadialArcPath = memo(
|
||||
)}
|
||||
</g>
|
||||
|
||||
{endpointMarks}
|
||||
{endpointMarker && (
|
||||
<RadialArcPathEndpointMarks
|
||||
startAngle={angle}
|
||||
arcLengthDeg={arcLengthDeg}
|
||||
dimensions={dimensions}
|
||||
endpointMarker={endpointMarker}
|
||||
fieldDisplay={fieldDisplay}
|
||||
xStart={xStart}
|
||||
xEnd={xEnd}
|
||||
yStart={yStart}
|
||||
yEnd={yEnd}
|
||||
roundedBars={roundedBars}
|
||||
endpointMarkerGlowFilter={endpointMarkerGlowFilter}
|
||||
glowFilter={glowFilter}
|
||||
{...rest}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
import { render, RenderResult } from '@testing-library/react';
|
||||
|
||||
import { FieldDisplay } from '@grafana/data';
|
||||
|
||||
import { RadialArcPathEndpointMarks, RadialArcPathEndpointMarksProps } from './RadialArcPathEndpointMarks';
|
||||
import { RadialGaugeDimensions } from './types';
|
||||
|
||||
const ser = new XMLSerializer();
|
||||
|
||||
const expectHTML = (result: RenderResult, expected: string) => {
|
||||
let actual = ser.serializeToString(result.asFragment()).replace(/xmlns=".*?" /g, '');
|
||||
expect(actual).toEqual(expected.replace(/^\s*|\n/gm, ''));
|
||||
};
|
||||
|
||||
describe('RadialArcPathEndpointMarks', () => {
|
||||
const defaultDimensions = Object.freeze({
|
||||
centerX: 100,
|
||||
centerY: 100,
|
||||
radius: 80,
|
||||
barWidth: 20,
|
||||
vizWidth: 200,
|
||||
vizHeight: 200,
|
||||
margin: 10,
|
||||
barIndex: 0,
|
||||
thresholdsBarRadius: 0,
|
||||
thresholdsBarWidth: 0,
|
||||
thresholdsBarSpacing: 0,
|
||||
scaleLabelsFontSize: 0,
|
||||
scaleLabelsSpacing: 0,
|
||||
scaleLabelsRadius: 0,
|
||||
gaugeBottomY: 0,
|
||||
}) satisfies RadialGaugeDimensions;
|
||||
|
||||
const defaultFieldDisplay = Object.freeze({
|
||||
name: 'Test',
|
||||
field: {},
|
||||
display: { text: '50', numeric: 50, color: '#FF0000' },
|
||||
hasLinks: false,
|
||||
}) satisfies FieldDisplay;
|
||||
|
||||
const defaultProps = Object.freeze({
|
||||
arcLengthDeg: 90,
|
||||
dimensions: defaultDimensions,
|
||||
fieldDisplay: defaultFieldDisplay,
|
||||
startAngle: 0,
|
||||
xStart: 100,
|
||||
xEnd: 150,
|
||||
yStart: 100,
|
||||
yEnd: 50,
|
||||
}) satisfies Omit<RadialArcPathEndpointMarksProps, 'color' | 'gradient' | 'endpointMarker'>;
|
||||
|
||||
it('renders the expected marks when endpointMarker is "point" w/ a static color', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
<RadialArcPathEndpointMarks {...defaultProps} endpointMarker="point" color="#FF0000" />
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"><circle cx=\"100\" cy=\"100\" r=\"4\" fill=\"#111217\" opacity=\"0.5\"/><circle cx=\"150\" cy=\"50\" r=\"4\" fill=\"#111217\" opacity=\"0.5\"/></svg>'
|
||||
);
|
||||
});
|
||||
|
||||
it('renders the expected marks when endpointMarker is "point" w/ a gradient color', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
<RadialArcPathEndpointMarks
|
||||
{...defaultProps}
|
||||
endpointMarker="point"
|
||||
gradient={[
|
||||
{ color: '#00FF00', percent: 0 },
|
||||
{ color: '#0000FF', percent: 1 },
|
||||
]}
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"><circle cx=\"100\" cy=\"100\" r=\"4\" fill=\"#111217\" opacity=\"0.5\"/><circle cx=\"150\" cy=\"50\" r=\"4\" fill=\"#fbfbfb\" opacity=\"0.5\"/></svg>'
|
||||
);
|
||||
});
|
||||
|
||||
it('renders the expected marks when endpointMarker is "glow" w/ a static color', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
<RadialArcPathEndpointMarks {...defaultProps} endpointMarker="glow" color="#FF0000" />
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"><path d=\"M 113.89185421335443 21.215379759023364 A 80 80 0 0 1 150 50\" fill=\"none\" stroke-width=\"20\" stroke-linecap=\"butt\"/></svg>'
|
||||
);
|
||||
});
|
||||
|
||||
it('renders the expected marks when endpointMarker is "glow" w/ a gradient color', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
<RadialArcPathEndpointMarks
|
||||
{...defaultProps}
|
||||
endpointMarker="glow"
|
||||
gradient={[
|
||||
{ color: '#00FF00', percent: 0 },
|
||||
{ color: '#0000FF', percent: 1 },
|
||||
]}
|
||||
/>
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"><path d=\"M 113.89185421335443 21.215379759023364 A 80 80 0 0 1 150 50\" fill=\"none\" stroke-width=\"20\" stroke-linecap=\"butt\"/></svg>'
|
||||
);
|
||||
});
|
||||
|
||||
it('does not render the start mark when arcLengthDeg is less than the minimum angle for "point" endpointMarker', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
<RadialArcPathEndpointMarks {...defaultProps} arcLengthDeg={5} endpointMarker="point" color="#FF0000" />
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"><circle cx=\"150\" cy=\"50\" r=\"4\" fill=\"#111217\" opacity=\"0.5\"/></svg>'
|
||||
);
|
||||
});
|
||||
|
||||
it('does not render anything when arcLengthDeg is less than the minimum angle for "glow" endpointMarker', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
<RadialArcPathEndpointMarks {...defaultProps} arcLengthDeg={5} endpointMarker="glow" color="#FF0000" />
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"/>'
|
||||
);
|
||||
});
|
||||
|
||||
it('does not render anything if endpointMarker is some other value', () => {
|
||||
expectHTML(
|
||||
render(
|
||||
<svg role="img">
|
||||
{/* @ts-ignore: confirming the component doesn't throw */}
|
||||
<RadialArcPathEndpointMarks {...defaultProps} endpointMarker="foo" />
|
||||
</svg>
|
||||
),
|
||||
'<svg role=\"img\"/>'
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
import { FieldDisplay } from '@grafana/data';
|
||||
|
||||
import { getEndpointMarkerColors, getGuideDotColor } from './colors';
|
||||
import { GradientStop, RadialGaugeDimensions } from './types';
|
||||
import { toRad } from './utils';
|
||||
|
||||
interface RadialArcPathEndpointMarksPropsBase {
|
||||
arcLengthDeg: number;
|
||||
dimensions: RadialGaugeDimensions;
|
||||
fieldDisplay: FieldDisplay;
|
||||
endpointMarker: 'point' | 'glow';
|
||||
roundedBars?: boolean;
|
||||
startAngle: number;
|
||||
glowFilter?: string;
|
||||
endpointMarkerGlowFilter?: string;
|
||||
xStart: number;
|
||||
xEnd: number;
|
||||
yStart: number;
|
||||
yEnd: number;
|
||||
}
|
||||
|
||||
interface RadialArcPathEndpointMarksPropsWithColor extends RadialArcPathEndpointMarksPropsBase {
|
||||
color: string;
|
||||
}
|
||||
|
||||
interface RadialArcPathEndpointMarksPropsWithGradient extends RadialArcPathEndpointMarksPropsBase {
|
||||
gradient: GradientStop[];
|
||||
}
|
||||
|
||||
export type RadialArcPathEndpointMarksProps =
|
||||
| RadialArcPathEndpointMarksPropsWithColor
|
||||
| RadialArcPathEndpointMarksPropsWithGradient;
|
||||
|
||||
const ENDPOINT_MARKER_MIN_ANGLE = 10;
|
||||
const DOT_OPACITY = 0.5;
|
||||
const DOT_RADIUS_FACTOR = 0.4;
|
||||
const MAX_DOT_RADIUS = 8;
|
||||
|
||||
export function RadialArcPathEndpointMarks({
|
||||
startAngle: angle,
|
||||
arcLengthDeg,
|
||||
dimensions,
|
||||
endpointMarker,
|
||||
fieldDisplay,
|
||||
xStart,
|
||||
xEnd,
|
||||
yStart,
|
||||
yEnd,
|
||||
roundedBars,
|
||||
endpointMarkerGlowFilter,
|
||||
glowFilter,
|
||||
...rest
|
||||
}: RadialArcPathEndpointMarksProps) {
|
||||
const isGradient = 'gradient' in rest;
|
||||
const { radius, centerX, centerY, barWidth } = dimensions;
|
||||
const endRadians = toRad(angle + arcLengthDeg);
|
||||
|
||||
switch (endpointMarker) {
|
||||
case 'point': {
|
||||
const [pointColorStart, pointColorEnd] = isGradient
|
||||
? getEndpointMarkerColors(rest.gradient, fieldDisplay.display.percent)
|
||||
: [getGuideDotColor(rest.color), getGuideDotColor(rest.color)];
|
||||
|
||||
const dotRadius =
|
||||
endpointMarker === 'point' ? Math.min((barWidth / 2) * DOT_RADIUS_FACTOR, MAX_DOT_RADIUS) : barWidth / 2;
|
||||
|
||||
return (
|
||||
<>
|
||||
{arcLengthDeg > ENDPOINT_MARKER_MIN_ANGLE && (
|
||||
<circle cx={xStart} cy={yStart} r={dotRadius} fill={pointColorStart} opacity={DOT_OPACITY} />
|
||||
)}
|
||||
<circle cx={xEnd} cy={yEnd} r={dotRadius} fill={pointColorEnd} opacity={DOT_OPACITY} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
case 'glow':
|
||||
const offsetAngle = toRad(ENDPOINT_MARKER_MIN_ANGLE);
|
||||
const xStartMark = centerX + radius * Math.cos(endRadians + offsetAngle);
|
||||
const yStartMark = centerY + radius * Math.sin(endRadians + offsetAngle);
|
||||
if (arcLengthDeg <= ENDPOINT_MARKER_MIN_ANGLE) {
|
||||
break;
|
||||
}
|
||||
return (
|
||||
<path
|
||||
d={['M', xStartMark, yStartMark, 'A', radius, radius, 0, 0, 1, xEnd, yEnd].join(' ')}
|
||||
fill="none"
|
||||
strokeWidth={barWidth}
|
||||
stroke={endpointMarkerGlowFilter}
|
||||
strokeLinecap={roundedBars ? 'round' : 'butt'}
|
||||
filter={glowFilter}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ export function getGradientCss(gradientStops: GradientStop[], shape: RadialShape
|
||||
const GRAY_05 = '#111217';
|
||||
const GRAY_90 = '#fbfbfb';
|
||||
const CONTRAST_THRESHOLD_MAX = 4.5;
|
||||
const getGuideDotColor = (color: string): string => {
|
||||
export const getGuideDotColor = (color: string): string => {
|
||||
const darkColor = GRAY_05;
|
||||
const lightColor = GRAY_90;
|
||||
return colorManipulator.getContrastRatio(darkColor, color) >= CONTRAST_THRESHOLD_MAX ? darkColor : lightColor;
|
||||
|
||||
@@ -204,7 +204,7 @@ func (hs *HTTPServer) DeleteDataSourceById(c *contextmodel.ReqContext) response.
|
||||
func (hs *HTTPServer) GetDataSourceByUID(c *contextmodel.ReqContext) response.Response {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("legacy", "GetDataSourceByUID"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("GetDataSourceByUID"), time.Since(start).Seconds())
|
||||
}()
|
||||
|
||||
ds, err := hs.getRawDataSourceByUID(c.Req.Context(), web.Params(c.Req)[":uid"], c.GetOrgID())
|
||||
@@ -240,7 +240,7 @@ func (hs *HTTPServer) GetDataSourceByUID(c *contextmodel.ReqContext) response.Re
|
||||
func (hs *HTTPServer) DeleteDataSourceByUID(c *contextmodel.ReqContext) response.Response {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("legacy", "DeleteDataSourceByUID"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("DeleteDataSourceByUID"), time.Since(start).Seconds())
|
||||
}()
|
||||
|
||||
uid := web.Params(c.Req)[":uid"]
|
||||
@@ -375,7 +375,7 @@ func validateJSONData(jsonData *simplejson.Json, cfg *setting.Cfg) error {
|
||||
func (hs *HTTPServer) AddDataSource(c *contextmodel.ReqContext) response.Response {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("legacy", "AddDataSource"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("AddDataSource"), time.Since(start).Seconds())
|
||||
}()
|
||||
|
||||
cmd := datasources.AddDataSourceCommand{}
|
||||
@@ -497,7 +497,7 @@ func (hs *HTTPServer) UpdateDataSourceByID(c *contextmodel.ReqContext) response.
|
||||
func (hs *HTTPServer) UpdateDataSourceByUID(c *contextmodel.ReqContext) response.Response {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("legacy", "UpdateDataSourceByUID"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(c.Req.Context(), hs.dsConfigHandlerRequestsDuration.WithLabelValues("UpdateDataSourceByUID"), time.Since(start).Seconds())
|
||||
}()
|
||||
cmd := datasources.UpdateDataSourceCommand{}
|
||||
if err := web.Bind(c.Req, &cmd); err != nil {
|
||||
|
||||
@@ -91,7 +91,7 @@ func setupDsConfigHandlerMetrics() (prometheus.Registerer, *prometheus.Histogram
|
||||
Namespace: "grafana",
|
||||
Name: "ds_config_handler_requests_duration_seconds",
|
||||
Help: "Duration of requests handled by datasource configuration handlers",
|
||||
}, []string{"code_path", "handler"})
|
||||
}, []string{"handler"})
|
||||
promRegister.MustRegister(dsConfigHandlerRequestsDuration)
|
||||
return promRegister, dsConfigHandlerRequestsDuration
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ func ProvideHTTPServer(opts ServerOptions, cfg *setting.Cfg, routeRegister routi
|
||||
Namespace: "grafana",
|
||||
Name: "ds_config_handler_requests_duration_seconds",
|
||||
Help: "Duration of requests handled by datasource configuration handlers",
|
||||
}, []string{"code_path", "handler"}),
|
||||
}, []string{"handler"}),
|
||||
}
|
||||
|
||||
promRegister.MustRegister(hs.htmlHandlerRequestsDuration)
|
||||
|
||||
@@ -928,9 +928,10 @@ func getDatasourceProxiedRequest(t *testing.T, ctx *contextmodel.ReqContext, cfg
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
features := featuremgmt.WithFeatures()
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsRetriever := datasourceservice.ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := datasourceservice.ProvideService(nil, secretsService, secretsStore, cfg, features, acimpl.ProvideAccessControl(features),
|
||||
&actest.FakePermissionsService{}, quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{},
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()))
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()), dsRetriever)
|
||||
require.NoError(t, err)
|
||||
proxy, err := NewDataSourceProxy(ds, routes, ctx, "", cfg, httpclient.NewProvider(), &oauthtoken.Service{}, dsService, tracer, features)
|
||||
require.NoError(t, err)
|
||||
@@ -1050,9 +1051,11 @@ func runDatasourceAuthTest(t *testing.T, secretsService secrets.Service, secrets
|
||||
var routes []*plugins.Route
|
||||
features := featuremgmt.WithFeatures()
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := datasourceservice.ProvideService(nil, secretsService, secretsStore, cfg, features, acimpl.ProvideAccessControl(features),
|
||||
var sqlStore db.DB = nil
|
||||
dsRetriever := datasourceservice.ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := datasourceservice.ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acimpl.ProvideAccessControl(features),
|
||||
&actest.FakePermissionsService{}, quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{},
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()))
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()), dsRetriever)
|
||||
require.NoError(t, err)
|
||||
proxy, err := NewDataSourceProxy(test.datasource, routes, ctx, "", &setting.Cfg{}, httpclient.NewProvider(), &oauthtoken.Service{}, dsService, tracer, features)
|
||||
require.NoError(t, err)
|
||||
@@ -1106,9 +1109,11 @@ func setupDSProxyTest(t *testing.T, ctx *contextmodel.ReqContext, ds *datasource
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(dbtest.NewFakeDB(), secretsService, log.NewNopLogger())
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsService, err := datasourceservice.ProvideService(nil, secretsService, secretsStore, cfg, features, acimpl.ProvideAccessControl(features),
|
||||
var sqlStore db.DB = nil
|
||||
dsRetriever := datasourceservice.ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := datasourceservice.ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acimpl.ProvideAccessControl(features),
|
||||
&actest.FakePermissionsService{}, quotatest.New(false, nil), &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{},
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()))
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()), dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
tracer := tracing.InitializeTracerForTest()
|
||||
|
||||
@@ -209,7 +209,7 @@ func (ots *TracingService) initSampler() (tracesdk.Sampler, error) {
|
||||
case "rateLimiting":
|
||||
return newRateLimiter(ots.cfg.SamplerParam), nil
|
||||
case "remote":
|
||||
return jaegerremote.New("grafana",
|
||||
return jaegerremote.New(ots.cfg.ServiceName,
|
||||
jaegerremote.WithSamplingServerURL(ots.cfg.SamplerRemoteURL),
|
||||
jaegerremote.WithInitialSampler(tracesdk.TraceIDRatioBased(ots.cfg.SamplerParam)),
|
||||
), nil
|
||||
|
||||
@@ -57,6 +57,12 @@ func (s *legacyStorage) ConvertToTable(ctx context.Context, object runtime.Objec
|
||||
}
|
||||
|
||||
func (s *legacyStorage) List(ctx context.Context, options *internalversion.ListOptions) (runtime.Object, error) {
|
||||
if s.dsConfigHandlerRequestsDuration != nil {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("legacyStorage.List"), time.Since(start).Seconds())
|
||||
}()
|
||||
}
|
||||
return s.datasources.ListDataSources(ctx)
|
||||
}
|
||||
|
||||
@@ -64,7 +70,7 @@ func (s *legacyStorage) Get(ctx context.Context, name string, options *metav1.Ge
|
||||
if s.dsConfigHandlerRequestsDuration != nil {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("new", "Get"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("legacyStorage.Get"), time.Since(start).Seconds())
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -76,7 +82,7 @@ func (s *legacyStorage) Create(ctx context.Context, obj runtime.Object, createVa
|
||||
if s.dsConfigHandlerRequestsDuration != nil {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("new", "Create"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("legacyStorage.Create"), time.Since(start).Seconds())
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -92,7 +98,7 @@ func (s *legacyStorage) Update(ctx context.Context, name string, objInfo rest.Up
|
||||
if s.dsConfigHandlerRequestsDuration != nil {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("new", "Create"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("legacyStorage.Update"), time.Since(start).Seconds())
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -135,7 +141,7 @@ func (s *legacyStorage) Delete(ctx context.Context, name string, deleteValidatio
|
||||
if s.dsConfigHandlerRequestsDuration != nil {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("new", "Create"), time.Since(start).Seconds())
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("legacyStorage.Delete"), time.Since(start).Seconds())
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -145,6 +151,13 @@ func (s *legacyStorage) Delete(ctx context.Context, name string, deleteValidatio
|
||||
|
||||
// DeleteCollection implements rest.CollectionDeleter.
|
||||
func (s *legacyStorage) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *internalversion.ListOptions) (runtime.Object, error) {
|
||||
if s.dsConfigHandlerRequestsDuration != nil {
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
metricutil.ObserveWithExemplar(ctx, s.dsConfigHandlerRequestsDuration.WithLabelValues("legacyStorage.DeleteCollection"), time.Since(start).Seconds())
|
||||
}()
|
||||
}
|
||||
|
||||
dss, err := s.datasources.ListDataSources(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
datasourceV0 "github.com/grafana/grafana/pkg/apis/datasource/v0alpha1"
|
||||
queryV0 "github.com/grafana/grafana/pkg/apis/query/v0alpha1"
|
||||
grafanaregistry "github.com/grafana/grafana/pkg/apiserver/registry/generic"
|
||||
"github.com/grafana/grafana/pkg/infra/metrics"
|
||||
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/sources"
|
||||
@@ -69,10 +70,10 @@ func RegisterAPIService(
|
||||
|
||||
dataSourceCRUDMetric := metricutil.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: "grafana",
|
||||
Name: "ds_config_handler_requests_duration_seconds",
|
||||
Help: "Duration of requests handled by datasource configuration handlers",
|
||||
}, []string{"code_path", "handler"})
|
||||
regErr := reg.Register(dataSourceCRUDMetric)
|
||||
Name: "ds_config_handler_apis_requests_duration_seconds",
|
||||
Help: "Duration of requests handled by new k8s style APIs datasource configuration handlers",
|
||||
}, []string{"handler"})
|
||||
regErr := metrics.ProvideRegisterer().Register(dataSourceCRUDMetric)
|
||||
if regErr != nil && !errors.As(regErr, &prometheus.AlreadyRegisteredError{}) {
|
||||
return nil, regErr
|
||||
}
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package anno
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"k8s.io/apiserver/pkg/authorization/authorizer"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/app"
|
||||
appsdkapiserver "github.com/grafana/grafana-app-sdk/k8s/apiserver"
|
||||
"github.com/grafana/grafana-app-sdk/simple"
|
||||
apis "github.com/grafana/grafana/apps/anno/pkg/apis/manifestdata"
|
||||
annoapp "github.com/grafana/grafana/apps/anno/pkg/app"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
var (
|
||||
_ appsdkapiserver.AppInstaller = (*AnnotationAppInstaller)(nil)
|
||||
)
|
||||
|
||||
type AnnotationAppInstaller struct {
|
||||
appsdkapiserver.AppInstaller
|
||||
cfg *setting.Cfg
|
||||
}
|
||||
|
||||
func RegisterAppInstaller(
|
||||
cfg *setting.Cfg,
|
||||
features featuremgmt.FeatureToggles,
|
||||
) (*AnnotationAppInstaller, error) {
|
||||
installer := &AnnotationAppInstaller{
|
||||
cfg: cfg,
|
||||
}
|
||||
provider := simple.NewAppProvider(apis.LocalManifest(), nil, annoapp.New)
|
||||
|
||||
appConfig := app.Config{
|
||||
KubeConfig: restclient.Config{}, // this will be overridden by the installer's InitializeApp method
|
||||
ManifestData: *apis.LocalManifest().ManifestData,
|
||||
}
|
||||
i, err := appsdkapiserver.NewDefaultAppInstaller(provider, appConfig, apis.NewGoTypeAssociator())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
installer.AppInstaller = i
|
||||
|
||||
return installer, nil
|
||||
}
|
||||
|
||||
func (a *AnnotationAppInstaller) GetAuthorizer() authorizer.Authorizer {
|
||||
return authorizer.AuthorizerFunc(
|
||||
func(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) {
|
||||
return authorizer.DecisionAllow, "", nil
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/registry/apps/alerting/historian"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/alerting/notifications"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/alerting/rules"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/anno"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/annotation"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/correlations"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/example"
|
||||
@@ -44,7 +43,6 @@ func ProvideAppInstallers(
|
||||
alertingNotificationAppInstaller *notifications.AlertingNotificationsAppInstaller,
|
||||
logsdrilldownAppInstaller *logsdrilldown.LogsDrilldownAppInstaller,
|
||||
annotationAppInstaller *annotation.AnnotationAppInstaller,
|
||||
annoAppInstaller *anno.AnnotationAppInstaller,
|
||||
exampleAppInstaller *example.ExampleAppInstaller,
|
||||
advisorAppInstaller *advisor.AdvisorAppInstaller,
|
||||
alertingHistorianAppInstaller *historian.AlertingHistorianAppInstaller,
|
||||
@@ -91,8 +89,6 @@ func ProvideAppInstallers(
|
||||
installers = append(installers, alertingHistorianAppInstaller)
|
||||
}
|
||||
|
||||
installers = append(installers, annoAppInstaller)
|
||||
|
||||
return installers
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/apiserver"
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/appinstaller"
|
||||
grafanaauthorizer "github.com/grafana/grafana/pkg/services/apiserver/auth/authorizer"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginassets"
|
||||
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
|
||||
)
|
||||
@@ -36,9 +37,13 @@ func ProvideAppInstaller(
|
||||
pluginStore pluginstore.Store,
|
||||
pluginAssetsService *pluginassets.Service,
|
||||
accessControlService accesscontrol.Service, accessClient authlib.AccessClient,
|
||||
features featuremgmt.FeatureToggles,
|
||||
) (*AppInstaller, error) {
|
||||
if err := registerAccessControlRoles(accessControlService); err != nil {
|
||||
return nil, fmt.Errorf("registering access control roles: %w", err)
|
||||
//nolint:staticcheck // not yet migrated to OpenFeature
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagPluginStoreServiceLoading) {
|
||||
if err := registerAccessControlRoles(accessControlService); err != nil {
|
||||
return nil, fmt.Errorf("registering access control roles: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
localProvider := meta.NewLocalProvider(pluginStore, pluginAssetsService)
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/registry/apps/alerting/historian"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/alerting/notifications"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/alerting/rules"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/anno"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/annotation"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/correlations"
|
||||
"github.com/grafana/grafana/pkg/registry/apps/example"
|
||||
@@ -31,7 +30,6 @@ var WireSet = wire.NewSet(
|
||||
historian.RegisterAppInstaller,
|
||||
logsdrilldown.RegisterAppInstaller,
|
||||
annotation.RegisterAppInstaller,
|
||||
anno.RegisterAppInstaller,
|
||||
quotas.RegisterAppInstaller,
|
||||
example.RegisterAppInstaller,
|
||||
)
|
||||
|
||||
@@ -330,6 +330,7 @@ var wireBasicSet = wire.NewSet(
|
||||
dashsnapstore.ProvideStore,
|
||||
wire.Bind(new(dashboardsnapshots.Service), new(*dashsnapsvc.ServiceImpl)),
|
||||
dashsnapsvc.ProvideService,
|
||||
datasourceservice.ProvideDataSourceRetriever,
|
||||
datasourceservice.ProvideService,
|
||||
wire.Bind(new(datasources.DataSourceService), new(*datasourceservice.Service)),
|
||||
datasourceservice.ProvideLegacyDataSourceLookup,
|
||||
|
||||
Generated
+9
-16
File diff suppressed because one or more lines are too long
@@ -3,7 +3,6 @@ package authorizer
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
k8suser "k8s.io/apiserver/pkg/authentication/user"
|
||||
"k8s.io/apiserver/pkg/authorization/authorizer"
|
||||
@@ -29,9 +28,9 @@ type GrafanaAuthorizer struct {
|
||||
// 4. We check authorizer that is configured speficially for an api.
|
||||
// 5. As a last fallback we check Role, this will only happen if an api have not configured
|
||||
// an authorizer or return authorizer.DecisionNoOpinion
|
||||
func NewGrafanaBuiltInSTAuthorizer(cfg *setting.Cfg) *GrafanaAuthorizer {
|
||||
func NewGrafanaBuiltInSTAuthorizer() *GrafanaAuthorizer {
|
||||
authorizers := []authorizer.Authorizer{
|
||||
newImpersonationAuthorizer(),
|
||||
NewImpersonationAuthorizer(),
|
||||
authorizerfactory.NewPrivilegedGroups(k8suser.SystemPrivilegedGroup),
|
||||
newNamespaceAuthorizer(),
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
var _ authorizer.Authorizer = (*impersonationAuthorizer)(nil)
|
||||
|
||||
func newImpersonationAuthorizer() *impersonationAuthorizer {
|
||||
func NewImpersonationAuthorizer() *impersonationAuthorizer {
|
||||
return &impersonationAuthorizer{}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,19 +76,7 @@ var PathRewriters = []filters.PathRewriter{
|
||||
|
||||
func GetDefaultBuildHandlerChainFunc(builders []APIGroupBuilder, reg prometheus.Registerer) BuildHandlerChainFunc {
|
||||
return func(delegateHandler http.Handler, c *genericapiserver.Config) http.Handler {
|
||||
requestHandler, err := GetCustomRoutesHandler(
|
||||
delegateHandler,
|
||||
c.LoopbackClientConfig,
|
||||
builders,
|
||||
reg,
|
||||
c.MergedResourceConfig,
|
||||
)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("could not build the request handler for specified API builders: %s", err.Error()))
|
||||
}
|
||||
|
||||
// Needs to run last in request chain to function as expected, hence we register it first.
|
||||
handler := filters.WithTracingHTTPLoggingAttributes(requestHandler)
|
||||
handler := filters.WithTracingHTTPLoggingAttributes(delegateHandler)
|
||||
|
||||
// filters.WithRequester needs to be after the K8s chain because it depends on the K8s user in context
|
||||
handler = filters.WithRequester(handler)
|
||||
|
||||
@@ -3,146 +3,306 @@ package builder
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/emicklei/go-restful/v3"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
serverstorage "k8s.io/apiserver/pkg/server/storage"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
klog "k8s.io/klog/v2"
|
||||
"k8s.io/kube-openapi/pkg/spec3"
|
||||
)
|
||||
|
||||
type requestHandler struct {
|
||||
router *mux.Router
|
||||
// convertHandlerToRouteFunction converts an http.HandlerFunc to a restful.RouteFunction
|
||||
// It extracts path parameters from restful.Request and populates them in the request context
|
||||
// so that mux.Vars can read them (for backward compatibility with handlers that use mux.Vars)
|
||||
func convertHandlerToRouteFunction(handler http.HandlerFunc) restful.RouteFunction {
|
||||
return func(req *restful.Request, resp *restful.Response) {
|
||||
// Extract path parameters from restful.Request and populate mux.Vars
|
||||
// This is needed for backward compatibility with handlers that use mux.Vars(r)
|
||||
vars := make(map[string]string)
|
||||
|
||||
// Get all path parameters from the restful.Request
|
||||
// The restful.Request has PathParameters() method that returns a map
|
||||
pathParams := req.PathParameters()
|
||||
for key, value := range pathParams {
|
||||
vars[key] = value
|
||||
}
|
||||
|
||||
// Set the vars in the request context using mux.SetURLVars
|
||||
// This makes mux.Vars(r) work correctly
|
||||
if len(vars) > 0 {
|
||||
req.Request = mux.SetURLVars(req.Request, vars)
|
||||
}
|
||||
|
||||
handler(resp.ResponseWriter, req.Request)
|
||||
}
|
||||
}
|
||||
|
||||
func GetCustomRoutesHandler(delegateHandler http.Handler, restConfig *restclient.Config, builders []APIGroupBuilder, metricsRegistry prometheus.Registerer, apiResourceConfig *serverstorage.ResourceConfig) (http.Handler, error) {
|
||||
useful := false // only true if any routes exist anywhere
|
||||
router := mux.NewRouter()
|
||||
// AugmentWebServicesWithCustomRoutes adds custom routes from builders to existing WebServices
|
||||
// in the container.
|
||||
func AugmentWebServicesWithCustomRoutes(
|
||||
container *restful.Container,
|
||||
builders []APIGroupBuilder,
|
||||
metricsRegistry prometheus.Registerer,
|
||||
apiResourceConfig *serverstorage.ResourceConfig,
|
||||
) error {
|
||||
if container == nil {
|
||||
return fmt.Errorf("container cannot be nil")
|
||||
}
|
||||
|
||||
metrics := NewCustomRouteMetrics(metricsRegistry)
|
||||
|
||||
for _, builder := range builders {
|
||||
provider, ok := builder.(APIGroupRouteProvider)
|
||||
// Build a map of existing WebServices by root path
|
||||
existingWebServices := make(map[string]*restful.WebService)
|
||||
for _, ws := range container.RegisteredWebServices() {
|
||||
existingWebServices[ws.RootPath()] = ws
|
||||
}
|
||||
|
||||
for _, b := range builders {
|
||||
provider, ok := b.(APIGroupRouteProvider)
|
||||
if !ok || provider == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, gv := range GetGroupVersions(builder) {
|
||||
// filter out api groups that are disabled in APIEnablementOptions
|
||||
for _, gv := range GetGroupVersions(b) {
|
||||
// Filter out disabled API groups
|
||||
gvr := gv.WithResource("")
|
||||
if apiResourceConfig != nil && !apiResourceConfig.ResourceEnabled(gvr) {
|
||||
klog.InfoS("Skipping custom route handler for disabled group version", "gv", gv.String())
|
||||
klog.InfoS("Skipping custom routes for disabled group version", "gv", gv.String())
|
||||
continue
|
||||
}
|
||||
|
||||
routes := provider.GetAPIRoutes(gv)
|
||||
if routes == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
prefix := "/apis/" + gv.String()
|
||||
|
||||
// Root handlers
|
||||
var sub *mux.Router
|
||||
for _, route := range routes.Root {
|
||||
if sub == nil {
|
||||
sub = router.PathPrefix(prefix).Subrouter()
|
||||
sub.MethodNotAllowedHandler = &methodNotAllowedHandler{}
|
||||
}
|
||||
|
||||
useful = true
|
||||
methods, err := methodsFromSpec(route.Path, route.Spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
instrumentedHandler := metrics.InstrumentHandler(
|
||||
gv.Group,
|
||||
gv.Version,
|
||||
route.Path, // Use path as resource identifier
|
||||
route.Handler,
|
||||
)
|
||||
|
||||
sub.HandleFunc("/"+route.Path, instrumentedHandler).
|
||||
Methods(methods...)
|
||||
// Find or create WebService for this group version
|
||||
rootPath := "/apis/" + gv.String()
|
||||
ws, exists := existingWebServices[rootPath]
|
||||
if !exists {
|
||||
// Create a new WebService if one doesn't exist
|
||||
ws = new(restful.WebService)
|
||||
ws.Path(rootPath)
|
||||
container.Add(ws)
|
||||
existingWebServices[rootPath] = ws
|
||||
}
|
||||
|
||||
// Namespace handlers
|
||||
sub = nil
|
||||
prefix += "/namespaces/{namespace}"
|
||||
for _, route := range routes.Namespace {
|
||||
if sub == nil {
|
||||
sub = router.PathPrefix(prefix).Subrouter()
|
||||
sub.MethodNotAllowedHandler = &methodNotAllowedHandler{}
|
||||
}
|
||||
|
||||
useful = true
|
||||
methods, err := methodsFromSpec(route.Path, route.Spec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Add root handlers using OpenAPI specs
|
||||
for _, route := range routes.Root {
|
||||
instrumentedHandler := metrics.InstrumentHandler(
|
||||
gv.Group,
|
||||
gv.Version,
|
||||
route.Path, // Use path as resource identifier
|
||||
route.Path,
|
||||
route.Handler,
|
||||
)
|
||||
routeFunction := convertHandlerToRouteFunction(instrumentedHandler)
|
||||
|
||||
sub.HandleFunc("/"+route.Path, instrumentedHandler).
|
||||
Methods(methods...)
|
||||
// Use OpenAPI spec to configure routes properly
|
||||
if err := addRouteFromSpec(ws, route.Path, route.Spec, routeFunction, false); err != nil {
|
||||
return fmt.Errorf("failed to add root route %s: %w", route.Path, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Add namespace handlers using OpenAPI specs
|
||||
for _, route := range routes.Namespace {
|
||||
instrumentedHandler := metrics.InstrumentHandler(
|
||||
gv.Group,
|
||||
gv.Version,
|
||||
route.Path,
|
||||
route.Handler,
|
||||
)
|
||||
routeFunction := convertHandlerToRouteFunction(instrumentedHandler)
|
||||
|
||||
// Use OpenAPI spec to configure routes properly
|
||||
if err := addRouteFromSpec(ws, route.Path, route.Spec, routeFunction, true); err != nil {
|
||||
return fmt.Errorf("failed to add namespace route %s: %w", route.Path, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !useful {
|
||||
return delegateHandler, nil
|
||||
}
|
||||
|
||||
// Per Gorilla Mux issue here: https://github.com/gorilla/mux/issues/616#issuecomment-798807509
|
||||
// default handler must come last
|
||||
router.PathPrefix("/").Handler(delegateHandler)
|
||||
|
||||
return &requestHandler{
|
||||
router: router,
|
||||
}, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *requestHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
h.router.ServeHTTP(w, req)
|
||||
// addRouteFromSpec adds routes to a WebService using OpenAPI specs
|
||||
func addRouteFromSpec(ws *restful.WebService, routePath string, pathProps *spec3.PathProps, handler restful.RouteFunction, isNamespaced bool) error {
|
||||
if pathProps == nil {
|
||||
return fmt.Errorf("pathProps cannot be nil for route %s", routePath)
|
||||
}
|
||||
|
||||
// Build the full path (relative to WebService root)
|
||||
var fullPath string
|
||||
if isNamespaced {
|
||||
fullPath = "/namespaces/{namespace}/" + routePath
|
||||
} else {
|
||||
fullPath = "/" + routePath
|
||||
}
|
||||
|
||||
// Add routes for each HTTP method defined in the OpenAPI spec
|
||||
operations := map[string]*spec3.Operation{
|
||||
"GET": pathProps.Get,
|
||||
"POST": pathProps.Post,
|
||||
"PUT": pathProps.Put,
|
||||
"PATCH": pathProps.Patch,
|
||||
"DELETE": pathProps.Delete,
|
||||
}
|
||||
|
||||
for method, operation := range operations {
|
||||
if operation == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
// Create route builder for this method
|
||||
var routeBuilder *restful.RouteBuilder
|
||||
switch method {
|
||||
case "GET":
|
||||
routeBuilder = ws.GET(fullPath)
|
||||
case "POST":
|
||||
routeBuilder = ws.POST(fullPath)
|
||||
case "PUT":
|
||||
routeBuilder = ws.PUT(fullPath)
|
||||
case "PATCH":
|
||||
routeBuilder = ws.PATCH(fullPath)
|
||||
case "DELETE":
|
||||
routeBuilder = ws.DELETE(fullPath)
|
||||
}
|
||||
|
||||
// Set operation ID from OpenAPI spec (with K8s verb prefix if needed)
|
||||
operationID := operation.OperationId
|
||||
if operationID == "" {
|
||||
// Generate from path if not specified
|
||||
operationID = generateOperationNameFromPath(routePath)
|
||||
}
|
||||
operationID = prefixRouteIDWithK8sVerbIfNotPresent(operationID, method)
|
||||
routeBuilder = routeBuilder.Operation(operationID)
|
||||
|
||||
// Add description from OpenAPI spec
|
||||
if operation.Description != "" {
|
||||
routeBuilder = routeBuilder.Doc(operation.Description)
|
||||
}
|
||||
|
||||
// Check if namespace parameter is already in the OpenAPI spec
|
||||
hasNamespaceParam := false
|
||||
if operation.Parameters != nil {
|
||||
for _, param := range operation.Parameters {
|
||||
if param.Name == "namespace" && param.In == "path" {
|
||||
hasNamespaceParam = true
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add namespace parameter for namespaced routes if not already in spec
|
||||
if isNamespaced && !hasNamespaceParam {
|
||||
routeBuilder = routeBuilder.Param(restful.PathParameter("namespace", "object name and auth scope, such as for teams and projects"))
|
||||
}
|
||||
|
||||
// Add parameters from OpenAPI spec
|
||||
if operation.Parameters != nil {
|
||||
for _, param := range operation.Parameters {
|
||||
switch param.In {
|
||||
case "path":
|
||||
routeBuilder = routeBuilder.Param(restful.PathParameter(param.Name, param.Description))
|
||||
case "query":
|
||||
routeBuilder = routeBuilder.Param(restful.QueryParameter(param.Name, param.Description))
|
||||
case "header":
|
||||
routeBuilder = routeBuilder.Param(restful.HeaderParameter(param.Name, param.Description))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Note: Request/response schemas are already defined in the OpenAPI spec from builders
|
||||
// and will be added to the OpenAPI document via addBuilderRoutes in openapi.go.
|
||||
// We don't duplicate that information here since restful uses the route metadata
|
||||
// for OpenAPI generation, which is handled separately in this codebase.
|
||||
|
||||
// Register the route with handler
|
||||
ws.Route(routeBuilder.To(handler))
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func methodsFromSpec(slug string, props *spec3.PathProps) ([]string, error) {
|
||||
if props == nil {
|
||||
return []string{"GET", "POST", "PUT", "PATCH", "DELETE"}, nil
|
||||
func prefixRouteIDWithK8sVerbIfNotPresent(operationID string, method string) string {
|
||||
for _, verb := range allowedK8sVerbs {
|
||||
if len(operationID) > len(verb) && operationID[:len(verb)] == verb {
|
||||
return operationID
|
||||
}
|
||||
}
|
||||
|
||||
methods := make([]string, 0)
|
||||
if props.Get != nil {
|
||||
methods = append(methods, "GET")
|
||||
}
|
||||
if props.Post != nil {
|
||||
methods = append(methods, "POST")
|
||||
}
|
||||
if props.Put != nil {
|
||||
methods = append(methods, "PUT")
|
||||
}
|
||||
if props.Patch != nil {
|
||||
methods = append(methods, "PATCH")
|
||||
}
|
||||
if props.Delete != nil {
|
||||
methods = append(methods, "DELETE")
|
||||
}
|
||||
|
||||
if len(methods) == 0 {
|
||||
return nil, fmt.Errorf("invalid OpenAPI Spec for slug=%s without any methods in PathProps", slug)
|
||||
}
|
||||
|
||||
return methods, nil
|
||||
return fmt.Sprintf("%s%s", httpMethodToK8sVerb[strings.ToUpper(method)], operationID)
|
||||
}
|
||||
|
||||
type methodNotAllowedHandler struct{}
|
||||
|
||||
func (h *methodNotAllowedHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
w.WriteHeader(405) // method not allowed
|
||||
var allowedK8sVerbs = []string{
|
||||
"get", "log", "read", "replace", "patch", "delete", "deletecollection", "watch", "connect", "proxy", "list", "create", "patch",
|
||||
}
|
||||
|
||||
var httpMethodToK8sVerb = map[string]string{
|
||||
http.MethodGet: "get",
|
||||
http.MethodPost: "create",
|
||||
http.MethodPut: "replace",
|
||||
http.MethodPatch: "patch",
|
||||
http.MethodDelete: "delete",
|
||||
http.MethodConnect: "connect",
|
||||
http.MethodOptions: "connect", // No real equivalent to options and head
|
||||
http.MethodHead: "connect",
|
||||
}
|
||||
|
||||
// generateOperationNameFromPath creates an operation name from a route path.
|
||||
// The operation name is used by the OpenAPI generator and should be descriptive.
|
||||
// It uses meaningful path segments to create readable yet unique operation names.
|
||||
// Examples:
|
||||
// - "/search" -> "Search"
|
||||
// - "/snapshots/create" -> "SnapshotsCreate"
|
||||
// - "ofrep/v1/evaluate/flags" -> "OfrepEvaluateFlags"
|
||||
// - "ofrep/v1/evaluate/flags/{flagKey}" -> "OfrepEvaluateFlagsFlagKey"
|
||||
func generateOperationNameFromPath(routePath string) string {
|
||||
// Remove leading slash and split by path segments
|
||||
parts := strings.Split(strings.TrimPrefix(routePath, "/"), "/")
|
||||
|
||||
// Filter to keep meaningful segments and path parameters
|
||||
var nameParts []string
|
||||
skipPrefixes := map[string]bool{
|
||||
"namespaces": true,
|
||||
"apis": true,
|
||||
}
|
||||
|
||||
for _, part := range parts {
|
||||
if part == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
// Extract parameter name from {paramName} format
|
||||
if strings.HasPrefix(part, "{") && strings.HasSuffix(part, "}") {
|
||||
paramName := part[1 : len(part)-1]
|
||||
// Skip generic parameters like {namespace}, but keep specific ones like {flagKey}
|
||||
if paramName != "namespace" && paramName != "name" {
|
||||
nameParts = append(nameParts, strings.ToUpper(paramName[:1])+paramName[1:])
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// Skip common prefixes
|
||||
if skipPrefixes[strings.ToLower(part)] {
|
||||
continue
|
||||
}
|
||||
|
||||
// Skip version segments like v1, v0alpha1, v2beta1, etc.
|
||||
if strings.HasPrefix(strings.ToLower(part), "v") &&
|
||||
(len(part) <= 3 || strings.Contains(strings.ToLower(part), "alpha") || strings.Contains(strings.ToLower(part), "beta")) {
|
||||
continue
|
||||
}
|
||||
|
||||
// Capitalize first letter and add to parts
|
||||
if len(part) > 0 {
|
||||
nameParts = append(nameParts, strings.ToUpper(part[:1])+part[1:])
|
||||
}
|
||||
}
|
||||
|
||||
if len(nameParts) == 0 {
|
||||
return "Route"
|
||||
}
|
||||
|
||||
return strings.Join(nameParts, "")
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/apiserver/options"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
@@ -41,15 +40,6 @@ func applyGrafanaConfig(cfg *setting.Cfg, features featuremgmt.FeatureToggles, o
|
||||
apiserverCfg := cfg.SectionWithEnvOverrides("grafana-apiserver")
|
||||
|
||||
runtimeConfig := apiserverCfg.Key("runtime_config").String()
|
||||
runtimeConfigSplit := strings.Split(runtimeConfig, ",")
|
||||
|
||||
// TODO: temporary fix to allow disabling local features service and still being able to use its authz handler
|
||||
if !cfg.OpenFeature.APIEnabled {
|
||||
runtimeConfigSplit = append(runtimeConfigSplit, "features.grafana.app/v0alpha1=false")
|
||||
}
|
||||
|
||||
runtimeConfig = strings.Join(runtimeConfigSplit, ",")
|
||||
|
||||
if runtimeConfig != "" {
|
||||
if err := o.APIEnablementOptions.RuntimeConfig.Set(runtimeConfig); err != nil {
|
||||
return fmt.Errorf("failed to set runtime config: %w", err)
|
||||
|
||||
@@ -155,7 +155,7 @@ func ProvideService(
|
||||
features: features,
|
||||
rr: rr,
|
||||
builders: []builder.APIGroupBuilder{},
|
||||
authorizer: authorizer.NewGrafanaBuiltInSTAuthorizer(cfg),
|
||||
authorizer: authorizer.NewGrafanaBuiltInSTAuthorizer(),
|
||||
tracing: tracing,
|
||||
db: db, // For Unified storage
|
||||
metrics: reg,
|
||||
@@ -443,6 +443,19 @@ func (s *service) start(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Augment existing WebServices with custom routes from builders
|
||||
// This directly adds routes to existing WebServices using the OpenAPI specs from builders
|
||||
if server.Handler != nil && server.Handler.GoRestfulContainer != nil {
|
||||
if err := builder.AugmentWebServicesWithCustomRoutes(
|
||||
server.Handler.GoRestfulContainer,
|
||||
builders,
|
||||
s.metrics,
|
||||
serverConfig.MergedResourceConfig,
|
||||
); err != nil {
|
||||
return fmt.Errorf("failed to augment web services with custom routes: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// stash the options for later use
|
||||
s.options = o
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ type Service struct {
|
||||
pluginStore pluginstore.Store
|
||||
pluginClient plugins.Client
|
||||
basePluginContextProvider plugincontext.BasePluginContextProvider
|
||||
retriever DataSourceRetriever
|
||||
|
||||
ptc proxyTransportCache
|
||||
}
|
||||
@@ -70,6 +71,7 @@ func ProvideService(
|
||||
features featuremgmt.FeatureToggles, ac accesscontrol.AccessControl, datasourcePermissionsService accesscontrol.DatasourcePermissionsService,
|
||||
quotaService quota.Service, pluginStore pluginstore.Store, pluginClient plugins.Client,
|
||||
basePluginContextProvider plugincontext.BasePluginContextProvider,
|
||||
retriever DataSourceRetriever,
|
||||
) (*Service, error) {
|
||||
dslogger := log.New("datasources")
|
||||
store := &SqlStore{db: db, logger: dslogger, features: features}
|
||||
@@ -89,6 +91,7 @@ func ProvideService(
|
||||
pluginStore: pluginStore,
|
||||
pluginClient: pluginClient,
|
||||
basePluginContextProvider: basePluginContextProvider,
|
||||
retriever: retriever,
|
||||
}
|
||||
|
||||
ac.RegisterScopeAttributeResolver(NewNameScopeResolver(store))
|
||||
@@ -175,11 +178,11 @@ func NewIDScopeResolver(db DataSourceRetriever) (string, accesscontrol.ScopeAttr
|
||||
}
|
||||
|
||||
func (s *Service) GetDataSource(ctx context.Context, query *datasources.GetDataSourceQuery) (*datasources.DataSource, error) {
|
||||
return s.SQLStore.GetDataSource(ctx, query)
|
||||
return s.retriever.GetDataSource(ctx, query)
|
||||
}
|
||||
|
||||
func (s *Service) GetDataSourceInNamespace(ctx context.Context, namespace, name, group string) (*datasources.DataSource, error) {
|
||||
return s.SQLStore.GetDataSourceInNamespace(ctx, namespace, name, group)
|
||||
return s.retriever.GetDataSourceInNamespace(ctx, namespace, name, group)
|
||||
}
|
||||
|
||||
func (s *Service) GetDataSources(ctx context.Context, query *datasources.GetDataSourcesQuery) ([]*datasources.DataSource, error) {
|
||||
|
||||
@@ -832,8 +832,9 @@ func TestIntegrationService_DeleteDataSource(t *testing.T) {
|
||||
quotaService := quotatest.New(false, nil)
|
||||
permissionSvc := acmock.NewMockedPermissionsService()
|
||||
permissionSvc.On("DeleteResourcePermissions", mock.Anything, mock.Anything, mock.Anything).Return(nil).Maybe()
|
||||
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, &setting.Cfg{}, featuremgmt.WithFeatures(), acmock.New(), permissionSvc, quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, &setting.Cfg{}, features, acmock.New(), permissionSvc, quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
cmd := &datasources.DeleteDataSourceCommand{
|
||||
@@ -857,7 +858,9 @@ func TestIntegrationService_DeleteDataSource(t *testing.T) {
|
||||
permissionSvc.On("DeleteResourcePermissions", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once()
|
||||
cfg := &setting.Cfg{}
|
||||
enableRBACManagedPermissions(t, cfg)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), permissionSvc, quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), permissionSvc, quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
// First add the datasource
|
||||
@@ -1124,7 +1127,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
rt1, err := dsService.GetHTTPTransport(context.Background(), &ds, provider)
|
||||
@@ -1161,7 +1166,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1212,7 +1219,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1260,7 +1269,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1316,7 +1327,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1351,7 +1364,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1420,7 +1435,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1499,7 +1516,9 @@ func TestIntegrationService_GetHttpTransport(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
ds := datasources.DataSource{
|
||||
@@ -1522,7 +1541,9 @@ func TestIntegrationService_getProxySettings(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, &setting.Cfg{}, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, &setting.Cfg{}, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("Should default to disabled", func(t *testing.T) {
|
||||
@@ -1620,7 +1641,9 @@ func TestIntegrationService_getTimeout(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
for _, tc := range testCases {
|
||||
@@ -1645,7 +1668,9 @@ func TestIntegrationService_GetDecryptedValues(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, nil, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, nil, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
jsonData := map[string]string{
|
||||
@@ -1673,7 +1698,9 @@ func TestIntegrationService_GetDecryptedValues(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, nil, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, nil, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
jsonData := map[string]string{
|
||||
@@ -1699,7 +1726,9 @@ func TestIntegrationDataSource_CustomHeaders(t *testing.T) {
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, nil, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil)
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, nil, features, acmock.New(), acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, nil, dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
dsService.cfg = setting.NewCfg()
|
||||
@@ -1788,7 +1817,9 @@ func initDSService(t *testing.T) *Service {
|
||||
quotaService := quotatest.New(false, nil)
|
||||
mockPermission := acmock.NewMockedPermissionsService()
|
||||
mockPermission.On("SetPermissions", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return([]accesscontrol.ResourcePermission{}, nil)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), actest.FakeAccessControl{}, mockPermission, quotaService, &pluginstore.FakePluginStore{
|
||||
features := featuremgmt.WithFeatures()
|
||||
dsRetriever := ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := ProvideService(sqlStore, secretsService, secretsStore, cfg, features, actest.FakeAccessControl{}, mockPermission, quotaService, &pluginstore.FakePluginStore{
|
||||
PluginList: []pluginstore.Plugin{{
|
||||
JSONData: plugins.JSONData{
|
||||
ID: "test",
|
||||
@@ -1808,7 +1839,7 @@ func initDSService(t *testing.T) *Service {
|
||||
ObjectBytes: req.ObjectBytes,
|
||||
}, nil
|
||||
},
|
||||
}, plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()))
|
||||
}, plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()), dsRetriever)
|
||||
require.NoError(t, err)
|
||||
|
||||
return dsService
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/services/datasources"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
)
|
||||
|
||||
// DataSourceRetrieverImpl implements DataSourceRetriever by delegating to a Store.
|
||||
type DataSourceRetrieverImpl struct {
|
||||
store Store
|
||||
}
|
||||
|
||||
var _ DataSourceRetriever = (*DataSourceRetrieverImpl)(nil)
|
||||
|
||||
// ProvideDataSourceRetriever creates a DataSourceRetriever for wire injection.
|
||||
func ProvideDataSourceRetriever(db db.DB, features featuremgmt.FeatureToggles) DataSourceRetriever {
|
||||
dslogger := log.New("datasources-retriever")
|
||||
store := &SqlStore{db: db, logger: dslogger, features: features}
|
||||
return &DataSourceRetrieverImpl{store: store}
|
||||
}
|
||||
|
||||
// GetDataSource gets a datasource.
|
||||
func (r *DataSourceRetrieverImpl) GetDataSource(ctx context.Context, query *datasources.GetDataSourceQuery) (*datasources.DataSource, error) {
|
||||
return r.store.GetDataSource(ctx, query)
|
||||
}
|
||||
|
||||
// GetDataSourceInNamespace gets a datasource by namespace, name (datasource uid), and group (datasource type).
|
||||
func (r *DataSourceRetrieverImpl) GetDataSourceInNamespace(ctx context.Context, namespace, name, group string) (*datasources.DataSource, error) {
|
||||
return r.store.GetDataSourceInNamespace(ctx, namespace, name, group)
|
||||
}
|
||||
@@ -542,9 +542,10 @@ func setupEnv(t *testing.T, sqlStore db.DB, cfg *setting.Cfg, b bus.Bus, quotaSe
|
||||
dashService.RegisterDashboardPermissions(acmock.NewMockedPermissionsService())
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
secretsStore := secretskvs.NewSQLSecretsKVStore(sqlStore, secretsService, log.New("test.logger"))
|
||||
dsRetriever := dsservice.ProvideDataSourceRetriever(sqlStore, featuremgmt.WithFeatures())
|
||||
_, err = dsservice.ProvideService(sqlStore, secretsService, secretsStore, cfg, featuremgmt.WithFeatures(), acmock.New(), acmock.NewMockedPermissionsService(),
|
||||
quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{}, plugincontext.
|
||||
ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()))
|
||||
ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()), dsRetriever)
|
||||
require.NoError(t, err)
|
||||
m := metrics.NewNGAlert(prometheus.NewRegistry())
|
||||
|
||||
|
||||
@@ -37,9 +37,10 @@ func SetupTestDataSourceSecretMigrationService(t *testing.T, sqlStore db.DB, kvS
|
||||
features := featuremgmt.WithFeatures()
|
||||
secretsService := secretsmng.SetupTestService(t, fakes.NewFakeSecretsStore())
|
||||
quotaService := quotatest.New(false, nil)
|
||||
dsRetriever := dsservice.ProvideDataSourceRetriever(sqlStore, features)
|
||||
dsService, err := dsservice.ProvideService(sqlStore, secretsService, secretsStore, cfg, features, acmock.New(),
|
||||
acmock.NewMockedPermissionsService(), quotaService, &pluginstore.FakePluginStore{}, &pluginfakes.FakePluginClient{},
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()))
|
||||
plugincontext.ProvideBaseService(cfg, pluginconfig.NewFakePluginRequestConfigProvider()), dsRetriever)
|
||||
require.NoError(t, err)
|
||||
migService := ProvideDataSourceMigrationService(dsService, kvStore, features)
|
||||
return migService
|
||||
|
||||
@@ -293,15 +293,15 @@ overrides_path = overrides.yaml
|
||||
overrides_reload_period = 5s
|
||||
```
|
||||
|
||||
To overrides the default quota for a tenant, add the following to the overrides.yaml file:
|
||||
To override the default quota for a tenant, add the following to the `overrides.yaml` file:
|
||||
```yaml
|
||||
overrides:
|
||||
<NAMESPACE>:
|
||||
quotas:
|
||||
<GROUP>.<RESOURCE>:
|
||||
<GROUP>/<RESOURCE>:
|
||||
limit: 10
|
||||
```
|
||||
Unless otherwise set, the NAMESPACE when running locally is `default`.
|
||||
Unless otherwise set, the `NAMESPACE` when running locally is `default`.
|
||||
|
||||
To access quotas, use the following API endpoint:
|
||||
```
|
||||
|
||||
@@ -11,7 +11,7 @@ INSERT INTO {{ .Ident "resource" }}
|
||||
{{ .Ident "previous_resource_version" }}
|
||||
)
|
||||
VALUES (
|
||||
COALESCE({{ .Arg .Value }}, ""),
|
||||
(SELECT {{ .Ident "value" }} FROM {{ .Ident "resource_history" }} WHERE {{ .Ident "guid" }} = {{ .Arg .GUID }}),
|
||||
{{ .Arg .GUID }},
|
||||
{{ .Arg .Group }},
|
||||
{{ .Arg .Resource }},
|
||||
@@ -19,13 +19,5 @@ VALUES (
|
||||
{{ .Arg .Name }},
|
||||
{{ .Arg .Action }},
|
||||
{{ .Arg .Folder }},
|
||||
CASE WHEN {{ .Arg .Action }} = 1 THEN 0 ELSE (
|
||||
SELECT {{ .Ident "resource_version" }}
|
||||
FROM {{ .Ident "resource" }}
|
||||
WHERE {{ .Ident "group" }} = {{ .Arg .Group }}
|
||||
AND {{ .Ident "resource" }} = {{ .Arg .Resource }}
|
||||
AND {{ .Ident "namespace" }} = {{ .Arg .Namespace }}
|
||||
AND {{ .Ident "name" }} = {{ .Arg .Name }}
|
||||
ORDER BY {{ .Ident "resource_version" }} DESC LIMIT 1
|
||||
) END
|
||||
{{ .Arg .PreviousRV }}
|
||||
);
|
||||
|
||||
@@ -7,9 +7,7 @@ INSERT INTO {{ .Ident "resource_history" }}
|
||||
{{ .Ident "namespace" }},
|
||||
{{ .Ident "name" }},
|
||||
{{ .Ident "action" }},
|
||||
{{ .Ident "folder" }},
|
||||
{{ .Ident "previous_resource_version" }},
|
||||
{{ .Ident "generation" }}
|
||||
{{ .Ident "folder" }}
|
||||
)
|
||||
VALUES (
|
||||
COALESCE({{ .Arg .Value }}, ""),
|
||||
@@ -19,26 +17,5 @@ VALUES (
|
||||
{{ .Arg .Namespace }},
|
||||
{{ .Arg .Name }},
|
||||
{{ .Arg .Action }},
|
||||
{{ .Arg .Folder }},
|
||||
CASE WHEN {{ .Arg .Action }} = 1 THEN 0 ELSE (
|
||||
SELECT {{ .Ident "resource_version" }}
|
||||
FROM {{ .Ident "resource_history" }}
|
||||
WHERE {{ .Ident "group" }} = {{ .Arg .Group }}
|
||||
AND {{ .Ident "resource" }} = {{ .Arg .Resource }}
|
||||
AND {{ .Ident "namespace" }} = {{ .Arg .Namespace }}
|
||||
AND {{ .Ident "name" }} = {{ .Arg .Name }}
|
||||
ORDER BY {{ .Ident "resource_version" }} DESC LIMIT 1
|
||||
) END,
|
||||
CASE
|
||||
WHEN {{ .Arg .Action }} = 1 THEN 1
|
||||
WHEN {{ .Arg .Action }} = 3 THEN 0
|
||||
ELSE 1 + (
|
||||
SELECT COUNT(1)
|
||||
FROM {{ .Ident "resource_history" }}
|
||||
WHERE {{ .Ident "group" }} = {{ .Arg .Group }}
|
||||
AND {{ .Ident "resource" }} = {{ .Arg .Resource }}
|
||||
AND {{ .Ident "namespace" }} = {{ .Arg .Namespace }}
|
||||
AND {{ .Ident "name" }} = {{ .Arg .Name }}
|
||||
)
|
||||
END
|
||||
{{ .Arg .Folder }}
|
||||
);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
UPDATE {{ .Ident "resource" }}
|
||||
SET
|
||||
{{ .Ident "value" }} = {{ .Arg .Value }},
|
||||
{{ .Ident "guid" }} = {{ .Arg .GUID }},
|
||||
{{ .Ident "value" }} = (SELECT {{ .Ident "value" }} FROM {{ .Ident "resource_history" }} WHERE {{ .Ident "guid" }} = {{ .Arg .GUID }}),
|
||||
{{ .Ident "action" }} = {{ .Arg .Action }},
|
||||
{{ .Ident "folder" }} = {{ .Arg .Folder }}
|
||||
{{ .Ident "folder" }} = {{ .Arg .Folder }},
|
||||
{{ .Ident "previous_resource_version" }} = {{ .Arg .PreviousRV }}
|
||||
WHERE {{ .Ident "group" }} = {{ .Arg .Group }}
|
||||
AND {{ .Ident "resource" }} = {{ .Arg .Resource }}
|
||||
AND {{ .Ident "namespace" }} = {{ .Arg .Namespace }}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
UPDATE {{ .Ident "resource_history" }}
|
||||
SET
|
||||
{{ .Ident "previous_resource_version" }} = {{ .Arg .PreviousRV }},
|
||||
{{ .Ident "generation" }} = {{ .Arg .Generation }}
|
||||
WHERE {{ .Ident "guid" }} = {{ .Arg .GUID }};
|
||||
@@ -12,6 +12,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apimachinery/validation"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/sql/db"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/sql/dbutil"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/sql/sqltemplate"
|
||||
gocache "github.com/patrickmn/go-cache"
|
||||
)
|
||||
|
||||
@@ -306,10 +309,6 @@ func (d *dataStore) GetResourceKeyAtRevision(ctx context.Context, key GetRequest
|
||||
return DataKey{}, fmt.Errorf("invalid get request key: %w", err)
|
||||
}
|
||||
|
||||
if rv == 0 {
|
||||
rv = math.MaxInt64
|
||||
}
|
||||
|
||||
listKey := ListRequestKey(key)
|
||||
|
||||
iter := d.ListResourceKeysAtRevision(ctx, ListRequestOptions{Key: listKey, ResourceVersion: rv})
|
||||
@@ -598,7 +597,7 @@ func ParseKey(key string) (DataKey, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Temporary while we need to support unified/sql/backend compatibility
|
||||
// Temporary while we need to support unified/sql/backend compatibility.
|
||||
// Remove once we stop using RvManager in storage_backend.go
|
||||
func ParseKeyWithGUID(key string) (DataKey, error) {
|
||||
parts := strings.Split(key, "/")
|
||||
@@ -815,3 +814,121 @@ func (d *dataStore) getGroupResources(ctx context.Context) ([]GroupResource, err
|
||||
|
||||
return results, nil
|
||||
}
|
||||
|
||||
// TODO: remove when backwards compatibility is no longer needed.
|
||||
var (
|
||||
sqlKVUpdateLegacyResourceHistory = mustTemplate("sqlkv_update_legacy_resource_history.sql")
|
||||
sqlKVInsertLegacyResource = mustTemplate("sqlkv_insert_legacy_resource.sql")
|
||||
sqlKVUpdateLegacyResource = mustTemplate("sqlkv_update_legacy_resource.sql")
|
||||
)
|
||||
|
||||
// TODO: remove when backwards compatibility is no longer needed.
|
||||
type sqlKVLegacySaveRequest struct {
|
||||
sqltemplate.SQLTemplate
|
||||
GUID string
|
||||
Group string
|
||||
Resource string
|
||||
Namespace string
|
||||
Name string
|
||||
Action int64
|
||||
Folder string
|
||||
PreviousRV int64
|
||||
}
|
||||
|
||||
func (req sqlKVLegacySaveRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: remove when backwards compatibility is no longer needed.
|
||||
type sqlKVLegacyUpdateHistoryRequest struct {
|
||||
sqltemplate.SQLTemplate
|
||||
GUID string
|
||||
PreviousRV int64
|
||||
Generation int64
|
||||
}
|
||||
|
||||
func (req sqlKVLegacyUpdateHistoryRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// applyBackwardsCompatibleChanges updates the `resource` and `resource_history` tables
|
||||
// to make sure the sqlkv implementation is backwards-compatible with the existing sql backend.
|
||||
// Specifically, it will update the `resource_history` table to include the previous resource version
|
||||
// and generation, which come from the `WriteEvent`, and also make the corresponding change on the
|
||||
// `resource` table, no longer used in the storage backend.
|
||||
//
|
||||
// TODO: remove when backwards compatibility is no longer needed.
|
||||
func (d *dataStore) applyBackwardsCompatibleChanges(ctx context.Context, tx db.Tx, event WriteEvent, key DataKey) error {
|
||||
kv, isSQLKV := d.kv.(*sqlKV)
|
||||
if !isSQLKV {
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := dbutil.Exec(ctx, tx, sqlKVUpdateLegacyResourceHistory, sqlKVLegacyUpdateHistoryRequest{
|
||||
SQLTemplate: sqltemplate.New(kv.dialect),
|
||||
GUID: key.GUID,
|
||||
PreviousRV: event.PreviousRV,
|
||||
Generation: event.Object.GetGeneration(),
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("compatibility layer: failed to insert to resource: %w", err)
|
||||
}
|
||||
|
||||
var action int64
|
||||
switch key.Action {
|
||||
case DataActionCreated:
|
||||
action = 1
|
||||
case DataActionUpdated:
|
||||
action = 2
|
||||
case DataActionDeleted:
|
||||
action = 3
|
||||
}
|
||||
|
||||
switch key.Action {
|
||||
case DataActionCreated:
|
||||
_, err := dbutil.Exec(ctx, tx, sqlKVInsertLegacyResource, sqlKVLegacySaveRequest{
|
||||
SQLTemplate: sqltemplate.New(kv.dialect),
|
||||
GUID: key.GUID,
|
||||
Group: key.Group,
|
||||
Resource: key.Resource,
|
||||
Namespace: key.Namespace,
|
||||
Name: key.Name,
|
||||
Action: action,
|
||||
Folder: key.Folder,
|
||||
PreviousRV: event.PreviousRV,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("compatibility layer: failed to insert to resource: %w", err)
|
||||
}
|
||||
case DataActionUpdated:
|
||||
_, err := dbutil.Exec(ctx, tx, sqlKVUpdateLegacyResource, sqlKVLegacySaveRequest{
|
||||
SQLTemplate: sqltemplate.New(kv.dialect),
|
||||
GUID: key.GUID,
|
||||
Group: key.Group,
|
||||
Resource: key.Resource,
|
||||
Namespace: key.Namespace,
|
||||
Name: key.Name,
|
||||
Folder: key.Folder,
|
||||
PreviousRV: event.PreviousRV,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("compatibility layer: failed to update resource: %w", err)
|
||||
}
|
||||
case DataActionDeleted:
|
||||
_, err := dbutil.Exec(ctx, tx, sqlKVDeleteLegacyResource, sqlKVLegacySaveRequest{
|
||||
SQLTemplate: sqltemplate.New(kv.dialect),
|
||||
Resource: key.Resource,
|
||||
Namespace: key.Namespace,
|
||||
Name: key.Name,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("compatibility layer: failed to delete from resource: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -44,8 +44,6 @@ var (
|
||||
sqlKVInsertData = mustTemplate("sqlkv_insert_datastore.sql")
|
||||
sqlKVUpdateData = mustTemplate("sqlkv_update_datastore.sql")
|
||||
sqlKVInsertLegacyResourceHistory = mustTemplate("sqlkv_insert_legacy_resource_history.sql")
|
||||
sqlKVInsertLegacyResource = mustTemplate("sqlkv_insert_legacy_resource.sql")
|
||||
sqlKVUpdateLegacyResource = mustTemplate("sqlkv_update_legacy_resource.sql")
|
||||
sqlKVDeleteLegacyResource = mustTemplate("sqlkv_delete_legacy_resource.sql")
|
||||
sqlKVDelete = mustTemplate("sqlkv_delete.sql")
|
||||
sqlKVBatchDelete = mustTemplate("sqlkv_batch_delete.sql")
|
||||
@@ -157,26 +155,6 @@ func (req sqlKVSaveRequest) Validate() error {
|
||||
return req.sqlKVSectionKey.Validate()
|
||||
}
|
||||
|
||||
type sqlKVLegacySaveRequest struct {
|
||||
sqltemplate.SQLTemplate
|
||||
Value []byte
|
||||
GUID string
|
||||
Group string
|
||||
Resource string
|
||||
Namespace string
|
||||
Name string
|
||||
Action int64
|
||||
Folder string
|
||||
}
|
||||
|
||||
func (req sqlKVLegacySaveRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (req sqlKVLegacySaveRequest) Results() ([]byte, error) {
|
||||
return req.Value, nil
|
||||
}
|
||||
|
||||
type sqlKVKeysRequest struct {
|
||||
sqltemplate.SQLTemplate
|
||||
sqlKVSection
|
||||
@@ -392,7 +370,7 @@ func (w *sqlWriteCloser) Close() error {
|
||||
// used to keep backwards compatibility between sql-based kvstore and unified/sql/backend
|
||||
tx, ok := rvmanager.TxFromCtx(w.ctx)
|
||||
if !ok {
|
||||
// temporary save for dataStore without rvmanager
|
||||
// temporary save for dataStore without rvmanager (non backwards-compatible)
|
||||
// we can use the same template as the event one after we:
|
||||
// - move PK from GUID to key_path
|
||||
// - remove all unnecessary columns (or at least their NOT NULL constraints)
|
||||
@@ -429,11 +407,12 @@ func (w *sqlWriteCloser) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// special, temporary save that includes all the fields in resource_history that are not relevant for the kvstore,
|
||||
// as well as the resource table. This is only called if an RvManager was passed to storage_backend, as that
|
||||
// component will be responsible for populating the resource_version and key_path columns
|
||||
// note that we are not touching resource_version table, neither the resource_version columns or the key_path column
|
||||
// as the RvManager will be responsible for this
|
||||
// special, temporary backwards-compatible save that includes all the fields in resource_history that are not relevant
|
||||
// for the kvstore, as well as the resource table. This is only called if an RvManager was passed to storage_backend, as that
|
||||
// component will be responsible for populating the resource_version and key_path columns.
|
||||
// For full backwards-compatibility, the `Save` function needs to be called within a callback that updates the resource_history
|
||||
// table with `previous_resource_version` and `generation` and updates the `resource` table accordingly. See the
|
||||
// storage_backend for the full implementation.
|
||||
dataKey, err := ParseKeyWithGUID(w.sectionKey.Key)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to parse key: %w", err)
|
||||
@@ -448,7 +427,7 @@ func (w *sqlWriteCloser) Close() error {
|
||||
case DataActionDeleted:
|
||||
action = 3
|
||||
default:
|
||||
return fmt.Errorf("failed to parse key: %w", err)
|
||||
return fmt.Errorf("failed to parse key: invalid action")
|
||||
}
|
||||
|
||||
_, err = dbutil.Exec(w.ctx, tx, sqlKVInsertLegacyResourceHistory, sqlKVSaveRequest{
|
||||
@@ -468,52 +447,6 @@ func (w *sqlWriteCloser) Close() error {
|
||||
return fmt.Errorf("failed to save to resource_history: %w", err)
|
||||
}
|
||||
|
||||
switch dataKey.Action {
|
||||
case DataActionCreated:
|
||||
_, err = dbutil.Exec(w.ctx, tx, sqlKVInsertLegacyResource, sqlKVLegacySaveRequest{
|
||||
SQLTemplate: sqltemplate.New(w.kv.dialect),
|
||||
Value: w.buf.Bytes(),
|
||||
GUID: dataKey.GUID,
|
||||
Group: dataKey.Group,
|
||||
Resource: dataKey.Resource,
|
||||
Namespace: dataKey.Namespace,
|
||||
Name: dataKey.Name,
|
||||
Action: action,
|
||||
Folder: dataKey.Folder,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to insert to resource: %w", err)
|
||||
}
|
||||
case DataActionUpdated:
|
||||
_, err = dbutil.Exec(w.ctx, tx, sqlKVUpdateLegacyResource, sqlKVLegacySaveRequest{
|
||||
SQLTemplate: sqltemplate.New(w.kv.dialect),
|
||||
Value: w.buf.Bytes(),
|
||||
Group: dataKey.Group,
|
||||
Resource: dataKey.Resource,
|
||||
Namespace: dataKey.Namespace,
|
||||
Name: dataKey.Name,
|
||||
Action: action,
|
||||
Folder: dataKey.Folder,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update resource: %w", err)
|
||||
}
|
||||
case DataActionDeleted:
|
||||
_, err = dbutil.Exec(w.ctx, tx, sqlKVDeleteLegacyResource, sqlKVLegacySaveRequest{
|
||||
SQLTemplate: sqltemplate.New(w.kv.dialect),
|
||||
Group: dataKey.Group,
|
||||
Resource: dataKey.Resource,
|
||||
Namespace: dataKey.Namespace,
|
||||
Name: dataKey.Name,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to delete from resource: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -332,11 +332,14 @@ func (k *kvStorageBackend) WriteEvent(ctx context.Context, event WriteEvent) (in
|
||||
dataKey.GUID = uuid.New().String()
|
||||
var err error
|
||||
rv, err = k.rvManager.ExecWithRV(ctx, event.Key, func(tx db.Tx) (string, error) {
|
||||
err := k.dataStore.Save(rvmanager.ContextWithTx(ctx, tx), dataKey, bytes.NewReader(event.Value))
|
||||
if err != nil {
|
||||
if err := k.dataStore.Save(rvmanager.ContextWithTx(ctx, tx), dataKey, bytes.NewReader(event.Value)); err != nil {
|
||||
return "", fmt.Errorf("failed to write data: %w", err)
|
||||
}
|
||||
|
||||
if err := k.dataStore.applyBackwardsCompatibleChanges(ctx, tx, event, dataKey); err != nil {
|
||||
return "", fmt.Errorf("failed to apply backwards compatible updates: %w", err)
|
||||
}
|
||||
|
||||
return dataKey.GUID, nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
package apis
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
"github.com/grafana/grafana/pkg/util/testutil"
|
||||
)
|
||||
|
||||
const pluginsDiscoveryJSON = `[
|
||||
{
|
||||
"version": "v0alpha1",
|
||||
"freshness": "Current",
|
||||
"resources": [
|
||||
{
|
||||
"resource": "metas",
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "Meta",
|
||||
"version": ""
|
||||
},
|
||||
"scope": "Namespaced",
|
||||
"singularResource": "meta",
|
||||
"subresources": [
|
||||
{
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "Meta",
|
||||
"version": ""
|
||||
},
|
||||
"subresource": "status",
|
||||
"verbs": [
|
||||
"get",
|
||||
"patch",
|
||||
"update"
|
||||
]
|
||||
}
|
||||
],
|
||||
"verbs": [
|
||||
"get",
|
||||
"list"
|
||||
]
|
||||
},
|
||||
{
|
||||
"resource": "plugins",
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "Plugin",
|
||||
"version": ""
|
||||
},
|
||||
"scope": "Namespaced",
|
||||
"singularResource": "plugin",
|
||||
"subresources": [
|
||||
{
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "Plugin",
|
||||
"version": ""
|
||||
},
|
||||
"subresource": "status",
|
||||
"verbs": [
|
||||
"get",
|
||||
"patch",
|
||||
"update"
|
||||
]
|
||||
}
|
||||
],
|
||||
"verbs": [
|
||||
"create",
|
||||
"delete",
|
||||
"deletecollection",
|
||||
"get",
|
||||
"list",
|
||||
"patch",
|
||||
"update",
|
||||
"watch"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]`
|
||||
|
||||
func setupHelper(t *testing.T, openFeatureAPIEnabled bool) *K8sTestHelper {
|
||||
t.Helper()
|
||||
helper := NewK8sTestHelper(t, testinfra.GrafanaOpts{
|
||||
AppModeProduction: true,
|
||||
DisableAnonymous: true,
|
||||
APIServerRuntimeConfig: "plugins.grafana.app/v0alpha1=true",
|
||||
OpenFeatureAPIEnabled: openFeatureAPIEnabled,
|
||||
})
|
||||
t.Cleanup(func() { helper.Shutdown() })
|
||||
return helper
|
||||
}
|
||||
|
||||
func TestIntegrationAPIServerRuntimeConfig(t *testing.T) {
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
t.Run("discovery with openfeature api enabled", func(t *testing.T) {
|
||||
helper := setupHelper(t, true)
|
||||
disco, err := helper.GetGroupVersionInfoJSON("features.grafana.app")
|
||||
require.NoError(t, err)
|
||||
require.JSONEq(t, `[
|
||||
{
|
||||
"freshness": "Current",
|
||||
"resources": [
|
||||
{
|
||||
"resource": "noop",
|
||||
"responseKind": {
|
||||
"group": "",
|
||||
"kind": "Status",
|
||||
"version": ""
|
||||
},
|
||||
"scope": "Namespaced",
|
||||
"singularResource": "noop",
|
||||
"verbs": [
|
||||
"get"
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": "v0alpha1"
|
||||
}
|
||||
]`, disco)
|
||||
|
||||
// plugins should still be discoverable
|
||||
disco, err = helper.GetGroupVersionInfoJSON("plugins.grafana.app")
|
||||
require.NoError(t, err)
|
||||
require.JSONEq(t, pluginsDiscoveryJSON, disco)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
|
||||
t.Run("discovery with openfeature api false", func(t *testing.T) {
|
||||
helper := setupHelper(t, false)
|
||||
_, err := helper.GetGroupVersionInfoJSON("features.grafana.app")
|
||||
require.Error(t, err, "expected error when openfeature api is disabled")
|
||||
|
||||
// plugins should still be discoverable
|
||||
disco, err := helper.GetGroupVersionInfoJSON("plugins.grafana.app")
|
||||
require.NoError(t, err)
|
||||
require.JSONEq(t, pluginsDiscoveryJSON, disco)
|
||||
require.NoError(t, err)
|
||||
})
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/tests/apis"
|
||||
"github.com/grafana/grafana/pkg/tests/testinfra"
|
||||
"github.com/grafana/grafana/pkg/tests/testsuite"
|
||||
@@ -177,6 +178,9 @@ func setupHelper(t *testing.T) *apis.K8sTestHelper {
|
||||
AppModeProduction: true,
|
||||
DisableAnonymous: true,
|
||||
APIServerRuntimeConfig: "plugins.grafana.app/v0alpha1=true",
|
||||
EnableFeatureToggles: []string{
|
||||
featuremgmt.FlagPluginStoreServiceLoading,
|
||||
},
|
||||
})
|
||||
t.Cleanup(func() { helper.Shutdown() })
|
||||
return helper
|
||||
|
||||
@@ -320,8 +320,9 @@ func CreateGrafDir(t *testing.T, opts GrafanaOpts) (string, string) {
|
||||
require.NoError(t, err)
|
||||
_, err = openFeatureSect.NewKey("enable_api", strconv.FormatBool(opts.OpenFeatureAPIEnabled))
|
||||
require.NoError(t, err)
|
||||
if !opts.OpenFeatureAPIEnabled {
|
||||
_, err = openFeatureSect.NewKey("provider", "static") // in practice, APIEnabled being false goes with features-service type, but trying to make tests work
|
||||
|
||||
if opts.OpenFeatureAPIEnabled {
|
||||
_, err = openFeatureSect.NewKey("provider", "static")
|
||||
require.NoError(t, err)
|
||||
_, err = openFeatureSect.NewKey("targetingKey", "grafana")
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -128,7 +128,7 @@ describe('PanelTimeRange', () => {
|
||||
expect(panelTime.state.value.to.format('Z')).toBe('+00:00'); // UTC
|
||||
});
|
||||
|
||||
it('should handle invalid time reference in timeShift', () => {
|
||||
it('should handle invalid time reference in timeShift with relative time range', () => {
|
||||
const panelTime = new PanelTimeRange({ timeShift: 'now-1d' });
|
||||
|
||||
buildAndActivateSceneFor(panelTime);
|
||||
@@ -139,6 +139,22 @@ describe('PanelTimeRange', () => {
|
||||
expect(panelTime.state.to).toBe('now');
|
||||
});
|
||||
|
||||
it('should handle invalid time reference in timeShift with absolute time range', () => {
|
||||
const panelTime = new PanelTimeRange({ timeShift: 'now-1d' });
|
||||
const panel = new SceneCanvasText({ text: 'Hello', $timeRange: panelTime });
|
||||
const absoluteFrom = '2019-02-11T10:00:00.000Z';
|
||||
const absoluteTo = '2019-02-11T16:00:00.000Z';
|
||||
const scene = new SceneFlexLayout({
|
||||
$timeRange: new SceneTimeRange({ from: absoluteFrom, to: absoluteTo }),
|
||||
children: [new SceneFlexItem({ body: panel })],
|
||||
});
|
||||
activateFullSceneTree(scene);
|
||||
|
||||
expect(panelTime.state.timeInfo).toBe('invalid timeshift');
|
||||
expect(panelTime.state.from).toBe(absoluteFrom);
|
||||
expect(panelTime.state.to).toBe(absoluteTo);
|
||||
});
|
||||
|
||||
it('should handle invalid time reference in timeShift combined with timeFrom', () => {
|
||||
const panelTime = new PanelTimeRange({
|
||||
timeFrom: 'now-2h',
|
||||
@@ -153,6 +169,66 @@ describe('PanelTimeRange', () => {
|
||||
expect(panelTime.state.to).toBe('now');
|
||||
});
|
||||
|
||||
describe('from/to state format for liveNow compatibility', () => {
|
||||
it('should store relative strings in from/to when timeShift is applied to relative time range', () => {
|
||||
const panelTime = new PanelTimeRange({ timeShift: '2h' });
|
||||
|
||||
buildAndActivateSceneFor(panelTime);
|
||||
|
||||
expect(panelTime.state.from).toBe('now-6h-2h');
|
||||
expect(panelTime.state.to).toBe('now-2h');
|
||||
expect(panelTime.state.value.raw.from).toBe('now-6h-2h');
|
||||
expect(panelTime.state.value.raw.to).toBe('now-2h');
|
||||
});
|
||||
|
||||
it('should store relative strings when both timeFrom and timeShift are applied', () => {
|
||||
const panelTime = new PanelTimeRange({ timeFrom: '2h', timeShift: '1h' });
|
||||
|
||||
buildAndActivateSceneFor(panelTime);
|
||||
|
||||
expect(panelTime.state.from).toBe('now-2h-1h');
|
||||
expect(panelTime.state.to).toBe('now-1h');
|
||||
});
|
||||
|
||||
it('should store ISO strings when timeShift is applied to absolute time range', () => {
|
||||
const panelTime = new PanelTimeRange({ timeShift: '1h' });
|
||||
const panel = new SceneCanvasText({ text: 'Hello', $timeRange: panelTime });
|
||||
const absoluteFrom = '2019-02-11T10:00:00.000Z';
|
||||
const absoluteTo = '2019-02-11T16:00:00.000Z';
|
||||
const scene = new SceneFlexLayout({
|
||||
$timeRange: new SceneTimeRange({ from: absoluteFrom, to: absoluteTo }),
|
||||
children: [new SceneFlexItem({ body: panel })],
|
||||
});
|
||||
activateFullSceneTree(scene);
|
||||
|
||||
expect(panelTime.state.from).toBe('2019-02-11T09:00:00.000Z');
|
||||
expect(panelTime.state.to).toBe('2019-02-11T15:00:00.000Z');
|
||||
});
|
||||
|
||||
it('should update from/to when ancestor time range changes', () => {
|
||||
const panelTime = new PanelTimeRange({ timeShift: '1h' });
|
||||
const sceneTimeRange = new SceneTimeRange({ from: 'now-6h', to: 'now' });
|
||||
const panel = new SceneCanvasText({ text: 'Hello', $timeRange: panelTime });
|
||||
const scene = new SceneFlexLayout({
|
||||
$timeRange: sceneTimeRange,
|
||||
children: [new SceneFlexItem({ body: panel })],
|
||||
});
|
||||
activateFullSceneTree(scene);
|
||||
|
||||
expect(panelTime.state.from).toBe('now-6h-1h');
|
||||
expect(panelTime.state.to).toBe('now-1h');
|
||||
|
||||
sceneTimeRange.onTimeRangeChange({
|
||||
from: dateTime('2019-02-11T12:00:00.000Z'),
|
||||
to: dateTime('2019-02-11T18:00:00.000Z'),
|
||||
raw: { from: 'now-12h', to: 'now' },
|
||||
});
|
||||
|
||||
expect(panelTime.state.from).toBe('now-12h-1h');
|
||||
expect(panelTime.state.to).toBe('now-1h');
|
||||
});
|
||||
});
|
||||
|
||||
describe('onTimeRangeChange', () => {
|
||||
it('should reverse timeShift when updating time range', () => {
|
||||
const oneHourShift = '1h';
|
||||
|
||||
@@ -81,7 +81,19 @@ export class PanelTimeRange extends SceneTimeRangeTransformerBase<PanelTimeRange
|
||||
}
|
||||
|
||||
const overrideResult = this.getTimeOverride(timeRange.value);
|
||||
this.setState({ value: overrideResult.timeRange, timeInfo: overrideResult.timeInfo });
|
||||
const { timeRange: overrideTimeRange } = overrideResult;
|
||||
this.setState({
|
||||
value: overrideTimeRange,
|
||||
timeInfo: overrideResult.timeInfo,
|
||||
from:
|
||||
typeof overrideTimeRange.raw.from === 'string'
|
||||
? overrideTimeRange.raw.from
|
||||
: overrideTimeRange.raw.from.toISOString(),
|
||||
to:
|
||||
typeof overrideTimeRange.raw.to === 'string'
|
||||
? overrideTimeRange.raw.to
|
||||
: overrideTimeRange.raw.to.toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
// Get a time shifted request to compare with the primary request.
|
||||
@@ -153,10 +165,10 @@ export class PanelTimeRange extends SceneTimeRangeTransformerBase<PanelTimeRange
|
||||
|
||||
// Only evaluate if the timeFrom if parent time is relative
|
||||
if (rangeUtil.isRelativeTimeRange(parentTimeRange.raw)) {
|
||||
const timeZone = this.getTimeZone();
|
||||
const timezone = this.getTimeZone();
|
||||
newTimeData.timeRange = {
|
||||
from: dateMath.parse(timeFromInfo.from, undefined, timeZone)!,
|
||||
to: dateMath.parse(timeFromInfo.to, undefined, timeZone)!,
|
||||
from: dateMath.toDateTime(timeFromInfo.from, { timezone })!,
|
||||
to: dateMath.toDateTime(timeFromInfo.to, { timezone })!,
|
||||
raw: { from: timeFromInfo.from, to: timeFromInfo.to },
|
||||
};
|
||||
infoBlocks.push(timeFromInfo.display);
|
||||
@@ -172,18 +184,39 @@ export class PanelTimeRange extends SceneTimeRangeTransformerBase<PanelTimeRange
|
||||
return newTimeData;
|
||||
}
|
||||
|
||||
const timeShift = '-' + timeShiftInterpolated;
|
||||
infoBlocks.push('timeshift ' + timeShift);
|
||||
const shift = '-' + timeShiftInterpolated;
|
||||
infoBlocks.push('timeshift ' + shift);
|
||||
|
||||
const from = dateMath.parseDateMath(timeShift, newTimeData.timeRange.from, false)!;
|
||||
const to = dateMath.parseDateMath(timeShift, newTimeData.timeRange.to, true)!;
|
||||
if (rangeUtil.isRelativeTimeRange(newTimeData.timeRange.raw)) {
|
||||
const timezone = this.getTimeZone();
|
||||
|
||||
if (!from || !to) {
|
||||
newTimeData.timeInfo = 'invalid timeshift';
|
||||
return newTimeData;
|
||||
const rawFromShifted = `${newTimeData.timeRange.raw.from}${shift}`;
|
||||
const rawToShifted = `${newTimeData.timeRange.raw.to}${shift}`;
|
||||
|
||||
const from = dateMath.toDateTime(rawFromShifted, { timezone });
|
||||
const to = dateMath.toDateTime(rawToShifted, { timezone });
|
||||
|
||||
if (!from || !to) {
|
||||
newTimeData.timeInfo = 'invalid timeshift';
|
||||
return newTimeData;
|
||||
}
|
||||
|
||||
newTimeData.timeRange = {
|
||||
from,
|
||||
to,
|
||||
raw: { from: rawFromShifted, to: rawToShifted },
|
||||
};
|
||||
} else {
|
||||
const from = dateMath.parseDateMath(shift, newTimeData.timeRange.from, false);
|
||||
const to = dateMath.parseDateMath(shift, newTimeData.timeRange.to, true);
|
||||
|
||||
if (!from || !to) {
|
||||
newTimeData.timeInfo = 'invalid timeshift';
|
||||
return newTimeData;
|
||||
}
|
||||
|
||||
newTimeData.timeRange = { from, to, raw: { from, to } };
|
||||
}
|
||||
|
||||
newTimeData.timeRange = { from, to, raw: { from, to } };
|
||||
}
|
||||
|
||||
if (compareWith) {
|
||||
|
||||
@@ -3791,7 +3791,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4454,6 +4453,7 @@
|
||||
},
|
||||
"no-properties-changed": "Žádné relevantní vlastnosti se nezměnily",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Datum",
|
||||
"updatedBy": "Aktualizoval uživatel",
|
||||
"version": "Verze"
|
||||
@@ -4912,7 +4912,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Hodnoty oddělené čárkou"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filtr názvu",
|
||||
@@ -6010,6 +6011,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Vlastní možnosti",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Hodnoty oddělené čárkou",
|
||||
"selection-options": "Možnosti výběru"
|
||||
},
|
||||
@@ -6601,6 +6605,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Nástěnka byla uložena"
|
||||
},
|
||||
@@ -6624,6 +6633,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6683,8 +6693,11 @@
|
||||
"tooltip-show-usages": "Zobrazit použití"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Náhled hodnot",
|
||||
"show-more": "Zobrazit více"
|
||||
"show-more": "Zobrazit více",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_few": "",
|
||||
"preview-of-values_many": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Keine relevanten Eigenschaften geändert",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Datum",
|
||||
"updatedBy": "Aktualisiert von",
|
||||
"version": "Version"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Werte werden durch Komma getrennt"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Namensfilter",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Benutzerdefinierte Optionen",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Werte werden durch Komma getrennt",
|
||||
"selection-options": "Auswahloptionen"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Dashboard gespeichert"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Nutzungen anzeigen"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Vorschau der Werte",
|
||||
"show-more": "Mehr anzeigen"
|
||||
"show-more": "Mehr anzeigen",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "No se ha cambiado ninguna propiedad relevante",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Fecha",
|
||||
"updatedBy": "Actualizada por",
|
||||
"version": "Versión"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Valores separados por coma"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Nombrar filtro",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Opciones personalizadas",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Valores separados por comas",
|
||||
"selection-options": "Opciones de selección"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Dashboard guardado"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Mostrar usos"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Vista previa de los valores",
|
||||
"show-more": "Mostrar más"
|
||||
"show-more": "Mostrar más",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Aucune propriété pertinente n’a été modifiée",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Date",
|
||||
"updatedBy": "Mis à jour par",
|
||||
"version": "Version"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Valeurs séparées par une virgule"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Nom du filtre",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Personnaliser les options",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Valeurs séparées par des virgules",
|
||||
"selection-options": "Options de sélection"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Tableau de bord enregistré"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Afficher les usages"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Aperçu des valeurs",
|
||||
"show-more": "Afficher plus"
|
||||
"show-more": "Afficher plus",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Nem változtak meg a releváns tulajdonságok",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Dátum",
|
||||
"updatedBy": "Frissítette:",
|
||||
"version": "Verzió"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Értékek vesszővel elválasztva"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Névszűrő",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Egyéni opciók",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Értékek vesszővel elválasztva",
|
||||
"selection-options": "Kijelölés beállításai"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Irányítópult elmentve"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Használatok megjelenítése"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Értékek előnézete",
|
||||
"show-more": "Több megjelenítése"
|
||||
"show-more": "Több megjelenítése",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3743,7 +3743,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4397,6 +4396,7 @@
|
||||
},
|
||||
"no-properties-changed": "Tidak ada properti yang relevan yang diubah",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Tanggal",
|
||||
"updatedBy": "Diperbarui Oleh",
|
||||
"version": "Versi"
|
||||
@@ -4855,7 +4855,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Nilai dipisahkan dengan koma"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filter nama",
|
||||
@@ -5947,6 +5948,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Opsi kustom",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Nilai dipisahkan dengan koma",
|
||||
"selection-options": "Opsi pemilihan"
|
||||
},
|
||||
@@ -6532,6 +6536,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Dasbor disimpan"
|
||||
},
|
||||
@@ -6555,6 +6564,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6614,8 +6624,8 @@
|
||||
"tooltip-show-usages": "Tampilkan penggunaan"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Pratinjau nilai",
|
||||
"show-more": "Tampilkan lebih banyak"
|
||||
"show-more": "Tampilkan lebih banyak",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Nessuna proprietà rilevante modificata",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Data",
|
||||
"updatedBy": "Aggiornato da",
|
||||
"version": "Versione"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Valori separati da virgola"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filtro nome",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Opzioni personalizzate",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Valori separati da virgola",
|
||||
"selection-options": "Seleziona opzioni"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Dashboard salvata"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Mostra utilizzi"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Anteprima dei valori",
|
||||
"show-more": "Mostra di più"
|
||||
"show-more": "Mostra di più",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3743,7 +3743,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4397,6 +4396,7 @@
|
||||
},
|
||||
"no-properties-changed": "関連するプロパティは変更されていません",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "日付",
|
||||
"updatedBy": "更新者",
|
||||
"version": "バージョン"
|
||||
@@ -4855,7 +4855,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "カンマで区切った値"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "名前フィルター",
|
||||
@@ -5947,6 +5948,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "カスタムオプション",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "カンマ区切りの値",
|
||||
"selection-options": "選択オプション"
|
||||
},
|
||||
@@ -6532,6 +6536,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "ダッシュボードが保存されました"
|
||||
},
|
||||
@@ -6555,6 +6564,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6614,8 +6624,8 @@
|
||||
"tooltip-show-usages": "使用状況を表示"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "値のプレビュー",
|
||||
"show-more": "さらに表示"
|
||||
"show-more": "さらに表示",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3743,7 +3743,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4397,6 +4396,7 @@
|
||||
},
|
||||
"no-properties-changed": "변경된 관련 속성 없음",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "날짜",
|
||||
"updatedBy": "업데이트한 사용자",
|
||||
"version": "버전"
|
||||
@@ -4855,7 +4855,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "쉼표로 구분된 값"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "이름 필터",
|
||||
@@ -5947,6 +5948,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "사용자 지정 옵션",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "쉼표로 구분된 값",
|
||||
"selection-options": "선택 옵션"
|
||||
},
|
||||
@@ -6532,6 +6536,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "대시보드가 저장되었습니다"
|
||||
},
|
||||
@@ -6555,6 +6564,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6614,8 +6624,8 @@
|
||||
"tooltip-show-usages": "사용처 표시"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "값 미리 보기",
|
||||
"show-more": "더 보기"
|
||||
"show-more": "더 보기",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Geen relevante eigenschappen gewijzigd",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Datum",
|
||||
"updatedBy": "Bijgewerkt door",
|
||||
"version": "Versie"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Waarden gescheiden door komma"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filter een naam geven",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Aangepaste opties",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Waarden gescheiden door komma",
|
||||
"selection-options": "Selectiemogelijkheden"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Dashboard opgeslagen"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Gebruik weergeven"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Voorbeeldweergave van waarden",
|
||||
"show-more": "Meer weergeven"
|
||||
"show-more": "Meer weergeven",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3791,7 +3791,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4454,6 +4453,7 @@
|
||||
},
|
||||
"no-properties-changed": "Nie zmieniono istotnych właściwości",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Data",
|
||||
"updatedBy": "Zaktualizowane przez",
|
||||
"version": "Wersja"
|
||||
@@ -4912,7 +4912,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Wartości rozdzielone przecinkami"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filtr nazwy",
|
||||
@@ -6010,6 +6011,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Opcje niestandardowe",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Wartości rozdzielone przecinkami",
|
||||
"selection-options": "Opcje wyboru"
|
||||
},
|
||||
@@ -6601,6 +6605,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Pulpit został zapisany"
|
||||
},
|
||||
@@ -6624,6 +6633,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6683,8 +6693,11 @@
|
||||
"tooltip-show-usages": "Wyświetl użycie"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Podgląd wartości",
|
||||
"show-more": "Pokaż więcej"
|
||||
"show-more": "Pokaż więcej",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_few": "",
|
||||
"preview-of-values_many": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Nenhuma propriedade relevante alterada",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Data",
|
||||
"updatedBy": "Atualizada por",
|
||||
"version": "Versão"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Valores separados por vírgula"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filtro de nome",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Opções personalizadas",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Valores separados por vírgula",
|
||||
"selection-options": "Opções de seleção"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Painel de controle salvo"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Exibir usos"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Pré-visualização de valores",
|
||||
"show-more": "Exibir mais"
|
||||
"show-more": "Exibir mais",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Nenhuma propriedade relevante alterada",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Data",
|
||||
"updatedBy": "Atualizado por",
|
||||
"version": "Versão"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Valores separados por vírgulas"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Filtro de nome",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Opções personalizadas",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Valores separados por vírgulas",
|
||||
"selection-options": "Opções de seleção"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Painel de controlo guardado"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Mostrar utilizações"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Pré-visualização de valores",
|
||||
"show-more": "Mostrar mais"
|
||||
"show-more": "Mostrar mais",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3791,7 +3791,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4454,6 +4453,7 @@
|
||||
},
|
||||
"no-properties-changed": "Нет изменений соответствующих свойств",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Дата",
|
||||
"updatedBy": "Обновлено",
|
||||
"version": "Версия"
|
||||
@@ -4912,7 +4912,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Значения, разделенные запятыми"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Фильтр по названию",
|
||||
@@ -6010,6 +6011,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Пользовательские параметры",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Значения, разделенные запятыми",
|
||||
"selection-options": "Параметры выбора"
|
||||
},
|
||||
@@ -6601,6 +6605,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Дашборд сохранен"
|
||||
},
|
||||
@@ -6624,6 +6633,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6683,8 +6693,11 @@
|
||||
"tooltip-show-usages": "Показать варианты использования"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Просмотр значений",
|
||||
"show-more": "Показать еще"
|
||||
"show-more": "Показать еще",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_few": "",
|
||||
"preview-of-values_many": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "Inga relevanta egenskaper har ändrats",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Datum",
|
||||
"updatedBy": "Uppdaterad per",
|
||||
"version": "Version"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Värden åtskilda med kommatecken"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Namnfilter",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Anpassade alternativ",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Värden åtskilda med kommatecken",
|
||||
"selection-options": "Urvalsalternativ"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Kontrollpanelen sparades"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Visa användningar"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Förhandsgranska värden",
|
||||
"show-more": "Visa mer"
|
||||
"show-more": "Visa mer",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3759,7 +3759,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4416,6 +4415,7 @@
|
||||
},
|
||||
"no-properties-changed": "İlgili hiçbir özellik değiştirilmedi",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "Tarih",
|
||||
"updatedBy": "Güncelleyen:",
|
||||
"version": "Sürüm"
|
||||
@@ -4874,7 +4874,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "Virgülle ayrılmış değerler"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "Ad filtresi",
|
||||
@@ -5968,6 +5969,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "Özel seçenekler",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "Virgülle ayrılmış değerler",
|
||||
"selection-options": "Seçim ayarları"
|
||||
},
|
||||
@@ -6555,6 +6559,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "Pano kaydedildi"
|
||||
},
|
||||
@@ -6578,6 +6587,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6637,8 +6647,9 @@
|
||||
"tooltip-show-usages": "Kullanımları göster"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "Değerlerin ön izlemesi",
|
||||
"show-more": "Daha fazla göster"
|
||||
"show-more": "Daha fazla göster",
|
||||
"preview-of-values_one": "",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3743,7 +3743,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4397,6 +4396,7 @@
|
||||
},
|
||||
"no-properties-changed": "没有相关属性更改",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "日期",
|
||||
"updatedBy": "更新者",
|
||||
"version": "版本"
|
||||
@@ -4855,7 +4855,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "以逗号分隔的值"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "名称筛选器",
|
||||
@@ -5947,6 +5948,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "自定义选项",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "以逗号分隔的值",
|
||||
"selection-options": "选择内容选项"
|
||||
},
|
||||
@@ -6532,6 +6536,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "数据面板已保存"
|
||||
},
|
||||
@@ -6555,6 +6564,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6614,8 +6624,8 @@
|
||||
"tooltip-show-usages": "显示使用情况"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "值预览",
|
||||
"show-more": "显示更多"
|
||||
"show-more": "显示更多",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
@@ -3743,7 +3743,6 @@
|
||||
},
|
||||
"recently-viewed": {
|
||||
"clear": "",
|
||||
"empty": "",
|
||||
"error": "",
|
||||
"retry": "",
|
||||
"title": ""
|
||||
@@ -4397,6 +4396,7 @@
|
||||
},
|
||||
"no-properties-changed": "沒有相關的屬性變更",
|
||||
"table": {
|
||||
"notes": "",
|
||||
"updated": "日期",
|
||||
"updatedBy": "更新者",
|
||||
"version": "版本"
|
||||
@@ -4855,7 +4855,8 @@
|
||||
"apply": "",
|
||||
"change-value": "",
|
||||
"discard": "",
|
||||
"modal-title": ""
|
||||
"modal-title": "",
|
||||
"values": "以逗號分隔的值"
|
||||
},
|
||||
"datasource-options": {
|
||||
"name-filter": "名稱篩選",
|
||||
@@ -5947,6 +5948,9 @@
|
||||
},
|
||||
"custom-variable-form": {
|
||||
"custom-options": "自訂選項",
|
||||
"json-values-tooltip": "",
|
||||
"name-csv-values": "",
|
||||
"name-json-values": "",
|
||||
"name-values-separated-comma": "以逗號分隔的值",
|
||||
"selection-options": "選擇選項"
|
||||
},
|
||||
@@ -6532,6 +6536,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"use-modal-editor": {
|
||||
"description": {
|
||||
"change-variable-query": ""
|
||||
}
|
||||
},
|
||||
"use-save-dashboard": {
|
||||
"message-dashboard-saved": "儀表板已儲存"
|
||||
},
|
||||
@@ -6555,6 +6564,7 @@
|
||||
"label": ""
|
||||
},
|
||||
"hidden": {
|
||||
"description": "",
|
||||
"label": ""
|
||||
},
|
||||
"hidden-label": {
|
||||
@@ -6614,8 +6624,8 @@
|
||||
"tooltip-show-usages": "顯示使用情況"
|
||||
},
|
||||
"variable-values-preview": {
|
||||
"preview-of-values": "數值預覽",
|
||||
"show-more": "顯示更多"
|
||||
"show-more": "顯示更多",
|
||||
"preview-of-values_other": ""
|
||||
},
|
||||
"version-history": {
|
||||
"comparison": {
|
||||
|
||||
Reference in New Issue
Block a user