From 103498f5384d8dc0535a654c6f9f7cb53549855f Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 1 Aug 2019 12:18:56 -0700 Subject: [PATCH] test images: Adds version and bind-tools to agnhost Adds bind-tools to the agnhost image. With this, dig will available in the agnhost image, which can be used in DNS related tests. Adds the --version flag to the agnhost binary, which will be useful for debugging purposes (e.g.: when the image version does not match the binary version). Bumps version to 2.5. --- test/images/agnhost/Dockerfile | 2 +- test/images/agnhost/README.md | 9 +++++++++ test/images/agnhost/VERSION | 2 +- test/images/agnhost/agnhost.go | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test/images/agnhost/Dockerfile b/test/images/agnhost/Dockerfile index be4c2e8e6f8..d4c9d967f01 100644 --- a/test/images/agnhost/Dockerfile +++ b/test/images/agnhost/Dockerfile @@ -22,7 +22,7 @@ CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ # - iproute2: includes ss used in NodePort tests # from iperf image # install necessary packages: iperf, bash -RUN apk --update add curl netcat-openbsd iproute2 iperf bash && rm -rf /var/cache/apk/* \ +RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf bash && rm -rf /var/cache/apk/* \ && ln -s /usr/bin/iperf /usr/local/bin/iperf \ && ls -altrh /usr/local/bin/iperf diff --git a/test/images/agnhost/README.md b/test/images/agnhost/README.md index 771d53967ee..1a48f4c8653 100644 --- a/test/images/agnhost/README.md +++ b/test/images/agnhost/README.md @@ -15,6 +15,15 @@ word of the words agnostic and host. The image was created for testing purposes, reducing the need for having different test cases for the same tested behaviour. + +## Developer notes + +We've introduced versioning into the `agnhost` binary for debugging purposes (e.g.: if the +image and binary versions do not match, see [here](https://github.com/kubernetes/kubernetes/pull/79667#discussion_r304198370)). + +Whenever the image `VERSION` is bumped, the `Version` in `agnhost.go` will also have to be bumped. + + ## Usage The `agnhost` binary has several subcommands which are can be used to test different diff --git a/test/images/agnhost/VERSION b/test/images/agnhost/VERSION index 6b4950e3de2..95e3ba81920 100644 --- a/test/images/agnhost/VERSION +++ b/test/images/agnhost/VERSION @@ -1 +1 @@ -2.4 +2.5 diff --git a/test/images/agnhost/agnhost.go b/test/images/agnhost/agnhost.go index 12150ed7994..b98b4fe018a 100644 --- a/test/images/agnhost/agnhost.go +++ b/test/images/agnhost/agnhost.go @@ -44,7 +44,8 @@ import ( ) func main() { - rootCmd := &cobra.Command{Use: "app"} + rootCmd := &cobra.Command{Use: "app", Version: "2.5"} + rootCmd.AddCommand(auditproxy.CmdAuditProxy) rootCmd.AddCommand(connect.CmdConnect) rootCmd.AddCommand(crdconvwebhook.CmdCrdConversionWebhook)