Skip to content

Commit

Permalink
Resolve TODOs about annotations (#1280)
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Hall <jason@chainguard.dev>
  • Loading branch information
imjasonh authored Aug 30, 2023
1 parent 244fdec commit 1c3fd18
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 24 deletions.
7 changes: 0 additions & 7 deletions BEST_PRACTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
Expand Down
5 changes: 0 additions & 5 deletions images/cadvisor/configs/latest.apko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions images/slim-toolkit-debug/configs/latest.apko.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ contents:
- curl
- bash
- busybox
- git
- git
- curl
- grpcurl
- drill
Expand Down Expand Up @@ -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
6 changes: 0 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion tflib/publisher/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down

0 comments on commit 1c3fd18

Please sign in to comment.