Add incremental configuration

This commit is contained in:
2025-09-28 08:26:18 +02:00
parent d40c54b802
commit 015583f1cd
2 changed files with 8 additions and 11 deletions

View File

@@ -93,13 +93,7 @@ var configSchema = `
"type": "object", "type": "object",
"properties": { "properties": {
"name": { "name": {
"description": "The name of the cluster.", "description": "The name of the cluster."
"kind": {
"type": "string",
"enum": ["influxdb", "prometheus", "cc-metric-store", "cc-metric-store-internal", "test"]
},
"url": {
"type": "string"
}, },
"subClusters" { "subClusters" {
"description": "The array of overrides per subcluster.", "description": "The array of overrides per subcluster.",

View File

@@ -54,8 +54,11 @@ type MetricConfig struct {
} }
type ClusterConfig struct { type ClusterConfig struct {
Name string `json:"name"` Name string `json:"name"`
SubClusters []SubClusterConfig `json:"subClusters"` JobListMetrics []string `json:"jobListMetrics"`
JobViewPlotMetrics []string `json:"jobViewPlotMetrics"`
JobViewTableMetrics []string `json:"jobViewTableMetrics"`
SubClusters []SubClusterConfig `json:"subClusters"`
} }
type SubClusterConfig struct { type SubClusterConfig struct {
@@ -74,7 +77,7 @@ type PlotConfiguration struct {
var initOnce sync.Once var initOnce sync.Once
var Keys = WebConfig{ var UIDefaults = WebConfig{
JobList: JobListConfig{ JobList: JobListConfig{
UsePaging: false, UsePaging: false,
ShowFootprint: true, ShowFootprint: true,
@@ -119,7 +122,7 @@ func Init(rawConfig json.RawMessage, disableArchive bool) error {
initOnce.Do(func() { initOnce.Do(func() {
config.Validate(configSchema, rawConfig) config.Validate(configSchema, rawConfig)
if err = json.Unmarshal(rawConfig, &Keys); err != nil { if err = json.Unmarshal(rawConfig, &UIDefaults); err != nil {
cclog.Warn("Error while unmarshaling raw config json") cclog.Warn("Error while unmarshaling raw config json")
return return
} }