diff --git a/config/incidents.patch.json b/config/cluster-health-analyzer.patch.json similarity index 100% rename from config/incidents.patch.json rename to config/cluster-health-analyzer.patch.json diff --git a/pkg/plugin_handler.go b/pkg/plugin_handler.go index f56c9304..842bfa12 100644 --- a/pkg/plugin_handler.go +++ b/pkg/plugin_handler.go @@ -44,7 +44,14 @@ func patchManifest(baseManifestData []byte, cfg *Config) []byte { patchedManifest = performPatch(baseManifestData, filepath.Join(cfg.ConfigPath, "clear-extensions.patch.json")) } + if cfg.Features[Incidents] || cfg.Features[ClusterHealthAnalyzer] { + patchedManifest = performPatch(patchedManifest, filepath.Join(cfg.ConfigPath, "cluster-health-analyzer.patch.json")) + } + for feature := range cfg.Features { + if feature == ClusterHealthAnalyzer || feature == Incidents { + continue + } patchedManifest = performPatch(patchedManifest, filepath.Join(cfg.ConfigPath, fmt.Sprintf("%s.patch.json", feature))) } diff --git a/pkg/server.go b/pkg/server.go index 653fca84..669fd9b1 100644 --- a/pkg/server.go +++ b/pkg/server.go @@ -56,10 +56,11 @@ type PluginConfig struct { type Feature string const ( - AcmAlerting Feature = "acm-alerting" - Incidents Feature = "incidents" - DevConfig Feature = "dev-config" - PersesDashboards Feature = "perses-dashboards" + AcmAlerting Feature = "acm-alerting" + Incidents Feature = "incidents" + DevConfig Feature = "dev-config" + PersesDashboards Feature = "perses-dashboards" + ClusterHealthAnalyzer Feature = "cluster-health-analyzer" ) func (pluginConfig *PluginConfig) MarshalJSON() ([]byte, error) {