Commit Graph

168 Commits

Author SHA1 Message Date
Ryan McKinley
29cdfdff87
Storage: Revert using real gRPC for integration tests (#96410)
---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
2024-11-15 16:50:49 -05:00
Isabella Siu
06196022cf
Elasticsearch: Update grafana-plugin-sdk-go for sse errorsource updates (#96144) 2024-11-15 10:18:07 -05:00
dependabot[bot]
0b84d8afe7
Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#95807)
* Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1

Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](https://github.com/golang-jwt/jwt/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix make workspace update

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jo <me@jguer.space>
2024-11-14 17:06:12 +02:00
Karl Persson
8d74296b6c
Authn: Always set namespace (#96230)
* Rename from AllowedKubernetesNamespace to Namespace

* Use a sync hook to always set namespace for Identity.

* format

* Don't set uid when authenticating as user
2024-11-12 10:12:47 +01:00
Leonor Oliveira
a1de4cc5fc
Allow downgrade from any mode to mode 1 or 2. Allow setting all dual writer combinations (#95968)
* Allow downgrade from any mode to mode 1 or 2

* Allow for all combinations of dual writer setting

* Add all cases

* Include mode3
2024-11-11 10:52:36 +01:00
Carl Bergquist
70223b2e3d
Loki: Add support for injecting scopes into loki expressions. (#95591)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2024-11-06 15:28:42 +02:00
Karl Persson
3bcbf231ee
IDToken: fix namespace format (#95341)
* Bump authlib version

* Remove temporary formatter and start signing tokens with `stacks-` prefix

* update workspace
2024-11-04 09:33:03 +01:00
Todd Treece
30b1e3b289
K8s: APIGroupBuilder App SDK Support (#95638) 2024-11-01 08:28:56 -04:00
Ryan McKinley
4e1f0dadbd
UnifiedStorage: Default to running unified-grpc in integration tests (#93492) 2024-10-31 16:29:32 +03:00
Marcus Efraimsson
5c9071a6c6
Chore: Update SDK to v0.258.0 (#95325) 2024-10-24 12:14:19 +02:00
Leonor Oliveira
a03652494c
Dual Writer simplification (#93852)
* All objects should have an UID

* Now with a different error message

* Simplify create on DW 2: use the same object to write to both storages

* Run only one test

* Add check for status code

* Add name if it's not present in mode2

* Populate UID in legacy

* Remove logs and commented code

* Change dualwriter1

* Remove commented code

* Fix list test

* remove get on update from dualwriter 2

* Get object before updating. Better var renaming

* Finish rebasing

* Comment test

* Uncomment tests

* Update legacy first. Add preconditions

* Remove preconditions

* Fix update test

* copy RV from unified to legacy objects

* revert changes to playlist xorm store

* Improve logging. Add go routines for mode3

* Add tests for async funcs in mode3

* Lint

* Lint

* Lint. Start to fix tests

* Fix watcher tests

* Fix store tests

* Fiinish fixing watcher tests

* Fix server tests

* add name check

* Update pkg/apiserver/rest/dualwriter_mode1.go

Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>

* All objects should have an UID

* Now with a different error message

* Simplify create on DW 2: use the same object to write to both storages

* Run only one test

* Add check for status code

* Add name if it's not present in mode2

* Populate UID in legacy

* Remove logs and commented code

* Change dualwriter1

* Remove commented code

* Fix list test

* remove get on update from dualwriter 2

* Get object before updating. Better var renaming

* Finish rebasing

* Comment test

* Uncomment tests

* Fix update test

* revert changes to playlist xorm store

* Improve logging. Add go routines for mode3

* Lint

* Fix watcher tests

* Fiinish fixing watcher tests

* Add mode 5 with etcd test case. Add early check to fail on populated RV in payload

* we can't set RV to the found object when updating

* Lint

* Don't fail on update playlists

* Name should not be different when updating and it should be not empty on creating

* Fix tests

* Update pkg/apiserver/rest/dualwriter_mode2.go

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* Lint

* Fix mode 5 tests

* Lint

* Add generateName condition on every mode. Fix tests

* Lint

* Add condition on where name or generate name have to be set

* Fix test

* Lint

* Fix folders test

* We dont need to send name for mode1

* Fail if UID is not present

* Remove change from not running test

* Remove unused line

* Lint

* Update pkg/storage/unified/apistore/store.go

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>

* Improve error message

* Fix broken watcher test

* Fail on name mismatch on update

* Remove log

* Make sure UIDs match on create in both stores

* Lint

* Write first to unified storage

* Remove uid setting

* Remove RV only in mode2

* Fix test. Remove log line

* test

* No need to asser on RV in mode3

* Remove RV check due to race condition

* Update dualwriter.go

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>

* Update pkg/storage/unified/client.go

* remove unused parameter

* log an error for object is missing UID instead of returning an error

* remove obj.SetResourceVersion("")

* log an error for object is missing UID instead of returning an error

* FInalise merge

* Move RV check to where it was

* Remove name check

* Remove server check for backwards compatibility

* Remove unused fn

* Move test checks for another PR

* Dont commit go work sum changes

* Only log error if RV is present for now.

---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
Co-authored-by: Bruno Abrantes <bruno.abrantes@grafana.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2024-10-23 10:29:41 +02:00
Will Browne
25abd57029
Plugins: Update to latest go plugin SDK (0.256.0) (#95065)
* update to latest go plugin SDK

* make update-workspace

* update alerting tests
2024-10-22 15:44:53 +01:00
Karl Persson
a82d01214d
Auth: Update authlib (#94947)
* Update authlib
2024-10-18 13:36:21 +02:00
Marcus Efraimsson
42016dc359
Chore: Update SDK to v0.255.0 (#94894) 2024-10-18 10:42:32 +02:00
maicon
c4f906f7fa
UniStore: Fix DualWriter compare method (#94705)
* UniStore: Fix DualWriter compare method

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-16 16:22:49 +02:00
maicon
4a60f29709
UniStore: register dual_writer_data_syncer_outcome metric (#94789)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-16 16:44:20 +03:00
maicon
9dc2ccdbfd
UniStore: Test both Mode1 and Mode2 for LegacyToUnifiedStorage Syncer (#94784)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-10-16 06:43:01 +02:00
Alexander Zobnin
9f1b584c85
Chore: Update authlib version (#94714)
* Chore: Update authlib version

* update workspace

* use ParseNamespace()
2024-10-15 16:58:46 +02:00
maicon
bfd3506549
UniStore: Enable DataSyncer in Mode1 + better logging (#94688)
* UniStore: Enable DataSyncer Mode1 + better logging

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-10-15 06:41:12 +03:00
Karl Persson
9ece88d585
Zanzana: bump openfga version (#94485)
* Bump openfga

* Remove internall sqlite implementation for openfga

* Use sqlite implementation from openfga
2024-10-10 09:07:40 +02:00
Georges Chaudy
03f55e5288
Unistore : Ensure Watch works in HA mode (#94120)
* Revert "Revert "Unistore : Ensure Watch works in HA mode." (#94097)"

This reverts commit 7c3fc2f261.

* make previous_resource_version nullable

* handle nil case
2024-10-07 10:01:53 +02:00
Todd Treece
a4d919c157
Chore: Update k8s.io dependencies to v0.31.1 (#93696) 2024-10-03 15:50:15 -04:00
Marcus Efraimsson
e22b510cd8
API Server: Fix extracting jaeger remote trace from incoming request (#93998) 2024-10-02 17:07:31 +02:00
Georges Chaudy
7c3fc2f261
Revert "Unistore : Ensure Watch works in HA mode." (#94097)
Revert "Unistore : Ensure Watch works in HA mode. (#93428)"

This reverts commit 0a26c9e9ae.
2024-10-01 18:45:47 +00:00
Santiago
aa77023008
Alerting: Fix panics when attempting to create an Alertmanager after failing (#94023) 2024-09-30 13:50:35 -03:00
Georges Chaudy
0a26c9e9ae
Unistore : Ensure Watch works in HA mode. (#93428)
* Replace Watch with WatchNext

* remove watchset

* fix previous page and closing the channel

* Remove the broadcaster cache to prevent dupplicated events

* add watch bookmark

* add watch bookmark

* cleanup comments

* disable the tests for bookmarks for now

* Ensure we send previosu events

* lint

* re-introduce the cache

* load from cache

* disabling legacy test

* disabling legacy test

* Update pkg/storage/unified/resource/server.go

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>

* Could not read previous events

* add proper migration

* Add previous_resource_version to both history and resource

* First event should have an RV of 2 and not 1

* Test both storage backends

* fix the inital RV for the sql backend

* ensure graceful stop of the stream decoder

* gocyclo

---------

Co-authored-by: Diego Augusto Molina <diegoaugustomolina@gmail.com>
2024-09-30 13:14:07 +02:00
Ryan McKinley
afe464bc20
K8s/Storage: add a reusable generic storage builder (#93778) 2024-09-26 14:26:45 +01:00
maicon
d60351d8e8
Unistore: fix DualWriter context cancelation on mode 1 (#93377)
* Unistore: fix DualWriter context cancelation on mode 1

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-09-23 10:34:36 -03:00
Karl Persson
2e38329026
RBAC: Add required component to perform access control checks for user api when running single tenant (#93104)
* Unexport store and create new constructor function

* Add ResourceAuthorizer and LegacyAccessClient

* Configure checks for user store

* List with checks if AccessClient is configured

* Allow system user service account to read all users

---------

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2024-09-23 11:26:44 +02:00
Andres Martinez Gotor
74b2d38e37
Chore: Update grafana-plugin-sdk (#93426) 2024-09-20 10:20:59 +02:00
Todd Treece
d1ffcc22d9
Playlists: Migrate to App SDK codegen (#93246) 2024-09-13 16:27:40 -04:00
Ryan McKinley
d724d463b1
DualWriter: Add mode 5 that always uses storage (#93169) 2024-09-10 13:07:06 -04:00
Ryan McKinley
22c63ea3c5
DualWriter: remove mode4 wrapper (#93172) 2024-09-10 16:01:14 +03:00
Ryan McKinley
2f792ee4ae
DualWriter: Return error for unsupported watch (#93159) 2024-09-10 15:42:17 +03:00
Leonor Oliveira
8d2b8378ed
Remove UID on update in dual writer mode 2 (#93032)
* Remove UID on update in dual writer mode 2

* WIP: add dashboard tests

* Add more crud tests for dashboards in each mode

* trigger build

* Fix test
2024-09-10 11:57:28 +02:00
ismail simsek
6548ea377d
Chore: Bump grafana-plugin-sdk-go version to v0.247.0 (#93095)
* Bump grafana-plugin-sdk-go version to v0.247.0

* make update-workspace

* make update-workspace
2024-09-09 14:36:59 +03:00
Dave Henderson
e1090db5d9
Chore: Bump Go to 1.23.1 (#93007)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
2024-09-06 20:58:50 +03:00
Ryan McKinley
3cf84d1921
Chore: update centrifuge library (#93020) 2024-09-06 12:17:43 +03:00
Claudiu Dragalina-Paraipan
1ce43b4c42
[authn] update authlib and claims versions (#92987)
* update authlib and claims versions

* 2nd make update-workspace

* manual fix
2024-09-05 19:17:15 +03:00
Santiago
87f4df4bc3
Remote Alertmanager: update github.com/go-openapi/runtime (v0.27.1 -> v0.28.0) (#92951) 2024-09-05 08:47:38 -03:00
Marcus Efraimsson
0a337ff3b3
Chore: Update SDK to v0.246.0 (#92938) 2024-09-04 17:30:37 +02:00
maicon
2b3d2e5b40
UniStore: Remove leftover references to unifiedStorage feature toggle (#92685)
it got removed on https://github.com/grafana/grafana/pull/92192

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
2024-08-29 18:04:36 +03:00
Leonor Oliveira
66e0121dd5
Pass resource name into the dual writer initialization (#92654) 2024-08-29 13:30:48 +02:00
Leonor Oliveira
09f102b72e
Remove condition on where we return from unified storage in mode2 (#92593) 2024-08-28 16:31:53 +02:00
Todd Treece
85ef26a85d
K8s: Add generic support for status (#92378) 2024-08-28 03:45:04 +03:00
Charandas
af2e79aa83
K8s: namespace mapper should use authlib's util (#92332) 2024-08-27 15:01:42 -07:00
maicon
de2c9a06bf
Unified Storage: First iteration Dual Write Syncer (#89809)
* Unified Storage: First iteration Dual Write Syncer

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Leonor Oliveira <9090754+leonorfmartins@users.noreply.github.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
2024-08-27 13:31:40 -03:00
Todd Treece
2f01286034
Storage: Add go.mod for apistore (#92224) 2024-08-21 14:32:01 -04:00
Dave Henderson
df3d8915ba
Chore: Bump Go to 1.23.0 (#92105)
* chore: Bump Go to 1.23.0

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* update swagger files

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore: update .bingo/README.md formatting to satisfy prettier

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* chore(lint): Fix new lint errors found by golangci-lint 1.60.1 and Go 1.23

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* keep golden file

* update openapi

* add name to expected output

* chore(lint): rearrange imports to a sensible order

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

---------

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-08-21 11:40:42 -04:00
Leonor Oliveira
81ce3c92d5
Remove optionsStorage and labelSelector (#92196) 2024-08-21 15:44:38 +02:00