Skip to content

Commit b6fb025

Browse files
authored
Merge pull request #35 from scalyr/tests_updates
Exercise additional chart config options (values) / code paths as part of end to end tests
2 parents 336e888 + c12eec5 commit b6fb025

File tree

9 files changed

+70
-16
lines changed

9 files changed

+70
-16
lines changed

.github/workflows/end_to_end_tests.yaml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,27 @@ jobs:
7676
values_file_path: "ci/daemonset-agent-values.yaml"
7777
image_type: "${{ matrix.image_type }}"
7878

79+
- name: Describe Pod
80+
run: |
81+
set -e
82+
83+
kubectl describe pod ${SCALYR_AGENT_POD_NAME}
84+
85+
# Verify test volume defined using chart volumes and volumeMounts value is there
86+
kubectl describe pod ${SCALYR_AGENT_POD_NAME} | grep "/test-volume from test-volume (rw)"
87+
kubectl describe pod ${SCALYR_AGENT_POD_NAME} | grep "test-volume:"
88+
7989
- name: Verify Agent Logs are Ingested
8090
env:
8191
scalyr_readlog_token: "${{ secrets.SCALYR_READ_API_KEY_US }}"
8292
SCALYR_AGENT_POD_NAME: "${{ env.SCALYR_AGENT_POD_NAME }}"
8393
run: |
8494
# Verify agent and kubernetes monitor has been started
85-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Starting scalyr agent..."'
86-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "No checkpoints were found. All logs will be copied starting at their current end"'
95+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "Starting scalyr agent..."'
96+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "No checkpoints were found. All logs will be copied starting at their current end"'
8797
88-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Cluster name detected, enabling k8s metric reporting"'
89-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "kubernetes_monitor parameters: "'
98+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "Cluster name detected, enabling k8s metric reporting"'
99+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "kubernetes_monitor parameters: "'
90100
91101
# Verify Kubernetes metrics are beeing ingested
92102
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/kubernetes_monitor.log" "k8s-daemon-set=\"scalyr-agent\""'
@@ -174,19 +184,27 @@ jobs:
174184
values_file_path: "ci/deployment-agent-values.yaml"
175185
image_type: "${{ matrix.image_type }}"
176186

187+
- name: Describe Pod
188+
run: |
189+
set -e
190+
191+
kubectl describe pod ${SCALYR_AGENT_POD_NAME}
192+
193+
# Verify test volume defined using chart volumes and volumeMounts value is there
194+
kubectl describe pod ${SCALYR_AGENT_POD_NAME} | grep "/test-volume from test-volume (rw)"
195+
kubectl describe pod ${SCALYR_AGENT_POD_NAME} | grep "test-volume:"
196+
177197
- name: Verify Logs are Ingested
178198
env:
179199
scalyr_readlog_token: "${{ secrets.SCALYR_READ_API_KEY_US }}"
180200
SCALYR_AGENT_POD_NAME: "${{ env.SCALYR_AGENT_POD_NAME }}"
181201
run: |
182-
export POD_NAME=$(kubectl get pod --selector=test=true -o jsonpath="{.items[0].metadata.name}")
183-
184202
# Verify agent and kubernetes monitor has been started
185-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Starting scalyr agent..."'
186-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "No checkpoints were found. All logs will be copied starting at their current end"'
203+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "Starting scalyr agent..."'
204+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "No checkpoints were found. All logs will be copied starting at their current end"'
187205
188-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "Cluster name detected, enabling k8s metric reporting"'
189-
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" "kubernetes_monitor parameters: "'
206+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "Cluster name detected, enabling k8s metric reporting"'
207+
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/agent.log" attribute1="value1" "kubernetes_monitor parameters: "'
190208
191209
# Verify Kubernetes metrics are beeing ingested
192210
./ci/scripts/scalyr-query.sh '$serverHost="'${SCALYR_AGENT_POD_NAME}'" $logfile="/var/log/scalyr-agent-2/kubernetes_monitor.log" "k8s-deployment=\"scalyr-agent\""'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
For actual scalyr agent changelog, please see https://github.com/scalyr/scalyr-agent-2/blob/release/CHANGELOG.md
44

5+
## 0.2.24
6+
7+
- Small template formatting fix for DaemonSet and Deployment template ``volumes`` and
8+
``volumeMounts`` section. #35
9+
510
## 0.2.23
611

