mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 07:33:42 -06:00
merge main
This commit is contained in:
commit
75d5ad465e
85
.github/workflows/bump-version.yml
vendored
85
.github/workflows/bump-version.yml
vendored
@ -5,74 +5,39 @@ on:
|
|||||||
version:
|
version:
|
||||||
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch, major.minor.patch-preview or major.minor.patch-preview<number> format. example: 7.4.3, 7.4.3-preview or 7.4.3-preview1'
|
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch, major.minor.patch-preview or major.minor.patch-preview<number> format. example: 7.4.3, 7.4.3-preview or 7.4.3-preview1'
|
||||||
required: true
|
required: true
|
||||||
env:
|
push:
|
||||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
default: true
|
||||||
|
required: false
|
||||||
|
dry_run:
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# This is a basic workflow to help you get started with Actions
|
- name: Checkout Grafana
|
||||||
- uses: actions-ecosystem/action-regex-match@v2.0.2
|
|
||||||
if: ${{ github.event.inputs.version != '' }}
|
|
||||||
id: regex-match
|
|
||||||
with:
|
|
||||||
text: ${{ github.event.inputs.version }}
|
|
||||||
regex: '^(\d+.\d+).\d+(?:-(?:(preview\d?)|(pre)))?$'
|
|
||||||
- uses: actions-ecosystem/action-regex-match@v2.0.2
|
|
||||||
if: ${{ inputs.version_call != '' }}
|
|
||||||
id: regex-match-version-call
|
|
||||||
with:
|
|
||||||
text: ${{ inputs.version_call }}
|
|
||||||
regex: '^(\d+.\d+).\d+(?:-(?:(preview\d?)|(pre)))?$'
|
|
||||||
- name: Validate input version
|
|
||||||
if: ${{ steps.regex-match.outputs.match == '' && github.event.inputs.version != '' }}
|
|
||||||
run: |
|
|
||||||
echo "The input version format is not correct, please respect:\
|
|
||||||
major.minor.patch, major.minor.patch-preview or major.minor.patch-preview<number> format. \
|
|
||||||
example: 7.4.3, 7.4.3-preview or 7.4.3-preview1"
|
|
||||||
exit 1
|
|
||||||
- name: Validate input version call
|
|
||||||
if: ${{ inputs.version_call != '' && steps.regex-match-version-call.outputs.match == '' }}
|
|
||||||
run: |
|
|
||||||
echo "The input version format is not correct, please respect:\
|
|
||||||
major.minor.patch, major.minor.patch-preview or major.minor.patch-preview<number> format. \
|
|
||||||
example: 7.4.3, 7.4.3-preview or 7.4.3-preview1"
|
|
||||||
exit 1
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set intermedia variables
|
|
||||||
id: intermedia
|
|
||||||
run: |
|
|
||||||
echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
|
||||||
echo "check_passed=false" >> $GITHUB_OUTPUT
|
|
||||||
echo "branch_name=v${{steps.regex-match.outputs.group1}}" >> $GITHUB_OUTPUT
|
|
||||||
echo "branch_exist=$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Checkout Actions
|
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Update package.json versions
|
||||||
|
uses: ./pkg/build/actions/bump-version
|
||||||
with:
|
with:
|
||||||
repository: "grafana/grafana-github-actions"
|
version: ${{ inputs.version }}
|
||||||
path: ./actions
|
- if: ${{ inputs.push }}
|
||||||
ref: main
|
name: Generate token
|
||||||
# Go is required for also updating the schema versions as part of the precommit hook:
|
|
||||||
- uses: actions/setup-go@v4
|
|
||||||
with:
|
|
||||||
go-version-file: go.mod
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '18'
|
|
||||||
- name: Install Actions
|
|
||||||
run: npm install --production --prefix ./actions
|
|
||||||
- name: "Generate token"
|
|
||||||
id: generate_token
|
id: generate_token
|
||||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||||
- name: Run bump version (manually invoked)
|
- if: ${{ inputs.push }}
|
||||||
uses: ./actions/bump-version
|
name: Push & Create PR
|
||||||
with:
|
run: |
|
||||||
token: ${{ steps.generate_token.outputs.token }}
|
git config --local user.name "github-actions[bot]"
|
||||||
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
precommit_make_target: gen-cue
|
git config --local --add --bool push.autoSetupRemote true
|
||||||
|
git checkout -b "bump-version/${{ github.run_id }}/${{ inputs.version }}"
|
||||||
|
git add .
|
||||||
|
git commit -m "bump version ${{ inputs.version }}"
|
||||||
|
git push
|
||||||
|
gh pr create --dry-run=${{ inputs.dry_run }} -l "type/ci" -l "no-changelog" -B "${{ github.ref_name }}" --title "Release: Bump version to ${{ inputs.version }}" --body "Updated version to ${{ inputs.version }}"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||||
|
23
.github/workflows/release-pr.yml
vendored
23
.github/workflows/release-pr.yml
vendored
@ -22,6 +22,7 @@ on:
|
|||||||
description: Branch to backport these changes to
|
description: Branch to backport these changes to
|
||||||
dry_run:
|
dry_run:
|
||||||
required: false
|
required: false
|
||||||
|
default: false
|
||||||
type: bool
|
type: bool
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -42,21 +43,31 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --local --add --bool push.autoSetupRemote true
|
||||||
- name: Create branch
|
- name: Create branch
|
||||||
run: git checkout -b "release/${{ github.run_id }}/${{ inputs.version }}"
|
run: git checkout -b "release/${{ github.run_id }}/${{ inputs.version }}"
|
||||||
- name: Generate changelog
|
- name: Generate changelog
|
||||||
run: git commit --allow-empty -m "Update changelog placeholder"
|
run: git commit --allow-empty -m "Update changelog placeholder"
|
||||||
- name: Update package.json
|
- name: Update package.json versions
|
||||||
run: git commit --allow-empty -m "Update version in package.json(s) (and yarn install) placeholder"
|
uses: ./pkg/build/actions/bump-version
|
||||||
|
with:
|
||||||
|
version: ${{ inputs.version }}
|
||||||
|
- name: add package.json changes
|
||||||
|
run: |
|
||||||
|
git add .
|
||||||
|
git commit -m "Update version to ${{ inputs.version }}"
|
||||||
|
- name: git push
|
||||||
|
if: ${{ inputs.dry_run }} != true
|
||||||
|
run: git push
|
||||||
- name: Create PR without backports
|
- name: Create PR without backports
|
||||||
if: "${{ github.event.inputs.backport == '' }}"
|
if: "${{ inputs.backport == '' }}"
|
||||||
run: >
|
run: >
|
||||||
gh pr create --dry-run=${{ inputs.dry_run }} -H "release/${{ inputs.version }}" -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
gh pr create --dry-run=${{ inputs.dry_run }} -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||||
- name: Create PR with backports
|
- name: Create PR with backports
|
||||||
if: "${{ github.event.inputs.backport != '' }}"
|
if: "${{ inputs.backport != '' }}"
|
||||||
run: >
|
run: >
|
||||||
gh pr create -l "backport ${{ inputs.backport }}" --dry-run=${{ inputs.dry_run }} -H "release/${{ inputs.version }}" -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
gh pr create -l "backport ${{ inputs.backport }}" -l "product-approved" --dry-run=${{ inputs.dry_run }} -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||||
|
@ -89,7 +89,7 @@ For instructions on how to add a data source to Grafana, refer to the [administr
|
|||||||
Only users with the organization `administrator` role can add data sources and edit existing data sources.
|
Only users with the organization `administrator` role can add data sources and edit existing data sources.
|
||||||
Administrators can also [configure the data source via YAML](#provision-the-data-source) with Grafana's provisioning system.
|
Administrators can also [configure the data source via YAML](#provision-the-data-source) with Grafana's provisioning system.
|
||||||
|
|
||||||
Once you've added the Prometheus data source, you can [configure it](ref:configure-prometheus-data-source) so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor" >}}) when they [build dashboards](ref:build-dashboards), use [Explore](ref:explore), and [annotate visualizations][annotate visualizations].
|
Once you've added the Prometheus data source, you can [configure it](ref:configure-prometheus-data-source) so that your Grafana instance's users can create queries in its [query editor]({{< relref "./query-editor" >}}) when they [build dashboards](ref:build-dashboards), use [Explore](ref:explore), and [annotate visualizations](ref:annotate-visualizations).
|
||||||
|
|
||||||
The following guides will help you get started with the Prometheus data source:
|
The following guides will help you get started with the Prometheus data source:
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ We also bundle a dashboard within Grafana so you can start viewing your metrics
|
|||||||
|
|
||||||
**To import the bundled dashboard:**
|
**To import the bundled dashboard:**
|
||||||
|
|
||||||
1. Navigate to the data source's [configuration page](#configure-the-data-source).
|
1. Navigate to the data source's [configuration page](ref:configure-prometheus-data-source).
|
||||||
1. Select the **Dashboards** tab.
|
1. Select the **Dashboards** tab.
|
||||||
|
|
||||||
This displays dashboards for Grafana and Prometheus.
|
This displays dashboards for Grafana and Prometheus.
|
||||||
|
9
go.mod
9
go.mod
@ -149,7 +149,7 @@ require (
|
|||||||
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf // @grafana/grafana-backend-group
|
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf // @grafana/grafana-backend-group
|
||||||
github.com/ua-parser/uap-go v0.0.0-20211112212520-00c877edfe0f // @grafana/grafana-backend-group
|
github.com/ua-parser/uap-go v0.0.0-20211112212520-00c877edfe0f // @grafana/grafana-backend-group
|
||||||
github.com/urfave/cli v1.22.15 // indirect; @grafana/grafana-backend-group
|
github.com/urfave/cli v1.22.15 // indirect; @grafana/grafana-backend-group
|
||||||
github.com/urfave/cli/v2 v2.25.1 // @grafana/grafana-backend-group
|
github.com/urfave/cli/v2 v2.27.1 // @grafana/grafana-backend-group
|
||||||
github.com/wk8/go-ordered-map v1.0.0 // @grafana/grafana-backend-group
|
github.com/wk8/go-ordered-map v1.0.0 // @grafana/grafana-backend-group
|
||||||
github.com/xlab/treeprint v1.2.0 // @grafana/observability-traces-and-profiling
|
github.com/xlab/treeprint v1.2.0 // @grafana/observability-traces-and-profiling
|
||||||
github.com/yudai/gojsondiff v1.0.0 // @grafana/grafana-backend-group
|
github.com/yudai/gojsondiff v1.0.0 // @grafana/grafana-backend-group
|
||||||
@ -299,6 +299,7 @@ require (
|
|||||||
github.com/google/gofuzz v1.2.0 // indirect
|
github.com/google/gofuzz v1.2.0 // indirect
|
||||||
github.com/google/s2a-go v0.1.7 // indirect
|
github.com/google/s2a-go v0.1.7 // indirect
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||||
|
github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620152449-c88de7f4d073 // @grafana/grafana-search-and-storage
|
||||||
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db // indirect
|
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db // indirect
|
||||||
github.com/grafana/sqlds/v3 v3.2.0 // indirect
|
github.com/grafana/sqlds/v3 v3.2.0 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340 // indirect; @grafana/plugins-platform-backend
|
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20191002090509-6af20e3a5340 // indirect; @grafana/plugins-platform-backend
|
||||||
@ -381,7 +382,7 @@ require (
|
|||||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
|
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
|
||||||
github.com/segmentio/asm v1.2.0 // indirect
|
github.com/segmentio/asm v1.2.0 // indirect
|
||||||
github.com/segmentio/encoding v0.3.6 // indirect
|
github.com/segmentio/encoding v0.3.6 // indirect
|
||||||
github.com/sergi/go-diff v1.3.1 // indirect
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||||
github.com/shopspring/decimal v1.3.1 // indirect
|
github.com/shopspring/decimal v1.3.1 // indirect
|
||||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
||||||
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
|
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
|
||||||
@ -410,7 +411,7 @@ require (
|
|||||||
go.opentelemetry.io/otel/metric v1.26.0 // indirect
|
go.opentelemetry.io/otel/metric v1.26.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
|
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
|
||||||
go.uber.org/multierr v1.11.0 // indirect
|
go.uber.org/multierr v1.11.0 // indirect
|
||||||
go.uber.org/zap v1.27.0
|
go.uber.org/zap v1.27.0 // @grafana/identity-access-team
|
||||||
golang.org/x/sys v0.21.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
golang.org/x/term v0.21.0 // indirect
|
golang.org/x/term v0.21.0 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
|
||||||
@ -434,8 +435,6 @@ require (
|
|||||||
sigs.k8s.io/yaml v1.4.0 // indirect; @grafana-app-platform-squad
|
sigs.k8s.io/yaml v1.4.0 // indirect; @grafana-app-platform-squad
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620135321-10b6011dd787
|
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Masterminds/squirrel v1.5.4 // indirect
|
github.com/Masterminds/squirrel v1.5.4 // indirect
|
||||||
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
|
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
|
||||||
|
12
go.sum
12
go.sum
@ -2334,8 +2334,8 @@ github.com/grafana/grafana/pkg/apiserver v0.0.0-20240226124929-648abdbd0ea4 h1:t
|
|||||||
github.com/grafana/grafana/pkg/apiserver v0.0.0-20240226124929-648abdbd0ea4/go.mod h1:vpYI6DHvFO595rpQGooUjcyicjt9rOevldDdW79peV0=
|
github.com/grafana/grafana/pkg/apiserver v0.0.0-20240226124929-648abdbd0ea4/go.mod h1:vpYI6DHvFO595rpQGooUjcyicjt9rOevldDdW79peV0=
|
||||||
github.com/grafana/grafana/pkg/promlib v0.0.6 h1:FuRyHMIgVVXkLuJnCflNfk3gqJflmyiI+/ZuJ9MoAfY=
|
github.com/grafana/grafana/pkg/promlib v0.0.6 h1:FuRyHMIgVVXkLuJnCflNfk3gqJflmyiI+/ZuJ9MoAfY=
|
||||||
github.com/grafana/grafana/pkg/promlib v0.0.6/go.mod h1:shFkrG1fQ/PPNRGhxAPNMLp0SAeG/jhqaLoG6n2191M=
|
github.com/grafana/grafana/pkg/promlib v0.0.6/go.mod h1:shFkrG1fQ/PPNRGhxAPNMLp0SAeG/jhqaLoG6n2191M=
|
||||||
github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620135321-10b6011dd787 h1:hWkuJda3RC3EC45GfYArB6CweHSJ7efsrJOu1db1dsE=
|
github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620152449-c88de7f4d073 h1:Au8+1QORZnMVo52+19dgkP4zzIlXyJ7x/d9ysSGQHOk=
|
||||||
github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620135321-10b6011dd787/go.mod h1:zOInHv2y6bsgm9bIMsCVDaz1XylqIVX9r4amH4iuWPE=
|
github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620152449-c88de7f4d073/go.mod h1:zOInHv2y6bsgm9bIMsCVDaz1XylqIVX9r4amH4iuWPE=
|
||||||
github.com/grafana/grafana/pkg/util/xorm v0.0.1 h1:72QZjxWIWpSeOF8ob4aMV058kfgZyeetkAB8dmeti2o=
|
github.com/grafana/grafana/pkg/util/xorm v0.0.1 h1:72QZjxWIWpSeOF8ob4aMV058kfgZyeetkAB8dmeti2o=
|
||||||
github.com/grafana/grafana/pkg/util/xorm v0.0.1/go.mod h1:eNfbB9f2jM8o9RfwqwjY8SYm5tvowJ8Ly+iE4P9rXII=
|
github.com/grafana/grafana/pkg/util/xorm v0.0.1/go.mod h1:eNfbB9f2jM8o9RfwqwjY8SYm5tvowJ8Ly+iE4P9rXII=
|
||||||
github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8=
|
github.com/grafana/otel-profiling-go v0.5.1 h1:stVPKAFZSa7eGiqbYuG25VcqYksR6iWvF3YH66t4qL8=
|
||||||
@ -3146,8 +3146,8 @@ github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
|
|||||||
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
|
||||||
github.com/segmentio/encoding v0.3.6 h1:E6lVLyDPseWEulBmCmAKPanDd3jiyGDo5gMcugCRwZQ=
|
github.com/segmentio/encoding v0.3.6 h1:E6lVLyDPseWEulBmCmAKPanDd3jiyGDo5gMcugCRwZQ=
|
||||||
github.com/segmentio/encoding v0.3.6/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM=
|
github.com/segmentio/encoding v0.3.6/go.mod h1:n0JeuIqEQrQoPDGsjo8UNd1iA0U8d8+oHAA4E3G3OxM=
|
||||||
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
||||||
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
||||||
github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec=
|
github.com/sethvargo/go-retry v0.2.4 h1:T+jHEQy/zKJf5s95UkguisicE0zuF9y7+/vgz08Ocec=
|
||||||
github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw=
|
github.com/sethvargo/go-retry v0.2.4/go.mod h1:1afjQuvh7s4gflMObvjLPaWgluLLyhA1wmVZ6KLpICw=
|
||||||
github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
|
github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
|
||||||
@ -3292,8 +3292,8 @@ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijb
|
|||||||
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||||
github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM=
|
github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM=
|
||||||
github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0=
|
github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0=
|
||||||
github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw=
|
github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
|
||||||
github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
|
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/vburenin/ifacemaker v1.2.1/go.mod h1:5WqrzX2aD7/hi+okBjcaEQJMg4lDGrpuEX3B8L4Wgrs=
|
github.com/vburenin/ifacemaker v1.2.1/go.mod h1:5WqrzX2aD7/hi+okBjcaEQJMg4lDGrpuEX3B8L4Wgrs=
|
||||||
|
11
go.work.sum
11
go.work.sum
@ -450,6 +450,7 @@ github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:m
|
|||||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
|
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
|
||||||
github.com/OneOfOne/xxhash v1.2.6 h1:U68crOE3y3MPttCMQGywZOLrTeF5HHJ3/vDBCJn9/bA=
|
github.com/OneOfOne/xxhash v1.2.6 h1:U68crOE3y3MPttCMQGywZOLrTeF5HHJ3/vDBCJn9/bA=
|
||||||
github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
|
github.com/OneOfOne/xxhash v1.2.6/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
|
||||||
|
github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
|
||||||
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||||
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
|
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
|
||||||
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
|
||||||
@ -468,6 +469,7 @@ github.com/Shopify/sarama v1.38.1/go.mod h1:iwv9a67Ha8VNa+TifujYoWGxWnu2kNVAQdSd
|
|||||||
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
|
github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=
|
||||||
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
|
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
|
||||||
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=
|
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 h1:rFw4nCn9iMW+Vajsk51NtYIcwSTkXr+JGrMd36kTDJw=
|
||||||
|
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
|
||||||
github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9 h1:7kQgkwGRoLzC9K0oyXdJo7nve/bynv/KwUsxbiTlzAM=
|
github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9 h1:7kQgkwGRoLzC9K0oyXdJo7nve/bynv/KwUsxbiTlzAM=
|
||||||
github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19 h1:iXUgAaqDcIUGbRoy2TdeofRG/j1zpGRSEmNK05T+bi8=
|
github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19 h1:iXUgAaqDcIUGbRoy2TdeofRG/j1zpGRSEmNK05T+bi8=
|
||||||
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
|
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b h1:slYM766cy2nI3BwyRiyQj/Ud48djTMtMebDqepE95rw=
|
||||||
@ -478,10 +480,13 @@ github.com/alecthomas/kong v0.2.11/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QL
|
|||||||
github.com/alecthomas/participle/v2 v2.1.0 h1:z7dElHRrOEEq45F2TG5cbQihMtNTv8vwldytDj7Wrz4=
|
github.com/alecthomas/participle/v2 v2.1.0 h1:z7dElHRrOEEq45F2TG5cbQihMtNTv8vwldytDj7Wrz4=
|
||||||
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
|
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
|
||||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
|
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
|
||||||
|
github.com/alexflint/go-arg v1.4.2/go.mod h1:9iRbDxne7LcR/GSvEr7ma++GLpdIU1zrghf2y2768kM=
|
||||||
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
|
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0=
|
||||||
github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk=
|
github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk=
|
||||||
|
github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxjy3MxYW0gjYw=
|
||||||
github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j82Yjf3KFv7ApYzUI=
|
github.com/alicebob/miniredis v2.5.0+incompatible h1:yBHoLpsyjupjz3NL3MhKMVkR41j82Yjf3KFv7ApYzUI=
|
||||||
github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
|
github.com/alicebob/miniredis v2.5.0+incompatible/go.mod h1:8HZjEj4yU0dwhYHky+DxYx+6BMjkBbe5ONFIF1MXffk=
|
||||||
|
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
|
||||||
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
|
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
|
||||||
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
|
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
|
||||||
github.com/apache/arrow/go/v10 v10.0.1 h1:n9dERvixoC/1JjDmBcs9FPaEryoANa2sCgVFo6ez9cI=
|
github.com/apache/arrow/go/v10 v10.0.1 h1:n9dERvixoC/1JjDmBcs9FPaEryoANa2sCgVFo6ez9cI=
|
||||||
@ -517,6 +522,7 @@ github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb
|
|||||||
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||||
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
|
||||||
github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs=
|
github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs=
|
||||||
|
github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0=
|
||||||
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
|
github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk=
|
||||||
github.com/bufbuild/protovalidate-go v0.2.1 h1:pJr07sYhliyfj/STAM7hU4J3FKpVeLVKvOBmOTN8j+s=
|
github.com/bufbuild/protovalidate-go v0.2.1 h1:pJr07sYhliyfj/STAM7hU4J3FKpVeLVKvOBmOTN8j+s=
|
||||||
github.com/bufbuild/protovalidate-go v0.2.1/go.mod h1:e7XXDtlxj5vlEyAgsrxpzayp4cEMKCSSb8ZCkin+MVA=
|
github.com/bufbuild/protovalidate-go v0.2.1/go.mod h1:e7XXDtlxj5vlEyAgsrxpzayp4cEMKCSSb8ZCkin+MVA=
|
||||||
@ -944,6 +950,7 @@ github.com/grafana/grafana-plugin-sdk-go v0.231.1-0.20240523124942-62dae9836284/
|
|||||||
github.com/grafana/grafana-plugin-sdk-go v0.234.0/go.mod h1:FlXjmBESxaD6Hoi8ojWLkH007nyjtJM3XC8SpwzF/YE=
|
github.com/grafana/grafana-plugin-sdk-go v0.234.0/go.mod h1:FlXjmBESxaD6Hoi8ojWLkH007nyjtJM3XC8SpwzF/YE=
|
||||||
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240613114114-5e2f08de316d/go.mod h1:adT8O7k6ZSzUKjAC4WS6VfWlCE4G1VavPwSXVhvScCs=
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240613114114-5e2f08de316d/go.mod h1:adT8O7k6ZSzUKjAC4WS6VfWlCE4G1VavPwSXVhvScCs=
|
||||||
github.com/grafana/grafana/pkg/promlib v0.0.3/go.mod h1:3El4NlsfALz8QQCbEGHGFvJUG+538QLMuALRhZ3pcoo=
|
github.com/grafana/grafana/pkg/promlib v0.0.3/go.mod h1:3El4NlsfALz8QQCbEGHGFvJUG+538QLMuALRhZ3pcoo=
|
||||||
|
github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20240620135321-10b6011dd787/go.mod h1:zOInHv2y6bsgm9bIMsCVDaz1XylqIVX9r4amH4iuWPE=
|
||||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
|
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||||
@ -1052,6 +1059,7 @@ github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIR
|
|||||||
github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA=
|
github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA=
|
||||||
github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw=
|
github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw=
|
||||||
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
|
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
|
||||||
|
github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM=
|
||||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||||
github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=
|
github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY=
|
||||||
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
|
github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=
|
||||||
@ -1089,6 +1097,7 @@ github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmt
|
|||||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743 h1:143Bb8f8DuGWck/xpNUOckBVYfFbBTnLevfRZ1aVVqo=
|
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743 h1:143Bb8f8DuGWck/xpNUOckBVYfFbBTnLevfRZ1aVVqo=
|
||||||
github.com/lightstep/lightstep-tracer-go v0.18.1 h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk=
|
github.com/lightstep/lightstep-tracer-go v0.18.1 h1:vi1F1IQ8N7hNWytK9DpJsUfQhGuNSc19z330K6vl4zk=
|
||||||
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo=
|
||||||
|
github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc=
|
||||||
github.com/lyft/protoc-gen-star v0.6.1 h1:erE0rdztuaDq3bpGifD95wfoPrSZc95nGA6tbiNYh6M=
|
github.com/lyft/protoc-gen-star v0.6.1 h1:erE0rdztuaDq3bpGifD95wfoPrSZc95nGA6tbiNYh6M=
|
||||||
github.com/lyft/protoc-gen-star/v2 v2.0.3 h1:/3+/2sWyXeMLzKd1bX+ixWKgEMsULrIivpDsuaF441o=
|
github.com/lyft/protoc-gen-star/v2 v2.0.3 h1:/3+/2sWyXeMLzKd1bX+ixWKgEMsULrIivpDsuaF441o=
|
||||||
github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA=
|
github.com/lyft/protoc-gen-validate v0.0.13 h1:KNt/RhmQTOLr7Aj8PsJ7mTronaFyx80mRTT9qF261dA=
|
||||||
@ -1106,6 +1115,7 @@ github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI=
|
|||||||
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
||||||
github.com/matryer/moq v0.3.1 h1:kLDiBJoGcusWS2BixGyTkF224aSCD8nLY24tj/NcTCs=
|
github.com/matryer/moq v0.3.1 h1:kLDiBJoGcusWS2BixGyTkF224aSCD8nLY24tj/NcTCs=
|
||||||
github.com/matryer/moq v0.3.1/go.mod h1:RJ75ZZZD71hejp39j4crZLsEDszGk6iH4v4YsWFKH4s=
|
github.com/matryer/moq v0.3.1/go.mod h1:RJ75ZZZD71hejp39j4crZLsEDszGk6iH4v4YsWFKH4s=
|
||||||
|
github.com/matryer/moq v0.3.3/go.mod h1:RJ75ZZZD71hejp39j4crZLsEDszGk6iH4v4YsWFKH4s=
|
||||||
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
|
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
|
||||||
github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
|
github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
|
||||||
github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
|
github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o=
|
||||||
@ -1718,7 +1728,6 @@ k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8
|
|||||||
k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||||
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks=
|
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks=
|
||||||
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
|
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
|
||||||
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
|
|
||||||
k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
|
||||||
k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
|
k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
|
||||||
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
|
||||||
|
@ -197,4 +197,5 @@ export interface FeatureToggles {
|
|||||||
failWrongDSUID?: boolean;
|
failWrongDSUID?: boolean;
|
||||||
databaseReadReplica?: boolean;
|
databaseReadReplica?: boolean;
|
||||||
zanzana?: boolean;
|
zanzana?: boolean;
|
||||||
|
passScopeToDashboardApi?: boolean;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ require (
|
|||||||
k8s.io/apiserver v0.29.2
|
k8s.io/apiserver v0.29.2
|
||||||
k8s.io/client-go v0.29.3
|
k8s.io/client-go v0.29.3
|
||||||
k8s.io/component-base v0.29.2
|
k8s.io/component-base v0.29.2
|
||||||
|
k8s.io/klog v1.0.0
|
||||||
k8s.io/klog/v2 v2.120.1
|
k8s.io/klog/v2 v2.120.1
|
||||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
|
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
|
||||||
)
|
)
|
||||||
|
@ -440,6 +440,7 @@ k8s.io/apiserver v0.29.2/go.mod h1:B0LieKVoyU7ykQvPFm7XSdIHaCHSzCzQWPFa5bqbeMQ=
|
|||||||
k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg=
|
k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg=
|
||||||
k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8=
|
k8s.io/component-base v0.29.2 h1:lpiLyuvPA9yV1aQwGLENYyK7n/8t6l3nn3zAtFTJYe8=
|
||||||
k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM=
|
k8s.io/component-base v0.29.2/go.mod h1:BfB3SLrefbZXiBfbM+2H1dlat21Uewg/5qtKOl8degM=
|
||||||
|
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
|
||||||
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
|
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
|
||||||
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
|
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
|
||||||
|
35
pkg/build/actions/bump-version/action.yml
Normal file
35
pkg/build/actions/bump-version/action.yml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
name: Bump version
|
||||||
|
description: Updates package.json versions in Grafana and subpackages and regenerates schemas
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: The new version (ex. 1.2.3)
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: actions-ecosystem/action-regex-match@v2.0.2
|
||||||
|
if: ${{ github.event.inputs.version != '' }}
|
||||||
|
id: regex-match
|
||||||
|
with:
|
||||||
|
text: ${{ github.event.inputs.version }}
|
||||||
|
# https://semver.org/
|
||||||
|
regex: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'
|
||||||
|
- name: Validate input version
|
||||||
|
if: ${{ steps.regex-match.outputs.match == '' && github.event.inputs.version != '' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "The input version format is not correct, please respect:\
|
||||||
|
major.minor.patch, major.minor.patch-preview or major.minor.patch-preview<number> format. \
|
||||||
|
example: 7.4.3, 7.4.3-preview or 7.4.3-preview1"
|
||||||
|
exit 1
|
||||||
|
- uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version-file: go.mod
|
||||||
|
- name: Bump versions
|
||||||
|
uses: dagger/dagger-for-github@v5
|
||||||
|
with:
|
||||||
|
verb: run
|
||||||
|
args: go run ./pkg/build/actions/bump-version -version=${{ inputs.version }}
|
||||||
|
- name: make gen-cue
|
||||||
|
shell: bash
|
||||||
|
run: make gen-cue
|
77
pkg/build/actions/bump-version/main.go
Normal file
77
pkg/build/actions/bump-version/main.go
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var (
|
||||||
|
dir = flag.String("dir", ".", "The grafana directory")
|
||||||
|
version = flag.String("version", "", "Use the '-version' flag to manually set the version")
|
||||||
|
ctx = context.Background()
|
||||||
|
)
|
||||||
|
flag.Parse()
|
||||||
|
if *version == "" {
|
||||||
|
log.Fatalln("-version must be set")
|
||||||
|
}
|
||||||
|
|
||||||
|
d, err := dagger.Connect(ctx)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
src := d.Host().Directory(filepath.Clean(*dir), dagger.HostDirectoryOpts{
|
||||||
|
Include: []string{
|
||||||
|
".nvmrc",
|
||||||
|
".yarn",
|
||||||
|
".yarnrc.yml",
|
||||||
|
"nx.json",
|
||||||
|
"project.json",
|
||||||
|
"lerna.json",
|
||||||
|
"**/package.json",
|
||||||
|
"**/yarn.lock",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
nodeVersion, err := NodeVersion(d, src).Stdout(ctx)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln("error getting node version from '.nvmrc':", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update version(s)
|
||||||
|
updated := WithUpdatedVersion(d, src, nodeVersion, *version)
|
||||||
|
log.Println("Exporting directory")
|
||||||
|
if _, err := updated.Export(ctx, filepath.Clean(*dir)); err != nil {
|
||||||
|
log.Fatalln("error exporting directory", err)
|
||||||
|
}
|
||||||
|
log.Println("Done exporting directory")
|
||||||
|
}
|
||||||
|
|
||||||
|
// NodeVersion a container whose `stdout` will return the node version from the '.nvmrc' file in the directory 'src'.
|
||||||
|
func NodeVersion(d *dagger.Client, src *dagger.Directory) *dagger.Container {
|
||||||
|
return d.Container().From("alpine").
|
||||||
|
WithMountedFile("/src/.nvmrc", src.File(".nvmrc")).
|
||||||
|
WithWorkdir("/src").
|
||||||
|
WithExec([]string{"cat", ".nvmrc"})
|
||||||
|
}
|
||||||
|
|
||||||
|
func WithUpdatedVersion(d *dagger.Client, src *dagger.Directory, nodeVersion, version string) *dagger.Directory {
|
||||||
|
nodeVersion = strings.TrimPrefix(strings.TrimSpace(nodeVersion), "v")
|
||||||
|
image := fmt.Sprintf("node:%s-slim", nodeVersion)
|
||||||
|
|
||||||
|
return d.Container().From(image).
|
||||||
|
WithDirectory("/src", src).
|
||||||
|
WithWorkdir("/src").
|
||||||
|
WithExec([]string{"yarn", "install"}).
|
||||||
|
WithExec([]string{"npm", "version", version, "--no-git-tag-version"}).
|
||||||
|
WithExec([]string{"yarn", "run", "lerna", "version", version, "--no-push", "--no-git-tag-version", "--force-publish", "--exact", "--yes"}).
|
||||||
|
WithExec([]string{"yarn", "install"}).
|
||||||
|
Directory("/src").
|
||||||
|
WithoutDirectory("node_modules")
|
||||||
|
}
|
@ -35,7 +35,7 @@ require (
|
|||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect; @grafana/grafana-backend-group
|
github.com/jmespath/go-jmespath v0.4.0 // indirect; @grafana/grafana-backend-group
|
||||||
github.com/stretchr/testify v1.9.0 // @grafana/grafana-backend-group
|
github.com/stretchr/testify v1.9.0 // @grafana/grafana-backend-group
|
||||||
github.com/urfave/cli v1.22.15 // @grafana/grafana-backend-group
|
github.com/urfave/cli v1.22.15 // @grafana/grafana-backend-group
|
||||||
github.com/urfave/cli/v2 v2.25.1 // @grafana/grafana-backend-group
|
github.com/urfave/cli/v2 v2.27.1 // @grafana/grafana-backend-group
|
||||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect; @grafana/plugins-platform-backend
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect; @grafana/plugins-platform-backend
|
||||||
go.opentelemetry.io/otel v1.26.0 // indirect; @grafana/grafana-backend-group
|
go.opentelemetry.io/otel v1.26.0 // indirect; @grafana/grafana-backend-group
|
||||||
go.opentelemetry.io/otel/sdk v1.26.0 // indirect; @grafana/grafana-backend-group
|
go.opentelemetry.io/otel/sdk v1.26.0 // indirect; @grafana/grafana-backend-group
|
||||||
@ -97,12 +97,28 @@ require (
|
|||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
require dagger.io/dagger v0.11.8-rc.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/99designs/gqlgen v0.17.44 // indirect
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
|
||||||
github.com/kr/pretty v0.3.1 // indirect
|
github.com/Khan/genqlient v0.7.0 // indirect
|
||||||
|
github.com/adrg/xdg v0.4.0 // indirect
|
||||||
|
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||||
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||||
github.com/moby/term v0.5.0 // indirect
|
github.com/moby/term v0.5.0 // indirect
|
||||||
github.com/rogpeppe/go-internal v1.12.0 // indirect
|
github.com/sosodev/duration v1.2.0 // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
github.com/vektah/gqlparser/v2 v2.5.11 // indirect
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240518090000-14441aefdf88 // indirect
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.2.0-alpha // indirect
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect
|
||||||
|
go.opentelemetry.io/otel/log v0.2.0-alpha // indirect
|
||||||
|
go.opentelemetry.io/otel/sdk/log v0.2.0-alpha // indirect
|
||||||
|
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
|
||||||
|
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
|
||||||
gotest.tools/v3 v3.5.1 // indirect
|
gotest.tools/v3 v3.5.1 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,19 +11,29 @@ cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc=
|
|||||||
cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI=
|
cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI=
|
||||||
cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg=
|
cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg=
|
||||||
cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY=
|
cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY=
|
||||||
|
dagger.io/dagger v0.11.8-rc.2 h1:HCP3gXgAfJJBFitJm0jRdKWJsIKgSWNmVN9UV+CkOdk=
|
||||||
|
dagger.io/dagger v0.11.8-rc.2/go.mod h1:kIzxLfN8N8FXUCN9u5EHLBJUJMJm0t6XynecUzp0A5w=
|
||||||
github.com/99designs/basicauth-go v0.0.0-20160802081356-2a93ba0f464d/go.mod h1:3cARGAK9CfW3HoxCy1a0G4TKrdiKke8ftOMEOHyySYs=
|
github.com/99designs/basicauth-go v0.0.0-20160802081356-2a93ba0f464d/go.mod h1:3cARGAK9CfW3HoxCy1a0G4TKrdiKke8ftOMEOHyySYs=
|
||||||
|
github.com/99designs/gqlgen v0.17.44 h1:OS2wLk/67Y+vXM75XHbwRnNYJcbuJd4OBL76RX3NQQA=
|
||||||
|
github.com/99designs/gqlgen v0.17.44/go.mod h1:UTCu3xpK2mLI5qcMNw+HKDiEL77it/1XtAjisC4sLwM=
|
||||||
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY=
|
github.com/99designs/httpsignatures-go v0.0.0-20170731043157-88528bf4ca7e/go.mod h1:Xa6lInWHNQnuWoF0YPSsx+INFA9qk7/7pTjwb3PInkY=
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
|
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||||
|
github.com/Khan/genqlient v0.7.0 h1:GZ1meyRnzcDTK48EjqB8t3bcfYvHArCUUvgOwpz1D4w=
|
||||||
|
github.com/Khan/genqlient v0.7.0/go.mod h1:HNyy3wZvuYwmW3Y7mkoQLZsa/R5n5yIRajS1kPBvSFM=
|
||||||
github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
|
github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
|
||||||
github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
|
github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
|
||||||
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
|
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
|
||||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
||||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
||||||
|
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
|
||||||
|
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
|
||||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
|
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ=
|
||||||
|
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
|
||||||
github.com/aws/aws-sdk-go v1.51.31 h1:4TM+sNc+Dzs7wY1sJ0+J8i60c6rkgnKP1pvPx8ghsSY=
|
github.com/aws/aws-sdk-go v1.51.31 h1:4TM+sNc+Dzs7wY1sJ0+J8i60c6rkgnKP1pvPx8ghsSY=
|
||||||
github.com/aws/aws-sdk-go v1.51.31/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
|
github.com/aws/aws-sdk-go v1.51.31/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
|
||||||
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
||||||
@ -32,6 +42,8 @@ github.com/bmatcuk/doublestar v1.1.1 h1:YroD6BJCZBYx06yYFEWvUuKVWQn3vLLQAVmDmvTS
|
|||||||
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
|
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
|
||||||
github.com/buildkite/yaml v2.1.0+incompatible h1:xirI+ql5GzfikVNDmt+yeiXpf/v1Gt03qXTtT5WXdr8=
|
github.com/buildkite/yaml v2.1.0+incompatible h1:xirI+ql5GzfikVNDmt+yeiXpf/v1Gt03qXTtT5WXdr8=
|
||||||
github.com/buildkite/yaml v2.1.0+incompatible/go.mod h1:UoU8vbcwu1+vjZq01+KrpSeLBgQQIjL/H7Y6KwikUrI=
|
github.com/buildkite/yaml v2.1.0+incompatible/go.mod h1:UoU8vbcwu1+vjZq01+KrpSeLBgQQIjL/H7Y6KwikUrI=
|
||||||
|
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||||
|
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||||
@ -42,7 +54,6 @@ github.com/containerd/containerd v1.3.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMX
|
|||||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
|
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
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.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 h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
@ -130,6 +141,8 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksP
|
|||||||
github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA=
|
github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA=
|
||||||
github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4=
|
github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4=
|
||||||
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||||
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
|
||||||
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
|
||||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||||
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||||
@ -142,7 +155,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI
|
|||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
@ -150,6 +162,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/moby/moby v23.0.4+incompatible h1:A/pe8vi9KIKhNbzR0G3wW4ACKDsMgXILBveMqiJNa8M=
|
github.com/moby/moby v23.0.4+incompatible h1:A/pe8vi9KIKhNbzR0G3wW4ACKDsMgXILBveMqiJNa8M=
|
||||||
github.com/moby/moby v23.0.4+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc=
|
github.com/moby/moby v23.0.4+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc=
|
||||||
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
|
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
|
||||||
@ -161,7 +175,6 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
|
|||||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||||
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
|
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
|
||||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
@ -169,12 +182,15 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
|||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
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/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
|
||||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
|
||||||
|
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
|
||||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||||
|
github.com/sosodev/duration v1.2.0 h1:pqK/FLSjsAADWY74SyWDCjOcd5l7H8GSnnOGEB9A1Us=
|
||||||
|
github.com/sosodev/duration v1.2.0/go.mod h1:RQIBBX0+fMLc/D9+Jb/fwvVmo0eZvDDEERAikUR6SDg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
@ -190,8 +206,10 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
|
|||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM=
|
github.com/urfave/cli v1.22.15 h1:nuqt+pdC/KqswQKhETJjo7pvn/k4xMUxgW6liI7XpnM=
|
||||||
github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0=
|
github.com/urfave/cli v1.22.15/go.mod h1:wSan1hmo5zeyLGBjRJbzRTNk8gwoYa2B9n4q9dmRIc0=
|
||||||
github.com/urfave/cli/v2 v2.25.1 h1:zw8dSP7ghX0Gmm8vugrs6q9Ku0wzweqPyshy+syu9Gw=
|
github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
|
||||||
github.com/urfave/cli/v2 v2.25.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc=
|
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
||||||
|
github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8=
|
||||||
|
github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
@ -204,14 +222,31 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0
|
|||||||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc=
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0/go.mod h1:vy+2G/6NvVMpwGX/NyLqcC41fxepnuKHk16E6IZUcJc=
|
||||||
go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs=
|
go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs=
|
||||||
go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4=
|
go.opentelemetry.io/otel v1.26.0/go.mod h1:UmLkJHUAidDval2EICqBMbnAd0/m2vmpf/dAM+fvFs4=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240518090000-14441aefdf88 h1:oM0GTNKGlc5qHctWeIGTVyda4iFFalOzMZ3Ehj5rwB4=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240518090000-14441aefdf88/go.mod h1:JGG8ebaMO5nXOPnvKEl+DiA4MGwFjCbjsxT1WHIEBPY=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.2.0-alpha h1:z2s6Zba+OUyayRv5m1AXWNUTGh57K1iMhy6emU5QT5Y=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.2.0-alpha/go.mod h1:paOXXyUgPW6jYxYkP0pB47H2zHE1fPvMJ4E4G9LHOi0=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 h1:1u/AyyOqAWzy+SkPxDpahCNZParHV8Vid1RnI2clyDE=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0/go.mod h1:z46paqbJ9l7c9fIPCXTqTGwhQZ5XoTIsfeFYWboizjs=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 h1:Waw9Wfpo/IXzOI8bCB7DIk+0JZcqqsyn1JFnAc+iam8=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 h1:1wp/gyxsuYtuE/JFxsQRtcCDtMrO2qMvlfXALU5wkzI=
|
||||||
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0/go.mod h1:gbTHmghkGgqxMomVQQMur1Nba4M0MQ8AYThXDUjsJ38=
|
||||||
|
go.opentelemetry.io/otel/log v0.2.0-alpha h1:ixOPvMzserpqA07SENHvRzkZOsnG0XbPr74hv1AQ+n0=
|
||||||
|
go.opentelemetry.io/otel/log v0.2.0-alpha/go.mod h1:vbFZc65yq4c4ssvXY43y/nIqkNJLxORrqw0L85P59LA=
|
||||||
go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30=
|
go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30=
|
||||||
go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4=
|
go.opentelemetry.io/otel/metric v1.26.0/go.mod h1:SY+rHOI4cEawI9a7N1A4nIg/nTQXe1ccCNWYOJUrpX4=
|
||||||
go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8=
|
go.opentelemetry.io/otel/sdk v1.26.0 h1:Y7bumHf5tAiDlRYFmGqetNcLaVUZmh4iYfmGxtmz7F8=
|
||||||
go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs=
|
go.opentelemetry.io/otel/sdk v1.26.0/go.mod h1:0p8MXpqLeJ0pzcszQQN4F0S5FVjBLgypeGSngLsmirs=
|
||||||
|
go.opentelemetry.io/otel/sdk/log v0.2.0-alpha h1:jGTkL/jroJ31jnP6jDl34N/mDOfRGGYZHcHsCM+5kWA=
|
||||||
|
go.opentelemetry.io/otel/sdk/log v0.2.0-alpha/go.mod h1:Hd8Lw9FPGUM3pfY7iGMRvFaC2Nyau4Ajb5WnQ9OdIho=
|
||||||
go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA=
|
go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA=
|
||||||
go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
|
go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZuWCBllGV2U2y0=
|
||||||
|
go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94=
|
||||||
|
go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A=
|
||||||
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY=
|
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca h1:VdD38733bfYv5tUZwEIskMM93VanwNIi5bIKnDrJdEY=
|
||||||
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
|
go.starlark.net v0.0.0-20230525235612-a134d8f9ddca/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds=
|
||||||
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
@ -219,6 +254,7 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
|
|||||||
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
||||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||||
@ -254,6 +290,7 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
|
@ -19,7 +19,7 @@ const (
|
|||||||
StorageTypeLegacy StorageType = "legacy"
|
StorageTypeLegacy StorageType = "legacy"
|
||||||
StorageTypeUnified StorageType = "unified"
|
StorageTypeUnified StorageType = "unified"
|
||||||
StorageTypeUnifiedGrpc StorageType = "unified-grpc"
|
StorageTypeUnifiedGrpc StorageType = "unified-grpc"
|
||||||
StorageTypeUnifiedExp StorageType = "unified-exp"
|
StorageTypeUnifiedNext StorageType = "unified-next"
|
||||||
)
|
)
|
||||||
|
|
||||||
type StorageOptions struct {
|
type StorageOptions struct {
|
||||||
@ -45,10 +45,10 @@ func (o *StorageOptions) AddFlags(fs *pflag.FlagSet) {
|
|||||||
func (o *StorageOptions) Validate() []error {
|
func (o *StorageOptions) Validate() []error {
|
||||||
errs := []error{}
|
errs := []error{}
|
||||||
switch o.StorageType {
|
switch o.StorageType {
|
||||||
case StorageTypeFile, StorageTypeEtcd, StorageTypeLegacy, StorageTypeUnified, StorageTypeUnifiedGrpc, StorageTypeUnifiedExp:
|
case StorageTypeFile, StorageTypeEtcd, StorageTypeLegacy, StorageTypeUnified, StorageTypeUnifiedGrpc, StorageTypeUnifiedNext:
|
||||||
// no-op
|
// no-op
|
||||||
default:
|
default:
|
||||||
errs = append(errs, fmt.Errorf("--grafana-apiserver-storage-type must be one of %s, %s, %s, %s, %s, %s", StorageTypeFile, StorageTypeEtcd, StorageTypeLegacy, StorageTypeUnified, StorageTypeUnifiedGrpc, StorageTypeUnifiedExp))
|
errs = append(errs, fmt.Errorf("--grafana-apiserver-storage-type must be one of %s, %s, %s, %s, %s, %s", StorageTypeFile, StorageTypeEtcd, StorageTypeLegacy, StorageTypeUnified, StorageTypeUnifiedGrpc, StorageTypeUnifiedNext))
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, _, err := net.SplitHostPort(o.Address); err != nil {
|
if _, _, err := net.SplitHostPort(o.Address); err != nil {
|
||||||
|
@ -262,7 +262,7 @@ func (s *service) start(ctx context.Context) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
case grafanaapiserveroptions.StorageTypeUnifiedExp:
|
case grafanaapiserveroptions.StorageTypeUnifiedNext:
|
||||||
if !s.features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
|
if !s.features.IsEnabledGlobally(featuremgmt.FlagUnifiedStorage) {
|
||||||
return fmt.Errorf("unified storage requires the unifiedStorage feature flag")
|
return fmt.Errorf("unified storage requires the unifiedStorage feature flag")
|
||||||
}
|
}
|
||||||
|
@ -1344,6 +1344,17 @@ var (
|
|||||||
HideFromDocs: true,
|
HideFromDocs: true,
|
||||||
HideFromAdminPage: true,
|
HideFromAdminPage: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "passScopeToDashboardApi",
|
||||||
|
Description: "Enables the passing of scopes to dashboards fetching in Grafana",
|
||||||
|
FrontendOnly: false,
|
||||||
|
Stage: FeatureStageExperimental,
|
||||||
|
Owner: grafanaDashboardsSquad,
|
||||||
|
RequiresRestart: false,
|
||||||
|
AllowSelfServe: false,
|
||||||
|
HideFromDocs: true,
|
||||||
|
HideFromAdminPage: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -178,3 +178,4 @@ ssoSettingsLDAP,experimental,@grafana/identity-access-team,false,false,false
|
|||||||
failWrongDSUID,experimental,@grafana/plugins-platform-backend,false,false,false
|
failWrongDSUID,experimental,@grafana/plugins-platform-backend,false,false,false
|
||||||
databaseReadReplica,experimental,@grafana/grafana-backend-services-squad,false,false,false
|
databaseReadReplica,experimental,@grafana/grafana-backend-services-squad,false,false,false
|
||||||
zanzana,experimental,@grafana/identity-access-team,false,false,false
|
zanzana,experimental,@grafana/identity-access-team,false,false,false
|
||||||
|
passScopeToDashboardApi,experimental,@grafana/dashboards-squad,false,false,false
|
||||||
|
|
@ -722,4 +722,8 @@ const (
|
|||||||
// FlagZanzana
|
// FlagZanzana
|
||||||
// Use openFGA as authorization engine.
|
// Use openFGA as authorization engine.
|
||||||
FlagZanzana = "zanzana"
|
FlagZanzana = "zanzana"
|
||||||
|
|
||||||
|
// FlagPassScopeToDashboardApi
|
||||||
|
// Enables the passing of scopes to dashboards fetching in Grafana
|
||||||
|
FlagPassScopeToDashboardApi = "passScopeToDashboardApi"
|
||||||
)
|
)
|
||||||
|
@ -1678,6 +1678,20 @@
|
|||||||
"requiresDevMode": true
|
"requiresDevMode": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"metadata": {
|
||||||
|
"name": "passScopeToDashboardApi",
|
||||||
|
"resourceVersion": "1718290335877",
|
||||||
|
"creationTimestamp": "2024-06-13T14:52:15Z"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"description": "Enables the passing of scopes to dashboards fetching in Grafana",
|
||||||
|
"stage": "experimental",
|
||||||
|
"codeowner": "@grafana/dashboards-squad",
|
||||||
|
"hideFromAdminPage": true,
|
||||||
|
"hideFromDocs": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "pdfTables",
|
"name": "pdfTables",
|
||||||
@ -2335,4 +2349,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ func (sc *SmtpClient) Send(ctx context.Context, messages ...*Message) (int, erro
|
|||||||
emailsSentFailed.Inc()
|
emailsSentFailed.Inc()
|
||||||
}
|
}
|
||||||
|
|
||||||
err = fmt.Errorf("failed to send notification to email addresses: %s: %w", strings.Join(msg.To, ";"), innerError)
|
err = fmt.Errorf("failed to send email: %w", innerError)
|
||||||
span.RecordError(err)
|
span.RecordError(err)
|
||||||
span.SetStatus(codes.Error, err.Error())
|
span.SetStatus(codes.Error, err.Error())
|
||||||
|
|
||||||
|
@ -58,6 +58,27 @@ func WrapDatabaseDriverWithHooks(dbType string, tracer tracing.Tracer) string {
|
|||||||
return driverWithHooks
|
return driverWithHooks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WrapDatabaseDriverWithHooks creates a fake database driver that
|
||||||
|
// executes pre and post functions which we use to gather metrics about
|
||||||
|
// database queries. It also registers the metrics.
|
||||||
|
func WrapDatabaseReplDriverWithHooks(dbType string, tracer tracing.Tracer) string {
|
||||||
|
drivers := map[string]driver.Driver{
|
||||||
|
migrator.SQLite: &sqlite3.SQLiteDriver{},
|
||||||
|
migrator.MySQL: &mysql.MySQLDriver{},
|
||||||
|
migrator.Postgres: &pq.Driver{},
|
||||||
|
}
|
||||||
|
|
||||||
|
d, exist := drivers[dbType]
|
||||||
|
if !exist {
|
||||||
|
return dbType
|
||||||
|
}
|
||||||
|
|
||||||
|
driverWithHooks := dbType + "ReplicaWithHooks"
|
||||||
|
sql.Register(driverWithHooks, sqlhooks.Wrap(d, &databaseQueryWrapper{log: log.New("sqlstore.metrics"), tracer: tracer}))
|
||||||
|
core.RegisterDriver(driverWithHooks, &databaseQueryWrapperDriver{dbType: dbType})
|
||||||
|
return driverWithHooks
|
||||||
|
}
|
||||||
|
|
||||||
// databaseQueryWrapper satisfies the sqlhook.databaseQueryWrapper interface
|
// databaseQueryWrapper satisfies the sqlhook.databaseQueryWrapper interface
|
||||||
// which allow us to wrap all SQL queries with a `Before` & `After` hook.
|
// which allow us to wrap all SQL queries with a `Before` & `After` hook.
|
||||||
type databaseQueryWrapper struct {
|
type databaseQueryWrapper struct {
|
||||||
|
@ -118,7 +118,7 @@ func (ss *SQLStore) initReadOnlyEngine(engine *xorm.Engine) error {
|
|||||||
ss.dbCfg = dbCfg
|
ss.dbCfg = dbCfg
|
||||||
|
|
||||||
if ss.cfg.DatabaseInstrumentQueries {
|
if ss.cfg.DatabaseInstrumentQueries {
|
||||||
ss.dbCfg.Type = WrapDatabaseDriverWithHooks(ss.dbCfg.Type, ss.tracer)
|
ss.dbCfg.Type = WrapDatabaseReplDriverWithHooks(ss.dbCfg.Type, ss.tracer)
|
||||||
}
|
}
|
||||||
|
|
||||||
if engine == nil {
|
if engine == nil {
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM=
|
||||||
|
cloud.google.com/go/auth v0.2.2 h1:gmxNJs4YZYcw6YvKRtVBaF2fyUE6UrWPyzU8jHvYfmI=
|
||||||
|
cloud.google.com/go/auth/oauth2adapt v0.2.1 h1:VSPmMmUlT8CkIZ2PzD9AlLN+R3+D1clXMWHHa6vG/Ag=
|
||||||
|
cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU=
|
||||||
|
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
|
||||||
|
cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc=
|
||||||
|
cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg=
|
||||||
|
github.com/aws/aws-sdk-go v1.51.31 h1:4TM+sNc+Dzs7wY1sJ0+J8i60c6rkgnKP1pvPx8ghsSY=
|
||||||
|
github.com/aws/aws-sdk-go-v2 v1.16.2 h1:fqlCk6Iy3bnCumtrLz9r3mJ/2gUT0pJ0wLFVIdWh+JA=
|
||||||
|
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1 h1:SdK4Ppk5IzLs64ZMvr6MrSficMtjY2oS0WOORXTlxwU=
|
||||||
|
github.com/aws/aws-sdk-go-v2/config v1.15.3 h1:5AlQD0jhVXlGzwo+VORKiUuogkG7pQcLJNzIzK7eodw=
|
||||||
|
github.com/aws/aws-sdk-go-v2/credentials v1.11.2 h1:RQQ5fzclAKJyY5TvF+fkjJEwzK4hnxQCLOu5JXzDmQo=
|
||||||
|
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.3 h1:LWPg5zjHV9oz/myQr4wMs0gi4CjnDN/ILmyZUFYXZsU=
|
||||||
|
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.3 h1:ir7iEq78s4txFGgwcLqD6q9IIPzTQNRJXulJd9h/zQo=
|
||||||
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.9 h1:onz/VaaxZ7Z4V+WIN9Txly9XLTmoOh1oJ8XcAC3pako=
|
||||||
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.3 h1:9stUQR/u2KXU6HkFJYlqnZEjBnbgrVbG6I5HN09xZh0=
|
||||||
|
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.10 h1:by9P+oy3P/CwggN4ClnW2D4oL91QV7pBzBICi1chZvQ=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1 h1:T4pFel53bkHjL2mMo+4DKE6r6AuoZnM0fg7k1/ratr4=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.3 h1:I0dcwWitE752hVSMrsLCxqNQ+UdEp3nACx2bYNMQq+k=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.3 h1:Gh1Gpyh01Yvn7ilO/b/hr01WgNpaszfbKMUgqM186xQ=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.3 h1:BKjwCJPnANbkwQ8vzSbaZDKawwagDubrH/z/c0X+kbQ=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/s3 v1.26.3 h1:rMPtwA7zzkSQZhhz9U3/SoIDz/NZ7Q+iRn4EIO8rSyU=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sso v1.11.3 h1:frW4ikGcxfAEDfmQqWgMLp+F1n4nRo9sF39OcIb5BkQ=
|
||||||
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.3 h1:cJGRyzCSVwZC7zZZ1xbx9m32UnrKydRYhOvcD1NYP9Q=
|
||||||
|
github.com/aws/smithy-go v1.11.2 h1:eG/N+CcUMAvsdffgMvjMKwfyDzIkjM6pfxMJ8Mzc6mE=
|
||||||
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
|
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
|
||||||
|
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
||||||
|
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
|
||||||
|
github.com/fullstorydev/grpchan v1.1.1 h1:heQqIJlAv5Cnks9a70GRL2EJke6QQoUB25VGR6TZQas=
|
||||||
|
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||||
|
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||||
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
|
||||||
|
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
|
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
|
||||||
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8=
|
||||||
|
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
|
||||||
|
github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA=
|
||||||
|
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20240613114114-5e2f08de316d h1:/UE5JdF+0hxll7EuuO7zRzAxXrvAxQo5M9eqOepc2mQ=
|
||||||
|
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk=
|
||||||
|
github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c=
|
||||||
|
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||||
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||||
|
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
|
||||||
|
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||||
|
github.com/prometheus/common v0.53.0 h1:U2pL9w9nmJwJDa4qqLQ3ZaePJ6ZTwt7cMD3AG3+aLCE=
|
||||||
|
github.com/prometheus/procfs v0.14.0 h1:Lw4VdGGoKEZilJsayHf0B+9YgLGREba2C6xr+Fdfq6s=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
|
||||||
|
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 h1:A3SayB3rNyt+1S6qpI9mHPkeHTZbD7XILEqWnYZb2l0=
|
||||||
|
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 h1:Xs2Ncz0gNihqu9iosIZ5SkBbWo5T8JhhLJFMQL1qmLI=
|
||||||
|
go.opentelemetry.io/otel v1.26.0 h1:LQwgL5s/1W7YiiRwxf03QGnWLb2HW4pLiAhaA5cZXBs=
|
||||||
|
go.opentelemetry.io/otel/metric v1.26.0 h1:7S39CLuY5Jgg9CrnA9HHiEjGMF/X2VHvoXGgSllRz30=
|
||||||
|
go.opentelemetry.io/otel/trace v1.26.0 h1:1ieeAUb4y0TE26jUFrCIXKpTuVK7uJGN9/Z/2LP5sQA=
|
||||||
|
gocloud.dev v0.25.0 h1:Y7vDq8xj7SyM848KXf32Krda2e6jQ4CLh/mTeCSqXtk=
|
||||||
|
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
||||||
|
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
||||||
|
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
|
||||||
|
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||||
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
|
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||||
|
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||||
|
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
|
||||||
|
google.golang.org/api v0.176.0 h1:dHj1/yv5Dm/eQTXiP9hNCRT3xzJHWXeNdRq29XbMxoE=
|
||||||
|
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY=
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 h1:+rdxYoE3E5htTEWIe15GlN6IfvbURM//Jt0mmkmm6ZU=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
|
||||||
|
google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY=
|
||||||
|
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
|
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU=
|
||||||
|
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
|
||||||
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||||
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
|
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
|
||||||
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
@ -3,7 +3,7 @@ module github.com/grafana/grafana/pkg/util/xorm
|
|||||||
go 1.21.10
|
go 1.21.10
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/mattn/go-sqlite3 v1.14.19
|
github.com/mattn/go-sqlite3 v1.14.22
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
xorm.io/builder v0.3.6
|
xorm.io/builder v0.3.6
|
||||||
xorm.io/core v0.7.3
|
xorm.io/core v0.7.3
|
||||||
|
@ -17,8 +17,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||||
github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI=
|
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||||
github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
|
||||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
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 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
@ -256,4 +256,26 @@ describe('filterRules', function () {
|
|||||||
expect(filtered[0]?.groups[0]?.rules).toHaveLength(1);
|
expect(filtered[0]?.groups[0]?.rules).toHaveLength(1);
|
||||||
expect(filtered[0]?.groups[0]?.rules[0]?.name).toBe('CPU too high');
|
expect(filtered[0]?.groups[0]?.rules[0]?.name).toBe('CPU too high');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not crash when trying to filter with regex-like strings', () => {
|
||||||
|
const rules = [mockCombinedRule({ name: '[alongnameinthefirstgroup]' })];
|
||||||
|
|
||||||
|
const ns = mockCombinedRuleNamespace({
|
||||||
|
name: 'foo|bar',
|
||||||
|
groups: [
|
||||||
|
// Create group with regex-like name so we can test that searching for it doesn't crash,
|
||||||
|
// and so we can test further paths of the filtering
|
||||||
|
// (we need some a group to be matched so we can test filtering by rule name as well)
|
||||||
|
mockCombinedRuleGroup('some|group', rules),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const ruleQuery = '[alongnameinthefirstgroup][thishas spaces][somethingelse]';
|
||||||
|
const namespaceQuery = 'foo|bar';
|
||||||
|
const groupQuery = 'some|group';
|
||||||
|
|
||||||
|
const performFilter = () =>
|
||||||
|
filterRules([ns], getFilter({ groupName: groupQuery, ruleName: ruleQuery, namespace: namespaceQuery }));
|
||||||
|
expect(performFilter).not.toThrow();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -28,6 +28,19 @@ import { useURLSearchParams } from './useURLSearchParams';
|
|||||||
const MAX_NEEDLE_SIZE = 25;
|
const MAX_NEEDLE_SIZE = 25;
|
||||||
const INFO_THRESHOLD = Infinity;
|
const INFO_THRESHOLD = Infinity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escape query strings so that regex characters don't interfere
|
||||||
|
* with uFuzzy search methods.
|
||||||
|
*
|
||||||
|
* The fuzzy searching will take the query and generate a regex - but if the query
|
||||||
|
* contains a regex itself, then it can easily end up being split in a bad place
|
||||||
|
* and end up creating an invalid expression
|
||||||
|
*/
|
||||||
|
const escapeQueryRegex = (query: string) => {
|
||||||
|
// see https://stackoverflow.com/a/6969486
|
||||||
|
return query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||||
|
};
|
||||||
|
|
||||||
export function useRulesFilter() {
|
export function useRulesFilter() {
|
||||||
const [queryParams, updateQueryParams] = useURLSearchParams();
|
const [queryParams, updateQueryParams] = useURLSearchParams();
|
||||||
const searchQuery = queryParams.get('search') ?? '';
|
const searchQuery = queryParams.get('search') ?? '';
|
||||||
@ -130,10 +143,12 @@ export const filterRules = (
|
|||||||
if (namespaceFilter) {
|
if (namespaceFilter) {
|
||||||
const namespaceHaystack = filteredNamespaces.map((ns) => ns.name);
|
const namespaceHaystack = filteredNamespaces.map((ns) => ns.name);
|
||||||
|
|
||||||
|
const escapedQuery = escapeQueryRegex(namespaceFilter);
|
||||||
|
|
||||||
const ufuzzy = getSearchInstance(namespaceFilter);
|
const ufuzzy = getSearchInstance(namespaceFilter);
|
||||||
const [idxs, info, order] = ufuzzy.search(
|
const [idxs, info, order] = ufuzzy.search(
|
||||||
namespaceHaystack,
|
namespaceHaystack,
|
||||||
namespaceFilter,
|
escapedQuery,
|
||||||
getOutOfOrderLimit(namespaceFilter),
|
getOutOfOrderLimit(namespaceFilter),
|
||||||
INFO_THRESHOLD
|
INFO_THRESHOLD
|
||||||
);
|
);
|
||||||
@ -157,9 +172,11 @@ const reduceNamespaces = (filterState: RulesFilter) => {
|
|||||||
const groupsHaystack = filteredGroups.map((g) => g.name);
|
const groupsHaystack = filteredGroups.map((g) => g.name);
|
||||||
const ufuzzy = getSearchInstance(groupNameFilter);
|
const ufuzzy = getSearchInstance(groupNameFilter);
|
||||||
|
|
||||||
|
const escapedQuery = escapeQueryRegex(groupNameFilter);
|
||||||
|
|
||||||
const [idxs, info, order] = ufuzzy.search(
|
const [idxs, info, order] = ufuzzy.search(
|
||||||
groupsHaystack,
|
groupsHaystack,
|
||||||
groupNameFilter,
|
escapedQuery,
|
||||||
getOutOfOrderLimit(groupNameFilter),
|
getOutOfOrderLimit(groupNameFilter),
|
||||||
INFO_THRESHOLD
|
INFO_THRESHOLD
|
||||||
);
|
);
|
||||||
@ -193,10 +210,11 @@ const reduceGroups = (filterState: RulesFilter) => {
|
|||||||
if (ruleNameQuery) {
|
if (ruleNameQuery) {
|
||||||
const rulesHaystack = filteredRules.map((r) => r.name);
|
const rulesHaystack = filteredRules.map((r) => r.name);
|
||||||
const ufuzzy = getSearchInstance(ruleNameQuery);
|
const ufuzzy = getSearchInstance(ruleNameQuery);
|
||||||
|
const escapedQuery = escapeQueryRegex(ruleNameQuery);
|
||||||
|
|
||||||
const [idxs, info, order] = ufuzzy.search(
|
const [idxs, info, order] = ufuzzy.search(
|
||||||
rulesHaystack,
|
rulesHaystack,
|
||||||
ruleNameQuery,
|
escapedQuery,
|
||||||
getOutOfOrderLimit(ruleNameQuery),
|
getOutOfOrderLimit(ruleNameQuery),
|
||||||
INFO_THRESHOLD
|
INFO_THRESHOLD
|
||||||
);
|
);
|
||||||
|
@ -57,6 +57,10 @@ interface RestoreDashboardArgs {
|
|||||||
dashboardUID: string;
|
dashboardUID: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface HardDeleteDashboardArgs {
|
||||||
|
dashboardUID: string;
|
||||||
|
}
|
||||||
|
|
||||||
function createBackendSrvBaseQuery({ baseURL }: { baseURL: string }): BaseQueryFn<RequestOptions> {
|
function createBackendSrvBaseQuery({ baseURL }: { baseURL: string }): BaseQueryFn<RequestOptions> {
|
||||||
async function backendSrvBaseQuery(requestOptions: RequestOptions) {
|
async function backendSrvBaseQuery(requestOptions: RequestOptions) {
|
||||||
try {
|
try {
|
||||||
@ -382,6 +386,19 @@ export const browseDashboardsAPI = createApi({
|
|||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
// permanently delete a dashboard. used in PermanentlyDeleteModal.
|
||||||
|
hardDeleteDashboard: builder.mutation<void, HardDeleteDashboardArgs>({
|
||||||
|
query: ({ dashboardUID }) => ({
|
||||||
|
url: `/dashboards/uid/${dashboardUID}/trash`,
|
||||||
|
method: 'DELETE',
|
||||||
|
}),
|
||||||
|
onQueryStarted: ({ dashboardUID }, { queryFulfilled, dispatch }) => {
|
||||||
|
queryFulfilled.then(() => {
|
||||||
|
dispatch(refreshParents([dashboardUID]));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -397,6 +414,7 @@ export const {
|
|||||||
useSaveDashboardMutation,
|
useSaveDashboardMutation,
|
||||||
useSaveFolderMutation,
|
useSaveFolderMutation,
|
||||||
useRestoreDashboardMutation,
|
useRestoreDashboardMutation,
|
||||||
|
useHardDeleteDashboardMutation,
|
||||||
} = browseDashboardsAPI;
|
} = browseDashboardsAPI;
|
||||||
|
|
||||||
export { skipToken } from '@reduxjs/toolkit/query/react';
|
export { skipToken } from '@reduxjs/toolkit/query/react';
|
||||||
|
@ -35,6 +35,18 @@ export const DeleteModal = ({ onConfirm, onDismiss, selectedItems, ...props }: P
|
|||||||
<ConfirmModal
|
<ConfirmModal
|
||||||
body={
|
body={
|
||||||
<>
|
<>
|
||||||
|
{config.featureToggles.dashboardRestore && (
|
||||||
|
<>
|
||||||
|
<Text element="p">
|
||||||
|
<Trans i18nKey="browse-dashboards.action.delete-modal-restore-dashboards-text">
|
||||||
|
This action will delete the selected folders immediately but the selected dashboards will be marked
|
||||||
|
for deletion in 30 days. You can restore the dashboards anytime before the 30 days expires. Folders
|
||||||
|
cannot be restored.
|
||||||
|
</Trans>
|
||||||
|
</Text>
|
||||||
|
<Space v={2} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Text element="p">
|
<Text element="p">
|
||||||
<Trans i18nKey="browse-dashboards.action.delete-modal-text">
|
<Trans i18nKey="browse-dashboards.action.delete-modal-text">
|
||||||
This action will delete the following content:
|
This action will delete the following content:
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { ConfirmModal, Text } from '@grafana/ui';
|
||||||
|
|
||||||
|
import { Trans, t } from '../../../core/internationalization';
|
||||||
|
|
||||||
|
import { Props as ModalProps } from './RestoreModal';
|
||||||
|
|
||||||
|
export const PermanentlyDeleteModal = ({
|
||||||
|
onConfirm,
|
||||||
|
onDismiss,
|
||||||
|
selectedDashboards,
|
||||||
|
isLoading,
|
||||||
|
...props
|
||||||
|
}: ModalProps) => {
|
||||||
|
const numberOfDashboards = selectedDashboards.length;
|
||||||
|
|
||||||
|
const onDelete = async () => {
|
||||||
|
await onConfirm();
|
||||||
|
onDismiss();
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<ConfirmModal
|
||||||
|
body={
|
||||||
|
<Text element="p">
|
||||||
|
<Trans i18nKey="recently-deleted.permanently-delete-modal.text" count={numberOfDashboards}>
|
||||||
|
This action will delete {{ numberOfDashboards }} dashboards.
|
||||||
|
</Trans>
|
||||||
|
</Text>
|
||||||
|
}
|
||||||
|
title={t('recently-deleted.permanently-delete-modal.title', 'Permanently Delete Dashboards')}
|
||||||
|
confirmationText={t('recently-deleted.permanently-delete-modal.confirm-text', 'Delete')}
|
||||||
|
confirmText={
|
||||||
|
isLoading
|
||||||
|
? t('recently-deleted.permanently-delete-modal.delete-loading', 'Deleting...')
|
||||||
|
: t('recently-deleted.permanently-delete-modal.delete-button', 'Delete')
|
||||||
|
}
|
||||||
|
confirmButtonVariant="destructive"
|
||||||
|
onConfirm={onDelete}
|
||||||
|
onDismiss={onDismiss}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
@ -9,10 +9,12 @@ import appEvents from '../../../core/app_events';
|
|||||||
import { Trans } from '../../../core/internationalization';
|
import { Trans } from '../../../core/internationalization';
|
||||||
import { useDispatch } from '../../../types';
|
import { useDispatch } from '../../../types';
|
||||||
import { ShowModalReactEvent } from '../../../types/events';
|
import { ShowModalReactEvent } from '../../../types/events';
|
||||||
import { useRestoreDashboardMutation } from '../../browse-dashboards/api/browseDashboardsAPI';
|
import { useHardDeleteDashboardMutation, useRestoreDashboardMutation } from '../api/browseDashboardsAPI';
|
||||||
import { clearFolders, setAllSelection, useActionSelectionState } from '../../browse-dashboards/state';
|
|
||||||
import { useRecentlyDeletedStateManager } from '../api/useRecentlyDeletedStateManager';
|
import { useRecentlyDeletedStateManager } from '../api/useRecentlyDeletedStateManager';
|
||||||
import { RestoreModal } from '../components/RestoreModal';
|
import { clearFolders, setAllSelection, useActionSelectionState } from '../state';
|
||||||
|
|
||||||
|
import { PermanentlyDeleteModal } from './PermanentlyDeleteModal';
|
||||||
|
import { RestoreModal } from './RestoreModal';
|
||||||
|
|
||||||
export function RecentlyDeletedActions() {
|
export function RecentlyDeletedActions() {
|
||||||
const styles = useStyles2(getStyles);
|
const styles = useStyles2(getStyles);
|
||||||
@ -22,6 +24,7 @@ export function RecentlyDeletedActions() {
|
|||||||
const [, stateManager] = useRecentlyDeletedStateManager();
|
const [, stateManager] = useRecentlyDeletedStateManager();
|
||||||
|
|
||||||
const [restoreDashboard, { isLoading: isRestoreLoading }] = useRestoreDashboardMutation();
|
const [restoreDashboard, { isLoading: isRestoreLoading }] = useRestoreDashboardMutation();
|
||||||
|
const [deleteDashboard, { isLoading: isDeleteLoading }] = useHardDeleteDashboardMutation();
|
||||||
|
|
||||||
const selectedDashboards = useMemo(() => {
|
const selectedDashboards = useMemo(() => {
|
||||||
return Object.entries(selectedItemsState.dashboard)
|
return Object.entries(selectedItemsState.dashboard)
|
||||||
@ -64,6 +67,13 @@ export function RecentlyDeletedActions() {
|
|||||||
onActionComplete();
|
onActionComplete();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onDelete = async () => {
|
||||||
|
const promises = selectedDashboards.map((uid) => deleteDashboard({ dashboardUID: uid }));
|
||||||
|
|
||||||
|
await Promise.all(promises);
|
||||||
|
onActionComplete();
|
||||||
|
};
|
||||||
|
|
||||||
const showRestoreModal = () => {
|
const showRestoreModal = () => {
|
||||||
appEvents.publish(
|
appEvents.publish(
|
||||||
new ShowModalReactEvent({
|
new ShowModalReactEvent({
|
||||||
@ -77,17 +87,36 @@ export function RecentlyDeletedActions() {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const showDeleteModal = () => {
|
||||||
|
appEvents.publish(
|
||||||
|
new ShowModalReactEvent({
|
||||||
|
component: PermanentlyDeleteModal,
|
||||||
|
props: {
|
||||||
|
selectedDashboards,
|
||||||
|
onConfirm: onDelete,
|
||||||
|
isLoading: isDeleteLoading,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.row}>
|
<div className={styles.row}>
|
||||||
<Button onClick={showRestoreModal} variant="secondary">
|
<Button onClick={showRestoreModal} variant="secondary">
|
||||||
<Trans i18nKey="recently-deleted.buttons.restore">Restore</Trans>
|
<Trans i18nKey="recently-deleted.buttons.restore">Restore</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={showDeleteModal} variant="destructive">
|
||||||
|
<Trans i18nKey="recently-deleted.buttons.delete">Delete permanently</Trans>
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStyles = (theme: GrafanaTheme2) => ({
|
const getStyles = (theme: GrafanaTheme2) => ({
|
||||||
row: css({
|
row: css({
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'row',
|
||||||
|
gap: theme.spacing(1),
|
||||||
marginBottom: theme.spacing(2),
|
marginBottom: theme.spacing(2),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,7 @@ import { ConfirmModal, Text } from '@grafana/ui';
|
|||||||
|
|
||||||
import { Trans, t } from '../../../core/internationalization';
|
import { Trans, t } from '../../../core/internationalization';
|
||||||
|
|
||||||
interface Props {
|
export interface Props {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
onConfirm: () => Promise<void>;
|
onConfirm: () => Promise<void>;
|
||||||
onDismiss: () => void;
|
onDismiss: () => void;
|
||||||
|
@ -173,11 +173,11 @@ describe('DashboardScenePageStateManager', () => {
|
|||||||
|
|
||||||
const loader = new DashboardScenePageStateManager({});
|
const loader = new DashboardScenePageStateManager({});
|
||||||
|
|
||||||
expect(loader.getFromCache('fake-dash')).toBeNull();
|
expect(loader.getDashboardFromCache('fake-dash')).toBeNull();
|
||||||
|
|
||||||
await loader.loadDashboard({ uid: 'fake-dash', route: DashboardRoutes.Normal });
|
await loader.loadDashboard({ uid: 'fake-dash', route: DashboardRoutes.Normal });
|
||||||
|
|
||||||
expect(loader.getFromCache('fake-dash')).toBeDefined();
|
expect(loader.getDashboardFromCache('fake-dash')).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should load dashboard DTO from cache if requested again within 2s', async () => {
|
it('should load dashboard DTO from cache if requested again within 2s', async () => {
|
||||||
@ -186,7 +186,7 @@ describe('DashboardScenePageStateManager', () => {
|
|||||||
|
|
||||||
const loader = new DashboardScenePageStateManager({});
|
const loader = new DashboardScenePageStateManager({});
|
||||||
|
|
||||||
expect(loader.getFromCache('fake-dash')).toBeNull();
|
expect(loader.getDashboardFromCache('fake-dash')).toBeNull();
|
||||||
|
|
||||||
await loader.fetchDashboard({ uid: 'fake-dash', route: DashboardRoutes.Normal });
|
await loader.fetchDashboard({ uid: 'fake-dash', route: DashboardRoutes.Normal });
|
||||||
expect(loadDashSpy).toHaveBeenCalledTimes(1);
|
expect(loadDashSpy).toHaveBeenCalledTimes(1);
|
||||||
@ -228,7 +228,7 @@ describe('DashboardScenePageStateManager', () => {
|
|||||||
keepDashboardFromExploreInLocalStorage: false,
|
keepDashboardFromExploreInLocalStorage: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(loader.getFromCache('fake-dash')).toBeNull();
|
expect(loader.getDashboardFromCache('fake-dash')).toBeNull();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -16,6 +16,7 @@ import {
|
|||||||
import { trackDashboardSceneLoaded } from 'app/features/dashboard/utils/tracking';
|
import { trackDashboardSceneLoaded } from 'app/features/dashboard/utils/tracking';
|
||||||
import { DashboardDTO, DashboardRoutes } from 'app/types';
|
import { DashboardDTO, DashboardRoutes } from 'app/types';
|
||||||
|
|
||||||
|
import { getScopesFromUrl } from '../../dashboard/utils/getScopesFromUrl';
|
||||||
import { PanelEditor } from '../panel-edit/PanelEditor';
|
import { PanelEditor } from '../panel-edit/PanelEditor';
|
||||||
import { DashboardScene } from '../scene/DashboardScene';
|
import { DashboardScene } from '../scene/DashboardScene';
|
||||||
import { buildNewDashboardSaveModel } from '../serialization/buildNewDashboardSaveModel';
|
import { buildNewDashboardSaveModel } from '../serialization/buildNewDashboardSaveModel';
|
||||||
@ -83,7 +84,7 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cacheKey = route === DashboardRoutes.Home ? HOME_DASHBOARD_CACHE_KEY : uid;
|
const cacheKey = route === DashboardRoutes.Home ? HOME_DASHBOARD_CACHE_KEY : uid;
|
||||||
const cachedDashboard = this.getFromCache(cacheKey);
|
const cachedDashboard = this.getDashboardFromCache(cacheKey);
|
||||||
|
|
||||||
if (cachedDashboard) {
|
if (cachedDashboard) {
|
||||||
return cachedDashboard;
|
return cachedDashboard;
|
||||||
@ -142,7 +143,7 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do not cache new dashboards
|
// Do not cache new dashboards
|
||||||
this.dashboardCache = { dashboard: rsp, ts: Date.now(), cacheKey };
|
this.setDashboardCache(cacheKey, rsp);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Ignore cancelled errors
|
// Ignore cancelled errors
|
||||||
if (isFetchError(e) && e.cancelled) {
|
if (isFetchError(e) && e.cancelled) {
|
||||||
@ -220,7 +221,7 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
|
|||||||
|
|
||||||
const rsp = await this.fetchDashboard(options);
|
const rsp = await this.fetchDashboard(options);
|
||||||
|
|
||||||
const fromCache = this.cache[options.uid];
|
const fromCache = this.getSceneFromCache(options.uid);
|
||||||
|
|
||||||
// When coming from Explore, skip returnning scene from cache
|
// When coming from Explore, skip returnning scene from cache
|
||||||
if (!comingFromExplore) {
|
if (!comingFromExplore) {
|
||||||
@ -234,7 +235,7 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
|
|||||||
|
|
||||||
// Cache scene only if not coming from Explore, we don't want to cache temporary dashboard
|
// Cache scene only if not coming from Explore, we don't want to cache temporary dashboard
|
||||||
if (options.uid && !comingFromExplore) {
|
if (options.uid && !comingFromExplore) {
|
||||||
this.cache[options.uid] = scene;
|
this.setSceneCache(options.uid, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
return scene;
|
return scene;
|
||||||
@ -249,8 +250,9 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
|
|||||||
throw new Error('Dashboard not found');
|
throw new Error('Dashboard not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
public getFromCache(cacheKey: string) {
|
public getDashboardFromCache(cacheKey: string) {
|
||||||
const cachedDashboard = this.dashboardCache;
|
const cachedDashboard = this.dashboardCache;
|
||||||
|
cacheKey = this.getCacheKey(cacheKey);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
cachedDashboard &&
|
cachedDashboard &&
|
||||||
@ -275,12 +277,38 @@ export class DashboardScenePageStateManager extends StateManagerBase<DashboardSc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public setDashboardCache(cacheKey: string, dashboard: DashboardDTO) {
|
public setDashboardCache(cacheKey: string, dashboard: DashboardDTO) {
|
||||||
|
cacheKey = this.getCacheKey(cacheKey);
|
||||||
|
|
||||||
this.dashboardCache = { dashboard, ts: Date.now(), cacheKey };
|
this.dashboardCache = { dashboard, ts: Date.now(), cacheKey };
|
||||||
}
|
}
|
||||||
|
|
||||||
public clearDashboardCache() {
|
public clearDashboardCache() {
|
||||||
this.dashboardCache = undefined;
|
this.dashboardCache = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getSceneFromCache(cacheKey: string) {
|
||||||
|
cacheKey = this.getCacheKey(cacheKey);
|
||||||
|
|
||||||
|
return this.cache[cacheKey];
|
||||||
|
}
|
||||||
|
|
||||||
|
public setSceneCache(cacheKey: string, scene: DashboardScene) {
|
||||||
|
cacheKey = this.getCacheKey(cacheKey);
|
||||||
|
|
||||||
|
this.cache[cacheKey] = scene;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getCacheKey(cacheKey: string): string {
|
||||||
|
const scopesSearchParams = getScopesFromUrl();
|
||||||
|
|
||||||
|
if (!scopesSearchParams?.has('scopes')) {
|
||||||
|
return cacheKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
scopesSearchParams.sort();
|
||||||
|
|
||||||
|
return `${cacheKey}__scp__${scopesSearchParams.toString()}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let stateManager: DashboardScenePageStateManager | null = null;
|
let stateManager: DashboardScenePageStateManager | null = null;
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { act, cleanup, waitFor } from '@testing-library/react';
|
import { act, cleanup, waitFor } from '@testing-library/react';
|
||||||
import userEvents from '@testing-library/user-event';
|
import userEvents from '@testing-library/user-event';
|
||||||
|
|
||||||
import { config } from '@grafana/runtime';
|
import { config, locationService } from '@grafana/runtime';
|
||||||
import { sceneGraph } from '@grafana/scenes';
|
import { sceneGraph } from '@grafana/scenes';
|
||||||
|
import { getDashboardAPI, setDashboardAPI } from 'app/features/dashboard/api/dashboard_api';
|
||||||
import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene';
|
import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene';
|
||||||
|
|
||||||
import { ScopesFiltersScene } from './ScopesFiltersScene';
|
import { ScopesFiltersScene } from './ScopesFiltersScene';
|
||||||
@ -33,8 +34,7 @@ import {
|
|||||||
getDashboardsContainer,
|
getDashboardsContainer,
|
||||||
getDashboardsExpand,
|
getDashboardsExpand,
|
||||||
getDashboardsSearch,
|
getDashboardsSearch,
|
||||||
mocksNodes,
|
getMock,
|
||||||
mocksScopeDashboardBindings,
|
|
||||||
mocksScopes,
|
mocksScopes,
|
||||||
queryAllDashboard,
|
queryAllDashboard,
|
||||||
queryFiltersApply,
|
queryFiltersApply,
|
||||||
@ -52,31 +52,7 @@ jest.mock('@grafana/runtime', () => ({
|
|||||||
__esModule: true,
|
__esModule: true,
|
||||||
...jest.requireActual('@grafana/runtime'),
|
...jest.requireActual('@grafana/runtime'),
|
||||||
getBackendSrv: () => ({
|
getBackendSrv: () => ({
|
||||||
get: jest.fn().mockImplementation((url: string, params: { parent: string; scope: string[]; query?: string }) => {
|
get: getMock,
|
||||||
if (url.startsWith('/apis/scope.grafana.app/v0alpha1/namespaces/default/find/scope_node_children')) {
|
|
||||||
return {
|
|
||||||
items: mocksNodes.filter(
|
|
||||||
({ parent, spec: { title } }) => parent === params.parent && title.includes(params.query ?? '')
|
|
||||||
),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.startsWith('/apis/scope.grafana.app/v0alpha1/namespaces/default/scopes/')) {
|
|
||||||
const name = url.replace('/apis/scope.grafana.app/v0alpha1/namespaces/default/scopes/', '');
|
|
||||||
|
|
||||||
return mocksScopes.find((scope) => scope.metadata.name === name) ?? {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.startsWith('/apis/scope.grafana.app/v0alpha1/namespaces/default/find/scope_dashboard_bindings')) {
|
|
||||||
return {
|
|
||||||
items: mocksScopeDashboardBindings.filter(({ spec: { scope: bindingScope } }) =>
|
|
||||||
params.scope.includes(bindingScope)
|
|
||||||
),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {};
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -109,6 +85,7 @@ describe('ScopesScene', () => {
|
|||||||
fetchScopeSpy.mockClear();
|
fetchScopeSpy.mockClear();
|
||||||
fetchSelectedScopesSpy.mockClear();
|
fetchSelectedScopesSpy.mockClear();
|
||||||
fetchSuggestedDashboardsSpy.mockClear();
|
fetchSuggestedDashboardsSpy.mockClear();
|
||||||
|
getMock.mockClear();
|
||||||
|
|
||||||
dashboardScene = buildTestScene();
|
dashboardScene = buildTestScene();
|
||||||
scopesScene = dashboardScene.state.scopes!;
|
scopesScene = dashboardScene.state.scopes!;
|
||||||
@ -418,4 +395,54 @@ describe('ScopesScene', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Dashboards API', () => {
|
||||||
|
describe('Feature flag off', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
config.featureToggles.scopeFilters = true;
|
||||||
|
config.featureToggles.passScopeToDashboardApi = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
setDashboardAPI(undefined);
|
||||||
|
locationService.push('/?scopes=scope1&scopes=scope2&scopes=scope3');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Legacy API should not pass the scopes', () => {
|
||||||
|
config.featureToggles.kubernetesDashboards = false;
|
||||||
|
getDashboardAPI().getDashboardDTO('1');
|
||||||
|
expect(getMock).toHaveBeenCalledWith('/api/dashboards/uid/1', undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('K8s API should not pass the scopes', () => {
|
||||||
|
config.featureToggles.kubernetesDashboards = true;
|
||||||
|
getDashboardAPI().getDashboardDTO('1');
|
||||||
|
expect(getMock).toHaveBeenCalledWith('/apis/dashboard.grafana.app/v0alpha1/namespaces/default/dashboards/1');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Feature flag on', () => {
|
||||||
|
beforeAll(() => {
|
||||||
|
config.featureToggles.scopeFilters = true;
|
||||||
|
config.featureToggles.passScopeToDashboardApi = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
setDashboardAPI(undefined);
|
||||||
|
locationService.push('/?scopes=scope1&scopes=scope2&scopes=scope3');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Legacy API should pass the scopes', () => {
|
||||||
|
config.featureToggles.kubernetesDashboards = false;
|
||||||
|
getDashboardAPI().getDashboardDTO('1');
|
||||||
|
expect(getMock).toHaveBeenCalledWith('/api/dashboards/uid/1', { scopes: ['scope1', 'scope2', 'scope3'] });
|
||||||
|
});
|
||||||
|
|
||||||
|
it('K8s API should not pass the scopes', () => {
|
||||||
|
config.featureToggles.kubernetesDashboards = true;
|
||||||
|
getDashboardAPI().getDashboardDTO('1');
|
||||||
|
expect(getMock).toHaveBeenCalledWith('/apis/dashboard.grafana.app/v0alpha1/namespaces/default/dashboards/1');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -252,6 +252,46 @@ export const fetchScopeSpy = jest.spyOn(api, 'fetchScope');
|
|||||||
export const fetchSelectedScopesSpy = jest.spyOn(api, 'fetchSelectedScopes');
|
export const fetchSelectedScopesSpy = jest.spyOn(api, 'fetchSelectedScopes');
|
||||||
export const fetchSuggestedDashboardsSpy = jest.spyOn(api, 'fetchSuggestedDashboards');
|
export const fetchSuggestedDashboardsSpy = jest.spyOn(api, 'fetchSuggestedDashboards');
|
||||||
|
|
||||||
|
export const getMock = jest
|
||||||
|
.fn()
|
||||||
|
.mockImplementation((url: string, params: { parent: string; scope: string[]; query?: string }) => {
|
||||||
|
if (url.startsWith('/apis/scope.grafana.app/v0alpha1/namespaces/default/find/scope_node_children')) {
|
||||||
|
return {
|
||||||
|
items: mocksNodes.filter(
|
||||||
|
({ parent, spec: { title } }) => parent === params.parent && title.includes(params.query ?? '')
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.startsWith('/apis/scope.grafana.app/v0alpha1/namespaces/default/scopes/')) {
|
||||||
|
const name = url.replace('/apis/scope.grafana.app/v0alpha1/namespaces/default/scopes/', '');
|
||||||
|
|
||||||
|
return mocksScopes.find((scope) => scope.metadata.name === name) ?? {};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.startsWith('/apis/scope.grafana.app/v0alpha1/namespaces/default/find/scope_dashboard_bindings')) {
|
||||||
|
return {
|
||||||
|
items: mocksScopeDashboardBindings.filter(({ spec: { scope: bindingScope } }) =>
|
||||||
|
params.scope.includes(bindingScope)
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.startsWith('/api/dashboards/uid/')) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.startsWith('/apis/dashboard.grafana.app/v0alpha1/namespaces/default/dashboards/')) {
|
||||||
|
return {
|
||||||
|
metadata: {
|
||||||
|
name: '1',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
});
|
||||||
|
|
||||||
const selectors = {
|
const selectors = {
|
||||||
tree: {
|
tree: {
|
||||||
search: (nodeId: string) => `scopes-tree-${nodeId}-search`,
|
search: (nodeId: string) => `scopes-tree-${nodeId}-search`,
|
||||||
|
@ -6,6 +6,8 @@ import { dashboardWatcher } from 'app/features/live/dashboard/dashboardWatcher';
|
|||||||
import { DeleteDashboardResponse } from 'app/features/manage-dashboards/types';
|
import { DeleteDashboardResponse } from 'app/features/manage-dashboards/types';
|
||||||
import { DashboardDTO, DashboardDataDTO } from 'app/types';
|
import { DashboardDTO, DashboardDataDTO } from 'app/types';
|
||||||
|
|
||||||
|
import { getScopesFromUrl } from '../utils/getScopesFromUrl';
|
||||||
|
|
||||||
export interface DashboardAPI {
|
export interface DashboardAPI {
|
||||||
/** Get a dashboard with the access control metadata */
|
/** Get a dashboard with the access control metadata */
|
||||||
getDashboardDTO(uid: string): Promise<DashboardDTO>;
|
getDashboardDTO(uid: string): Promise<DashboardDTO>;
|
||||||
@ -35,7 +37,11 @@ class LegacyDashboardAPI implements DashboardAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDashboardDTO(uid: string): Promise<DashboardDTO> {
|
getDashboardDTO(uid: string): Promise<DashboardDTO> {
|
||||||
return getBackendSrv().get<DashboardDTO>(`/api/dashboards/uid/${uid}`);
|
const scopesSearchParams = getScopesFromUrl();
|
||||||
|
const scopes = scopesSearchParams?.getAll('scopes') ?? [];
|
||||||
|
const queryParams = scopes.length > 0 ? { scopes } : undefined;
|
||||||
|
|
||||||
|
return getBackendSrv().get<DashboardDTO>(`/api/dashboards/uid/${uid}`, queryParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,3 +88,10 @@ export function getDashboardAPI() {
|
|||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function setDashboardAPI(override: DashboardAPI | undefined) {
|
||||||
|
if (process.env.NODE_ENV !== 'test') {
|
||||||
|
throw new Error('dashboardAPI can be only overridden in test environment');
|
||||||
|
}
|
||||||
|
instance = override;
|
||||||
|
}
|
||||||
|
@ -77,7 +77,7 @@ export class DashboardLoaderSrv {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
} else if (uid) {
|
} else if (uid) {
|
||||||
const cachedDashboard = stateManager.getFromCache(uid);
|
const cachedDashboard = stateManager.getDashboardFromCache(uid);
|
||||||
if (cachedDashboard) {
|
if (cachedDashboard) {
|
||||||
return Promise.resolve(cachedDashboard);
|
return Promise.resolve(cachedDashboard);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ async function fetchDashboard(
|
|||||||
switch (args.routeName) {
|
switch (args.routeName) {
|
||||||
case DashboardRoutes.Home: {
|
case DashboardRoutes.Home: {
|
||||||
const stateManager = getDashboardScenePageStateManager();
|
const stateManager = getDashboardScenePageStateManager();
|
||||||
const cachedDashboard = stateManager.getFromCache(HOME_DASHBOARD_CACHE_KEY);
|
const cachedDashboard = stateManager.getDashboardFromCache(HOME_DASHBOARD_CACHE_KEY);
|
||||||
|
|
||||||
if (cachedDashboard) {
|
if (cachedDashboard) {
|
||||||
return cachedDashboard;
|
return cachedDashboard;
|
||||||
|
13
public/app/features/dashboard/utils/getScopesFromUrl.ts
Normal file
13
public/app/features/dashboard/utils/getScopesFromUrl.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { config, locationService } from '@grafana/runtime';
|
||||||
|
|
||||||
|
export function getScopesFromUrl(): URLSearchParams | undefined {
|
||||||
|
if (!config.featureToggles.scopeFilters || !config.featureToggles.passScopeToDashboardApi) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const queryParams = locationService.getSearchObject();
|
||||||
|
const rawScopes = queryParams['scopes'] ?? [];
|
||||||
|
const scopes = Array.isArray(rawScopes) ? rawScopes : [rawScopes];
|
||||||
|
|
||||||
|
return new URLSearchParams(scopes.map((scope) => ['scopes', String(scope)]));
|
||||||
|
}
|
@ -78,6 +78,7 @@
|
|||||||
"delete-button": "Delete",
|
"delete-button": "Delete",
|
||||||
"delete-modal-invalid-text": "One or more folders contain library panels or alert rules. Delete these first in order to proceed.",
|
"delete-modal-invalid-text": "One or more folders contain library panels or alert rules. Delete these first in order to proceed.",
|
||||||
"delete-modal-invalid-title": "Cannot delete folder",
|
"delete-modal-invalid-title": "Cannot delete folder",
|
||||||
|
"delete-modal-restore-dashboards-text": "This action will delete the selected folders immediately but the selected dashboards will be marked for deletion in 30 days. You can restore the dashboards anytime before the 30 days expires. Folders cannot be restored.",
|
||||||
"delete-modal-text": "This action will delete the following content:",
|
"delete-modal-text": "This action will delete the following content:",
|
||||||
"delete-modal-title": "Delete",
|
"delete-modal-title": "Delete",
|
||||||
"deleting": "Deleting...",
|
"deleting": "Deleting...",
|
||||||
@ -1574,8 +1575,17 @@
|
|||||||
},
|
},
|
||||||
"recently-deleted": {
|
"recently-deleted": {
|
||||||
"buttons": {
|
"buttons": {
|
||||||
|
"delete": "Delete permanently",
|
||||||
"restore": "Restore"
|
"restore": "Restore"
|
||||||
},
|
},
|
||||||
|
"permanently-delete-modal": {
|
||||||
|
"confirm-text": "Delete",
|
||||||
|
"delete-button": "Delete",
|
||||||
|
"delete-loading": "Deleting...",
|
||||||
|
"text_one": "This action will delete {{numberOfDashboards}} dashboards.",
|
||||||
|
"text_other": "This action will delete {{numberOfDashboards}} dashboards.",
|
||||||
|
"title": "Permanently Delete Dashboards"
|
||||||
|
},
|
||||||
"restore-modal": {
|
"restore-modal": {
|
||||||
"restore-button": "Restore",
|
"restore-button": "Restore",
|
||||||
"restore-loading": "Restoring...",
|
"restore-loading": "Restoring...",
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
"delete-button": "Đęľęŧę",
|
"delete-button": "Đęľęŧę",
|
||||||
"delete-modal-invalid-text": "Øʼnę őř mőřę ƒőľđęřş čőʼnŧäįʼn ľįþřäřy päʼnęľş őř äľęřŧ řūľęş. Đęľęŧę ŧĥęşę ƒįřşŧ įʼn őřđęř ŧő přőčęęđ.",
|
"delete-modal-invalid-text": "Øʼnę őř mőřę ƒőľđęřş čőʼnŧäįʼn ľįþřäřy päʼnęľş őř äľęřŧ řūľęş. Đęľęŧę ŧĥęşę ƒįřşŧ įʼn őřđęř ŧő přőčęęđ.",
|
||||||
"delete-modal-invalid-title": "Cäʼnʼnőŧ đęľęŧę ƒőľđęř",
|
"delete-modal-invalid-title": "Cäʼnʼnőŧ đęľęŧę ƒőľđęř",
|
||||||
|
"delete-modal-restore-dashboards-text": "Ŧĥįş äčŧįőʼn ŵįľľ đęľęŧę ŧĥę şęľęčŧęđ ƒőľđęřş įmmęđįäŧęľy þūŧ ŧĥę şęľęčŧęđ đäşĥþőäřđş ŵįľľ þę mäřĸęđ ƒőř đęľęŧįőʼn įʼn 30 đäyş. Ÿőū čäʼn řęşŧőřę ŧĥę đäşĥþőäřđş äʼnyŧįmę þęƒőřę ŧĥę 30 đäyş ęχpįřęş. Főľđęřş čäʼnʼnőŧ þę řęşŧőřęđ.",
|
||||||
"delete-modal-text": "Ŧĥįş äčŧįőʼn ŵįľľ đęľęŧę ŧĥę ƒőľľőŵįʼnģ čőʼnŧęʼnŧ:",
|
"delete-modal-text": "Ŧĥįş äčŧįőʼn ŵįľľ đęľęŧę ŧĥę ƒőľľőŵįʼnģ čőʼnŧęʼnŧ:",
|
||||||
"delete-modal-title": "Đęľęŧę",
|
"delete-modal-title": "Đęľęŧę",
|
||||||
"deleting": "Đęľęŧįʼnģ...",
|
"deleting": "Đęľęŧįʼnģ...",
|
||||||
@ -1574,8 +1575,17 @@
|
|||||||
},
|
},
|
||||||
"recently-deleted": {
|
"recently-deleted": {
|
||||||
"buttons": {
|
"buttons": {
|
||||||
|
"delete": "Đęľęŧę pęřmäʼnęʼnŧľy",
|
||||||
"restore": "Ŗęşŧőřę"
|
"restore": "Ŗęşŧőřę"
|
||||||
},
|
},
|
||||||
|
"permanently-delete-modal": {
|
||||||
|
"confirm-text": "Đęľęŧę",
|
||||||
|
"delete-button": "Đęľęŧę",
|
||||||
|
"delete-loading": "Đęľęŧįʼnģ...",
|
||||||
|
"text_one": "Ŧĥįş äčŧįőʼn ŵįľľ đęľęŧę {{numberOfDashboards}} đäşĥþőäřđş.",
|
||||||
|
"text_other": "Ŧĥįş äčŧįőʼn ŵįľľ đęľęŧę {{numberOfDashboards}} đäşĥþőäřđş.",
|
||||||
|
"title": "Pęřmäʼnęʼnŧľy Đęľęŧę Đäşĥþőäřđş"
|
||||||
|
},
|
||||||
"restore-modal": {
|
"restore-modal": {
|
||||||
"restore-button": "Ŗęşŧőřę",
|
"restore-button": "Ŗęşŧőřę",
|
||||||
"restore-loading": "Ŗęşŧőřįʼnģ...",
|
"restore-loading": "Ŗęşŧőřįʼnģ...",
|
||||||
|
Loading…
Reference in New Issue
Block a user