diff --git a/src/server/db/migrations/001_seed.ts b/src/server/db/migrations/001_seed.ts index 4dc13c5..fb31aa3 100644 --- a/src/server/db/migrations/001_seed.ts +++ b/src/server/db/migrations/001_seed.ts @@ -447,7 +447,7 @@ export async function up(knex: Knex): Promise { INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('deletePendingHelmReleaseStep', '{"delete":true,"static_delete":true}', now(), now(), null, 'If deletePendingHelmReleaseStep is set to true'); INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('redpanda', '{"version":"3.7.2","args":"--force --timeout 60m0s --wait","action":"install","chart":{"name":"redpanda","repoUrl":"https://charts.redpanda.com","version":"5.9.0","values":[],"valueFiles":[]},"tolerations":"tolerations","affinity":"affinity","nodeSelector":"nodeSelector"}', now(), now(), null, 'Redpanda helm chart configuration default values.'); INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('mongodb', '{"version":"3.7.2","args":"--force --timeout 60m0s --wait","action":"install","chart":{"name":"mongodb","repoUrl":"https://charts.bitnami.com/bitnami","version":"16.3.0","values":["auth.rootPassword=rootpassword","replicaCount=1","timeoutSeconds=20","periodSeconds=15","timeoutSeconds=20","periodSeconds=15","useStatefulSet=true"],"valueFiles":[]},"label":"labels","tolerations":"tolerations","affinity":"affinity","nodeSelector":"nodeSelector"}', now(), now(), null, 'MongoDB bitnami helm chart configuration default values.'); - INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('serviceDefaults', '{"dockerfilePath":"Dockerfile","cpuRequest":"10m","memoryRequest":"100Mi","readinessInitialDelaySeconds":0,"readinessPeriodSeconds":10,"readinessTimeoutSeconds":1,"readinessSuccessThreshold":1,"readinessFailureThreshold":30,"readinessTcpSocketPort":8090,"readinessHttpGetPort":8080,"readinessHttpGetPath":"/__lbheartbeat__","acmARN":"replace_me","grpc":false,"defaultIPWhiteList":"{ 0.0.0.0/0 }"}', now(), now(), null, 'Default configuration for services for values that are not set in the configuration file'); + INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('serviceDefaults', '{"dockerfilePath":"Dockerfile","cpuRequest":"10m","memoryRequest":"100Mi","readinessInitialDelaySeconds":0,"readinessPeriodSeconds":10,"readinessTimeoutSeconds":1,"readinessSuccessThreshold":1,"readinessFailureThreshold":30,"acmARN":"replace_me","grpc":false,"defaultIPWhiteList":"{ 0.0.0.0/0 }"}', now(), now(), null, 'Default configuration for services for values that are not set in the configuration file'); INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('domainDefaults', '{"http":"127.0.0.1.nip.io","grpc":"127.0.0.1.nip.io"}', now(), now(), null, 'Default domain hostnames for the lifecycle deployments'); INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('orgChart', '{"name":"replace_me"}', now(), now(), null, 'Default internal helm chart for the org.'); INSERT INTO global_config (key, config, "createdAt", "updatedAt", "deletedAt", description) VALUES ('auroraRestoreSettings', '{"vpcId":"","accountId":"","region":"us-west-2","securityGroupIds":[],"subnetGroupName":"","engine":"aurora-mysql","engineVersion":"8.0.mysql_aurora.3.06.0","tagMatch":{"key":"restore-for"},"instanceSize":"db.t3.medium","restoreSize":"db.t3.small"}', now(), now(), null, 'Default aurora database settings to use for restore'); diff --git a/src/server/models/yaml/YamlService.ts b/src/server/models/yaml/YamlService.ts index 645a292..a98335e 100644 --- a/src/server/models/yaml/YamlService.ts +++ b/src/server/models/yaml/YamlService.ts @@ -833,9 +833,7 @@ export async function getTcpSocketPort(deployment: DeploymentConfig): Promise { helm: undefined, }); }); + + test('Generate config should not infer readiness when not configured', async () => { + const githubService: YamlService.GithubService = { + name: 'github-app', + github: { + repository: 'example-org/example-service', + branchName: 'unit-test', + docker: { + defaultTag: 'main', + app: { + dockerfilePath: 'app1/app.Dockerfile', + ports: [8080], + }, + }, + deployment: { + public: false, + capacityType: 'SPOT', + }, + }, + }; + + // @ts-ignore + const result: DeployableAttributes = await deployableService.generateAttributesFromYamlConfig( + 100, + 'unit-test-12345', + '1234567890', + 'unit-test', + githubService + ); + + expect(result.readinessTcpSocketPort).toBeNull(); + expect(result.readinessHttpGetPort).toBeUndefined(); + expect(result.readinessHttpGetPath).toBeUndefined(); + }); }); }); diff --git a/src/server/services/service.ts b/src/server/services/service.ts index 081d6dd..da74afa 100644 --- a/src/server/services/service.ts +++ b/src/server/services/service.ts @@ -49,14 +49,6 @@ export default class ServiceService extends BaseService { public: true, cpuRequest: '10m', memoryRequest: '100Mi', - readinessInitialDelaySeconds: 0, - readinessPeriodSeconds: 10, - readinessTimeoutSeconds: 1, - readinessSuccessThreshold: 1, - readinessFailureThreshold: 30, - readinessTcpSocketPort: 8090, - readinessHttpGetPath: '/__lbheartbeat__', - readinessHttpGetPort: 8080, host: domainDefaults.http, acmARN: serviceDefaults.acmARN, initEnv: '{}',