Skip to content

Commit

Permalink
Support consul 1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Venkatesh committed Dec 15, 2021
1 parent e3ad99e commit fd07b6d
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ executors:
- image: docker.mirror.hashicorp.services/cimg/go:1.17.5
environment:
TEST_RESULTS: /tmp/test-results # path to where test results are saved
CONSUL_VERSION: 1.11.0-rc # Consul's OSS version to use in tests
CONSUL_ENT_VERSION: 1.11.0+ent-rc # Consul's enterprise version to use in tests
CONSUL_VERSION: 1.11.0 # Consul's OSS version to use in tests
CONSUL_ENT_VERSION: 1.11.0+ent # Consul's enterprise version to use in tests

control-plane-path : &control-plane-path control-plane
cli-path : &cli-path cli
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## UNRELEASED

FEATURES:
* Helm
* Support Consul 1.11.0. [[GH-935](https://github.com/hashicorp/consul-k8s/pull/935)]
* Support Envoy 1.20.0. [[GH-935](https://github.com/hashicorp/consul-k8s/pull/935)]
* Minimum Kubernetes versions supported is 1.18+. [[GH-935](https://github.com/hashicorp/consul-k8s/pull/935)]
* CLI
* **BETA** Add `upgrade` command to modify Consul installation on Kubernetes. [[GH-898](https://github.com/hashicorp/consul-k8s/pull/898)]

Expand All @@ -27,7 +31,7 @@ FEATURES:

Requirements:
* Consul 1.11+
* Vault 1.19+ and Vault-K8s 0.14+ must be installed with the Vault Agent Injector enabled (`injector.enabled=true`)
* Vault 1.9+ and Vault-K8s 0.14+ must be installed with the Vault Agent Injector enabled (`injector.enabled=true`)
into the Kubernetes cluster that Consul is installed into.
* `global.tls.enableAutoEncryption=true` is required for TLS support.
* If TLS is enabled in Vault, `global.secretsBackend.vault.ca` must be provided and should reference a Kube secret
Expand Down
4 changes: 2 additions & 2 deletions acceptance/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.17
require (
github.com/gruntwork-io/terratest v0.31.2
github.com/hashicorp/consul-k8s/control-plane v0.0.0-20211207212234-aea9efea5638
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc
github.com/hashicorp/consul/sdk v0.8.0
github.com/hashicorp/consul/api v1.12.0
github.com/hashicorp/consul/sdk v0.9.0
github.com/hashicorp/vault/api v1.2.0
github.com/stretchr/testify v1.7.0
gopkg.in/yaml.v2 v2.4.0
Expand Down
11 changes: 4 additions & 7 deletions acceptance/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,12 @@ github.com/hashicorp/consul-k8s/control-plane v0.0.0-20211207212234-aea9efea5638
github.com/hashicorp/consul-k8s/control-plane v0.0.0-20211207212234-aea9efea5638/go.mod h1:7ZeaiADGbvJDuoWAT8UKj6KCcLsFUk+34OkUGMVtdXg=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/api v1.10.1-0.20211116182834-e6956893fb6f/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc h1:tUgL1cinAFDtidyKqgsJzlxLkEi9atLmN6j8kgCr17Q=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc h1:tUgL1cinAFDtidyKqgsJzlxLkEi9atLmN6j8kgCr17Q=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY=
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc h1:tUgL1cinAFDtidyKqgsJzlxLkEi9atLmN6j8kgCr17Q=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU=
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
github.com/hashicorp/consul/sdk v0.9.0 h1:NGSHAU7X3yDCjo8WBUbNOtD3BSqv8u0vu3+zNxgmxQI=
github.com/hashicorp/consul/sdk v0.9.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down
2 changes: 0 additions & 2 deletions acceptance/tests/controller/controller_namespaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ func TestControllerNamespaces(t *testing.T) {
ctx := suite.Environment().DefaultContext(t)

helmValues := map[string]string{
"global.image": "hashicorp/consul-enterprise:1.11.0-ent-rc",

"global.enableConsulNamespaces": "true",
"global.adminPartitions.enabled": "true",
"controller.enabled": "true",
Expand Down
6 changes: 0 additions & 6 deletions acceptance/tests/partitions/partitions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ func TestPartitions(t *testing.T) {
t.Skipf("skipping this test because Admin Partition tests are only supported in Kind for now")
}

if cfg.EnableTransparentProxy {
t.Skipf("skipping this test as Transparent Proxy behavior is flaky")
}

const defaultPartition = "default"
const secondaryPartition = "secondary"
const defaultNamespace = "default"
Expand Down Expand Up @@ -96,7 +92,6 @@ func TestPartitions(t *testing.T) {

serverHelmValues := map[string]string{
"global.datacenter": "dc1",
"global.image": "hashicorp/consul-enterprise:1.11.0-ent-rc",

"global.adminPartitions.enabled": "true",
"global.enableConsulNamespaces": "true",
Expand Down Expand Up @@ -197,7 +192,6 @@ func TestPartitions(t *testing.T) {
// Create client cluster.
clientHelmValues := map[string]string{
"global.datacenter": "dc1",
"global.image": "hashicorp/consul-enterprise:1.11.0-ent-rc",
"global.enabled": "false",

"global.tls.enabled": "true",
Expand Down
12 changes: 6 additions & 6 deletions charts/consul/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: consul
version: 0.38.0
appVersion: 1.10.4
kubeVersion: ">=1.17.0-0"
version: 0.39.0
appVersion: 1.11.0
kubeVersion: ">=1.18.0-0"
description: Official HashiCorp Consul Chart
home: https://www.consul.io
icon: https://raw.githubusercontent.com/hashicorp/consul-k8s/main/assets/icon.png
Expand All @@ -13,11 +13,11 @@ annotations:
artifacthub.io/prerelease: false
artifacthub.io/images: |
- name: consul
image: hashicorp/consul:1.10.4
image: hashicorp/consul:1.11.0
- name: consul-k8s-control-plane
image: hashicorp/consul-k8s-control-plane:0.38.0
image: hashicorp/consul-k8s-control-plane:0.39.0
- name: envoy
image: envoyproxy/envoy-alpine:v1.18.4
image: envoyproxy/envoy-alpine:v1.20.0
artifacthub.io/license: MPL-2.0
artifacthub.io/links: |
- name: Documentation
Expand Down
4 changes: 0 additions & 4 deletions charts/consul/templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ spec:
{{ tpl .Values.server.tolerations . | nindent 8 | trim }}
{{- end }}
{{- if .Values.server.topologySpreadConstraints }}
{{- if and (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "18") }}
topologySpreadConstraints:
{{ tpl .Values.server.topologySpreadConstraints . | nindent 8 | trim }}
{{- else }}
{{- fail "`topologySpreadConstraints` requires Kubernetes 1.18 and above." }}
{{- end }}
{{- end }}
terminationGracePeriodSeconds: 30
serviceAccountName: {{ template "consul.fullname" . }}-server
Expand Down
2 changes: 1 addition & 1 deletion charts/consul/test/unit/ingress-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ load _helpers
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.containers[0].image' | tee /dev/stderr)
[ "${actual}" = "envoyproxy/envoy-alpine:v1.18.4" ]
[ "${actual}" = "envoyproxy/envoy-alpine:v1.20.0" ]
}

@test "ingressGateways/Deployment: envoy image can be set using the global value" {
Expand Down
2 changes: 1 addition & 1 deletion charts/consul/test/unit/mesh-gateway-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ key2: value2' \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.containers[0].image' | tee /dev/stderr)
[ "${actual}" = "envoyproxy/envoy-alpine:v1.18.4" ]
[ "${actual}" = "envoyproxy/envoy-alpine:v1.20.0" ]
}

@test "meshGateway/Deployment: setting meshGateway.imageEnvoy fails" {
Expand Down
9 changes: 0 additions & 9 deletions charts/consul/test/unit/server-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,6 @@ load _helpers
. | tee /dev/stderr |
yq '.spec.template.spec.topologySpreadConstraints == "foobar"' | tee /dev/stderr)
[ "${actual}" = "true" ]

# todo: test for Kube versions < 1.18 when helm supports --kube-version flag (https://github.com/helm/helm/pull/9040)
# not supported before 1.18
# run helm template \
# -s templates/server-statefulset.yaml \
# --kube-version "1.17" \
# .
# [ "$status" -eq 1 ]
# [[ "$output" =~ "`topologySpreadConstraints` requires Kubernetes 1.18 and above." ]]
}

#--------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ load _helpers
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.containers[0].image' | tee /dev/stderr)
[ "${actual}" = "envoyproxy/envoy-alpine:v1.18.4" ]
[ "${actual}" = "envoyproxy/envoy-alpine:v1.20.0" ]
}

@test "terminatingGateways/Deployment: envoy image can be set using the global value" {
Expand Down
16 changes: 0 additions & 16 deletions charts/consul/test/unit/ui-ingress.bats
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ load _helpers
--set 'ui.ingress.enabled=true' \
--set 'global.tls.enabled=false' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "80" ]
Expand All @@ -92,7 +91,6 @@ load _helpers
--set 'ui.ingress.enabled=true' \
--set 'global.tls.enabled=true' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "443" ]
Expand All @@ -119,7 +117,6 @@ load _helpers
--set 'global.tls.enabled=true' \
--set 'global.tls.httpsOnly=false' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "80" ]
Expand Down Expand Up @@ -147,7 +144,6 @@ load _helpers
--set 'global.tls.enabled=true' \
--set 'global.tls.httpsOnly=false' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[1].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "443" ]
Expand Down Expand Up @@ -279,15 +275,3 @@ load _helpers
[ "${actual}" = "nginx" ]
}

@test "ui/Ingress: cannot set ingressClassName for Kube version < 1.18" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ui-ingress.yaml \
--set 'ui.ingress.enabled=true' \
--set 'ui.ingress.ingressClassName=nginx' \
--kube-version "1.17" \
. | tee /dev/stderr |
yq -r '.spec.ingressClassName' | tee /dev/stderr)
[ "${actual}" = "null" ]
}

6 changes: 3 additions & 3 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ global:
# image: "hashicorp/consul-enterprise:1.10.0-ent"
# ```
# @default: hashicorp/consul:<latest version>
image: "hashicorp/consul:1.10.4"
image: "hashicorp/consul:1.11.0"

# Array of objects containing image pull secret names that will be applied to each service account.
# This can be used to reference image pull secrets if using a custom consul or consul-k8s-control-plane Docker image.
Expand All @@ -105,7 +105,7 @@ global:
# image that is used for functionality such as catalog sync.
# This can be overridden per component.
# @default: hashicorp/consul-k8s-control-plane:<latest version>
imageK8S: "hashicorp/consul-k8s-control-plane:0.38.0"
imageK8S: "hashicorp/consul-k8s-control-plane:0.39.0"

# The name of the datacenter that the agents should
# register as. This can't be changed once the Consul cluster is up and running
Expand Down Expand Up @@ -444,7 +444,7 @@ global:
# connect-injected sidecar proxies and mesh, terminating, and ingress gateways.
# See https://www.consul.io/docs/connect/proxies/envoy for full compatibility matrix between Consul and Envoy.
# @default: envoyproxy/envoy-alpine:<latest supported version>
imageEnvoy: "envoyproxy/envoy-alpine:v1.18.4"
imageEnvoy: "envoyproxy/envoy-alpine:v1.20.0"

# Configuration for running this Helm chart on the Red Hat OpenShift platform.
# This Helm chart currently supports OpenShift v4.x+.
Expand Down
5 changes: 2 additions & 3 deletions control-plane/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ require (
github.com/go-logr/logr v0.4.0
github.com/google/go-cmp v0.5.6
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc
github.com/hashicorp/consul/sdk v0.8.0
github.com/hashicorp/consul/api v1.12.0
github.com/hashicorp/consul/sdk v0.9.0
github.com/hashicorp/go-discover v0.0.0-20200812215701-c4b85f6ed31f
github.com/hashicorp/go-hclog v0.16.1
github.com/hashicorp/go-multierror v1.1.0
Expand Down Expand Up @@ -83,7 +83,6 @@ require (
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/miekg/dns v1.1.41 // indirect
github.com/mitchellh/go-testing-interface v1.14.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 // indirect
Expand Down
9 changes: 4 additions & 5 deletions control-plane/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,12 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc h1:tUgL1cinAFDtidyKqgsJzlxLkEi9atLmN6j8kgCr17Q=
github.com/hashicorp/consul/api v1.10.1-0.20211206193229-9b44861ce4bc/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY=
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU=
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
github.com/hashicorp/consul/sdk v0.9.0 h1:NGSHAU7X3yDCjo8WBUbNOtD3BSqv8u0vu3+zNxgmxQI=
github.com/hashicorp/consul/sdk v0.9.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down Expand Up @@ -433,8 +434,6 @@ github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/go-testing-interface v1.14.0 h1:/x0XQ6h+3U3nAyk1yx+bHPURrKa9sVVvYbuqZ7pIAtI=
github.com/mitchellh/go-testing-interface v1.14.0/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
Expand Down
8 changes: 4 additions & 4 deletions control-plane/subcommand/consul-sidecar/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestRunSignalHandlingMetricsOnly(t *testing.T) {
UI: ui,
}

randomPorts := freeport.MustTake(1)
randomPorts := freeport.GetN(t, 1)
// Run async because we need to kill it when the test is over.
exitChan := runCommandAsynchronously(&cmd, []string{
"-enable-service-registration=false",
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestRunSignalHandlingAllProcessesEnabled(t *testing.T) {

require.NoError(t, err)

randomPorts := freeport.MustTake(1)
randomPorts := freeport.GetN(t, 1)
// Run async because we need to kill it when the test is over.
exitChan := runCommandAsynchronously(&cmd, []string{
"-service-config", configFile,
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestMergedMetricsServer(t *testing.T) {

for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
randomPorts := freeport.MustTake(2)
randomPorts := freeport.GetN(t, 2)
ui := cli.NewMockUi()
cmd := Command{
UI: ui,
Expand Down Expand Up @@ -485,7 +485,7 @@ func TestRun_ServicesRegistration_ConsulDown(t *testing.T) {

// we need to reserve all 6 ports to avoid potential
// port collisions with other tests
randomPorts := freeport.MustTake(6)
randomPorts := freeport.GetN(t, 6)

// Run async because we need to kill it when the test is over.
exitChan := runCommandAsynchronously(&cmd, []string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ func TestRun_ConsulClientDelay(t *testing.T) {

// We need to reserve all 6 ports to avoid potential
// port collisions with other tests.
randomPorts := freeport.MustTake(6)
randomPorts := freeport.GetN(t, 6)
caFile, certFile, keyFile := test.GenerateServerCerts(t)

// Create fake k8s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestRun_ConsulServerAvailableLater(t *testing.T) {
UI: ui,
}

randomPorts := freeport.MustTake(6)
randomPorts := freeport.GetN(t, 6)

// Start the consul agent asynchronously
var a *testutil.TestServer
Expand Down
2 changes: 1 addition & 1 deletion control-plane/subcommand/server-acl-init/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ func TestRun_DelayedServers(t *testing.T) {
require := require.New(t)
k8s := fake.NewSimpleClientset()

randomPorts := freeport.MustTake(6)
randomPorts := freeport.GetN(t, 6)

ui := cli.NewMockUi()
cmd := Command{
Expand Down

0 comments on commit fd07b6d

Please sign in to comment.