Skip to content

Commit

Permalink
Revert "Revert "Merge branch 'main' into curtbushko/agentless-metrics…
Browse files Browse the repository at this point in the history
…-merging""

This reverts commit dde818d.
  • Loading branch information
curtbushko committed Oct 19, 2022
1 parent 32cb989 commit 6536020
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 466 deletions.
62 changes: 0 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1084,67 +1084,6 @@ jobs:
fail_only: true
failure_message: "OpenShift acceptance tests failed. Check the logs at: ${CIRCLE_BUILD_URL}"

acceptance-kind-1-23-consul-nightly-1-11:
environment:
- TEST_RESULTS: /tmp/test-results
- CONSUL_IMAGE: "docker.mirror.hashicorp.services/hashicorppreview/consul-enterprise:1.11-dev"
- ENVOY_IMAGE: "envoyproxy/envoy:v1.20.2"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.49.0"
- HELM_CHART_VERSION: "0.49.0"
machine:
image: ubuntu-2004:202010-01
resource_class: xlarge
steps:
- run:
name: checkout code
command: |
if [ -e '/home/circleci/project/.git' ] ; then
echo 'Fetching into existing repository'
existing_repo='true'
cd '/home/circleci/project'
git remote set-url origin "$CIRCLE_REPOSITORY_URL" || true
else
echo 'Cloning git repository'
existing_repo='false'
mkdir -p '/home/circleci/project'
cd '/home/circleci/project'
git clone --no-checkout "$CIRCLE_REPOSITORY_URL" .
fi
if [ "$existing_repo" = 'true' ] || [ 'false' = 'true' ]; then
echo 'Fetching from remote repository'
git fetch --force --tags origin
fi
echo 'Checking out tag'
git checkout --force "v$HELM_CHART_VERSION"
- install-prereqs
- create-kind-clusters:
version: "v1.23.0"
- restore_cache:
keys:
- consul-helm-modcache-v2-{{ checksum "acceptance/go.mod" }}
- run:
name: go mod download
working_directory: *acceptance-mod-path
command: go mod download
- save_cache:
key: consul-helm-modcache-v2-{{ checksum "acceptance/go.mod" }}
paths:
- ~/.go_workspace/pkg/mod
- run: mkdir -p $TEST_RESULTS
- run-acceptance-tests:
consul-k8s-image: $CONSUL_K8S_IMAGE
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -consul-image=$CONSUL_IMAGE -consul-version="1.11" -envoy-image=$ENVOY_IMAGE -helm-chart-version=$HELM_CHART_VERSION
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
- slack/status:
channel: *slack-channel
fail_only: true
failure_message: "Acceptance tests against Kind with Kubernetes v1.23 with Consul 1.11 nightly failed. Check the logs at: ${CIRCLE_BUILD_URL}"

acceptance-kind-1-23-consul-nightly-1-12:
environment:
- TEST_RESULTS: /tmp/test-results
Expand Down Expand Up @@ -1353,6 +1292,5 @@ workflows:
only:
- main
jobs:
- acceptance-kind-1-23-consul-nightly-1-11
- acceptance-kind-1-23-consul-nightly-1-12
- acceptance-kind-1-23-consul-nightly-1-13
230 changes: 59 additions & 171 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions LICENSE.md → LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Copyright (c) 2018 HashiCorp, Inc.

Mozilla Public License, version 2.0

