diff --git a/test/images/BUILD b/test/images/BUILD index e10c35de236..d40deb53b7e 100644 --- a/test/images/BUILD +++ b/test/images/BUILD @@ -17,17 +17,11 @@ filegroup( "//test/images/crd-conversion-webhook:all-srcs", "//test/images/echoserver:all-srcs", "//test/images/entrypoint-tester:all-srcs", - "//test/images/fakegitserver:all-srcs", "//test/images/inclusterclient:all-srcs", - "//test/images/liveness:all-srcs", - "//test/images/logs-generator:all-srcs", "//test/images/metadata-concealment:all-srcs", "//test/images/mounttest:all-srcs", - "//test/images/no-snat-test:all-srcs", - "//test/images/no-snat-test-proxy:all-srcs", "//test/images/nonewprivs:all-srcs", "//test/images/pets/peer-finder:all-srcs", - "//test/images/port-forward-tester:all-srcs", "//test/images/porter:all-srcs", "//test/images/regression-issue-74839:all-srcs", "//test/images/resource-consumer:all-srcs", diff --git a/test/images/agnhost/BUILD b/test/images/agnhost/BUILD index c11a32865e7..3a711c4cf7f 100644 --- a/test/images/agnhost/BUILD +++ b/test/images/agnhost/BUILD @@ -17,10 +17,16 @@ go_library( importpath = "k8s.io/kubernetes/test/images/agnhost", deps = [ "//test/images/agnhost/dns:go_default_library", + "//test/images/agnhost/fakegitserver:go_default_library", + "//test/images/agnhost/liveness:go_default_library", + "//test/images/agnhost/logs-generator:go_default_library", "//test/images/agnhost/net:go_default_library", "//test/images/agnhost/netexec:go_default_library", "//test/images/agnhost/nettest:go_default_library", + "//test/images/agnhost/no-snat-test:go_default_library", + "//test/images/agnhost/no-snat-test-proxy:go_default_library", "//test/images/agnhost/pause:go_default_library", + "//test/images/agnhost/port-forward-tester:go_default_library", "//test/images/agnhost/webhook:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/klog:go_default_library", @@ -39,10 +45,16 @@ filegroup( srcs = [ ":package-srcs", "//test/images/agnhost/dns:all-srcs", + "//test/images/agnhost/fakegitserver:all-srcs", + "//test/images/agnhost/liveness:all-srcs", + "//test/images/agnhost/logs-generator:all-srcs", "//test/images/agnhost/net:all-srcs", "//test/images/agnhost/netexec:all-srcs", "//test/images/agnhost/nettest:all-srcs", + "//test/images/agnhost/no-snat-test:all-srcs", + "//test/images/agnhost/no-snat-test-proxy:all-srcs", "//test/images/agnhost/pause:all-srcs", + "//test/images/agnhost/port-forward-tester:all-srcs", "//test/images/agnhost/webhook:all-srcs", ], tags = ["automanaged"], diff --git a/test/images/agnhost/Dockerfile b/test/images/agnhost/Dockerfile index 24cf5abbd69..1bd66a2190b 100644 --- a/test/images/agnhost/Dockerfile +++ b/test/images/agnhost/Dockerfile @@ -22,6 +22,10 @@ CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ # - iproute2: includes ss used in NodePort tests RUN apk --update add curl netcat-openbsd iproute2 && rm -rf /var/cache/apk/* +# from logs-generator +ENV LOGS_GENERATOR_LINES_TOTAL 1 +ENV LOGS_GENERATOR_DURATION 1s + # PORT 8080 needed by: netexec, nettest # PORT 8081 needed by: netexec EXPOSE 8080 8081 @@ -31,3 +35,4 @@ RUN mkdir /uploads ADD agnhost agnhost ENTRYPOINT ["/agnhost"] +CMD ["pause"] diff --git a/test/images/agnhost/README.md b/test/images/agnhost/README.md index 93d3929d5ce..039617940d2 100644 --- a/test/images/agnhost/README.md +++ b/test/images/agnhost/README.md @@ -17,18 +17,8 @@ cases for the same tested behaviour. ## Usage -The `agnhost` binary is a CLI with the following subcommands: - -- `dns-suffix`: It will output the host's configured DNS suffix list, separated by commas. -- `dns-server-list`: It will output the host's configured DNS servers, separated by commas. -- `etc-hosts`: It will output the contents of host's `hosts` file. This file's location - is `/etc/hosts` on Linux, while on Windows it is `C:/Windows/System32/drivers/etc/hosts`. -- `pause`: It will pause the execution of the binary. This can be used for containers - which have to be kept in a `Running` state for various purposes, including executing - other `agnhost` commands. -- `help`: Prints the binary's help menu. Additionally, it can be followed by another - subcommand in order to get more information about that subcommand, including its - possible arguments. +The `agnhost` binary has several subcommands which are can be used to test different +Kubernetes features; their behaviour and output is not affected by the underlying OS. For example, let's consider the following `pod.yaml` file: @@ -74,6 +64,123 @@ created with the `pause` argument instead, allowing us execute multiple commands The `agnhost` binary is a CLI with the following subcommands: + +### dns-server-list + +It will output the host's configured DNS servers, separated by commas. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost dns-server-list +``` + + +### dns-suffix + +It will output the host's configured DNS suffix list, separated by commas. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost dns-suffix +``` + + +### etc-hosts + +It will output the contents of host's `hosts` file. This file's location is `/etc/hosts` +on Linux, while on Windows it is `C:/Windows/System32/drivers/etc/hosts`. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost etc-hosts +``` + + +### fake-gitserver + +Fakes a git server. When doing `git clone localhost:8000`, you will clone an empty git +repo named `8000` on local. You can also use `git clone localhost:8000 my-repo-name` to +rename that repo. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost fake-gitserver +``` + + +### help + +Prints the binary's help menu. Additionally, it can be followed by another subcommand +in order to get more information about that subcommand, including its possible arguments. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost help +``` + + +### liveness + +Starts a simple server that is alive for 10 seconds, then reports unhealthy for the rest +of its (hopefully) short existence. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost liveness +``` + + +### logs-generator + +The `logs-generator` subcommand is a tool to create predictable load on the logs delivery system. +It generates random lines with predictable format and predictable average length. +Each line can be later uniquely identified to ensure logs delivery. + +Tool is parametrized with the total number of number that should be generated and the duration of +the generation process. For example, if you want to create a throughput of 100 lines per second +for a minute, you set total number of lines to 6000 and duration to 1 minute. + +Parameters are passed through environment variables. There are no defaults, you should always +set up container parameters. Total number of line is parametrized through env variable +`LOGS_GENERATOR_LINES_TOTAL` and duration in go format is parametrized through env variable +`LOGS_GENERATOR_DURATION`. + +Inside the container all log lines are written to the stdout. + +Each line is on average 100 bytes long and follows this pattern: + +``` +2000-12-31T12:59:59Z /api/v1/namespaces//endpoints/ +``` + +Where `` refers to the number from 0 to `total_lines - 1`, which is unique for each +line in a given run of the container. + +Examples: + +```console +docker run -i \ + gcr.io/kubernetes-e2e-test-images/agnhost:1.1 \ + logs-generator --log-lines-total 10 --run-duration 1 +``` + +```console +kubectl run logs-generator \ + --generator=run-pod/v1 \ + --image=gcr.io/kubernetes-e2e-test-images/agnhost:1.1 \ + --restart=Never \ + -- logs-generator -t 10 -d 1 +``` + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/test/images/logs-generator/README.md?pixel)]() + + ### net The goal of this Go project is to consolidate all low-level @@ -173,6 +280,93 @@ Usage: kubectl exec test-agnhost -- /agnhost nettest [--port ] [--peers ] [--service ] [--namespace ] [--delay-shutdown ] ``` + +### no-snat-test + +The subcommand requires the following environment variables to be set, and they should be +valid IP addresses: + +- `POD_IP` +- `NODE_IP` + +Serves the following endpoints on the given port (defaults to `8080`). + +- `/whoami` - returns the request's IP address. +- `/checknosnat` - queries `ip/whoami` for each provided IP (`/checknosnat?ips=ip1,ip2`), + and if all the response bodies match the `POD_IP`, it will return a 200 response, 500 otherwise. + +Usage: + +```console + kubectl run test-agnhost \ + --generator=run-pod/v1 \ + --image=gcr.io/kubernetes-e2e-test-images/agnhost:1.1 \ + --restart=Never \ + --env "POD_IP=" \ + --env "NODE_IP=" \ + -- no-snat-test [--port ] +``` + + +### no-snat-test-proxy + +Serves the `/checknosnat` endpoint on the given port (defaults to `31235`). The endpoint +proxies the request to the given `target` (`/checknosnat?target=target_ip&ips=ip1,ip2` +-> `target_ip/checknosnat?ips=ip1,ip2`) and will return the same status as the status +as the proxied request, or 500 on error. + + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost no-snat-test-proxy [--port ] +``` + + +### pause + +It will pause the execution of the binary. This can be used for containers +which have to be kept in a `Running` state for various purposes, including +executing other `agnhost` commands. + +Usage: + +```console + kubectl exec test-agnhost -- /agnhost pause +``` + + +### port-forward-tester + +Listens for TCP connections on a given address and port, optionally checks the data received, +and sends a configurable number of data chunks, with a configurable interval between chunks. + +The subcommand is using the following environment variables: + +- `BIND_ADDRESS` (optional): The address on which it will start listening for TCP connections (default value: `localhost`) +- `BIND_PORT`: The port on which it will start listening for TCP connections. +- `EXPECTED_CLIENT_DATA` (optional): If set, it will check that the request sends the same exact data. +- `CHUNKS`: How many chunks of data to write in the response. +- `CHUNK_SIZE`: The expected size of each written chunk of data. If it does not match the actual size of the written data, it will exit with the exit code `4`. +- `CHUNK_INTERVAL`: The amount of time to wait in between chunks. + +Usage: + +```console + kubectl run test-agnhost \ + --generator=run-pod/v1 \ + --image=gcr.io/kubernetes-e2e-test-images/agnhost:1.1 \ + --restart=Never \ + --env "BIND_ADDRESS=localhost" \ + --env "BIND_PORT=8080" \ + --env "EXPECTED_CLIENT_DATA='Hello there!'" \ + --env "CHUNKS=1" \ + --env "CHUNK_SIZE=10" \ + --env "CHUNK_INTERVAL=1" \ + -- port-forward-tester +``` + + ### webhook (Kubernetes External Admission Webhook) The subcommand tests MutatingAdmissionWebhook and ValidatingAdmissionWebhook. After deploying @@ -191,6 +385,6 @@ Usage: ## Image -The image can be found at `gcr.io/kubernetes-e2e-test-images/agnhost:2.1` for Linux -containers, and `e2eteam/agnhost:2.1` for Windows containers. In the future, the same +The image can be found at `gcr.io/kubernetes-e2e-test-images/agnhost:1.1` for Linux +containers, and `e2eteam/agnhost:1.1` for Windows containers. In the future, the same repository can be used for both OSes. diff --git a/test/images/agnhost/agnhost.go b/test/images/agnhost/agnhost.go index 0f1a7809767..3db8f7c9093 100644 --- a/test/images/agnhost/agnhost.go +++ b/test/images/agnhost/agnhost.go @@ -23,10 +23,16 @@ import ( "k8s.io/klog" "k8s.io/kubernetes/test/images/agnhost/dns" + "k8s.io/kubernetes/test/images/agnhost/fakegitserver" + "k8s.io/kubernetes/test/images/agnhost/liveness" + "k8s.io/kubernetes/test/images/agnhost/logs-generator" "k8s.io/kubernetes/test/images/agnhost/net" "k8s.io/kubernetes/test/images/agnhost/netexec" "k8s.io/kubernetes/test/images/agnhost/nettest" + "k8s.io/kubernetes/test/images/agnhost/no-snat-test" + "k8s.io/kubernetes/test/images/agnhost/no-snat-test-proxy" "k8s.io/kubernetes/test/images/agnhost/pause" + "k8s.io/kubernetes/test/images/agnhost/port-forward-tester" "k8s.io/kubernetes/test/images/agnhost/webhook" ) @@ -35,10 +41,16 @@ func main() { rootCmd.AddCommand(dns.CmdDNSSuffix) rootCmd.AddCommand(dns.CmdDNSServerList) rootCmd.AddCommand(dns.CmdEtcHosts) + rootCmd.AddCommand(fakegitserver.CmdFakeGitServer) + rootCmd.AddCommand(liveness.CmdLiveness) + rootCmd.AddCommand(logsgen.CmdLogsGenerator) rootCmd.AddCommand(net.CmdNet) rootCmd.AddCommand(netexec.CmdNetexec) rootCmd.AddCommand(nettest.CmdNettest) + rootCmd.AddCommand(nosnat.CmdNoSnatTest) + rootCmd.AddCommand(nosnatproxy.CmdNoSnatTestProxy) rootCmd.AddCommand(pause.CmdPause) + rootCmd.AddCommand(portforwardtester.CmdPortForwardTester) rootCmd.AddCommand(webhook.CmdWebhook) // NOTE(claudiub): Some tests are passing logging related flags, so we need to be able to diff --git a/test/images/fakegitserver/BUILD b/test/images/agnhost/fakegitserver/BUILD similarity index 72% rename from test/images/fakegitserver/BUILD rename to test/images/agnhost/fakegitserver/BUILD index 17d78b163e2..70a2db097f8 100644 --- a/test/images/fakegitserver/BUILD +++ b/test/images/agnhost/fakegitserver/BUILD @@ -2,19 +2,14 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", - "go_binary", "go_library", ) -go_binary( - name = "fakegitserver", - embed = [":go_default_library"], -) - go_library( name = "go_default_library", srcs = ["gitserver.go"], - importpath = "k8s.io/kubernetes/test/images/fakegitserver", + importpath = "k8s.io/kubernetes/test/images/agnhost/fakegitserver", + deps = ["//vendor/github.com/spf13/cobra:go_default_library"], ) filegroup( diff --git a/test/images/fakegitserver/gitserver.go b/test/images/agnhost/fakegitserver/gitserver.go similarity index 67% rename from test/images/fakegitserver/gitserver.go rename to test/images/agnhost/fakegitserver/gitserver.go index 6077fb661c9..6ae1d67404e 100644 --- a/test/images/fakegitserver/gitserver.go +++ b/test/images/agnhost/fakegitserver/gitserver.go @@ -14,13 +14,25 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package fakegitserver import ( "io" "net/http" + + "github.com/spf13/cobra" ) +// CmdFakeGitServer is used by agnhost Cobra. +var CmdFakeGitServer = &cobra.Command{ + Use: "fake-gitserver", + Short: "Fakes a git server", + Long: `When doing "git clone localhost:8000", you will clone an empty git repo named "8000" on local. +You can also use "git clone localhost:8000 my-repo-name" to rename that repo.`, + Args: cobra.MaximumNArgs(0), + Run: main, +} + func hello(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "I am a fake git server") @@ -28,7 +40,7 @@ func hello(w http.ResponseWriter, r *http.Request) { // When doing `git clone localhost:8000`, you will clone an empty git repo named "8000" on local. // You can also use `git clone localhost:8000 my-repo-name` to rename that repo. -func main() { +func main(cmd *cobra.Command, args []string) { http.HandleFunc("/", hello) http.ListenAndServe(":8000", nil) } diff --git a/test/images/liveness/BUILD b/test/images/agnhost/liveness/BUILD similarity index 73% rename from test/images/liveness/BUILD rename to test/images/agnhost/liveness/BUILD index 47e6dd7d984..1d92ef6ca00 100644 --- a/test/images/liveness/BUILD +++ b/test/images/agnhost/liveness/BUILD @@ -2,19 +2,16 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", - "go_binary", "go_library", ) -go_binary( - name = "liveness", - embed = [":go_default_library"], -) - go_library( name = "go_default_library", srcs = ["server.go"], - importpath = "k8s.io/kubernetes/test/images/liveness", + importpath = "k8s.io/kubernetes/test/images/agnhost/liveness", + deps = [ + "//vendor/github.com/spf13/cobra:go_default_library", + ], ) filegroup( diff --git a/test/images/liveness/server.go b/test/images/agnhost/liveness/server.go similarity index 79% rename from test/images/liveness/server.go rename to test/images/agnhost/liveness/server.go index 7b6d7118a10..3ec2669df43 100644 --- a/test/images/liveness/server.go +++ b/test/images/agnhost/liveness/server.go @@ -16,7 +16,8 @@ limitations under the License. // A simple server that is alive for 10 seconds, then reports unhealthy for // the rest of its (hopefully) short existence. -package main + +package liveness import ( "fmt" @@ -24,9 +25,20 @@ import ( "net/http" "net/url" "time" + + "github.com/spf13/cobra" ) -func main() { +// CmdLiveness is used by agnhost Cobra. +var CmdLiveness = &cobra.Command{ + Use: "liveness", + Short: "Starts a server that is alive for 10 seconds", + Long: "A simple server that is alive for 10 seconds, then reports unhealthy for the rest of its (hopefully) short existence", + Args: cobra.MaximumNArgs(0), + Run: main, +} + +func main(cmd *cobra.Command, args []string) { started := time.Now() http.HandleFunc("/started", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) diff --git a/test/images/logs-generator/BUILD b/test/images/agnhost/logs-generator/BUILD similarity index 78% rename from test/images/logs-generator/BUILD rename to test/images/agnhost/logs-generator/BUILD index c632d7d1533..1036a0cdd58 100644 --- a/test/images/logs-generator/BUILD +++ b/test/images/agnhost/logs-generator/BUILD @@ -2,21 +2,16 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", - "go_binary", "go_library", ) -go_binary( - name = "logs-generator", - embed = [":go_default_library"], -) - go_library( name = "go_default_library", srcs = ["logs_generator.go"], - importpath = "k8s.io/kubernetes/test/images/logs-generator", + importpath = "k8s.io/kubernetes/test/images/agnhost/logs-generator", deps = [ "//staging/src/k8s.io/apimachinery/pkg/util/rand:go_default_library", + "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/k8s.io/klog:go_default_library", ], ) diff --git a/test/images/logs-generator/logs_generator.go b/test/images/agnhost/logs-generator/logs_generator.go similarity index 63% rename from test/images/logs-generator/logs_generator.go rename to test/images/agnhost/logs-generator/logs_generator.go index 27a65c3b798..9ff6120bacd 100644 --- a/test/images/logs-generator/logs_generator.go +++ b/test/images/agnhost/logs-generator/logs_generator.go @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package logsgen import ( - "flag" "fmt" "time" + "github.com/spf13/cobra" + "k8s.io/apimachinery/pkg/util/rand" "k8s.io/klog" ) @@ -38,27 +39,35 @@ var ( } ) +// CmdLogsGenerator is used by agnhost Cobra. +var CmdLogsGenerator = &cobra.Command{ + Use: "logs-generator", + Short: "Outputs lines of logs to stdout uniformly", + Long: "Outputs lines of logs to stdout uniformly for ", + Args: cobra.MaximumNArgs(2), + Run: generateLogs, +} + var ( - linesTotal = flag.Int("log-lines-total", 0, "Total lines that should be generated by the end of the run") - duration = flag.Duration("run-duration", 0, "Total duration of the run") + linesTotal int + duration time.Duration ) -func main() { - flag.Parse() - - if *linesTotal <= 0 { - klog.Fatalf("Invalid total number of lines: %d", *linesTotal) - } - - if *duration <= 0 { - klog.Fatalf("Invalid duration: %v", *duration) - } - - generateLogs(*linesTotal, *duration) +func init() { + CmdLogsGenerator.Flags().IntVarP(&linesTotal, "log-lines-total", "t", 0, "Total lines that should be generated by the end of the run") + CmdLogsGenerator.Flags().DurationVarP(&duration, "run-duration", "d", 0, "Total duration of the run") } // Outputs linesTotal lines of logs to stdout uniformly for duration -func generateLogs(linesTotal int, duration time.Duration) { +func generateLogs(cmd *cobra.Command, args []string) { + if linesTotal <= 0 { + klog.Fatalf("Invalid total number of lines: %d", linesTotal) + } + + if duration <= 0 { + klog.Fatalf("Invalid duration: %v", duration) + } + delay := duration / time.Duration(linesTotal) ticker := time.NewTicker(delay) diff --git a/test/images/no-snat-test/BUILD b/test/images/agnhost/no-snat-test-proxy/BUILD similarity index 63% rename from test/images/no-snat-test/BUILD rename to test/images/agnhost/no-snat-test-proxy/BUILD index 9d8811d3c26..e68a8d1e5f4 100644 --- a/test/images/no-snat-test/BUILD +++ b/test/images/agnhost/no-snat-test-proxy/BUILD @@ -2,23 +2,16 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", - "go_binary", "go_library", ) -go_binary( - name = "no-snat-test", - embed = [":go_default_library"], -) - go_library( name = "go_default_library", srcs = ["main.go"], - importpath = "k8s.io/kubernetes/test/images/no-snat-test", + importpath = "k8s.io/kubernetes/test/images/agnhost/no-snat-test-proxy", deps = [ - "//staging/src/k8s.io/component-base/cli/flag:go_default_library", "//staging/src/k8s.io/component-base/logs:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/github.com/spf13/cobra:go_default_library", ], ) diff --git a/test/images/no-snat-test-proxy/main.go b/test/images/agnhost/no-snat-test-proxy/main.go similarity index 73% rename from test/images/no-snat-test-proxy/main.go rename to test/images/agnhost/no-snat-test-proxy/main.go index 7b2c9547964..1a3febf5c59 100644 --- a/test/images/no-snat-test-proxy/main.go +++ b/test/images/agnhost/no-snat-test-proxy/main.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package nosnatproxy import ( "fmt" @@ -22,32 +22,36 @@ import ( "net/http" "os" - "github.com/spf13/pflag" - cliflag "k8s.io/component-base/cli/flag" + "github.com/spf13/cobra" "k8s.io/component-base/logs" ) +// CmdNoSnatTestProxy is used by agnhost Cobra. +var CmdNoSnatTestProxy = &cobra.Command{ + Use: "no-snat-test-proxy", + Short: "Creates a proxy for the /checknosnat endpoint", + Long: `Creates the /checknosnat endpoint which proxies the request to the given target (/checknosnat?target=target_ip&ips=ip1,ip2) and returns its response, or a 500 response on error.`, + Args: cobra.MaximumNArgs(1), + Run: main, +} + +var port string + +func init() { + CmdNoSnatTestProxy.Flags().StringVar(&port, "port", "31235", "The port to serve /checknosnat endpoint on.") +} + // This Pod's /checknosnat takes `target` and `ips` arguments, and queries {target}/checknosnat?ips={ips} type masqTestProxy struct { Port string } -func newMasqTestProxy() *masqTestProxy { - return &masqTestProxy{ - Port: "31235", +func main(cmd *cobra.Command, args []string) { + m := &masqTestProxy{ + Port: port, } -} -func (m *masqTestProxy) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&m.Port, "port", m.Port, "The port to serve /checknosnat endpoint on.") -} - -func main() { - m := newMasqTestProxy() - m.AddFlags(pflag.CommandLine) - - cliflag.InitFlags() logs.InitLogs() defer logs.FlushLogs() diff --git a/test/images/no-snat-test-proxy/BUILD b/test/images/agnhost/no-snat-test/BUILD similarity index 62% rename from test/images/no-snat-test-proxy/BUILD rename to test/images/agnhost/no-snat-test/BUILD index 4e27ee6cbb8..69c927803f5 100644 --- a/test/images/no-snat-test-proxy/BUILD +++ b/test/images/agnhost/no-snat-test/BUILD @@ -2,23 +2,16 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", - "go_binary", "go_library", ) -go_binary( - name = "no-snat-test-proxy", - embed = [":go_default_library"], -) - go_library( name = "go_default_library", srcs = ["main.go"], - importpath = "k8s.io/kubernetes/test/images/no-snat-test-proxy", + importpath = "k8s.io/kubernetes/test/images/agnhost/no-snat-test", deps = [ - "//staging/src/k8s.io/component-base/cli/flag:go_default_library", "//staging/src/k8s.io/component-base/logs:go_default_library", - "//vendor/github.com/spf13/pflag:go_default_library", + "//vendor/github.com/spf13/cobra:go_default_library", ], ) diff --git a/test/images/no-snat-test/main.go b/test/images/agnhost/no-snat-test/main.go similarity index 82% rename from test/images/no-snat-test/main.go rename to test/images/agnhost/no-snat-test/main.go index bb94daf1a29..e77b53a34f6 100644 --- a/test/images/no-snat-test/main.go +++ b/test/images/agnhost/no-snat-test/main.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package nosnat import ( "fmt" @@ -24,11 +24,29 @@ import ( "os" "strings" - "github.com/spf13/pflag" - cliflag "k8s.io/component-base/cli/flag" + "github.com/spf13/cobra" "k8s.io/component-base/logs" ) +// CmdNoSnatTest is used by agnhost Cobra. +var CmdNoSnatTest = &cobra.Command{ + Use: "no-snat-test", + Short: "Creates the /checknosnat and /whoami endpoints", + Long: `Serves the following endpoints on the given port (defaults to "8080"). + +- /whoami - returns the request's IP address. +- /checknosnat - queries "ip/whoami" for each provided IP ("/checknosnat?ips=ip1,ip2"), + and if all the response bodies match the "POD_IP" environment variable, it will return a 200 response, 500 otherwise.`, + Args: cobra.MaximumNArgs(1), + Run: main, +} + +var port string + +func init() { + CmdNoSnatTest.Flags().StringVar(&port, "port", "8080", "The port to serve /checknosnat and /whoami endpoints on.") +} + // ip = target for /whoami query // rip = returned ip // pip = this pod's ip @@ -38,21 +56,11 @@ type masqTester struct { Port string } -func newMasqTester() *masqTester { - return &masqTester{ - Port: "8080", +func main(cmd *cobra.Command, args []string) { + m := &masqTester{ + Port: port, } -} -func (m *masqTester) AddFlags(fs *pflag.FlagSet) { - fs.StringVar(&m.Port, "port", m.Port, "The port to serve /checknosnat and /whoami endpoints on.") -} - -func main() { - m := newMasqTester() - m.AddFlags(pflag.CommandLine) - - cliflag.InitFlags() logs.InitLogs() defer logs.FlushLogs() diff --git a/test/images/port-forward-tester/BUILD b/test/images/agnhost/port-forward-tester/BUILD similarity index 71% rename from test/images/port-forward-tester/BUILD rename to test/images/agnhost/port-forward-tester/BUILD index d9833751314..68d4338e943 100644 --- a/test/images/port-forward-tester/BUILD +++ b/test/images/agnhost/port-forward-tester/BUILD @@ -2,19 +2,14 @@ package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", - "go_binary", "go_library", ) -go_binary( - name = "port-forward-tester", - embed = [":go_default_library"], -) - go_library( name = "go_default_library", srcs = ["portforwardtester.go"], - importpath = "k8s.io/kubernetes/test/images/port-forward-tester", + importpath = "k8s.io/kubernetes/test/images/agnhost/port-forward-tester", + deps = ["//vendor/github.com/spf13/cobra:go_default_library"], ) filegroup( diff --git a/test/images/port-forward-tester/portforwardtester.go b/test/images/agnhost/port-forward-tester/portforwardtester.go similarity index 79% rename from test/images/port-forward-tester/portforwardtester.go rename to test/images/agnhost/port-forward-tester/portforwardtester.go index 6131edc6582..9cff3ba5ea2 100644 --- a/test/images/port-forward-tester/portforwardtester.go +++ b/test/images/agnhost/port-forward-tester/portforwardtester.go @@ -26,7 +26,8 @@ limitations under the License. // Log messages are written to stdout at various stages of the binary's execution. // Test code can retrieve this container's log and validate that the expected // behavior is taking place. -package main + +package portforwardtester import ( "fmt" @@ -35,6 +36,8 @@ import ( "strconv" "strings" "time" + + "github.com/spf13/cobra" ) func getEnvInt(name string) int { @@ -58,7 +61,26 @@ func getEnvInt(name string) int { // This timeout is somewhat arbitrary (~latency around the planet). const rstAvoidanceDelay = 500 * time.Millisecond -func main() { +// CmdPortForwardTester is used by agnhost Cobra. +var CmdPortForwardTester = &cobra.Command{ + Use: "port-forward-tester", + Short: "Creates a TCP server that sends chunks of data", + Long: `Listens for TCP connections on a given address and port, optionally checks the data received, +and sends a configurable number of data chunks, with a configurable interval between chunks. + +The subcommand is using the following environment variables: + +- BIND_ADDRESS (optional): The address on which it will start listening for TCP connections (default value: localhost) +- BIND_PORT: The port on which it will start listening for TCP connections. +- EXPECTED_CLIENT_DATA (optional): If set, it will check that the request sends the same exact data. +- CHUNKS: How many chunks of data to write in the response. +- CHUNK_SIZE: The expected size of each written chunk of data. If it does not match the actual size of the written data, it will exit with the exit code 4. +- CHUNK_INTERVAL: The amount of time to wait in between chunks.`, + Args: cobra.MaximumNArgs(0), + Run: main, +} + +func main(cmd *cobra.Command, args []string) { bindAddress := os.Getenv("BIND_ADDRESS") if bindAddress == "" { bindAddress = "localhost" diff --git a/test/images/fakegitserver/Dockerfile b/test/images/fakegitserver/Dockerfile deleted file mode 100644 index e25b13e1d6a..00000000000 --- a/test/images/fakegitserver/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM scratch -COPY GITHASH.txt / -COPY fakegitserver / -ENTRYPOINT ["/fakegitserver"] - diff --git a/test/images/fakegitserver/Makefile b/test/images/fakegitserver/Makefile deleted file mode 100644 index 34f07dc9da3..00000000000 --- a/test/images/fakegitserver/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SRCS = fakegitserver -ARCH ?= amd64 -TARGET ?= $(CURDIR) -GOLANG_VERSION ?= latest -SRC_DIR = $(notdir $(shell pwd)) -export - -IGNORE := $(shell git rev-parse HEAD > $(TARGET)/GITHASH.txt) - -bin: - ../image-util.sh bin $(SRCS) - -.PHONY: bin diff --git a/test/images/fakegitserver/VERSION b/test/images/fakegitserver/VERSION deleted file mode 100644 index d3827e75a5c..00000000000 --- a/test/images/fakegitserver/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/test/images/hostexec/BASEIMAGE b/test/images/hostexec/BASEIMAGE deleted file mode 100644 index 7bad7a6d3a2..00000000000 --- a/test/images/hostexec/BASEIMAGE +++ /dev/null @@ -1,5 +0,0 @@ -amd64=alpine:3.6 -arm=arm32v6/alpine:3.6 -arm64=arm64v8/alpine:3.6 -ppc64le=ppc64le/alpine:3.6 -s390x=s390x/alpine:3.6 diff --git a/test/images/hostexec/Dockerfile b/test/images/hostexec/Dockerfile deleted file mode 100644 index f7edf8391a3..00000000000 --- a/test/images/hostexec/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE - -CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ - -# install necessary packages: -# - curl, nc: used by a lot of e2e tests -# - iproute2: includes ss used in NodePort tests -RUN apk --update add curl netcat-openbsd iproute2 && rm -rf /var/cache/apk/* - -# wait forever -CMD while true; do sleep 1d; done diff --git a/test/images/hostexec/VERSION b/test/images/hostexec/VERSION deleted file mode 100644 index 9459d4ba2a0..00000000000 --- a/test/images/hostexec/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1 diff --git a/test/images/hostexec/pod.yaml b/test/images/hostexec/pod.yaml deleted file mode 100644 index 733d4273f75..00000000000 --- a/test/images/hostexec/pod.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: hostexec - labels: - app: hostexec -spec: - containers: - - name: hostexec - image: gcr.io/kubernetes-e2e-test-images/hostexec-amd64:1.1 - securityContext: - hostNetwork: true diff --git a/test/images/liveness/Dockerfile b/test/images/liveness/Dockerfile deleted file mode 100644 index fe022752c82..00000000000 --- a/test/images/liveness/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM scratch - -COPY liveness /server diff --git a/test/images/liveness/Makefile b/test/images/liveness/Makefile deleted file mode 100644 index e23182351bd..00000000000 --- a/test/images/liveness/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SRCS = liveness -ARCH ?= amd64 -TARGET ?= $(CURDIR) -GOLANG_VERSION ?= latest -SRC_DIR = $(notdir $(shell pwd)) -export - -bin: - ../image-util.sh bin $(SRCS) - -.PHONY: bin diff --git a/test/images/liveness/VERSION b/test/images/liveness/VERSION deleted file mode 100644 index 9459d4ba2a0..00000000000 --- a/test/images/liveness/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.1 diff --git a/test/images/logs-generator/BASEIMAGE b/test/images/logs-generator/BASEIMAGE deleted file mode 100644 index 18f002a5e6f..00000000000 --- a/test/images/logs-generator/BASEIMAGE +++ /dev/null @@ -1,4 +0,0 @@ -amd64=busybox -arm=arm32v6/busybox -arm64=arm64v8/busybox -ppc64le=ppc64le/busybox diff --git a/test/images/logs-generator/Dockerfile b/test/images/logs-generator/Dockerfile deleted file mode 100644 index d3f091d447c..00000000000 --- a/test/images/logs-generator/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE - -ENV LOGS_GENERATOR_LINES_TOTAL 1 -ENV LOGS_GENERATOR_DURATION 1s - -COPY logs-generator / - -CMD ["sh", "-c", "/logs-generator --logtostderr --log-lines-total=${LOGS_GENERATOR_LINES_TOTAL} --run-duration=${LOGS_GENERATOR_DURATION}"] diff --git a/test/images/logs-generator/Makefile b/test/images/logs-generator/Makefile deleted file mode 100644 index 86902a2dac6..00000000000 --- a/test/images/logs-generator/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SRCS=logs-generator -ARCH ?= amd64 -TARGET ?= $(CURDIR) -GOLANG_VERSION ?= latest -SRC_DIR = $(notdir $(shell pwd)) -export - -bin: - ../image-util.sh bin $(SRCS) - -.PHONY: bin diff --git a/test/images/logs-generator/README.md b/test/images/logs-generator/README.md deleted file mode 100644 index b70b820756c..00000000000 --- a/test/images/logs-generator/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Logs Generator - -## Overview - -Logs generator is a tool to create predictable load on the logs delivery system. -It generates random lines with predictable format and predictable average length. -Each line can be later uniquely identified to ensure logs delivery. - -## Usage - -Tool is parametrized with the total number of number that should be generated and the duration of -the generation process. For example, if you want to create a throughput of 100 lines per second -for a minute, you set total number of lines to 6000 and duration to 1 minute. - -Parameters are passed through environment variables. There are no defaults, you should always -set up container parameters. Total number of line is parametrized through env variable -`LOGS_GENERATOR_LINES_TOTAL` and duration in go format is parametrized through env variable -`LOGS_GENERATOR_DURATION`. - -Inside the container all log lines are written to the stdout. - -Each line is on average 100 bytes long and follows this pattern: - -``` -2000-12-31T12:59:59Z /api/v1/namespaces//endpoints/ -``` - -Where `` refers to the number from 0 to `total_lines - 1`, which is unique for each -line in a given run of the container. - -## Image - -Image is located in the public repository of Google Container Registry under the name - -``` -k8s.gcr.io/logs-generator:v0.1.1 -``` - -## Examples - -``` -docker run -i \ - -e "LOGS_GENERATOR_LINES_TOTAL=10" \ - -e "LOGS_GENERATOR_DURATION=1s" \ - k8s.gcr.io/logs-generator:v0.1.1 -``` - -``` -kubectl run logs-generator \ - --generator=run-pod/v1 \ - --image=k8s.gcr.io/logs-generator:v0.1.1 \ - --restart=Never \ - --env "LOGS_GENERATOR_LINES_TOTAL=1000" \ - --env "LOGS_GENERATOR_DURATION=1m" -``` - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/test/images/logs-generator/README.md?pixel)]() diff --git a/test/images/logs-generator/VERSION b/test/images/logs-generator/VERSION deleted file mode 100644 index d3827e75a5c..00000000000 --- a/test/images/logs-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/test/images/no-snat-test-proxy/BASEIMAGE b/test/images/no-snat-test-proxy/BASEIMAGE deleted file mode 100644 index 114844f395e..00000000000 --- a/test/images/no-snat-test-proxy/BASEIMAGE +++ /dev/null @@ -1,4 +0,0 @@ -amd64=alpine:3.6 -arm=arm32v6/alpine:3.6 -arm64=arm64v8/alpine:3.6 -ppc64le=ppc64le/alpine:3.6 diff --git a/test/images/no-snat-test-proxy/Dockerfile b/test/images/no-snat-test-proxy/Dockerfile deleted file mode 100644 index 04a89a96bc0..00000000000 --- a/test/images/no-snat-test-proxy/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE - -COPY no-snat-test-proxy / - -ENTRYPOINT ["/no-snat-test-proxy"] diff --git a/test/images/no-snat-test-proxy/Makefile b/test/images/no-snat-test-proxy/Makefile deleted file mode 100644 index 882b56fd090..00000000000 --- a/test/images/no-snat-test-proxy/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SRCS=no-snat-test-proxy -ARCH ?= amd64 -TARGET ?= $(CURDIR) -GOLANG_VERSION ?= latest -SRC_DIR = $(notdir $(shell pwd)) -export - -bin: - ../image-util.sh bin $(SRCS) - -.PHONY: bin diff --git a/test/images/no-snat-test-proxy/VERSION b/test/images/no-snat-test-proxy/VERSION deleted file mode 100644 index d3827e75a5c..00000000000 --- a/test/images/no-snat-test-proxy/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/test/images/no-snat-test/BASEIMAGE b/test/images/no-snat-test/BASEIMAGE deleted file mode 100644 index 114844f395e..00000000000 --- a/test/images/no-snat-test/BASEIMAGE +++ /dev/null @@ -1,4 +0,0 @@ -amd64=alpine:3.6 -arm=arm32v6/alpine:3.6 -arm64=arm64v8/alpine:3.6 -ppc64le=ppc64le/alpine:3.6 diff --git a/test/images/no-snat-test/Dockerfile b/test/images/no-snat-test/Dockerfile deleted file mode 100644 index b56749dbfa9..00000000000 --- a/test/images/no-snat-test/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE - -COPY no-snat-test / - -ENTRYPOINT ["/no-snat-test"] diff --git a/test/images/no-snat-test/Makefile b/test/images/no-snat-test/Makefile deleted file mode 100644 index 3c257410da3..00000000000 --- a/test/images/no-snat-test/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SRCS=no-snat-test -ARCH ?= amd64 -TARGET ?= $(CURDIR) -GOLANG_VERSION ?= latest -SRC_DIR = $(notdir $(shell pwd)) -export - -bin: - ../image-util.sh bin $(SRCS) - -.PHONY: bin diff --git a/test/images/no-snat-test/VERSION b/test/images/no-snat-test/VERSION deleted file mode 100644 index d3827e75a5c..00000000000 --- a/test/images/no-snat-test/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/test/images/port-forward-tester/.gitignore b/test/images/port-forward-tester/.gitignore deleted file mode 100644 index b43a4aae6d0..00000000000 --- a/test/images/port-forward-tester/.gitignore +++ /dev/null @@ -1 +0,0 @@ -portforwardtester diff --git a/test/images/port-forward-tester/Dockerfile b/test/images/port-forward-tester/Dockerfile deleted file mode 100644 index 3d27fc50fb7..00000000000 --- a/test/images/port-forward-tester/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2015 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM scratch -ADD portforwardtester portforwardtester -ADD portforwardtester.go portforwardtester.go -ENTRYPOINT ["/portforwardtester"] diff --git a/test/images/port-forward-tester/Makefile b/test/images/port-forward-tester/Makefile deleted file mode 100644 index 576ef5173ff..00000000000 --- a/test/images/port-forward-tester/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -SRCS=portforwardtester -ARCH ?= amd64 -TARGET ?= $(CURDIR) -GOLANG_VERSION ?= latest -SRC_DIR = $(notdir $(shell pwd)) -export - -bin: - ../image-util.sh bin $(SRCS) - -.PHONY: bin diff --git a/test/images/port-forward-tester/VERSION b/test/images/port-forward-tester/VERSION deleted file mode 100644 index d3827e75a5c..00000000000 --- a/test/images/port-forward-tester/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0