Skip to content

Commit

Permalink
fix webhook test stability (aws#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwagner5 committed Jul 28, 2020
1 parent bad975d commit 91b481a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
11 changes: 8 additions & 3 deletions config/helm/webhook-test-proxy/templates/daemonset.yaml
Expand Up @@ -18,18 +18,23 @@ spec:
app: {{ .Values.webhookTestProxy.label }}
spec:
serviceAccountName: {{ template "webhook-test-proxy.serviceAccountName" . }}
{{- if (not $isWindows) }}
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
{{- end }}
nodeSelector:
{{ $osSelector }}: {{ $isWindows | ternary "windows" "linux" }}
containers:
- name: {{ .Values.webhookTestProxy.label }}
image: {{ .Values.webhookTestProxy.image.repository }}:{{ .Values.webhookTestProxy.image.tag }}
imagePullPolicy: {{ .Values.webhookTestProxy.image.pullPolicy }}
ports:
- containerPort: {{ .Values.webhookTestProxy.port }}
hostPort: {{ .Values.webhookTestProxy.port }}
- containerPort: {{ .Values.webhookTestProxy.containerPort }}
env:
- name: PORT
value: {{ .Values.webhookTestProxy.port | quote }}
value: {{ .Values.webhookTestProxy.containerPort | quote }}
{{- if .Values.webhookTestProxy.tolerations }}
tolerations:
{{ toYaml .Values.webhookTestProxy.tolerations | indent 8 }}
Expand Down
1 change: 1 addition & 0 deletions config/helm/webhook-test-proxy/templates/service.yaml
Expand Up @@ -7,5 +7,6 @@ spec:
app: {{ .Values.webhookTestProxy.label }}
ports:
- port: {{ .Values.webhookTestProxy.port }}
targetPort: {{ .Values.webhookTestProxy.containerPort }}
protocol: TCP

3 changes: 2 additions & 1 deletion config/helm/webhook-test-proxy/values.yaml
Expand Up @@ -13,7 +13,8 @@ serviceAccount:
webhookTestProxy:
create: true
label: webhook-test-proxy
port: 1340
port: 80
containerPort: 1441
image:
repository: webhook-test-proxy
tag: customtest
Expand Down
1 change: 0 additions & 1 deletion test/e2e/webhook-http-proxy-test
Expand Up @@ -103,7 +103,6 @@ emtp_helm_args=(
$SCRIPTPATH/../../config/helm/webhook-test-proxy/
--wait
--namespace default
--set webhookTestProxy.port="$(echo ${WEBHOOK_URL} | rev | cut -d':' -f1 | rev)"
--set webhookTestProxy.image.repository="$WEBHOOK_DOCKER_REPO"
--set webhookTestProxy.image.tag="$WEBHOOK_DOCKER_TAG"
)
Expand Down
1 change: 0 additions & 1 deletion test/e2e/webhook-secret-test
Expand Up @@ -52,7 +52,6 @@ emtp_helm_args=(
$SCRIPTPATH/../../config/helm/webhook-test-proxy/
--wait
--namespace default
--set webhookTestProxy.port="$(echo ${WEBHOOK_URL} | rev | cut -d':' -f1 | rev)"
--set webhookTestProxy.image.repository="$WEBHOOK_DOCKER_REPO"
--set webhookTestProxy.image.tag="$WEBHOOK_DOCKER_TAG"
)
Expand Down
1 change: 0 additions & 1 deletion test/e2e/webhook-test
Expand Up @@ -58,7 +58,6 @@ emtp_helm_args=(
$SCRIPTPATH/../../config/helm/webhook-test-proxy/
--wait
--namespace default
--set webhookTestProxy.port="$(echo ${WEBHOOK_URL} | rev | cut -d':' -f1 | rev)"
--set webhookTestProxy.image.repository="$WEBHOOK_DOCKER_REPO"
--set webhookTestProxy.image.tag="$WEBHOOK_DOCKER_TAG"
)
Expand Down
4 changes: 2 additions & 2 deletions test/eks-cluster-test/run-test
Expand Up @@ -31,7 +31,7 @@ USAGE=$(cat << 'EOM'
WEBHOOK_DOCKER_PULL_POLICY Webhook Proxy Docker image pull policy (defaults to DOCKER_PULL_POLICY)
EC2_METADATA_PORT EC2 Metadata Test Proxy port (defaults to 18999)
EC2_METADATA_URL EC2 Metadata Test Proxy URL (defaults to "http://amazon-ec2-metadata-mock-service.default.svc.cluster.local:$EC2_METADATA_PORT")
WEBHOOK_URL Webhook URL (defaults to "http://webhook-test-proxy.default.svc.cluster.local:$EC2_METADATA_PORT")
WEBHOOK_URL Webhook URL (defaults to "http://webhook-test-proxy.default.svc.cluster.local")
EOM
)

Expand Down Expand Up @@ -115,7 +115,7 @@ echo "WEBHOOK_DOCKER_TAG=${WEBHOOK_DOCKER_TAG:?"not found"}"
echo "WEBHOOK_DOCKER_PULL_POLICY=${WEBHOOK_DOCKER_PULL_POLICY:=$DOCKER_PULL_POLICY}"
echo "EC2_METADATA_PORT=${EC2_METADATA_PORT:=18999}"
echo "EC2_METADATA_URL=${EC2_METADATA_URL:="http://amazon-ec2-metadata-mock-service.default.svc.cluster.local:$EC2_METADATA_PORT"}"
echo "WEBHOOK_URL=${WEBHOOK_URL:="http://webhook-test-proxy.default.svc.cluster.local:$EC2_METADATA_PORT"}"
echo "WEBHOOK_URL=${WEBHOOK_URL:="http://webhook-test-proxy.default.svc.cluster.local"}"

# The e2e test scripts use other variable names.
echo "IMDS_PORT=${IMDS_PORT:=$EC2_METADATA_PORT}"
Expand Down
2 changes: 1 addition & 1 deletion test/k8s-local-cluster-test/run-test
Expand Up @@ -18,7 +18,7 @@ K8S_VERSION="1.16"
AEMM_URL="amazon-ec2-metadata-mock-service.default.svc.cluster.local"
AEMM_VERSION="1.2.0"
AEMM_DL_URL="https://github.com/aws/amazon-ec2-metadata-mock/releases/download/v"$AEMM_VERSION"/amazon-ec2-metadata-mock-"$AEMM_VERSION".tgz"
WEBHOOK_URL=${WEBHOOK_URL:="http://webhook-test-proxy.default.svc.cluster.local:1338"}
WEBHOOK_URL=${WEBHOOK_URL:="http://webhook-test-proxy.default.svc.cluster.local"}

ASSERTION_SCRIPTS=$(find $SCRIPTPATH/../e2e -type f | sort)

Expand Down

0 comments on commit 91b481a

Please sign in to comment.