Skip to content

Commit 6927c51

Browse files
authored
fix: failed to create puller log for none-demo deployment (#2158)
1 parent d9c0560 commit 6927c51

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

manifests/bucketeer/charts/subscriber/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ spec:
6060
value: "{{ .Values.global.pubsub.project }}"
6161
- name: BUCKETEER_SUBSCRIBER_PROFILE
6262
value: "{{.Values.env.profile}}"
63+
- name: BUCKETEER_SUBSCRIBER_DEMO_SITE_ENABLED
64+
value: "{{.Values.env.demoSiteEnabled}}"
6365
- name: BUCKETEER_SUBSCRIBER_GCP_TRACE_ENABLED
6466
value: "{{.Values.env.gcpEnabled}}"
6567
- name: PUBSUB_EMULATOR_HOST

manifests/bucketeer/charts/subscriber/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fullnameOverride: "subscriber"
88
env:
99
project:
1010
profile: true
11+
demoSiteEnabled: false
1112
gcpEnabled: true
1213
enablePprof: false
1314
pprofAddr: 127.0.0.1:6060

manifests/bucketeer/values.dev.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ subscriber:
292292
env:
293293
project: bucketeer-test
294294
profile: false
295+
demoSiteEnabled: false
295296
gcpEnabled: false
296297
enablePprof: false
297298
pprofAddr: 127.0.0.1:6060

pkg/subscriber/cmd/server/server.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ type server struct {
5858
keyPath *string
5959
serviceTokenPath *string
6060
webURL *string
61+
demoSiteEnabled *bool
6162
// MySQL
6263
mysqlUser *string
6364
mysqlPass *string
@@ -98,6 +99,7 @@ func RegisterCommand(r cli.CommandRegistry, p cli.ParentCommand) cli.Command {
9899
CmdClause: cmd,
99100
port: cmd.Flag("port", "Port to bind to.").Default("9090").Int(),
100101
project: cmd.Flag("project", "Google Cloud project name.").String(),
102+
demoSiteEnabled: cmd.Flag("demo-site-enabled", "Enable demo site.").Default("false").Bool(),
101103
certPath: cmd.Flag("cert", "Path to TLS certificate.").Required().String(),
102104
keyPath: cmd.Flag("key", "Path to TLS key.").Required().String(),
103105
serviceTokenPath: cmd.Flag("service-token", "Path to service token.").Required().String(),
@@ -556,15 +558,17 @@ func (s *server) registerPubSubProcessorMap(
556558
userEventPersister,
557559
)
558560

559-
demoOrganizationCreationNotifier := processor.NewDemoOrganizationCreationNotifier(
560-
processorsConfigMap[processor.DemoOrganizationCreationNotifierName],
561-
*s.webURL,
562-
logger,
563-
)
564-
processors.RegisterProcessor(
565-
processor.DemoOrganizationCreationNotifierName,
566-
demoOrganizationCreationNotifier,
567-
)
561+
if *s.demoSiteEnabled {
562+
demoOrganizationCreationNotifier := processor.NewDemoOrganizationCreationNotifier(
563+
processorsConfigMap[processor.DemoOrganizationCreationNotifierName],
564+
*s.webURL,
565+
logger,
566+
)
567+
processors.RegisterProcessor(
568+
processor.DemoOrganizationCreationNotifierName,
569+
demoOrganizationCreationNotifier,
570+
)
571+
}
568572

569573
redisCache := cachev3.NewRedisCache(persistentRedisClient)
570574
evaluationCountEventPersister, err := processor.NewEvaluationCountEventPersister(

0 commit comments

Comments
 (0)