diff options
author | Vincent Ambo <tazjin@google.com> | 2019-07-30T22·55+0100 |
---|---|---|
committer | Vincent Ambo <github@tazj.in> | 2019-07-30T23·02+0100 |
commit | 2e4b1f85eef04c0abd83f5f47e1aa93c8ea84cb9 (patch) | |
tree | 96220740ace3354b504c5f2f349eee8cda859b5a /tools | |
parent | 4802727408b7afeb8b5245e698053a700ebf6775 (diff) |
fix(nix): Add empty image config to allow k8s usage
Introduce an empty runtime configuration object in each built layer. This is required because Kubernetes expects the configuration to be present (even if it's just empty values). Providing an empty configuration will make Docker's API return a full configuration struct with default (i.e. empty) values rather than `null`, which works for Kubernetes. This fixes issue #1. See the issue for additional details.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nixery/build-registry-image.nix | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/nixery/build-registry-image.nix b/tools/nixery/build-registry-image.nix index 25d1f59e714e..0d61f3b713f5 100644 --- a/tools/nixery/build-registry-image.nix +++ b/tools/nixery/build-registry-image.nix @@ -133,6 +133,8 @@ let os = "linux"; rootfs.type = "layers"; rootfs.diff_ids = map (layer: "sha256:${layer.sha256}") allLayers; + # Required to let Kubernetes import Nixery images + config = {}; }; configJson = writeText "${baseName}-config.json" (builtins.toJSON config); configMetadata = with builtins; fromJSON (readFile (runCommand "config-meta" { |