소스 검색

query-node deployment: only read indexer config options if deploying

Mokhtar Naamani 3 년 전
부모
커밋
59efc3fde4
1개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. 9 9
      devops/kubernetes/query-node/indexerDeployment.ts

+ 9 - 9
devops/kubernetes/query-node/indexerDeployment.ts

@@ -2,15 +2,6 @@ import * as k8s from '@pulumi/kubernetes'
 import * as pulumi from '@pulumi/pulumi'
 import { PostgresServiceDeployment } from 'pulumi-common'
 
-const config = new pulumi.Config()
-const DB_PASS = config.require('dbPassword')
-const BLOCK_HEIGHT = config.require('blockHeight') || '0'
-const WS_PROVIDER_ENDPOINT_URI = config.require('joystreamWsEndpoint')
-
-const DB_USERNAME = 'postgres'
-const INDEXER_DATABASE_NAME = 'indexer'
-const DB_PORT = '5432'
-
 /**
  * ServiceDeployment is an example abstraction that uses a class to fold together the common pattern of a
  * Kubernetes Deployment and its associated Service object.
@@ -23,6 +14,15 @@ export class IndexerServiceDeployment extends pulumi.ComponentResource {
   constructor(name: string, args: ServiceDeploymentArgs, opts?: pulumi.ComponentResourceOptions) {
     super('indexer:service:IndexerServiceDeployment', name, {}, opts)
 
+    const config = new pulumi.Config()
+    const DB_PASS = config.require('dbPassword')
+    const BLOCK_HEIGHT = config.require('blockHeight') || '0'
+    const WS_PROVIDER_ENDPOINT_URI = config.require('joystreamWsEndpoint')
+
+    const DB_USERNAME = 'postgres'
+    const INDEXER_DATABASE_NAME = 'indexer'
+    const DB_PORT = '5432'
+
     // Name passed in the constructor will be the endpoint for accessing the service
     const serviceName = name
     const appLabels = { appClass: 'indexer' }