1. Definitions
Expand Down
1 change: 0 additions & 1 deletion acceptance/tests/partitions/partitions_connect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ func TestPartitions_Connect(t *testing.T) {
// share the same node network (docker bridge), we can use
// a NodePort service so that we can access node(s) in a different Kind cluster.
if cfg.UseKind {
defaultPartitionHelmValues["global.adminPartitions.service.type"] = "NodePort"
defaultPartitionHelmValues["meshGateway.service.type"] = "NodePort"
defaultPartitionHelmValues["meshGateway.service.nodePort"] = "30200" // todo: do we need to set this port?
defaultPartitionHelmValues["server.exposeService.type"] = "NodePort"
Expand Down
4 changes: 2 additions & 2 deletions acceptance/tests/partitions/partitions_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func TestPartitions_Sync(t *testing.T) {
// share the same node network (docker bridge), we can use
// a NodePort service so that we can access node(s) in a different Kind cluster.
if cfg.UseKind {
serverHelmValues["global.adminPartitions.service.type"] = "NodePort"
serverHelmValues["global.adminPartitions.service.nodePort.https"] = "30000"
serverHelmValues["server.exposeService.type"] = "NodePort"
serverHelmValues["server.exposeService.nodePort.https"] = "30000"
}

releaseName := helpers.RandomName()
Expand Down
3 changes: 1 addition & 2 deletions acceptance/tests/vault/vault_partitions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,10 @@ func TestVault_Partitions(t *testing.T) {
// share the same node network (docker bridge), we can use
// a NodePort service so that we can access node(s) in a different Kind cluster.
if cfg.UseKind {
serverHelmValues["global.adminPartitions.service.type"] = "NodePort"
serverHelmValues["global.adminPartitions.service.nodePort.https"] = "30000"
serverHelmValues["meshGateway.service.type"] = "NodePort"
serverHelmValues["meshGateway.service.nodePort"] = "30100"
serverHelmValues["server.exposeService.type"] = "NodePort"
serverHelmValues["server.exposeService.nodePort.https"] = "30000"
}

helpers.MergeMaps(serverHelmValues, commonHelmValues)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ metadata:
release: {{ .Release.Name }}
component: connect-injector
spec:
{{- if .Values.connectInject.disruptionBudget.minAvailable }}
minAvailable: {{ .Values.connectInject.disruptionBudget.minAvailable }}
{{- else }}
maxUnavailable: {{ template "consul.pdb.connectInject.maxUnavailable" . }}
{{- end }}
selector:
matchLabels:
app: {{ template "consul.name" . }}
Expand Down
45 changes: 0 additions & 45 deletions charts/consul/templates/partition-service.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions charts/consul/templates/server-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ metadata:
{{- if .Values.server.service.annotations }}
{{ tpl .Values.server.service.annotations . | nindent 4 | trim }}
{{- end }}
# This must be set in addition to publishNotReadyAddresses due
# to an open issue where it may not work:
# https://github.com/kubernetes/kubernetes/issues/58662
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
clusterIP: None
# We want the servers to become available even if they're not ready
Expand Down
32 changes: 32 additions & 0 deletions charts/consul/test/unit/connect-injector-disruptionbudget.bats
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,35 @@ load _helpers
# no flag to *remove* an API version so some Helm versions will always have
# policy/v1 support and will always use that API version.


#--------------------------------------------------------------------
# minAvailable

@test "connect-injector/DisruptionBudget: correct minAvailable when set" {
cd `chart_dir`
local tpl=$(helm template \
-s templates/connect-injector-disruptionbudget.yaml \
--set 'connectInject.replicas=1' \
--set 'global.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'connectInject.disruptionBudget.enabled=true' \
--set 'connectInject.disruptionBudget.minAvailable=1' \
. | tee /dev/stderr)
[ $(echo "$tpl" | yq '.spec.minAvailable') = "1" ]
[ $(echo "$tpl" | yq '.spec.maxUnavailable') = "null" ]
}

@test "connect-injector/DisruptionBudget: correct minAvailable when set with maxUnavailable" {
cd `chart_dir`
local tpl=$(helm template \
-s templates/connect-injector-disruptionbudget.yaml \
--set 'connectInject.replicas=1' \
--set 'global.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'connectInject.disruptionBudget.enabled=true' \
--set 'connectInject.disruptionBudget.minAvailable=1' \
--set 'connectInject.disruptionBudget.maxUnavailable=2' \
. | tee /dev/stderr)
[ $(echo "$tpl" | yq '.spec.minAvailable') = "1" ]
[ $(echo "$tpl" | yq '.spec.maxUnavailable') = "null" ]
}
141 changes: 0 additions & 141 deletions charts/consul/test/unit/partition-service.bats

This file was deleted.

9 changes: 2 additions & 7 deletions charts/consul/test/unit/server-service.bats
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ load _helpers
# this is such an important part of making everything work we verify it here.
@test "server/Service: tolerates unready endpoints" {
cd `chart_dir`
local actual=$(helm template \
-s templates/server-service.yaml \
. | tee /dev/stderr |
yq -r '.metadata.annotations["service.alpha.kubernetes.io/tolerate-unready-endpoints"]' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(helm template \
-s templates/server-service.yaml \
Expand Down Expand Up @@ -103,13 +98,13 @@ load _helpers
#--------------------------------------------------------------------
# annotations

@test "server/Service: one annotation by default" {
@test "server/Service: no annotation by default" {
cd `chart_dir`
local actual=$(helm template \
-s templates/server-service.yaml \
. | tee /dev/stderr |
yq -r '.metadata.annotations | length' | tee /dev/stderr)
[ "${actual}" = "1" ]
[ "${actual}" = "0" ]
}

@test "server/Service: can set annotations" {
Expand Down
Loading

0 comments on commit 6536020

Please sign in to comment.