Files
kubernetes/hack
Patrick Ohly 73627dd663 verify: improve output of verify-e2e-images.sh
Before:

    Diffing e2e image list ...
    --- /dev/fd/63	2025-06-24 09:32:43.736397729 +0200
    +++ /dev/fd/62	2025-06-24 09:32:43.736397729 +0200
    @@ -5,7 +5,7 @@ invalid.registry.k8s.io/invalid/alpine
     registry.k8s.io/build-image/distroless-iptables
     registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
     registry.k8s.io/e2e-test-images/agnhost
    -registry.k8s.io/e2e-test-images/apparmor-loader
    +registry.k8s.io/e2e-test-images/apparmor-no-such-image
     registry.k8s.io/e2e-test-images/busybox
     registry.k8s.io/e2e-test-images/httpd
     registry.k8s.io/e2e-test-images/ipc-utils
    FAIL: e2e images do not match the approved list!

For this test, apparmor-loader was commented out in .permitted-images (making
it a forbidden unknown image) and apparmor-no-such-image was added (making it
an obsolete image).

Problems with the output:
- The position of old and new image lists was reversed.
- It's not clear what is being diffed. Not referencing .permitted-images
  directly probably was meant to discourage using some image other than
  agnhost, but developers can easily find the file anyway and are shown
  some other images in the diff context.

After:

    Diffing e2e image list ...
    obsolete image: registry.k8s.io/e2e-test-images/apparmor-no-such-image
    forbidden image: registry.k8s.io/e2e-test-images/apparmor-loader
    FAIL: current e2e images do not match the approved list in test/images/.permitted-images!

This mentions test/images/.permitted-images because developers might have to
edit it if some image really becomes obsolete.
2025-06-25 10:30:45 +02:00
..
2025-05-06 15:26:20 +08:00

Kubernetes hack GuideLines

This document describes how you can use the scripts from hack directory and gives a brief introduction and explanation of these scripts.

Overview

The hack directory contains many scripts that ensure continuous development of kubernetes, enhance the robustness of the code, improve development efficiency, etc. The explanations and descriptions of these scripts are helpful for contributors. For details, refer to the following guidelines.

Key scripts

  • verify-all.sh: This script is a vestigial redirection, Please do not add "real" logic. It is equivalent to make verify.
  • update-all.sh: This script is a vestigial redirection, Please do not add "real" logic. The true target of this makerule is hack/make-rules/update.sh.It is equivalent to make update.

Attention

Note that all scripts must be run from the Kubernetes root directory. We should run hack/verify-all.sh before submitting a PR and if anything fails run hack/update-all.sh.