Skip to content

Commit 71c20db

Browse files
authored
Merge pull request #46 from gruntwork-io/pull-request-43
Add a new test for prometheus ServiceMonitor and fix ServiceMonitor
2 parents ca903b4 + 9e7c38b commit 71c20db

12 files changed

+586
-764
lines changed

.circleci/config.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ defaults: &defaults
66
GRUNTWORK_INSTALLER_VERSION: v0.0.21
77
TERRATEST_LOG_PARSER_VERSION: v0.13.13
88
HELM_VERSION: v2.12.2
9-
MODULE_CI_VERSION: v0.14.1
9+
MODULE_CI_VERSION: v0.16.0
1010
TERRAFORM_VERSION: NONE
1111
TERRAGRUNT_VERSION: NONE
1212
PACKER_VERSION: NONE
13-
GOLANG_VERSION: 1.11.2
13+
GOLANG_VERSION: 1.13
1414
KUBECONFIG: /home/circleci/.kube/config
1515

1616

@@ -32,13 +32,10 @@ install_gruntwork_utils: &install_gruntwork_utils
3232
gruntwork-install --module-name "kubernetes-circleci-helpers" --repo "https://github.com/gruntwork-io/module-ci" --tag "${MODULE_CI_VERSION}"
3333
gruntwork-install --binary-name "terratest_log_parser" --repo "https://github.com/gruntwork-io/terratest" --tag "${TERRATEST_LOG_PARSER_VERSION}"
3434
configure-environment-for-gruntwork-module \
35-
--circle-ci-2-machine-executor \
3635
--terraform-version ${TERRAFORM_VERSION} \
3736
--terragrunt-version ${TERRAGRUNT_VERSION} \
3837
--packer-version ${PACKER_VERSION} \
39-
--use-go-dep \
4038
--go-version ${GOLANG_VERSION} \
41-
--go-src-path test
4239
4340
4441
version: 2
@@ -47,9 +44,6 @@ jobs:
4744
<<: *defaults
4845
steps:
4946
- checkout
50-
- restore_cache:
51-
keys:
52-
- dep-{{ checksum "test/Gopkg.lock" }}
5347

5448
# Install gruntwork utilities
5549
- run:
@@ -58,11 +52,6 @@ jobs:
5852
- run:
5953
<<: *install_helm_client
6054

61-
- save_cache:
62-
key: dep-{{ checksum "test/Gopkg.lock" }}
63-
paths:
64-
- ./test/vendor
65-
6655
# Fail the build if the pre-commit hooks don't pass. Note: if you run pre-commit install locally, these hooks will
6756
# execute automatically every time before you commit, ensuring the build never fails at this step!
6857
- run: pip install pre-commit==1.11.2
@@ -97,7 +86,9 @@ jobs:
9786
name: run tests
9887
command: |
9988
mkdir -p /tmp/logs
100-
run-go-tests --packages "-tags all ./test" --timeout 60m | tee /tmp/logs/all.log
89+
cd test
90+
go mod tidy
91+
run-go-tests --packages "-tags all ." --timeout 60m | tee /tmp/logs/all.log
10192
no_output_timeout: 3600s
10293

10394
- run:

charts/k8s-service/templates/servicemonitor.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{{- if .Values.serviceMonitor.enabled }}
2-
---
32
apiVersion: monitoring.coreos.com/v1
43
kind: ServiceMonitor
54
metadata:
@@ -16,9 +15,7 @@ metadata:
1615
{{- end }}
1716
spec:
1817
endpoints:
19-
{{- if .Values.serviceMonitor.endpoints }}
20-
{{- toYaml .Values.serviceMonitor.endpoints | nindent 6 }}
21-
{{- end }}
18+
{{- values .Values.serviceMonitor.endpoints | toYaml | nindent 6 }}
2219
selector:
2320
matchLabels:
2421
app.kubernetes.io/name: {{ template "k8s-service.name" . }}

0 commit comments

Comments
 (0)