Skip to content

Commit 81cfdd1

Browse files
authored
fix: pull registry probe image before the timed readiness check (#1904)
1 parent 26df08b commit 81cfdd1

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

renovate.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,12 @@
99
"matchUpdateTypes": ["minor", "patch", "lockFileMaintenance"],
1010
"groupName": "All non-major"
1111
}
12+
],
13+
"customManagers": [
14+
{
15+
"customType": "regex",
16+
"managerFilePatterns": ["/^src/utils\\.ts$/"],
17+
"matchStrings": ["// renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s+static readonly \\w+: string = \"[^:\"]+:(?<currentValue>[^\"]+)\";"]
18+
}
1219
]
1320
}

src/utils.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,12 @@ export class Utils {
422422
}
423423

424424
static readonly gclRegistryPrefix: string = "registry.gcl.local";
425+
// renovate: datasource=docker depName=registry
426+
static readonly gclRegistryImage: string = "registry:3.1.1";
427+
// renovate: datasource=docker depName=alpine/openssl
428+
static readonly gclOpensslImage: string = "alpine/openssl:3.5.7";
429+
// renovate: datasource=docker depName=curlimages/curl
430+
static readonly gclCurlImage: string = "curlimages/curl:8.21.0";
425431
static async startDockerRegistry (argv: Argv): Promise<void> {
426432
const gclRegistryCertVol = `${this.gclRegistryPrefix}.certs`;
427433
const gclRegistryDataVol = `${this.gclRegistryPrefix}.data`;
@@ -446,7 +452,7 @@ export class Utils {
446452
"-addext", `subjectAltName=DNS:${this.gclRegistryPrefix}`,
447453
];
448454
const generateCertsInPlace = [
449-
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", "alpine/openssl", "-c",
455+
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", this.gclOpensslImage, "-c",
450456
[
451457
"openssl", ...opensslArgs,
452458
"&&", "mkdir", "-p", `/certs/${this.gclRegistryPrefix}`,
@@ -481,18 +487,19 @@ export class Utils {
481487
"-e", "REGISTRY_HTTP_ADDR=0.0.0.0:443",
482488
"-e", `REGISTRY_HTTP_TLS_CERTIFICATE=/certs/${this.gclRegistryPrefix}.crt`,
483489
"-e", `REGISTRY_HTTP_TLS_KEY=/certs/${this.gclRegistryPrefix}.key`,
484-
"registry",
490+
this.gclRegistryImage,
485491
]);
486492

487493
try {
494+
await Utils.spawn([argv.containerExecutable, "pull", this.gclCurlImage]);
488495
await execa(argv.containerExecutable, [
489496
"run", "--rm",
490497
"--network", gclRegistryNet,
491498
"--entrypoint", "sh",
492-
"curlimages/curl",
499+
this.gclCurlImage,
493500
"-c", `until [ "$(curl -s -o /dev/null -k -w "%{http_code}" https://${this.gclRegistryPrefix}:443)" = "200" ]; do sleep 1; done;`,
494501
], {
495-
timeout: 4000,
502+
timeout: 10000,
496503
});
497504
} catch (err) {
498505
await this.stopDockerRegistry(argv.containerExecutable);

0 commit comments

Comments
 (0)