Skip to content

Commit 4d1bd0a

Browse files
committed
fix: pull registry probe image before the timed readiness check
The readiness probe's 4s budget also covered the curlimages/curl image pull, so a cold pull consumed it before the poll could run. Pin the three images used by the local registry and let renovate track them.
1 parent 26df08b commit 4d1bd0a

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

renovate.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@
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": ["Image: string = \"(?<depName>[^:\"]+):(?<currentValue>[^\"]+)\""],
18+
"datasourceTemplate": "docker"
19+
}
1220
]
1321
}

src/utils.ts

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

424424
static readonly gclRegistryPrefix: string = "registry.gcl.local";
425+
static readonly gclRegistryImage: string = "registry:3.1.1";
426+
static readonly gclOpensslImage: string = "alpine/openssl:3.5.7";
427+
static readonly gclCurlImage: string = "curlimages/curl:8.21.0";
425428
static async startDockerRegistry (argv: Argv): Promise<void> {
426429
const gclRegistryCertVol = `${this.gclRegistryPrefix}.certs`;
427430
const gclRegistryDataVol = `${this.gclRegistryPrefix}.data`;
@@ -446,7 +449,7 @@ export class Utils {
446449
"-addext", `subjectAltName=DNS:${this.gclRegistryPrefix}`,
447450
];
448451
const generateCertsInPlace = [
449-
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", "alpine/openssl", "-c",
452+
argv.containerExecutable, "run", "--rm", "-v", `${gclRegistryCertVol}:/certs`, "--entrypoint", "sh", this.gclOpensslImage, "-c",
450453
[
451454
"openssl", ...opensslArgs,
452455
"&&", "mkdir", "-p", `/certs/${this.gclRegistryPrefix}`,
@@ -481,18 +484,20 @@ export class Utils {
481484
"-e", "REGISTRY_HTTP_ADDR=0.0.0.0:443",
482485
"-e", `REGISTRY_HTTP_TLS_CERTIFICATE=/certs/${this.gclRegistryPrefix}.crt`,
483486
"-e", `REGISTRY_HTTP_TLS_KEY=/certs/${this.gclRegistryPrefix}.key`,
484-
"registry",
487+
this.gclRegistryImage,
485488
]);
486489

490+
await Utils.spawn([argv.containerExecutable, "pull", this.gclCurlImage]);
491+
487492
try {
488493
await execa(argv.containerExecutable, [
489494
"run", "--rm",
490495
"--network", gclRegistryNet,
491496
"--entrypoint", "sh",
492-
"curlimages/curl",
497+
this.gclCurlImage,
493498
"-c", `until [ "$(curl -s -o /dev/null -k -w "%{http_code}" https://${this.gclRegistryPrefix}:443)" = "200" ]; do sleep 1; done;`,
494499
], {
495-
timeout: 4000,
500+
timeout: 10000,
496501
});
497502
} catch (err) {
498503
await this.stopDockerRegistry(argv.containerExecutable);

0 commit comments

Comments
 (0)