| 36 | } |
| 37 | |
| 38 | func NewDistributorWithConfigFile(name string, store RingStore, address, configFile string, flags map[string]string, image string) *CortexService { |
| 39 | if configFile != "" { |
| 40 | flags["-config.file"] = filepath.Join(e2e.ContainerSharedDir, configFile) |
| 41 | } |
| 42 | |
| 43 | // Configure the ingesters ring backend |
| 44 | flags["-ring.store"] = string(store) |
| 45 | switch store { |
| 46 | case RingStoreConsul: |
| 47 | flags["-consul.hostname"] = address |
| 48 | case RingStoreEtcd: |
| 49 | flags["-etcd.endpoints"] = address |
| 50 | } |
| 51 | |
| 52 | if image == "" { |
| 53 | image = GetDefaultImage() |
| 54 | } |
| 55 | |
| 56 | return NewCortexService( |
| 57 | name, |
| 58 | image, |
| 59 | e2e.NewCommandWithoutEntrypoint("cortex", e2e.BuildArgs(e2e.MergeFlags(map[string]string{ |
| 60 | "-target": "distributor", |
| 61 | "-log.level": "warn", |
| 62 | "-auth.enabled": "true", |
| 63 | "-distributor.replication-factor": "1", |
| 64 | }, flags))...), |
| 65 | e2e.NewHTTPReadinessProbe(httpPort, "/ready", 200, 299), |
| 66 | httpPort, |
| 67 | grpcPort, |
| 68 | ) |
| 69 | } |
| 70 | |
| 71 | func NewQuerier(name string, store RingStore, address string, flags map[string]string, image string) *CortexService { |
| 72 | return NewQuerierWithConfigFile(name, store, address, "", flags, image) |