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>
This commit is contained in:
Michael Mandrus
2024-02-01 23:52:02 -05:00
committed by GitHub
parent 9c9e5e68c8
commit 7464ea4346
17 changed files with 348 additions and 775 deletions

View File

@@ -134,18 +134,7 @@ type FeatureFlag struct {
RequiresRestart bool `json:"requiresRestart,omitempty"`
}
type UpdateFeatureTogglesCommand struct {
FeatureToggles []FeatureToggleDTO `json:"featureToggles"`
}
type FeatureToggleDTO struct {
Name string `json:"name" binding:"Required"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
ReadOnly bool `json:"readOnly,omitempty"`
}
type FeatureManagerState struct {
RestartRequired bool `json:"restartRequired"`
AllowEditing bool `json:"allowEditing"`
type FeatureToggleWebhookPayload struct {
FeatureToggles map[string]string `json:"feature_toggles"`
User string `json:"user"`
}