kubernetes/test/e2e_node
Stephen Benjamin b351745c1c Replace use of Sprintf with net.JoinHostPort
On IPv6 clusters, one of the most frequent problems I encounter is
assumptions that one can build a URL with a host and port simply by
using Sprintf, like this:

```go
fmt.Sprintf("http://%s:%d/foo", host, port)
```

When `host` is an IPv6 address, this produces an invalid URL as it must
be bracketed, like this:

```
http://[2001:4860:4860::8888]:9443
```

This change fixes the occurences of joining a host and port with the
purpose built `net.JoinHostPort` function.

I encounter this problem often enough that I started to [write a linter
for it](https://github.com/stbenjam/go-sprintf-host-port).  I don't
think the linter is quite ready for wide use yet, but I did run it
against the Kube codebase and found these.  While the host portion in
some of these changes may always be an FQDN or IPv4 IP today, it's an
easy thing that can break later on.
2022-05-04 06:37:50 -04:00
..
builder move cluster/gce/gci/credential-provider to test/e2e_node/plugins/gcp-credential-provider 2022-03-23 10:30:02 -04:00
conformance Merge pull request #109410 from dims/set-default-flake-attempt-to-one 2022-05-04 01:27:30 -07:00
environment Merge pull request #99685 from yangjunmyfm192085/run-test24 2022-05-03 17:16:47 -07:00
gcp io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
jenkins e2e_node: remove jenkins docker_validation 2022-04-20 16:16:57 +00:00
kubeletconfig io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
perf/workloads Cleanup OWNERS files (No Activity in the last year) 2021-12-15 10:34:02 -05:00
perftype hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
plugins/gcp-credential-provider test/e2e_node/plugins/gcp-credential-provider: update Test_getCredentials to validate against v1beta1 kubelet APIs 2022-03-24 23:29:13 -04:00
remote test/e2e_node: update credential provider config to use v1beta1 kubelet 2022-03-24 23:28:37 -04:00
runner e2e_node: remote runner: Require containerd/crio 2022-04-20 16:49:29 +00:00
services Merge pull request #109649 from pohly/e2e-feature-gates 2022-05-04 02:35:18 -07:00
system hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
testing-manifests podresource: do not export NUMA topology if it's empty 2021-08-24 15:38:21 +00:00
apparmor_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
benchmark_util.go io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
container_log_rotation_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
container_manager_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
cpu_manager_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
critical_pod_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
density_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
device_manager_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
device_plugin_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
doc.go fix golint issues in test/e2e_node 2019-11-26 16:26:55 +08:00
e2e_node_suite_test.go e2e: move feature gate support from test/e2e to test/e2e_node 2022-04-25 15:41:41 +02:00
eviction_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
framework.go fix golint issues in test/e2e_node 2019-11-26 16:26:55 +08:00
garbage_collector_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
gubernator.sh fix test/e2e_node/gubernator.sh shellcheck failures 2019-06-23 17:01:54 -07:00
hugepages_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
image_credential_provider.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
image_id_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
image_list.go Add support for CRI verbose fields 2022-02-10 17:12:26 +01:00
lock_contention_linux_test.go Remove the restart kubelet check from the test. 2022-03-07 18:51:07 +05:30
log_path_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
memory_manager_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
mirror_pod_grace_period_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
mirror_pod_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
node_container_manager_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
node_perf_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
node_problem_detector_linux.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
node_shutdown_linux_test.go Merge pull request #107819 from matthyx/107505 2022-05-03 17:18:39 -07:00
numa_alignment.go io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
os_label_rename_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
OWNERS sig-node: endocrimes as e2e_node approver 2022-04-20 17:12:09 +00:00
pids_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
pod_hostnamefqdn_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
podresources_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
pods_container_manager_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
quota_lsci_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
README.md Removed broken link to Analytics 2020-08-13 16:03:37 -04:00
resource_collector.go io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
resource_metrics_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
resource_usage_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
restart_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
runtime_conformance_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
runtimeclass_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
security_context_test.go use privileged enforce level in host pid sharing testing 2022-03-29 15:51:33 +08:00
summary_test.go Merge pull request #108758 from fengzixu/improvement-volume-health 2022-03-29 17:35:34 -07:00
system_node_critical_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
topology_manager_test.go test/e2e/*: default existing tests to privileged pod security policy 2022-04-05 08:41:12 +02:00
util.go Replace use of Sprintf with net.JoinHostPort 2022-05-04 06:37:50 -04:00
util_kubevirt.go podresource: do not export NUMA topology if it's empty 2021-08-24 15:38:21 +00:00
util_sriov.go e2e: TM: add option to fail instead of skip 2021-09-13 13:23:36 +02:00
util_sriov_linux.go e2e: TM: add option to fail instead of skip 2021-09-13 13:23:36 +02:00
util_sriov_unsupported.go e2e: TM: add option to fail instead of skip 2021-09-13 13:23:36 +02:00
util_xfs_linux.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
util_xfs_unsupported.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
utils_linux.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
utils_unsupported.go generated: Run hack/update-gofmt.sh 2021-08-24 15:47:49 -04:00
volume_manager_test.go test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00