Commit Graph

40 Commits

Author SHA1 Message Date
maicon
5270d8e53f fix(unified-storage): remove permissions after executing on both stores (#109722)
Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
Co-authored-by: Jean-Philippe Quéméner <jeanphilippe.quemener@grafana.com>
2025-08-15 15:57:42 +00:00
Ryan McKinley
8fd8c6f476 SecureValues: Add explicit JSON schema (#109648) 2025-08-14 16:01:29 +03:00
Ryan McKinley
d3df5b8ddd Secrets: Manage secure values inside any resource (#107803) 2025-08-14 12:31:24 +00:00
Ryan McKinley
101aea9647 K8s/Meta: Support setting secure values on a struct type (#109381) 2025-08-12 00:53:56 -05:00
Ryan McKinley
295ace108d K8s/Meta: Support extracting InlineSecureValues from an explicit struct (#109279) 2025-08-06 21:17:50 +03:00
Ryan McKinley
9786389ae8 SecureValues: Support inline secure values in GrafanaMetaAccessor (#107996) 2025-07-11 16:47:54 +00:00
Ryan McKinley
06c00e4fa7 Chore: apimachinery types cleanup (#107988) 2025-07-10 12:45:16 -07:00
Todd Treece
f3b545a903 K8s: Add cluster scope support in app runner (#106914) 2025-06-18 13:15:32 -04:00
Roberto Jiménez Sánchez
55a2b77386 Provisioning: refactor commit signature logic (#104055)
* WIP: Separate signature package

* Add some unit tests

* Test factory

* Finish unit test coverage signature package

* Fix register

* Add FIXME

* Add more coverage

* Add more coverage

* Fix migrate tests

* Fix unit tests
2025-04-16 10:04:19 +01:00
Marco de Abreu
c47ab101d1 Dashboards: Add Dashboard Schema validation (2) (#103844)
* Activate schema validation and align underlying systems

* update to save as v0 if not the right schema version

* Resolve merge conflicts

* Move RequireApiErrorStatus to tests package

* Add mutation tests

* Fix lint

* Only do min version check if dashboard is v1

* Fix lint and disable provisioning test

* Revert provisioning changes

* Revert more tests and add schema test

* Reran gen

* SQL Dashboard save

* Adjust APIVERSION

* Fixed mutation test

* Add logging on downgrade

---------

Co-authored-by: Marco de Abreu <18629099+marcoabreu@users.noreply.github.com>
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-04-11 23:05:41 +02:00
Mariell Hoversholm
757be6365a CI: Bump golangci-lint to 2.0.2 (#103572) 2025-04-10 14:42:23 +02:00
Ryan McKinley
af8a70bbab K8s/Permissions: Enable a grant-permissions annotation action to set default permissions (#102527)
* create permissions

* add key

* lint

* structure as a delayed callback

* legacy API hook

* merge main

* wired up

* and folders

* watch repos

* missing return statement

* Set the correct permissions

* add TestAfterCreatePermissionCreator

* do not add perms on folder create

* fix tests

* add annotation on create

* lint

* lint

* ensure we set permissions when the FT is disabled

* remove custom folder_storage

* fix lint

* change default

* lint

* lint

* fix: annotation

* ensure permissions are added on folder legacy

* remove folderstorage again

* fix tests

* add FT

* undo change to folder

* dashboard on create

* remove annotation for folder

* fix tests

* fix prepare after rebase

* fix tests

* fix tests

* fix tests

* lint

* address comments

* add test for prepareObjectForStorage

* add again skipIfMode as per comment

---------

Co-authored-by: Georges Chaudy <chaudyg@gmail.com>
2025-04-09 13:05:37 +02:00
Stephanie Hingtgen
0087d7bd58 Unistore: Skip label for getting full path (#102928) 2025-03-26 15:50:53 -05:00
Stephanie Hingtgen
0ce28c8dd8 K8s: Reduce folder get calls in modes 0-2 (#102831) 2025-03-26 05:44:10 +02:00
Ryan McKinley
2e2b5942c8 K8s/Unified: Consolidate generation logic in apistore client (#102260) 2025-03-21 10:45:25 +02:00
Ryan McKinley
0845c781ae K8s/Storage: Refactor Upsert (create from update) (#102528) 2025-03-20 19:57:05 +03:00
Ryan McKinley
fd4e08e318 K8s/Dashboards: Remove slug annotation (#102270) 2025-03-17 19:01:29 +02:00
Ryan McKinley
e6f682bc14 K8s/Dashboards: Fix title extraction (#101990) 2025-03-12 09:46:12 +02:00
Ryan McKinley
dc2defd84f K8s/Annotations: Use manager/source annotations rather than repo (#101313)
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-03-05 08:54:20 +02:00
Igor Suleymanov
6ccc56814c Add resource annotations for storing manager properties (#99683)
What is this feature?

This change adds properties and known annotations to store them in for recording resource manager information, such as:

The type (kind) of the manager (ex. Terraform / kubectl / etc.)
The identity of the manager (ex. grafana/terraform-provider-grafana)
Whether the managers allows the resource to be edited by others.
Whether a resource is temporarily excluded from the manager's control.
These annotations are inspired by Kubernetes field management API (https://kubernetes.io/docs/reference/using-api/server-side-apply/#field-management) and known Kubernetes annotations
(https://kubernetes.io/docs/reference/labels-annotations-taints/#app-kubernetes-io-managed-by).

It also adds annotations for storing information about the source of a provisioned resource, such as path, checksum & timestamp.

Why do we need this feature?

To make it possible to mark resources as managed by specific managers, modifying how these resources appear in the UI and are treated in the backend APIs.

For example, we'd like to make managed resources read-only, or show specific docs / workflows based on the tool which is used to manage resources and so on.

The identity is required for ensuring that managers of the same kind can still be told apart.

Who is this feature for?

For as-code practitioners and API users.

---------

Signed-off-by: Igor Suleymanov <igor.suleymanov@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2025-02-20 11:39:12 +02:00
Ryan McKinley
3c56e32b0c K8s/Utils: Find title in unstructured content (#100576) 2025-02-13 14:04:03 +03:00
Ryan McKinley
a037c6f344 K8s/Folders: Remove kubernetesFolders flag and full path metadata (#99256)
* remove full path

* remove more

* remove KubernetesFolders tests

* remove feature toggles

* remove feature toggles

* skip permissions test

* skip permissions test

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2025-01-23 17:25:03 +03:00
Ryan McKinley
356b32008b Storage: Show history+trash using the list command (#99009)
Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
2025-01-17 15:54:25 +03:00
Karl Persson
c593b20465 Zanana: Add custom verb for get_permissions and set_permissions. (#98616)
* Add custom verb for get_permissions and update_permissions.

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2025-01-10 11:49:26 +01:00
Stephanie Hingtgen
03f7a7d89d K8s: Dashboards: Add search to dashboard service (#98395) 2025-01-02 09:39:45 -06:00
Ryan McKinley
1a46039037 K8s/Dashboards: Pass the legacy internal ID into labels (#98311)
---------

Co-authored-by: Stephanie Hingtgen <stephanie.hingtgen@grafana.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2024-12-20 21:33:49 +02:00
Ryan McKinley
cc6d057a18 Provisioning: Rename k8s origin metadata to repo (#96524) 2024-11-15 17:26:14 +03:00
Ryan McKinley
c0de407fee K8s/Dashboards: Delegate large objects to blob store (#94943) 2024-11-09 08:09:46 +03:00
Ryan McKinley
8b9bb2acf6 K8s/Folders: Warn against using full path in metadata (#94829) 2024-10-17 14:32:39 +03:00
Arati R.
011978e81b K8s/Folders: Remove folder service from client (#94450)
* Support getting full path of UIDs
* Use full path to set parents field
* Update get folder test
* Add folder store test for getting with full path UIDs
* Add test for parsing parent titles
* Test nested folder create payload
2024-10-10 13:22:57 +02:00
Karl Persson
0160f4f72c RBAC: Add legacy authorization checks to service accounts (#93753)
* Extract a helper funtion to perform list with authorization checks

* Add k8s verb to utils package

* Construct default mapping when no custom mapping is passed

* Configure authorization checks for service accounts

* Fix helper and add filtering to service accounts
2024-09-27 15:53:11 +02: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
Ryan McKinley
9210414782 K8s: support unstructured spec+status mutation with GrafanaMetaAccessor (#92970) 2024-09-10 13:32:18 +03:00
Ryan McKinley
cb484f9883 K8s: Move ResourceInfo from common to utils (#92924) 2024-09-04 14:53:14 +03:00
Todd Treece
85ef26a85d K8s: Add generic support for status (#92378) 2024-08-28 03:45:04 +03:00
Ryan McKinley
a223c46506 APIServer: Make TableConverter part of ResourceInfo (#91520) 2024-08-05 15:38:12 +03:00
Ryan McKinley
079f0715aa ResourceServer: Add resource server protobuf and wrapper (#90007) 2024-07-09 15:08:13 -07:00
Ryan McKinley
9b7f9ae22e K8s: Rename origin.key to origin.hash (#89337) 2024-06-18 22:27:16 +03:00
Ryan McKinley
f2b6a9aa3d K8s: Add numeric revisionVersion helpers to grafanaMetaAccessor (#89191) 2024-06-14 02:35:23 +03:00
Ryan McKinley
3ae95a6eb1 K8s: Update grafana resource metadata accessor (#89074) 2024-06-12 14:39:37 +03:00