nixos/docker-registry: fix mkIf misuse and OCI manifest test (#497827)
This commit is contained in:
@@ -28,20 +28,6 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
registryConfig.redis = lib.mkIf cfg.enableRedisCache {
|
||||
addr = "${cfg.redisUrl}";
|
||||
password = "${cfg.redisPassword}";
|
||||
db = 0;
|
||||
dialtimeout = "10ms";
|
||||
readtimeout = "10ms";
|
||||
writetimeout = "10ms";
|
||||
pool = {
|
||||
maxidle = 16;
|
||||
maxactive = 64;
|
||||
idletimeout = "300s";
|
||||
};
|
||||
};
|
||||
|
||||
configFile = cfg.configFile;
|
||||
in
|
||||
{
|
||||
@@ -139,6 +125,22 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.dockerRegistry.extraConfig = lib.mkIf cfg.enableRedisCache {
|
||||
redis = {
|
||||
addr = "${cfg.redisUrl}";
|
||||
password = "${cfg.redisPassword}";
|
||||
db = 0;
|
||||
dialtimeout = "10ms";
|
||||
readtimeout = "10ms";
|
||||
writetimeout = "10ms";
|
||||
pool = {
|
||||
maxidle = 16;
|
||||
maxactive = 64;
|
||||
idletimeout = "300s";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.docker-registry = {
|
||||
description = "Docker Container Registry";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
client2.succeed("docker images | grep scratch")
|
||||
|
||||
client2.succeed(
|
||||
"curl -fsS -X DELETE registry:8080/v2/scratch/manifests/$(curl -fsS -I -H\"Accept: application/vnd.docker.distribution.manifest.v2+json\" registry:8080/v2/scratch/manifests/latest | grep Docker-Content-Digest | sed -e 's/Docker-Content-Digest: //' | tr -d '\\r')"
|
||||
"curl -fsS -X DELETE registry:8080/v2/scratch/manifests/$(curl -fsS -I -H\"Accept: application/vnd.oci.image.manifest.v1+json\" registry:8080/v2/scratch/manifests/latest | grep Docker-Content-Digest | sed -e 's/Docker-Content-Digest: //' | tr -d '\\r')"
|
||||
)
|
||||
|
||||
registry.systemctl("start docker-registry-garbage-collect.service")
|
||||
|
||||
Reference in New Issue
Block a user