712
- Fix a bug with ``scalyr.base64Config`` chart value not being correctly indented in the ConfigMap

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ For example, let's say your custom config fragment lives in ``ci/examples/agent.
201201
1. Obtain base64 encoded version of the JSON file content
202202

203203
```bash
204-
cat ci/examples/agent.d/my-config.json | sed -e 's/^ *//' | tr -d '\n' | base64
204+
cat ci/examples/agent.d/my-config.json | sed -e 's/^ *//' | tr -d '\n' | base64 | tr -d '\n' ; echo ""
205205
```
206206

207207
To avoid any YAML formatting issues, we also utilize ``sed`` and ``tr`` command to fold multi line

charts/scalyr-agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: scalyr-agent
33
description: A Helm chart for deploying the Scalyr agent
44
type: application
5-
version: 0.2.23
5+
version: 0.2.24
66
appVersion: 2.1.36
77
keywords:
88
- scalyr

charts/scalyr-agent/templates/daemonset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
name: "{{ include "scalyr-helm.fullname" . }}-config-agent-d"
5555
defaultMode: 0600
5656
{{- if .Values.volumes }}
57-
{{ toYaml .Values.volumes | nindent 8 }}
57+
{{- toYaml .Values.volumes | nindent 8 }}
5858
{{- end }}
5959
containers:
6060
- name: {{ .Chart.Name }}
@@ -149,7 +149,7 @@ spec:
149149
mountPath: "/var/scalyr/docker.sock"
150150
{{- end }}
151151
{{- if .Values.volumeMounts }}
152-
{{ toYaml .Values.volumeMounts | nindent 12 }}
152+
{{- toYaml .Values.volumeMounts | nindent 12 }}
153153
{{- end }}
154154
- name: "checkpoints"
155155
mountPath: "/var/lib/scalyr-agent-2"

charts/scalyr-agent/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
name: "{{ include "scalyr-helm.fullname" . }}-config-agent-d"
5656
defaultMode: 0600
5757
{{- if .Values.volumes }}
58-
{{ toYaml .Values.volumes | nindent 8 }}
58+
{{- toYaml .Values.volumes | nindent 8 }}
5959
{{- end }}
6060
containers:
6161
- name: {{ .Chart.Name }}
@@ -146,7 +146,7 @@ spec:
146146
mountPath: "/var/scalyr/docker.sock"
147147
{{- end }}
148148
{{- if .Values.volumeMounts }}
149-
{{ toYaml .Values.volumeMounts | nindent 12 }}
149+
{{- toYaml .Values.volumeMounts | nindent 12 }}
150150
{{- end }}
151151
- name: "checkpoints"
152152
mountPath: "/var/lib/scalyr-agent-2"

ci/daemonset-agent-values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,18 @@ scalyr:
77
k8s:
88
clusterName: "k8s-explorer-e2e-tests"
99
verifyKubeletQueries: false
10+
base64Config: true
11+
config:
12+
# ci/examples/agent.d/test-config.json
13+
test-config.json: e3NlcnZlcl9hdHRyaWJ1dGVzOiB7YXR0cmlidXRlMTogInZhbHVlMSIsYXR0cmlidXRlMjogInZhbHVlMiIsfSx9
14+
15+
volumes:
16+
- name: test-volume
17+
emptyDir: {}
18+
19+
volumeMounts:
20+
- mountPath: /test-volume
21+
name: test-volume
22+
1023
image:
1124
distro: "IMAGE_TYPE"

ci/deployment-agent-values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@ scalyr:
77
k8s:
88
clusterName: "k8s-explorer-e2e-tests"
99
verifyKubeletQueries: false
10+
base64Config: true
11+
config:
12+
# ci/examples/agent.d/test-config.json
13+
test-config.json: e3NlcnZlcl9hdHRyaWJ1dGVzOiB7YXR0cmlidXRlMTogInZhbHVlMSIsYXR0cmlidXRlMjogInZhbHVlMiIsfSx9
14+
15+
volumes:
16+
- name: test-volume
17+
emptyDir: {}
18+
19+
volumeMounts:
20+
- mountPath: /test-volume
21+
name: test-volume
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
server_attributes: {
3+
attribute1: "value1",
4+
attribute2: "value2",
5+
},
6+
}

0 commit comments

Comments
 (0)