Skip to content

Commit e46481a

Browse files
vulkoingimroboquat
authored andcommitted
preview env - clean dead code
1 parent 2c5977c commit e46481a

File tree

5 files changed

+6
-434
lines changed

5 files changed

+6
-434
lines changed

.werft/platform-delete-preview-environments-cron.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Werft } from "./util/werft";
1+
import {Werft} from "./util/werft";
22
import * as Tracing from "./observability/tracing";
3-
import { SpanStatusCode } from "@opentelemetry/api";
4-
import { exec } from "./util/shell";
5-
import { CORE_DEV_KUBECONFIG_PATH, HARVESTER_KUBECONFIG_PATH } from "./jobs/build/const";
6-
import { HarvesterPreviewEnvironment, PreviewEnvironment } from "./util/preview";
3+
import {SpanStatusCode} from "@opentelemetry/api";
4+
import {exec} from "./util/shell";
5+
import {CORE_DEV_KUBECONFIG_PATH, HARVESTER_KUBECONFIG_PATH} from "./jobs/build/const";
6+
import {HarvesterPreviewEnvironment, PreviewEnvironment} from "./util/preview";
77

88
// for testing purposes
99
// if set to 'true' it shows only previews that would be deleted
@@ -184,7 +184,7 @@ async function determineStalePreviewEnvironments(options: {
184184

185185
werft.done(SLICES.CHECKING_FOR_DB_ACTIVITY);
186186

187-
const previewsToDelete = previews.filter((preview: PreviewEnvironment) => {
187+
return previews.filter((preview: PreviewEnvironment) => {
188188
if (!previewNamespaceBasedOnBranches.has(preview.namespace)) {
189189
werft.log(
190190
SLICES.DETERMINING_STALE_PREVIEW_ENVIRONMENTS,
@@ -210,8 +210,6 @@ async function determineStalePreviewEnvironments(options: {
210210
);
211211
return false;
212212
});
213-
214-
return previewsToDelete;
215213
}
216214

217215
async function removePreviewEnvironment(previewEnvironment: PreviewEnvironment) {

.werft/util/gpctl.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

.werft/util/templates/cert-manager_certificate.tpl

Lines changed: 0 additions & 12 deletions
This file was deleted.

.werft/util/util.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@ export async function sleep(millis: number) {
66
});
77
}
88

9-
export function validateIPaddress(ipaddress) {
10-
if (
11-
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(
12-
ipaddress,
13-
)
14-
) {
15-
return true;
16-
}
17-
return false;
18-
}
19-
209
export function env(k8sConfigPath: string, _parent?: ExecOptions): ExecOptions {
2110
const parent = _parent || {};
2211
if (!parent.env) {

0 commit comments

Comments
 (0)