Commit Graph

612 Commits

Author SHA1 Message Date
Jo
cc3b088b6c
Teams: Fix missing context in team service (#83327)
fix missing context in team service
2024-02-27 11:10:54 +01:00
Todd Treece
e5a26a3f7c
K8s: Add apimachinery and apiserver packages (#83190) 2024-02-23 15:15:43 -05:00
Charandas
0bd009fb53
K8s: fix nil deref from dummy factory for API Server options (#83132) 2024-02-20 23:00:02 +02:00
linoman
ac84069071
Password policy (#82268)
* add password service interface

* add password service implementation

* add tests for password service

* add password service wiring

* add feature toggle

* Rework from service interface to static function

* Replace previous password validations

* Add codeowners to password service

* add error logs

* update config files


---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2024-02-16 04:58:05 -06:00
Gabriel MABILLE
846eadff63
RBAC Search: Replace userLogin filter by namespacedID filter (#81810)
* Add namespace ID

* Refactor and add tests

* Rename maxOneOption -> atMostOneOption

* Add ToDo

* Remove UserLogin & UserID for NamespaceID

Co-authored-by: jguer <joao.guerreiro@grafana.com>

* Remove unecessary import of the userSvc

* Update pkg/services/accesscontrol/acimpl/service.go

* fix 1 -> userID

* Update pkg/services/accesscontrol/accesscontrol.go

---------

Co-authored-by: jguer <joao.guerreiro@grafana.com>
2024-02-16 11:42:36 +01:00
Ryan McKinley
c879588332
APIServer: Use options pattern in standalone mode (#82760)
use options
2024-02-15 12:00:20 -08:00
Karl Persson
1315c67c8b
Team/User: UID migrations (#82298)
* Add user uid migration to run on every startup to protect against empty values in a upgrade downgrade scenario

* Add team uid migration to run on every startup to protect against empty values in a upgrade downgrade scenario

* Run team uid migration
2024-02-12 14:48:29 +01:00
Dan Cech
790e1feb93
Chore: Update test database initialization (#81673)
* streamline initialization of test databases, support on-disk sqlite test db

* clean up test databases

* introduce testsuite helper

* use testsuite everywhere we use a test db

* update documentation

* improve error handling

* disable entity integration test until we can figure out locking error
2024-02-09 09:35:39 -05:00
Ryan McKinley
40a08a7720
K8s: use +enum tag in playlist and unstructured dummy (#82022) 2024-02-06 16:10:32 -08:00
Ryan McKinley
91754bcda5
K8s: Refactor standalone apiserver initialization (#81932) 2024-02-06 08:40:35 -08:00
Ryan McKinley
810d14d88f
K8s: use --runtime-config={group}/{version}=true to enabled APIs (#81614) 2024-02-01 22:06:28 -08:00
Michael Mandrus
7464ea4346
Feature Toggles: Switch feature toggle admin page over to k8s API (#80854)
* add handling for legacy and k8s apis to frontend

* use backend srv directly not redux

* add unit test to make sure the correct apis are being called

* require api server flag

* fix feature toggle name

* ensure both pages work correctly

* make consistent with legacy api

* implement webhook update

* fix unit test

* remove old apis and update

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-02-01 23:52:02 -05:00
Todd Treece
67b6be5515
K8s: Refactor config/options for aggregation (#81739) 2024-02-01 17:27:30 -05:00
Ryan McKinley
e013cd427c
K8s: Add basic query service (#80325) 2024-01-31 20:36:51 +02:00
Ryan McKinley
1fab107e79
FeatureFlags: Avoid using cfg.IsFeatureToggleEnabled (#81407) 2024-01-28 15:22:45 -08:00
Gabriel MABILLE
722b78f3e0
RBAC: Add userLogin filter to the permission search endpoint (#81137)
* RBAC: Search add user login filter

* Switch to a userService resolving instead

* Remove unused error

* Fallback to use the cache

* account for userID filter

* Account for the error

* snake case

* Add test cases

* Add api tests

* Fix return on error

* Re-order imports
2024-01-26 09:43:16 +01:00
Marcus Efraimsson
6768c6c059
Chore: Remove public vars in setting package (#81018)
Removes the public variable setting.SecretKey plus some other ones. 
Introduces some new functions for creating setting.Cfg.
2024-01-23 12:36:22 +01:00
Will Browne
2a0f1900d5
Datasources: Add wireset for datasource.DataSourceAPIBuilder (#80914)
tidy up
2024-01-22 15:21:27 +01:00
Ryan McKinley
41e523bde7
K8s/FeatureFlags: Add an apiserver to manage feature flags (dev only) (#80501)
* add deployment registry API cloud only

* update versions

* add feature flag endpoints

* use helpers

* merge main

* update AllowSelfServie and re-run code gen

* fix package name

* add allowselfserve flag to payload

* remove config

* update list api to return the full registry including states

* change enabled check

* fix compile error

* add feature toggle and split path in frontend

* changes

* with status

* add more status/state

* add back config thing

* add back config thing

* merge main

* merge main

* now on the /current api endpoint

* now on the /current api endpoint

* drop frontend changes

* change group name to featuretoggle (singular)

* use the same settings

* now with patch

* more common refs

* more common refs

* WIP actually do the webhook

* fix comment

* fewer imports

* registe standalone

* one less file

* fix singular name

---------

Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
2024-01-17 21:32:44 -08:00
Charandas
87c3d3b029
K8s: add the CRD server to the grafana-aggregator component (pkg/cmd) (#80759) 2024-01-17 12:21:24 -08:00
Tolya Korniltsev
b5a1a3e106
Profiling: Import godeltaprof/http/pprof (#80509)
chore: import godeltaprof/http/pprof

This adds /debug/pprof/delta_{heap,mutex,block} endpoints to DefaultServeMux
and the profiling port.
2024-01-16 17:58:35 +07:00
Ryan McKinley
6be6724433
K8s/Testdata: Expose testdata in standalone apiserver (#80248) 2024-01-10 17:45:23 +02:00
Ryan McKinley
ee7daeb2a7
APIServer: Move shared code to a utility/helper function (#80261) 2024-01-10 07:30:16 -08:00
Charandas
48612063dd
Grafana app platform: an aggregator cmd and package (#79948) 2024-01-08 22:33:42 +02:00
Todd Treece
d492100adc
Chore: Bump k8s dependencies to v0.29.0 (#79492)
* Chore: Bump k8s dependencies to v0.29.0

* update the openapi fork

* use post process spec

---------

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-14 10:00:48 -05:00
Todd Treece
2a2a132c61
K8s: Refactor metrics to share k8s registry (#79106) 2023-12-06 16:34:23 -05:00
Ryan McKinley
439edebcd6
K8s: fix standalone command and add hack scripts (#79052)
Co-authored-by: Charandas Batra <charandas.batra@grafana.com>
2023-12-05 14:31:49 -08:00
Todd Treece
7e2aad1d01
Revert "K8s: Refactor metrics to share k8s registry (#77957)" (#79079)
This reverts commit 38bc41651a.
2023-12-05 09:34:07 -05:00
Todd Treece
38bc41651a
K8s: Refactor metrics to share k8s registry (#77957)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-12-04 10:54:59 -08:00
Dan Cech
318f51eaee
Chore: Remove unused CacheService dependency from sqlstore (#78507)
remove unused CacheService dependency from sqlstore
2023-12-04 10:00:45 -05:00
Andres Martinez Gotor
20f3a87bf5
Bug: Fix loading behavior with FlagExternalCorePlugins (#78388) 2023-11-21 11:51:13 +01:00
Ryan McKinley
d410ef3439
K8s: Use grafana executable for standalone api service (#77904)
Co-authored-by: Dan Cech <dcech@grafana.com>
2023-11-09 16:50:27 -08:00
Charandas
28e58c1725
Grafana app platform: drop etcd requirement in example-apiserver (#77886) 2023-11-08 10:57:32 -08:00
Charandas
8a46dc39d0
Grafana App Platform: provide an example-apiserver to easily deploy aggregated APIservers (#77826) 2023-11-07 22:35:15 -08:00
Horst Gutmann
9813d17e93
Expose enterprise-commit in server version output (#75897)
* Expose enterprise-commit in server version output

* Define a DefaultCommitValue constant
2023-10-04 14:51:35 +02:00
Ezequiel Victorero
4cfc834c08
HealthCheck: show enterprise commit (#75242) 2023-09-22 08:17:10 -03:00
Kristin Laemmert
496cf3d0da
server target command (#74408)
feat: add grafana server target command
2023-09-06 13:11:57 -04:00
Kristin Laemmert
cc1205d6ba
fix: revert module server initialization from CLI (#74386)
not-a-revert reversion of module server initialization
2023-09-05 11:45:56 -04:00
Kristin Laemmert
0de2c9eb96
feat: add ability to launch targeted dskit modules in the grafana server CLI command (#74188)
* feat: add ability to launch targeted dskit modules in the grafana server CLI command

This commit adds a ModuleServer and ModuleRunner suitable for launching dskit services and updates the server cli command to use this instead of the full Server. The default behavior is unchanged and will launch the full Grafana server. Individual services are targeted by setting target=comma,seperated,list in the config file.

* require dev mode to target dskit modules

* remove unused type

* replace setting.CommandLineArgs w/setting.Cfg; the caller can deal with calling setting.NewCfg

* Update pkg/server/module_server.go

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>

---------

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2023-09-01 08:09:54 -04:00
Ryan McKinley
025b2f3011
Chore: use any rather than interface{} (#74066) 2023-08-30 18:46:47 +03:00
Kristin Laemmert
2569081165
chore: minor refactoring in the grafana server cli command (#72847)
This is preparative work for extending the grafana server cli command to target individual dskit modules that seemed worth breaking into this smaller PR. This moves the CLI flags and various reusable chunks of code into variables and methods.
2023-08-04 08:03:47 -04:00
Todd Treece
f3ffc850aa
Chore: Revert dskit service additions (#72608) 2023-08-03 09:19:01 -04:00
Hugo Kiyodi Oshiro
bc3d22ec48
Plugin: Remove error on invalid version (#71951)
* Remove error on invalid version

* Skip test case
2023-07-19 16:55:31 +02:00
Hugo Kiyodi Oshiro
2776a000ab
Plugin: Validate plugin version on installation (#71488) 2023-07-17 10:22:28 +02:00
Will Browne
162dde5bdd
Plugins: Use suffix for plugin directory (#71375)
* plugin dir suffix

* fix whitespace

* fix cli

* fix tests

* fixup

* simplify

* undo uninstall changes
2023-07-14 11:49:05 +02:00
Hugo Kiyodi Oshiro
fe4a932c6e
Plugins: Fail plugins installation on wrong args provided (#71355)
* Return error on plugin install extra args

* Remove unused valid argument

* Add log for wrong installation args
2023-07-12 13:52:12 +02:00
Will Browne
4818568c65
Chore: Convert background service registry to dskit module (#64062)
* Chore: Add initial support for deployment modes

* revert CLI changes and start modules independently

* add modules to codeowners

* additional comments

* add Engine and Manager interface to fix test issues

* convert background service registry to dskit module

* remove extra context from serviceListener logger

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Remove whitespace

* fix import

* undo ide changes

* only register All by default

* with registry

* add test

* add comments

* re-add debug log

* fix import

* reorganize arg

* undo kind changes

* add provide service test

* fix import

* rejig systemd calls

* update codeowners

---------

Co-authored-by: Todd Treece <todd.treece@grafana.com>
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2023-07-06 14:45:47 +02:00
Serge Zaitsev
47b2e7f1d7
Fix: Create store only once in cli mode (#70391)
fix: create store only once in cli mode
2023-06-20 17:28:42 +02:00
Will Browne
a221e1d226
Plugins: Standardize Golang enum naming convention (#69449)
* standardize enum pattern

* fix up
2023-06-08 12:21:19 +02:00
Eng Zer Jun
cf1945d0c3
Tests: use t.Setenv to set env vars (#69516)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-05 11:31:03 +02:00