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",
"properties": {
"name": {
"description": "The name of the cluster.",
"kind": {
"type": "string",
"enum": ["influxdb", "prometheus", "cc-metric-store", "cc-metric-store-internal", "test"]
},
"url": {
"type": "string"
"description": "The name of the cluster."
},
"subClusters" {
"description": "The array of overrides per subcluster.",

View File

@@ -54,8 +54,11 @@ type MetricConfig struct {
}
type ClusterConfig struct {
Name string `json:"name"`
SubClusters []SubClusterConfig `json:"subClusters"`
Name string `json:"name"`
JobListMetrics []string `json:"jobListMetrics"`
JobViewPlotMetrics []string `json:"jobViewPlotMetrics"`
JobViewTableMetrics []string `json:"jobViewTableMetrics"`
SubClusters []SubClusterConfig `json:"subClusters"`
}
type SubClusterConfig struct {
@@ -74,7 +77,7 @@ type PlotConfiguration struct {
var initOnce sync.Once
var Keys = WebConfig{
var UIDefaults = WebConfig{
JobList: JobListConfig{
UsePaging: false,
ShowFootprint: true,
@@ -119,7 +122,7 @@ func Init(rawConfig json.RawMessage, disableArchive bool) error {
initOnce.Do(func() {
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")
return
}