From 1c3fd186ab474a563121dd7ba78bb9f6317c402b Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Wed, 30 Aug 2023 10:20:49 -0400 Subject: [PATCH] Resolve TODOs about annotations (#1280) Signed-off-by: Jason Hall --- BEST_PRACTICES.md | 7 ------- images/cadvisor/configs/latest.apko.yaml | 5 ----- images/slim-toolkit-debug/configs/latest.apko.yaml | 6 +----- main.tf | 6 ------ tflib/publisher/main.tf | 2 +- 5 files changed, 2 insertions(+), 24 deletions(-) diff --git a/BEST_PRACTICES.md b/BEST_PRACTICES.md index e15e3c3b98..2dc9bd9114 100644 --- a/BEST_PRACTICES.md +++ b/BEST_PRACTICES.md @@ -268,13 +268,6 @@ Other tests that should be considered: * For utilities/tooling bring up help e.g. `–help` * For base images with a shell, call it e.g. [/bin/sh] * Consider where and how the image deviates from popular alternatives. Is there a good reason and is it documented? -* Add annotations e.g: - - annotations: - "org.opencontainers.image.authors": "Chainguard Team https://www.chainguard.dev/" - "org.opencontainers.image.url": https://edu.chainguard.dev/chainguard/chainguard-images/reference/busybox/ #use the academy site here - "org.opencontainers.image.source": https://github.com/chainguard-images/images/tree/main/images/bazel #use github here - * Check if environment variables are needed e.g. to set data locations * Ensure the image responds to SIGTERM * `docker kill $(docker run -d --rm cgr.dev/chainguard/nginx)` diff --git a/images/cadvisor/configs/latest.apko.yaml b/images/cadvisor/configs/latest.apko.yaml index 9fd9265478..b2d2e946d8 100644 --- a/images/cadvisor/configs/latest.apko.yaml +++ b/images/cadvisor/configs/latest.apko.yaml @@ -51,8 +51,3 @@ environment: entrypoint: command: /usr/bin/cadvisor cmd: -logtostderr - -annotations: - "org.opencontainers.image.authors": "Chainguard Team https://www.chainguard.dev/" - "org.opencontainers.image.url": https://edu.chainguard.dev/chainguard/chainguard-images/reference/cadvisor/ - "org.opencontainers.image.source": https://github.com/chainguard-images/images/tree/main/images/cadvisor diff --git a/images/slim-toolkit-debug/configs/latest.apko.yaml b/images/slim-toolkit-debug/configs/latest.apko.yaml index fb5d156f69..7e8b1d7da4 100644 --- a/images/slim-toolkit-debug/configs/latest.apko.yaml +++ b/images/slim-toolkit-debug/configs/latest.apko.yaml @@ -3,7 +3,7 @@ contents: - curl - bash - busybox - - git + - git - curl - grpcurl - drill @@ -32,7 +32,3 @@ contents: entrypoint: command: /bin/bash -c - -annotations: - "org.opencontainers.image.url": https://edu.chainguard.dev/chainguard/chainguard-images/reference/debug/ - "org.opencontainers.image.source": https://github.com/chainguard-images/images/tree/main/images/debug diff --git a/main.tf b/main.tf index dcad33e4ff..139cba40a8 100644 --- a/main.tf +++ b/main.tf @@ -33,9 +33,6 @@ provider "apko" { extra_keyring = concat(["https://packages.wolfi.dev/os/wolfi-signing.rsa.pub"], var.extra_keyring) extra_packages = concat(["wolfi-baselayout"], var.extra_packages) default_archs = length(var.archs) == 0 ? ["x86_64", "aarch64"] : var.archs - default_annotations = { - "org.opencontainers.image.authors" : "Chainguard Team https://www.chainguard.dev/", // TODO: remove this when everything is migrated to TF annotations - } } provider "apko" { @@ -45,9 +42,6 @@ provider "apko" { # These packages match chainguard-images/static extra_packages = ["alpine-baselayout-data", "alpine-release", "ca-certificates-bundle"] default_archs = length(var.archs) == 0 ? ["386", "amd64", "arm/v6", "arm/v7", "arm64", "ppc64le", "s390x"] : var.archs // All arches *except* riscv64 - default_annotations = { - "org.opencontainers.image.authors" : "Chainguard Team https://www.chainguard.dev/", // TODO: remove this when everything is migrated to TF annotations - } } provider "kubernetes" { diff --git a/tflib/publisher/main.tf b/tflib/publisher/main.tf index 527ebd8664..1bebae28d5 100644 --- a/tflib/publisher/main.tf +++ b/tflib/publisher/main.tf @@ -85,7 +85,7 @@ data "oci_structure_test" "structure" { } precondition { condition = startswith(module.this.config.annotations["org.opencontainers.image.url"], "https://edu.chainguard.dev/chainguard/chainguard-images/reference/") - error_message = "image.uri annotation must be edu.chainguard.dev (got '${module.this.config.annotations["org.opencontainers.image.url"]}')" + error_message = "image.url annotation must be edu.chainguard.dev (got '${module.this.config.annotations["org.opencontainers.image.url"]}')" } precondition { condition = startswith(module.this.config.annotations["org.opencontainers.image.source"], "https://github.com/chainguard-images/images/tree/main/images/")