aboutsummaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-05-06 13:51:48 +0100
committerGitHub <noreply@github.com>2022-05-06 13:51:48 +0100
commit507f63d0fc8158f200f3e29fd36e5f09c83e62db (patch)
treeec553399ddf351cc953e3f20cfec8dbfaa17d8f5 /setup
parenta1a5357f799887fc5b7e3bf5c81bbf3198704645 (diff)
Add `PolylithMode` base config option (#2428)
* Add `PolylithMode` base config option * Polylith mode always uses HTTP APIs
Diffstat (limited to 'setup')
-rw-r--r--setup/base/base.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/setup/base/base.go b/setup/base/base.go
index d7d5119f..ef449cc3 100644
--- a/setup/base/base.go
+++ b/setup/base/base.go
@@ -96,6 +96,7 @@ type BaseDendriteOptions int
const (
NoCacheMetrics BaseDendriteOptions = iota
UseHTTPAPIs
+ PolylithMode
)
// NewBaseDendrite creates a new instance to be used by a component.
@@ -105,17 +106,20 @@ func NewBaseDendrite(cfg *config.Dendrite, componentName string, options ...Base
platformSanityChecks()
useHTTPAPIs := false
cacheMetrics := true
+ isMonolith := true
for _, opt := range options {
switch opt {
case NoCacheMetrics:
cacheMetrics = false
case UseHTTPAPIs:
useHTTPAPIs = true
+ case PolylithMode:
+ isMonolith = false
+ useHTTPAPIs = true
}
}
configErrors := &config.ConfigErrors{}
- isMonolith := componentName == "Monolith" // TODO: better way?
cfg.Verify(configErrors, isMonolith)
if len(*configErrors) > 0 {
for _, err := range *configErrors {