From 88452928f7433170f23952a03b62668b748046c5 Mon Sep 17 00:00:00 2001 From: Iryna Shustava Date: Tue, 8 Sep 2020 14:00:32 -0700 Subject: [PATCH] WIP: minimal changes to support openshift --- CONTRIBUTING.md | 4 +- templates/client-role.yaml | 10 ++- templates/server-statefulset.yaml | 2 +- templates/tls-init-job.yaml | 1 + test/acceptance/framework/config.go | 7 ++ test/acceptance/framework/consul_cluster.go | 17 ++--- test/acceptance/framework/environment.go | 28 ++++++-- test/acceptance/framework/flags.go | 11 +++- test/acceptance/go.mod | 14 ++-- test/acceptance/go.sum | 64 +++++++++++++------ test/acceptance/helpers/helpers.go | 13 ++-- .../connect/connect_inject_namespaces_test.go | 16 ++--- .../tests/connect/connect_inject_test.go | 8 +-- .../tests/consul-dns/consul_dns_test.go | 17 ++--- test/acceptance/tests/example/example_test.go | 7 +- .../ingress_gateway_namespaces_test.go | 20 +++--- .../ingress-gateway/ingress_gateway_test.go | 6 +- .../tests/mesh-gateway/mesh_gateway_test.go | 21 +++--- .../sync/sync_catalog_namespaces_test.go | 8 +-- .../tests/sync/sync_catalog_test.go | 4 +- .../terminating_gateway_namespaces_test.go | 26 ++++---- .../terminating_gateway_test.go | 8 +-- values.yaml | 6 +- 23 files changed, 198 insertions(+), 120 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 112db9495..7833ada69 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -334,7 +334,7 @@ There are a number of `kubectl` commands available in the `helpers/kubectl.go` f For example, to call `kubectl apply` from the test write the following: ```go -helpers.KubectlApply(t, ctx.KubectlOptions(), filepath) +helpers.KubectlApply(t, ctx.KubectlOptions(t), filepath) ``` Similarly, you can obtain Kubernetes client from your test context. @@ -342,7 +342,7 @@ You can use it to, for example, read all services in a namespace: ```go k8sClient := ctx.KubernetesClient(t) -services, err := k8sClient.CoreV1().Services(ctx.KubectlOptions().Namespace).List(metav1.ListOptions{}) +services, err := k8sClient.CoreV1().Services(ctx.KubectlOptions(t).Namespace).List(metav1.ListOptions{}) ``` To make Consul API calls, you can get the Consul client from the `consulCluster` object, diff --git a/templates/client-role.yaml b/templates/client-role.yaml index 5a9f90ef2..da8a9ea7c 100644 --- a/templates/client-role.yaml +++ b/templates/client-role.yaml @@ -9,7 +9,7 @@ metadata: chart: {{ template "consul.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} -{{- if (or .Values.global.acls.manageSystemACLs .Values.global.enablePodSecurityPolicies) }} +{{- if (or .Values.global.acls.manageSystemACLs .Values.global.enablePodSecurityPolicies .Values.global.openshift.enabled) }} rules: {{- if .Values.global.enablePodSecurityPolicies }} - apiGroups: ["policy"] @@ -28,6 +28,14 @@ rules: verbs: - get {{- end }} +{{- if .Values.global.openshift.enabled}} + - apiGroups: ["security.openshift.io"] + resources: ["securitycontextconstraints"] + resourceNames: + - hostnetwork + verbs: + - use +{{- end}} {{- else}} rules: [] {{- end }} diff --git a/templates/server-statefulset.yaml b/templates/server-statefulset.yaml index 036f7e9c3..ce29f42e2 100644 --- a/templates/server-statefulset.yaml +++ b/templates/server-statefulset.yaml @@ -58,7 +58,7 @@ spec: {{- end }} terminationGracePeriodSeconds: 30 serviceAccountName: {{ template "consul.fullname" . }}-server - {{- if not .Values.server.disableFsGroupSecurityContext }} + {{- if not (or .Values.server.disableFsGroupSecurityContext .Values.global.openshift.enabled)}} securityContext: fsGroup: 1000 {{- end }} diff --git a/templates/tls-init-job.yaml b/templates/tls-init-job.yaml index 6fa81d41e..c00f5ce65 100644 --- a/templates/tls-init-job.yaml +++ b/templates/tls-init-job.yaml @@ -56,6 +56,7 @@ spec: # Note that in the subsequent runs of the job, POST requests will # return a 409 because these secrets would already exist; # we are ignoring these response codes. + workingDir: /tmp command: - "/bin/sh" - "-ec" diff --git a/test/acceptance/framework/config.go b/test/acceptance/framework/config.go index 50d945156..e5670ff20 100644 --- a/test/acceptance/framework/config.go +++ b/test/acceptance/framework/config.go @@ -23,6 +23,8 @@ type TestConfig struct { EnterpriseLicenseSecretName string EnterpriseLicenseSecretKey string + EnableOpenshift bool + ConsulImage string ConsulK8SImage string @@ -50,6 +52,11 @@ func (t *TestConfig) HelmValuesFromConfig() (map[string]string, error) { setIfNotEmpty(helmValues, "server.enterpriseLicense.secretKey", t.EnterpriseLicenseSecretKey) } + // todo add tests + if t.EnableOpenshift { + setIfNotEmpty(helmValues, "global.openshift.enabled", "true") + } + setIfNotEmpty(helmValues, "global.image", t.ConsulImage) setIfNotEmpty(helmValues, "global.imageK8S", t.ConsulK8SImage) diff --git a/test/acceptance/framework/consul_cluster.go b/test/acceptance/framework/consul_cluster.go index a1a1f2b78..8514444fd 100644 --- a/test/acceptance/framework/consul_cluster.go +++ b/test/acceptance/framework/consul_cluster.go @@ -1,6 +1,7 @@ package framework import ( + "context" "encoding/json" "fmt" "io/ioutil" @@ -67,7 +68,7 @@ func NewHelmCluster( opts := &helm.Options{ SetValues: values, - KubectlOptions: ctx.KubectlOptions(), + KubectlOptions: ctx.KubectlOptions(t), Logger: logger.TestingT, } return &HelmCluster{ @@ -106,14 +107,14 @@ func (h *HelmCluster) Destroy(t *testing.T) { helm.Delete(t, h.helmOptions, h.releaseName, false) // delete PVCs - h.kubernetesClient.CoreV1().PersistentVolumeClaims(h.helmOptions.KubectlOptions.Namespace).DeleteCollection(&metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "release=" + h.releaseName}) + h.kubernetesClient.CoreV1().PersistentVolumeClaims(h.helmOptions.KubectlOptions.Namespace).DeleteCollection(context.TODO(), metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: "release=" + h.releaseName}) // delete any serviceaccounts that have h.releaseName in their name - sas, err := h.kubernetesClient.CoreV1().ServiceAccounts(h.helmOptions.KubectlOptions.Namespace).List(metav1.ListOptions{}) + sas, err := h.kubernetesClient.CoreV1().ServiceAccounts(h.helmOptions.KubectlOptions.Namespace).List(context.TODO(), metav1.ListOptions{}) require.NoError(t, err) for _, sa := range sas.Items { if strings.Contains(sa.Name, h.releaseName) { - err := h.kubernetesClient.CoreV1().ServiceAccounts(h.helmOptions.KubectlOptions.Namespace).Delete(sa.Name, nil) + err := h.kubernetesClient.CoreV1().ServiceAccounts(h.helmOptions.KubectlOptions.Namespace).Delete(context.TODO(), sa.Name, metav1.DeleteOptions{}) if !errors.IsNotFound(err) { require.NoError(t, err) } @@ -121,11 +122,11 @@ func (h *HelmCluster) Destroy(t *testing.T) { } // delete any secrets that have h.releaseName in their name - secrets, err := h.kubernetesClient.CoreV1().Secrets(h.helmOptions.KubectlOptions.Namespace).List(metav1.ListOptions{}) + secrets, err := h.kubernetesClient.CoreV1().Secrets(h.helmOptions.KubectlOptions.Namespace).List(context.TODO(), metav1.ListOptions{}) require.NoError(t, err) for _, secret := range secrets.Items { if strings.Contains(secret.Name, h.releaseName) { - err := h.kubernetesClient.CoreV1().Secrets(h.helmOptions.KubectlOptions.Namespace).Delete(secret.Name, nil) + err := h.kubernetesClient.CoreV1().Secrets(h.helmOptions.KubectlOptions.Namespace).Delete(context.TODO(), secret.Name, metav1.DeleteOptions{}) if !errors.IsNotFound(err) { require.NoError(t, err) } @@ -154,7 +155,7 @@ func (h *HelmCluster) SetupConsulClient(t *testing.T, secure bool) *api.Client { remotePort = 8501 // get the CA - caSecret, err := h.kubernetesClient.CoreV1().Secrets(namespace).Get(h.releaseName+"-consul-ca-cert", metav1.GetOptions{}) + caSecret, err := h.kubernetesClient.CoreV1().Secrets(namespace).Get(context.TODO(), h.releaseName+"-consul-ca-cert", metav1.GetOptions{}) require.NoError(t, err) caFile, err := ioutil.TempFile("", "") require.NoError(t, err) @@ -168,7 +169,7 @@ func (h *HelmCluster) SetupConsulClient(t *testing.T, secure bool) *api.Client { } // get the ACL token - aclSecret, err := h.kubernetesClient.CoreV1().Secrets(namespace).Get(h.releaseName+"-consul-bootstrap-acl-token", metav1.GetOptions{}) + aclSecret, err := h.kubernetesClient.CoreV1().Secrets(namespace).Get(context.TODO(), h.releaseName+"-consul-bootstrap-acl-token", metav1.GetOptions{}) require.NoError(t, err) config.TLSConfig.CAFile = caFile.Name() diff --git a/test/acceptance/framework/environment.go b/test/acceptance/framework/environment.go index 139efbc9a..f9cb7d688 100644 --- a/test/acceptance/framework/environment.go +++ b/test/acceptance/framework/environment.go @@ -25,7 +25,7 @@ type TestEnvironment interface { // TestContext represents a specific context a test needs, // for example, information about a specific Kubernetes cluster. type TestContext interface { - KubectlOptions() *k8s.KubectlOptions + KubectlOptions(t *testing.T) *k8s.KubectlOptions KubernetesClient(t *testing.T) kubernetes.Interface } @@ -70,17 +70,35 @@ type kubernetesContext struct { kubeContextName string namespace string - client kubernetes.Interface + client kubernetes.Interface + options *k8s.KubectlOptions logDirectory string } -func (k kubernetesContext) KubectlOptions() *k8s.KubectlOptions { - return &k8s.KubectlOptions{ +func (k kubernetesContext) KubectlOptions(t *testing.T) *k8s.KubectlOptions { + if k.options != nil { + return k.options + } + + k.options = &k8s.KubectlOptions{ ContextName: k.kubeContextName, ConfigPath: k.pathToKubeConfig, Namespace: k.namespace, } + + if k.namespace == "" { + // Otherwise, get current context from config + configPath, err := k.options.GetConfigPath(t) + require.NoError(t, err) + + rawConfig, err := k8s.LoadConfigFromPath(configPath).RawConfig() + require.NoError(t, err) + + contextName := helpers.KubernetesContextFromOptions(t, k.options) + k.options.Namespace = rawConfig.Contexts[contextName].Namespace + } + return k.options } func (k kubernetesContext) KubernetesClient(t *testing.T) kubernetes.Interface { @@ -88,7 +106,7 @@ func (k kubernetesContext) KubernetesClient(t *testing.T) kubernetes.Interface { return k.client } - k.client = helpers.KubernetesClientFromOptions(t, k.KubectlOptions()) + k.client = helpers.KubernetesClientFromOptions(t, k.KubectlOptions(t)) return k.client } diff --git a/test/acceptance/framework/flags.go b/test/acceptance/framework/flags.go index 08fd486d5..cb7fc4d94 100644 --- a/test/acceptance/framework/flags.go +++ b/test/acceptance/framework/flags.go @@ -20,6 +20,8 @@ type TestFlags struct { flagEnterpriseLicenseSecretName string flagEnterpriseLicenseSecretKey string + flagEnableOpenshift bool + flagConsulImage string flagConsulK8sImage string @@ -42,7 +44,7 @@ func (t *TestFlags) init() { "the default kubeconfig path (~/.kube/config) will be used.") flag.StringVar(&t.flagKubecontext, "kubecontext", "", "The name of the Kubernetes context to use. If this is blank, "+ "the context set as the current context will be used by default.") - flag.StringVar(&t.flagNamespace, "namespace", "default", "The Kubernetes namespace to use for tests.") + flag.StringVar(&t.flagNamespace, "namespace", "", "The Kubernetes namespace to use for tests.") flag.StringVar(&t.flagConsulImage, "consul-image", "", "The Consul image to use for all tests.") flag.StringVar(&t.flagConsulK8sImage, "consul-k8s-image", "", "The consul-k8s image to use for all tests.") @@ -54,7 +56,7 @@ func (t *TestFlags) init() { "If this is blank, the default kubeconfig path (~/.kube/config) will be used.") flag.StringVar(&t.flagSecondaryKubecontext, "secondary-kubecontext", "", "The name of the Kubernetes context for the secondary cluster to use. "+ "If this is blank, the context set as the current context will be used by default.") - flag.StringVar(&t.flagSecondaryNamespace, "secondary-namespace", "default", "The Kubernetes namespace to use in the secondary k8s cluster.") + flag.StringVar(&t.flagSecondaryNamespace, "secondary-namespace", "", "The Kubernetes namespace to use in the secondary k8s cluster.") flag.BoolVar(&t.flagEnableEnterprise, "enable-enterprise", false, "If true, the test suite will run tests for enterprise features. "+ @@ -64,6 +66,9 @@ func (t *TestFlags) init() { flag.StringVar(&t.flagEnterpriseLicenseSecretKey, "enterprise-license-secret-key", "", "The key of the Kubernetes secret containing the enterprise license.") + flag.BoolVar(&t.flagEnableOpenshift, "enable-openshift", false, + "If true, the tests will automatically add Openshift Helm value for each Helm install.") + flag.BoolVar(&t.flagNoCleanupOnFailure, "no-cleanup-on-failure", false, "If true, the tests will not cleanup Kubernetes resources they create when they finish running."+ "Note this flag must be run with -failfast flag, otherwise subsequent tests will fail.") @@ -105,6 +110,8 @@ func (t *TestFlags) testConfigFromFlags() *TestConfig { EnterpriseLicenseSecretName: t.flagEnterpriseLicenseSecretName, EnterpriseLicenseSecretKey: t.flagEnterpriseLicenseSecretKey, + EnableOpenshift: t.flagEnableOpenshift, + ConsulImage: t.flagConsulImage, ConsulK8SImage: t.flagConsulK8sImage, diff --git a/test/acceptance/go.mod b/test/acceptance/go.mod index f6a4ce6a0..91e2c747a 100644 --- a/test/acceptance/go.mod +++ b/test/acceptance/go.mod @@ -3,13 +3,13 @@ module github.com/hashicorp/consul-helm/test/acceptance go 1.14 require ( - github.com/gruntwork-io/terratest v0.27.3 - github.com/hashicorp/consul/api v1.5.0 - github.com/hashicorp/consul/sdk v0.5.0 - github.com/hashicorp/serf v0.9.0 + github.com/gruntwork-io/terratest v0.29.0 + github.com/hashicorp/consul/api v1.6.0 + github.com/hashicorp/consul/sdk v0.6.0 + github.com/hashicorp/serf v0.9.3 github.com/stretchr/testify v1.5.1 gopkg.in/yaml.v2 v2.2.8 - k8s.io/api v0.17.0 - k8s.io/apimachinery v0.17.0 - k8s.io/client-go v0.17.0 + k8s.io/api v0.18.3 + k8s.io/apimachinery v0.18.3 + k8s.io/client-go v0.18.3 ) diff --git a/test/acceptance/go.sum b/test/acceptance/go.sum index 7e3a4847d..26a102f1b 100644 --- a/test/acceptance/go.sum +++ b/test/acceptance/go.sum @@ -45,7 +45,6 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20190822182118-27a4ced34534/go.mod h1:iroGtC8B3tQiqtds1l+mgk/BBOrxbqjH+eUfFQYRc14= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -59,6 +58,7 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5 github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.16.26/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.1 h1:MXnqY6SlWySaZAqNnXThOvjRFdiiOuKtC6i7baFdNdU= @@ -122,6 +122,7 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1 h1:yY9rWGoXv1U5pl4gxqlULARMQD7x0QG85lqEXTWysik= github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM= @@ -140,7 +141,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0 h1:skJKxRtNmevLqnayafdLe2AsenqRupVmzZSqrvb5caU= github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -165,6 +165,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -191,6 +193,8 @@ github.com/google/go-containerregistry v0.0.0-20200110202235-f4fb41bf00a3/go.mod github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -202,6 +206,7 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= @@ -210,18 +215,17 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/gruntwork-io/gruntwork-cli v0.5.1 h1:mVmVsFubUSLSCO8bGigI63HXzvzkC0uWXzm4dd9pXRg= github.com/gruntwork-io/gruntwork-cli v0.5.1/go.mod h1:IBX21bESC1/LGoV7jhXKUnTQTZgQ6dYRsoj/VqxUSZQ= -github.com/gruntwork-io/terratest v0.27.3 h1:kDTrA+b+OoqDkwLs0A7THgK8WPXyHfuPiZB2XvR5vVU= -github.com/gruntwork-io/terratest v0.27.3/go.mod h1:ONEOU6Fv3a1rN16Z5t5yWbV57DkVC7665yRyvu3aWnk= -github.com/hashicorp/consul/api v1.5.0 h1:Yo2bneoGy68A7aNwmuETFnPhjyBEm7n3vzRacEVMjvI= -github.com/hashicorp/consul/api v1.5.0/go.mod h1:LqwrLNW876eYSuUOo4ZLHBcdKc038txr/IMfbLPATa4= -github.com/hashicorp/consul/sdk v0.5.0 h1:WC4594Wp/LkEeML/OdQKEC1yqBmEYkRp6i7X5u0zDAs= -github.com/hashicorp/consul/sdk v0.5.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= +github.com/gruntwork-io/terratest v0.29.0 h1:EyPLLxglZIHJ0jU1cbx2NJT7A3MVEmPle8ENWDDwVAA= +github.com/gruntwork-io/terratest v0.29.0/go.mod h1:aVz7181EP4okz7LMx6BLpiF7bL8wkq+h57V6uicvoc0= +github.com/hashicorp/consul/api v1.6.0 h1:SZB2hQW8AcTOpfDmiVblQbijxzsRuiyy0JpHfabvHio= +github.com/hashicorp/consul/api v1.6.0/go.mod h1:1NSuaUUkFaJzMasbfq/11wKYWSR67Xn6r2DXKhuDNFg= +github.com/hashicorp/consul/sdk v0.6.0 h1:FfhMEkwvQl57CildXJyGHnwGGM4HMODGyfjGwNM1Vdw= +github.com/hashicorp/consul/sdk v0.6.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= 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.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= @@ -234,6 +238,8 @@ github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqk github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= @@ -249,10 +255,10 @@ github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/memberlist v0.2.0 h1:WeeNspppWi5s1OFefTviPQueC/Bq8dONfvNjPhiEQKE= -github.com/hashicorp/memberlist v0.2.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/serf v0.9.0 h1:+Zd/16AJ9lxk9RzfTDyv/TLhZ8UerqYS0/+JGCIDaa0= -github.com/hashicorp/serf v0.9.0/go.mod h1:YL0HO+FifKOW2u1ke99DGVu1zhcpZzNwrLIqBC7vbYU= +github.com/hashicorp/memberlist v0.2.2 h1:5+RffWKwqJ71YPu9mWsF7ZOscZmwfasdA8kbdC7AO2g= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.3 h1:AVF6JDQQens6nMHT9OGERBvK0f8rPrAGILnsKLr6lzM= +github.com/hashicorp/serf v0.9.3/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -286,7 +292,6 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -294,6 +299,8 @@ github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -309,7 +316,7 @@ github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= 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 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= @@ -335,6 +342,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= @@ -356,6 +365,7 @@ github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/pquerna/otp v1.2.0 h1:/A3+Jn+cagqayeR3iHs/L62m5ue7710D35zl1zJ1kok= github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= @@ -381,7 +391,6 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shopspring/decimal v0.0.0-20200105231215-408a2507e114/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -440,8 +449,8 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200109152110-61a87790db17 h1:nVJ3guKA9qdkEQ3TUdXI9QSINo2CUPM/cySEvw2w8I0= -golang.org/x/crypto v0.0.0-20200109152110-61a87790db17/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -525,6 +534,7 @@ golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -532,6 +542,8 @@ golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -639,11 +651,17 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.17.0 h1:H9d/lw+VkZKEVIUc8F3wgiQ+FUXTTr21M87jXLU7yqM= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= +k8s.io/api v0.18.3 h1:2AJaUQdgUZLoDZHrun21PW2Nx9+ll6cUzvn3IKhSIn0= +k8s.io/api v0.18.3/go.mod h1:UOaMwERbqJMfeeeHc8XJKawj4P9TgDRnViIqqBeH2QA= k8s.io/apimachinery v0.17.0 h1:xRBnuie9rXcPxUkDizUsGvPf1cnlZCFu210op7J7LJo= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.18.3 h1:pOGcbVAhxADgUYnjS08EFXs9QMl8qaH5U4fr5LGUrSk= +k8s.io/apimachinery v0.18.3/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= k8s.io/client-go v0.17.0 h1:8QOGvUGdqDMFrm9sD6IUFl256BcffynGoe80sxgTEDg= k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= +k8s.io/client-go v0.18.3 h1:QaJzz92tsN67oorwzmoB0a9r9ZVHuD5ryjbCKP0U22k= +k8s.io/client-go v0.18.3/go.mod h1:4a/dpQEvzAhT1BbuWW09qvIaGw6Gbu1gZYiQZIi1DMw= k8s.io/cloud-provider v0.17.0/go.mod h1:Ze4c3w2C0bRsjkBUoHpFi+qWe3ob1wI2/7cUn+YQIDE= k8s.io/code-generator v0.0.0-20191121015212-c4c8f8345c7e/go.mod h1:DVmfPQgxQENqDIzVR2ddLXMH34qeszkKSdH/N+s+38s= k8s.io/component-base v0.17.0/go.mod h1:rKuRAokNMY2nn2A6LP/MiwpoaMRHpfRnrPaUJJj1Yoc= @@ -656,11 +674,14 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/legacy-cloud-providers v0.17.0 h1:ITm7sUthpxQyP96MU7K4Ra9M9M1k9eywUWv9IiTaxzc= k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -670,5 +691,10 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/test/acceptance/helpers/helpers.go b/test/acceptance/helpers/helpers.go index 76887c104..5adf54f02 100644 --- a/test/acceptance/helpers/helpers.go +++ b/test/acceptance/helpers/helpers.go @@ -1,6 +1,7 @@ package helpers import ( + "context" "fmt" "io/ioutil" "os" @@ -39,8 +40,9 @@ func WaitForAllPodsToBeReady(t *testing.T, client kubernetes.Interface, namespac // Wait up to 3m. counter := &retry.Counter{Count: 36, Wait: 5 * time.Second} retry.RunWith(counter, t, func(r *retry.R) { - pods, err := client.CoreV1().Pods(namespace).List(metav1.ListOptions{LabelSelector: podLabelSelector}) + pods, err := client.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: podLabelSelector}) require.NoError(r, err) + require.NotEmpty(r, pods.Items) var numNotReadyContainers int var totalNumContainers int for _, pod := range pods.Items { @@ -61,6 +63,7 @@ func WaitForAllPodsToBeReady(t *testing.T, client kubernetes.Interface, namespac } } if numNotReadyContainers != 0 { + t.Logf("%d out of %d containers are ready", totalNumContainers-numNotReadyContainers, totalNumContainers) r.Errorf("%d out of %d containers are ready", totalNumContainers-numNotReadyContainers, totalNumContainers) } }) @@ -188,14 +191,14 @@ func WritePodsDebugInfoIfFailed(t *testing.T, kubectlOptions *k8s.KubectlOptions // Create k8s client from kubectl options client := KubernetesClientFromOptions(t, kubectlOptions) - contextName := kubernetesContextFromOptions(t, kubectlOptions) + contextName := KubernetesContextFromOptions(t, kubectlOptions) // Create a directory for the test testDebugDirectory := filepath.Join(debugDirectory, t.Name(), contextName) require.NoError(t, os.MkdirAll(testDebugDirectory, 0755)) t.Logf("dumping logs and pod info for %s to %s", labelSelector, testDebugDirectory) - pods, err := client.CoreV1().Pods(kubectlOptions.Namespace).List(metav1.ListOptions{LabelSelector: labelSelector}) + pods, err := client.CoreV1().Pods(kubectlOptions.Namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector}) require.NoError(t, err) for _, pod := range pods.Items { @@ -232,10 +235,10 @@ func KubernetesClientFromOptions(t *testing.T, options *k8s.KubectlOptions) kube return client } -// kubernetesContextFromOptions returns the Kubernetes context from options. +// KubernetesContextFromOptions returns the Kubernetes context from options. // If context is explicitly set in options, it returns that context. // Otherwise, it returns the current context. -func kubernetesContextFromOptions(t *testing.T, options *k8s.KubectlOptions) string { +func KubernetesContextFromOptions(t *testing.T, options *k8s.KubectlOptions) string { t.Helper() // First, check if context set in options and return that diff --git a/test/acceptance/tests/connect/connect_inject_namespaces_test.go b/test/acceptance/tests/connect/connect_inject_namespaces_test.go index 05bc28905..e50a90932 100644 --- a/test/acceptance/tests/connect/connect_inject_namespaces_test.go +++ b/test/acceptance/tests/connect/connect_inject_namespaces_test.go @@ -73,25 +73,25 @@ func TestConnectInjectNamespaces(t *testing.T) { consulCluster.Create(t) staticServerOpts := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: staticServerNamespace, } staticClientOpts := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: staticClientNamespace, } t.Logf("creating namespaces %s and %s", staticServerNamespace, staticClientNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", staticServerNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", staticServerNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", staticServerNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", staticServerNamespace) }) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", staticClientNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", staticClientNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", staticClientNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", staticClientNamespace) }) t.Log("creating static-server and static-client deployments") diff --git a/test/acceptance/tests/connect/connect_inject_test.go b/test/acceptance/tests/connect/connect_inject_test.go index 561918305..4223e4dd6 100644 --- a/test/acceptance/tests/connect/connect_inject_test.go +++ b/test/acceptance/tests/connect/connect_inject_test.go @@ -43,12 +43,12 @@ func TestConnectInject(t *testing.T) { consulCluster.Create(t) t.Log("creating static-server and static-client deployments") - helpers.DeployKustomize(t, ctx.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") - helpers.DeployKustomize(t, ctx.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-inject") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-inject") if c.secure { t.Log("checking that the connection is not successful because there's no intention") - helpers.CheckStaticServerConnection(t, ctx.KubectlOptions(), false, staticClientName, "http://localhost:1234") + helpers.CheckStaticServerConnection(t, ctx.KubectlOptions(t), false, staticClientName, "http://localhost:1234") consulClient := consulCluster.SetupConsulClient(t, true) @@ -62,7 +62,7 @@ func TestConnectInject(t *testing.T) { } t.Log("checking that connection is successful") - helpers.CheckStaticServerConnection(t, ctx.KubectlOptions(), true, staticClientName, "http://localhost:1234") + helpers.CheckStaticServerConnection(t, ctx.KubectlOptions(t), true, staticClientName, "http://localhost:1234") }) } } diff --git a/test/acceptance/tests/consul-dns/consul_dns_test.go b/test/acceptance/tests/consul-dns/consul_dns_test.go index 8406ca7c9..d40732871 100644 --- a/test/acceptance/tests/consul-dns/consul_dns_test.go +++ b/test/acceptance/tests/consul-dns/consul_dns_test.go @@ -1,6 +1,7 @@ package consuldns import ( + "context" "fmt" "testing" @@ -33,21 +34,21 @@ func TestConsulDNS(t *testing.T) { for _, c := range cases { t.Run(c.name, func(t *testing.T) { env := suite.Environment() - context := env.DefaultContext(t) + ctx := env.DefaultContext(t) releaseName := helpers.RandomName() - cluster := framework.NewHelmCluster(t, c.helmValues, context, suite.Config(), releaseName) + cluster := framework.NewHelmCluster(t, c.helmValues, ctx, suite.Config(), releaseName) cluster.Create(t) - k8sClient := context.KubernetesClient(t) - contextNamespace := context.KubectlOptions().Namespace + k8sClient := ctx.KubernetesClient(t) + contextNamespace := ctx.KubectlOptions(t).Namespace - dnsService, err := k8sClient.CoreV1().Services(contextNamespace).Get(fmt.Sprintf("%s-%s", releaseName, "consul-dns"), metav1.GetOptions{}) + dnsService, err := k8sClient.CoreV1().Services(contextNamespace).Get(context.TODO(), fmt.Sprintf("%s-%s", releaseName, "consul-dns"), metav1.GetOptions{}) require.NoError(t, err) dnsIP := dnsService.Spec.ClusterIP - consulServerList, err := k8sClient.CoreV1().Pods(contextNamespace).List(metav1.ListOptions{ + consulServerList, err := k8sClient.CoreV1().Pods(contextNamespace).List(context.TODO(), metav1.ListOptions{ LabelSelector: "app=consul,component=server", }) require.NoError(t, err) @@ -60,7 +61,7 @@ func TestConsulDNS(t *testing.T) { dnsTestPodArgs := []string{ "run", "-it", podName, "--restart", "Never", "--image", "anubhavmishra/tiny-tools", "--", "dig", fmt.Sprintf("@%s-consul-dns", releaseName), "consul.service.consul", } - logs, err := helpers.RunKubectlAndGetOutputE(t, context.KubectlOptions(), dnsTestPodArgs...) + logs, err := helpers.RunKubectlAndGetOutputE(t, ctx.KubectlOptions(t), dnsTestPodArgs...) require.NoError(t, err) helpers.Cleanup(t, suite.Config().NoCleanupOnFailure, func() { @@ -68,7 +69,7 @@ func TestConsulDNS(t *testing.T) { // This shouldn't cause any test pollution because the underlying // objects are deployments, and so when other tests create these // they should have different pod names. - helpers.RunKubectl(t, context.KubectlOptions(), "delete", "pod", podName) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "pod", podName) }) // When the `dig` request is successful, a section of it's response looks like the following: diff --git a/test/acceptance/tests/example/example_test.go b/test/acceptance/tests/example/example_test.go index fa732ff0a..4956bd992 100644 --- a/test/acceptance/tests/example/example_test.go +++ b/test/acceptance/tests/example/example_test.go @@ -1,6 +1,7 @@ package example import ( + "context" "testing" "github.com/hashicorp/consul-helm/test/acceptance/framework" @@ -35,17 +36,17 @@ func TestExample(t *testing.T) { // To run kubectl commands, you need to get KubectlOptions from the test context. // There are a number of kubectl commands available in the helpers/kubectl.go file. // For example, to call 'kubectl apply' from the test write the following: - helpers.KubectlApply(t, ctx.KubectlOptions(), "path/to/config") + helpers.KubectlApply(t, ctx.KubectlOptions(t), "path/to/config") // Clean up any Kubernetes resources you have created helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.KubectlDelete(t, ctx.KubectlOptions(), "path/to/config") + helpers.KubectlDelete(t, ctx.KubectlOptions(t), "path/to/config") }) // Similarly, you can obtain Kubernetes client from your test context. // You can use it to, for example, read all services in a namespace: k8sClient := ctx.KubernetesClient(t) - services, err := k8sClient.CoreV1().Services(ctx.KubectlOptions().Namespace).List(metav1.ListOptions{}) + services, err := k8sClient.CoreV1().Services(ctx.KubectlOptions(t).Namespace).List(context.TODO(), metav1.ListOptions{}) require.NoError(t, err) require.NotNil(t, services.Items) diff --git a/test/acceptance/tests/ingress-gateway/ingress_gateway_namespaces_test.go b/test/acceptance/tests/ingress-gateway/ingress_gateway_namespaces_test.go index 72332eff7..5a8e78cf6 100644 --- a/test/acceptance/tests/ingress-gateway/ingress_gateway_namespaces_test.go +++ b/test/acceptance/tests/ingress-gateway/ingress_gateway_namespaces_test.go @@ -74,14 +74,14 @@ func TestIngressGatewaySingleNamespace(t *testing.T) { }) t.Logf("creating Kubernetes namespace %s", testNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", testNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", testNamespace) }) nsK8SOptions := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: testNamespace, } @@ -115,7 +115,7 @@ func TestIngressGatewaySingleNamespace(t *testing.T) { require.NoError(t, err) require.Equal(t, true, created, "config entry failed") - ingressGatewayService := fmt.Sprintf("http://%s-consul-ingress-gateway.%s:8080/", releaseName, ctx.KubectlOptions().Namespace) + ingressGatewayService := fmt.Sprintf("http://%s-consul-ingress-gateway.%s:8080/", releaseName, ctx.KubectlOptions(t).Namespace) // If ACLs are enabled, test that intentions prevent connections. if c.secure { @@ -189,14 +189,14 @@ func TestIngressGatewayNamespaceMirroring(t *testing.T) { consulCluster.Create(t) t.Logf("creating Kubernetes namespace %s", testNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", testNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", testNamespace) }) nsK8SOptions := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: testNamespace, } @@ -232,7 +232,7 @@ func TestIngressGatewayNamespaceMirroring(t *testing.T) { require.NoError(t, err) require.Equal(t, true, created, "config entry failed") - ingressGatewayService := fmt.Sprintf("http://%s-consul-ingress-gateway.%s:8080/", releaseName, ctx.KubectlOptions().Namespace) + ingressGatewayService := fmt.Sprintf("http://%s-consul-ingress-gateway.%s:8080/", releaseName, ctx.KubectlOptions(t).Namespace) // If ACLs are enabled, test that intentions prevent connections. if c.secure { diff --git a/test/acceptance/tests/ingress-gateway/ingress_gateway_test.go b/test/acceptance/tests/ingress-gateway/ingress_gateway_test.go index 15e1ad6a7..d881dd2b6 100644 --- a/test/acceptance/tests/ingress-gateway/ingress_gateway_test.go +++ b/test/acceptance/tests/ingress-gateway/ingress_gateway_test.go @@ -53,12 +53,12 @@ func TestIngressGateway(t *testing.T) { consulCluster.Create(t) t.Log("creating server") - helpers.DeployKustomize(t, ctx.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") // We use the static-client pod so that we can make calls to the ingress gateway // via kubectl exec without needing a route into the cluster from the test machine. t.Log("creating static-client pod") - helpers.DeployKustomize(t, ctx.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/bases/static-client") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/bases/static-client") // With the cluster up, we can create our ingress-gateway config entry. t.Log("creating config entry") @@ -83,7 +83,7 @@ func TestIngressGateway(t *testing.T) { require.NoError(t, err) require.Equal(t, true, created, "config entry failed") - k8sOptions := ctx.KubectlOptions() + k8sOptions := ctx.KubectlOptions(t) // If ACLs are enabled, test that intentions prevent connections. if c.secure { diff --git a/test/acceptance/tests/mesh-gateway/mesh_gateway_test.go b/test/acceptance/tests/mesh-gateway/mesh_gateway_test.go index 1767de275..7cf578941 100644 --- a/test/acceptance/tests/mesh-gateway/mesh_gateway_test.go +++ b/test/acceptance/tests/mesh-gateway/mesh_gateway_test.go @@ -1,6 +1,7 @@ package meshgateway import ( + "context" "fmt" "testing" @@ -44,10 +45,10 @@ func TestMeshGatewayDefault(t *testing.T) { // Get the federation secret from the primary cluster and apply it to secondary cluster federationSecretName := fmt.Sprintf("%s-consul-federation", releaseName) t.Logf("retrieving federation secret %s from the primary cluster and applying to the secondary", federationSecretName) - federationSecret, err := primaryContext.KubernetesClient(t).CoreV1().Secrets(primaryContext.KubectlOptions().Namespace).Get(federationSecretName, metav1.GetOptions{}) + federationSecret, err := primaryContext.KubernetesClient(t).CoreV1().Secrets(primaryContext.KubectlOptions(t).Namespace).Get(context.TODO(), federationSecretName, metav1.GetOptions{}) federationSecret.ResourceVersion = "" require.NoError(t, err) - _, err = secondaryContext.KubernetesClient(t).CoreV1().Secrets(secondaryContext.KubectlOptions().Namespace).Create(federationSecret) + _, err = secondaryContext.KubernetesClient(t).CoreV1().Secrets(secondaryContext.KubectlOptions(t).Namespace).Create(context.TODO(), federationSecret, metav1.CreateOptions{}) require.NoError(t, err) // Create secondary cluster @@ -89,13 +90,13 @@ func TestMeshGatewayDefault(t *testing.T) { // Check that we can connect services over the mesh gateways t.Log("creating static-server in dc2") - helpers.DeployKustomize(t, secondaryContext.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") + helpers.DeployKustomize(t, secondaryContext.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") t.Log("creating static-client in dc1") - helpers.DeployKustomize(t, primaryContext.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-multi-dc") + helpers.DeployKustomize(t, primaryContext.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-multi-dc") t.Log("checking that connection is successful") - helpers.CheckStaticServerConnection(t, primaryContext.KubectlOptions(), true, staticClientName, "http://localhost:1234") + helpers.CheckStaticServerConnection(t, primaryContext.KubectlOptions(t), true, staticClientName, "http://localhost:1234") } // Test that Connect and wan federation over mesh gateways work in a secure installation, @@ -149,10 +150,10 @@ func TestMeshGatewaySecure(t *testing.T) { // Get the federation secret from the primary cluster and apply it to secondary cluster federationSecretName := fmt.Sprintf("%s-consul-federation", releaseName) t.Logf("retrieving federation secret %s from the primary cluster and applying to the secondary", federationSecretName) - federationSecret, err := primaryContext.KubernetesClient(t).CoreV1().Secrets(primaryContext.KubectlOptions().Namespace).Get(federationSecretName, metav1.GetOptions{}) + federationSecret, err := primaryContext.KubernetesClient(t).CoreV1().Secrets(primaryContext.KubectlOptions(t).Namespace).Get(context.TODO(), federationSecretName, metav1.GetOptions{}) require.NoError(t, err) federationSecret.ResourceVersion = "" - _, err = secondaryContext.KubernetesClient(t).CoreV1().Secrets(secondaryContext.KubectlOptions().Namespace).Create(federationSecret) + _, err = secondaryContext.KubernetesClient(t).CoreV1().Secrets(secondaryContext.KubectlOptions(t).Namespace).Create(context.TODO(), federationSecret, metav1.CreateOptions{}) require.NoError(t, err) // Create secondary cluster @@ -199,10 +200,10 @@ func TestMeshGatewaySecure(t *testing.T) { // Check that we can connect services over the mesh gateways t.Log("creating static-server in dc2") - helpers.DeployKustomize(t, secondaryContext.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") + helpers.DeployKustomize(t, secondaryContext.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-server-inject") t.Log("creating static-client in dc1") - helpers.DeployKustomize(t, primaryContext.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-multi-dc") + helpers.DeployKustomize(t, primaryContext.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-multi-dc") t.Log("creating intention") _, _, err = consulClient.Connect().IntentionCreate(&api.Intention{ @@ -213,7 +214,7 @@ func TestMeshGatewaySecure(t *testing.T) { require.NoError(t, err) t.Log("checking that connection is successful") - helpers.CheckStaticServerConnection(t, primaryContext.KubectlOptions(), true, staticClientName, "http://localhost:1234") + helpers.CheckStaticServerConnection(t, primaryContext.KubectlOptions(t), true, staticClientName, "http://localhost:1234") }) } } diff --git a/test/acceptance/tests/sync/sync_catalog_namespaces_test.go b/test/acceptance/tests/sync/sync_catalog_namespaces_test.go index 776247abc..018e2a63a 100644 --- a/test/acceptance/tests/sync/sync_catalog_namespaces_test.go +++ b/test/acceptance/tests/sync/sync_catalog_namespaces_test.go @@ -78,15 +78,15 @@ func TestSyncCatalogNamespaces(t *testing.T) { consulCluster.Create(t) staticServerOpts := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: staticServerNamespace, } t.Logf("creating namespace %s", staticServerNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", staticServerNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", staticServerNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", staticServerNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", staticServerNamespace) }) t.Log("creating a static-server with a service") diff --git a/test/acceptance/tests/sync/sync_catalog_test.go b/test/acceptance/tests/sync/sync_catalog_test.go index a0208ea9b..2e8d9bf47 100644 --- a/test/acceptance/tests/sync/sync_catalog_test.go +++ b/test/acceptance/tests/sync/sync_catalog_test.go @@ -59,13 +59,13 @@ func TestSyncCatalog(t *testing.T) { consulCluster.Create(t) t.Log("creating a static-server with a service") - helpers.DeployKustomize(t, ctx.KubectlOptions(), suite.Config().NoCleanupOnFailure, suite.Config().DebugDirectory, "../fixtures/bases/static-server") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), suite.Config().NoCleanupOnFailure, suite.Config().DebugDirectory, "../fixtures/bases/static-server") consulClient := consulCluster.SetupConsulClient(t, c.secure) t.Log("checking that the service has been synced to Consul") var services map[string][]string - syncedServiceName := fmt.Sprintf("static-server-%s", ctx.KubectlOptions().Namespace) + syncedServiceName := fmt.Sprintf("static-server-%s", ctx.KubectlOptions(t).Namespace) counter := &retry.Counter{Count: 10, Wait: 5 * time.Second} retry.RunWith(counter, t, func(r *retry.R) { var err error diff --git a/test/acceptance/tests/terminating-gateway/terminating_gateway_namespaces_test.go b/test/acceptance/tests/terminating-gateway/terminating_gateway_namespaces_test.go index e8f3925b3..f3c4cfc94 100644 --- a/test/acceptance/tests/terminating-gateway/terminating_gateway_namespaces_test.go +++ b/test/acceptance/tests/terminating-gateway/terminating_gateway_namespaces_test.go @@ -74,14 +74,14 @@ func TestTerminatingGatewaySingleNamespace(t *testing.T) { }) t.Logf("creating Kubernetes namespace %s", testNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", testNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", testNamespace) }) nsK8SOptions := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: testNamespace, } @@ -167,26 +167,26 @@ func TestTerminatingGatewayNamespaceMirroring(t *testing.T) { consulClient := consulCluster.SetupConsulClient(t, c.secure) t.Logf("creating Kubernetes namespace %s", testNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", testNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", testNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", testNamespace) }) staticClientNamespace := "ns2" t.Logf("creating Kubernetes namespace %s", staticClientNamespace) - helpers.RunKubectl(t, ctx.KubectlOptions(), "create", "ns", staticClientNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "create", "ns", staticClientNamespace) helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { - helpers.RunKubectl(t, ctx.KubectlOptions(), "delete", "ns", staticClientNamespace) + helpers.RunKubectl(t, ctx.KubectlOptions(t), "delete", "ns", staticClientNamespace) }) ns1K8SOptions := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: testNamespace, } ns2K8SOptions := &k8s.KubectlOptions{ - ContextName: ctx.KubectlOptions().ContextName, - ConfigPath: ctx.KubectlOptions().ConfigPath, + ContextName: ctx.KubectlOptions(t).ContextName, + ConfigPath: ctx.KubectlOptions(t).ConfigPath, Namespace: staticClientNamespace, } @@ -205,7 +205,7 @@ func TestTerminatingGatewayNamespaceMirroring(t *testing.T) { } // Create the config entry for the terminating gateway - createTerminatingGatewayConfigEntry(t, consulClient, ctx.KubectlOptions().Namespace, testNamespace) + createTerminatingGatewayConfigEntry(t, consulClient, ctx.KubectlOptions(t).Namespace, testNamespace) // Deploy the static client t.Log("deploying static client") diff --git a/test/acceptance/tests/terminating-gateway/terminating_gateway_test.go b/test/acceptance/tests/terminating-gateway/terminating_gateway_test.go index 1e28661f7..e2fad550c 100644 --- a/test/acceptance/tests/terminating-gateway/terminating_gateway_test.go +++ b/test/acceptance/tests/terminating-gateway/terminating_gateway_test.go @@ -59,7 +59,7 @@ func TestTerminatingGateway(t *testing.T) { // Deploy a static-server that will play the role of an external service t.Log("creating static-server deployment") - helpers.DeployKustomize(t, ctx.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/bases/static-server") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/bases/static-server") // Once the cluster is up, register the external service, then create the config entry. consulClient := consulCluster.SetupConsulClient(t, c.secure) @@ -79,19 +79,19 @@ func TestTerminatingGateway(t *testing.T) { // Deploy the static client t.Log("deploying static client") - helpers.DeployKustomize(t, ctx.KubectlOptions(), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-inject") + helpers.DeployKustomize(t, ctx.KubectlOptions(t), cfg.NoCleanupOnFailure, cfg.DebugDirectory, "../fixtures/cases/static-client-inject") // If ACLs are enabled, test that intentions prevent connections. if c.secure { // With the terminating gateway up, we test that we can make a call to it // via the static-server. It should fail to connect with the // static-server pod because of intentions. - assertNoConnectionAndAddIntention(t, consulClient, ctx.KubectlOptions(), "", "") + assertNoConnectionAndAddIntention(t, consulClient, ctx.KubectlOptions(t), "", "") } // Test that we can make a call to the terminating gateway t.Log("trying calls to terminating gateway") - helpers.CheckStaticServerConnection(t, ctx.KubectlOptions(), true, staticClientName, "http://localhost:1234") + helpers.CheckStaticServerConnection(t, ctx.KubectlOptions(t), true, staticClientName, "http://localhost:1234") }) } } diff --git a/values.yaml b/values.yaml index 18cd6f3ae..da2ec4416 100644 --- a/values.yaml +++ b/values.yaml @@ -233,6 +233,10 @@ global: # See https://www.consul.io/docs/connect/proxies/envoy for full compatibility matrix between Consul and Envoy. imageEnvoy: "envoyproxy/envoy-alpine:v1.14.2" + # todo: add docs + openshift: + enabled: false + # Server, when enabled, configures a server cluster to run. This should # be disabled if you plan on connecting to a Consul cluster external to # the Kube cluster. @@ -368,7 +372,7 @@ server: # disableFsGroupSecurityContext disables setting the fsGroup securityContext for the server statefulset, # this is required when using the OpenShift platform as fsGroup is automatically set to an arbitrary gid. - disableFsGroupSecurityContext : false + disableFsGroupSecurityContext: false # Configuration for Consul servers when the servers are running outside of Kubernetes. # When running external servers, configuring these values is recommended