Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/db/migrations/001_seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export async function up(knex: Knex): Promise<any> {
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');
Expand Down
11 changes: 2 additions & 9 deletions src/server/models/yaml/YamlService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,9 +833,7 @@ export async function getTcpSocketPort(deployment: DeploymentConfig): Promise<nu
if (deployment?.readiness?.httpGet?.port && deployment?.readiness?.httpGet?.path) {
return null;
}
const { serviceDefaults } = await GlobalConfigService.getInstance().getAllConfigs();

return serviceDefaults.readinessTcpSocketPort;
return null;
}

/**
Expand All @@ -852,12 +850,7 @@ export async function getHttpGetPortAndHost(deployment: DeploymentConfig): Promi
};
}
if (!deployment?.readiness?.httpGet?.port && !deployment?.readiness?.httpGet?.path) {
const { serviceDefaults } = await GlobalConfigService.getInstance().getAllConfigs();

return {
port: serviceDefaults.readinessHttpGetPort,
path: serviceDefaults.readinessHttpGetPath,
};
return null;
}
return {
port: deployment.readiness.httpGet.port,
Expand Down
37 changes: 34 additions & 3 deletions src/server/services/__tests__/deployable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ const serviceDefaults = {
readinessTimeoutSeconds: 1,
readinessSuccessThreshold: 1,
readinessFailureThreshold: 30,
readinessTcpSocketPort: 8090,
readinessHttpGetPort: 8080,
readinessHttpGetPath: '/__lbheartbeat__',
acmARN: 'arn:aws:acm:us-west-2:account-id:certificate/ceritifcate-id',
grpc: false,
defaultIPWhiteList: '{ 70.52.40.40/32,160.72.36.84/32 }',
Expand Down Expand Up @@ -392,5 +389,39 @@ describe('Deployable Service', () => {
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();
});
});
});
8 changes: 0 additions & 8 deletions src/server/services/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '{}',
Expand Down
Loading