Commit Graph

36 Commits

Author SHA1 Message Date
Stephanie Hingtgen
6571451a57
K8s: dashboards: fix conversion (#96648) 2024-11-19 05:32:05 -07:00
Ryan McKinley
cc6d057a18
Provisioning: Rename k8s origin metadata to repo (#96524) 2024-11-15 17:26:14 +03:00
Ryan McKinley
e9956f2345
Storage: Always set a UID in the apiserver (#96086) 2024-11-12 18:58:32 +02:00
Ryan McKinley
c0de407fee
K8s/Dashboards: Delegate large objects to blob store (#94943) 2024-11-09 08:09:46 +03:00
Ryan McKinley
4e1f0dadbd
UnifiedStorage: Default to running unified-grpc in integration tests (#93492) 2024-10-31 16:29:32 +03: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
Ryan McKinley
3457f219be
Storage: Add blob storage interfaces (#90932)
Co-authored-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
2024-10-17 12:18:29 +02:00
Prem Saraswat
e2672021bc
[unified-storage/apistore] Fix GuranteedUpdate skipping updates when tryUpdate is passed (#94557)
`GuranteedUpdate` method of `apistore.Storage` had a bug, where it would
errorneously conclude that the object is unchanged, in case a
`tryUpdate` function is passed that modifies the existing object itself
(as it is the case in many core types in K8s upstream).

The modified `existingObj` was compared with `updatedObj`, which would
essentially be same and this lead to the update being skipped.

This patch fixes this by always passing a copy of the `existingObj`.

Signed-off-by: Prem Kumar <prem.saraswat@grafana.com>
2024-10-11 17:15:43 +05:30
Matheus Macabu
4bc7a35f56
UnifiedStorage: fix watcher test (#94301) 2024-10-07 12:07:48 +03: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
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
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
Andres Martinez Gotor
74b2d38e37
Chore: Update grafana-plugin-sdk (#93426) 2024-09-20 10:20:59 +02:00
Ryan McKinley
542105b680
ResourceClient: Exercise resource client in k8s apis tests (#93473) 2024-09-19 17:16:48 +03:00
Todd Treece
d1ffcc22d9
Playlists: Migrate to App SDK codegen (#93246) 2024-09-13 16:27:40 -04:00
Claudiu Dragalina-Paraipan
3aeb8d390e
[authn] update authlib and claims versions (#93098)
* update authlib version to latest

* make update-workspace -- 2nd run

* manual cleanup of old version
2024-09-09 15:45:59 +03: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
Ryan McKinley
5441e4c752
Storage: create a client with access to all interfaces, not just ResourceStore (#92967) 2024-09-05 12:52:30 +03:00
Marcus Efraimsson
0a337ff3b3
Chore: Update SDK to v0.246.0 (#92938) 2024-09-04 17:30:37 +02:00
Charandas
af2e79aa83
K8s: namespace mapper should use authlib's util (#92332) 2024-08-27 15:01:42 -07:00
Todd Treece
2f01286034
Storage: Add go.mod for apistore (#92224) 2024-08-21 14:32:01 -04:00
Ryan McKinley
21d4a4f49e
Auth: use IdentityType from authlib (#91763) 2024-08-12 09:26:53 +03:00
Todd Treece
b4126d3bce
Chore: Update k8s.io dependencies (#91692) 2024-08-08 18:39:44 +03:00
Ryan McKinley
da65825c5f
Storage: Consolidate error handling (#91167) 2024-07-30 10:16:16 +00:00
Ryan McKinley
728150bdbd
Identity: extend k8s user.Info (#90937) 2024-07-30 08:27:23 +03:00
Ryan McKinley
9db3bc926e
Identity: Rename "namespace" to "type" in the requester interface (#90567) 2024-07-25 12:52:14 +03:00
Ryan McKinley
6e39f24588
Storage: Update storage.Interface for backend (#90382) 2024-07-18 07:47:47 -07:00
Ryan McKinley
f409f8c169
K8s/Dashboards: Implement dashboards as StorageBackend (#90295) 2024-07-17 10:49:23 -07:00
Ryan McKinley
07c2d886fa
Storage: prepare in resource bytes in storage.Interface, not the backend (#90513)
* prepare in k8s

* prepare in k8s

* prepare in k8s

* simplify event creation

* decode the inputs
2024-07-17 07:40:03 -07:00
Ryan McKinley
030188831d
Storage: Use Error property for error handling rather than Status (#90416)
replace status with error
2024-07-16 07:43:15 -07:00
Ryan McKinley
079f0715aa
ResourceServer: Add resource server protobuf and wrapper (#90007) 2024-07-09 15:08:13 -07:00