2021-02-01 23:46:01 +00:00
name : pr-helm
on :
pull_request :
paths :
2021-03-17 18:09:01 +00:00
- 'charts/**'
2021-02-01 23:46:01 +00:00
- '.github/workflows/pr-helm.yaml'
- '.github/scripts/helm-check-expected.sh'
- 'tools/ci/helm-values/**'
jobs :
sanity-check :
strategy :
matrix :
kube-version : [ 1.16 .0 , 1.17 .0 , 1.18 .0 ] # kubeval is currently lagging behind the active schema versions, so these are the ones we can test against. see https://github.com/instrumenta/kubernetes-json-schema/issues/26
runs-on : ubuntu-20.04
steps :
- name : checkout
uses : actions/checkout@v2
- name : create temp dir
run : mkdir -p helm-temp
- name : helm template -- default values
run : |
helm template \
--namespace fleet \
--release-name fleet \
2021-03-17 18:09:01 +00:00
--values charts/fleet/values.yaml \
charts/fleet \
2021-02-01 23:46:01 +00:00
> helm-temp/output-defaults.yaml
- name : helm template -- other configurations
run : |
VALUES_FILES=$(find tools/ci/helm-values -type f)
for FILE_PATH in ${VALUES_FILES}; do
FILE=$(echo ${FILE_PATH} | rev | cut -d"/" -f1 | rev)
REL_NAME=$(echo ${FILE} | cut -d"." -f1)
helm template \
--namespace ${REL_NAME} \
--release-name ${REL_NAME} \
--values ${FILE_PATH} \
2021-03-17 18:09:01 +00:00
charts/fleet \
2021-02-01 23:46:01 +00:00
> helm-temp/${FILE}
done
- name : kubeval sanity check
2021-02-02 01:42:44 +00:00
uses : instrumenta/kubeval-action@master
2021-02-01 23:46:01 +00:00
with :
files : helm-temp
version : ${{ matrix.kube-version }}
- name : install yq
env :
YQ_VERSION : 4.4 .1
run : |
curl -LO https://github.com/mikefarah/yq/releases/download/v$YQ_VERSION/yq_linux_amd64
curl -LO https://github.com/mikefarah/yq/releases/download/v$YQ_VERSION/checksums
echo "$(grep linux_amd64 checksums | awk '{print $19}') yq_linux_amd64" > sha256
sha256sum --check sha256
chmod +x yq_linux_amd64
mkdir -p ${HOME}/.bin
mv yq_linux_amd64 ${HOME}/.bin/yq
echo PATH=${PATH}:${HOME}/.bin >> $GITHUB_ENV
- name : check default values
run : |
.github/scripts/helm-check-expected.sh \
"helm-temp/output-defaults.yaml" \
2021-02-11 23:36:58 +00:00
'FLEET_FILESYSTEM_STATUS_LOG_FILE FLEET_FILESYSTEM_RESULT_LOG_FILE FLEET_FILESYSTEM_ENABLE_LOG_ROTATION FLEET_FILESYSTEM_ENABLE_LOG_COMPRESSION' \
2021-02-01 23:46:01 +00:00
'fleet-tls osquery-logs'
2021-02-24 18:02:26 +00:00
- name : check pubsub values
2021-02-01 23:46:01 +00:00
run : |
.github/scripts/helm-check-expected.sh \
"helm-temp/logger-pubsub.yaml" \
2021-02-11 23:36:58 +00:00
'FLEET_PUBSUB_PROJECT FLEET_PUBSUB_STATUS_TOPIC FLEET_PUBSUB_RESULT_TOPIC' \
2021-02-01 23:46:01 +00:00
'fleet-tls'
- name : check firehose accesskey values
run : |
.github/scripts/helm-check-expected.sh \
"helm-temp/logger-firehose-accesssid.yaml" \
2021-02-11 23:36:58 +00:00
'FLEET_FIREHOSE_REGION FLEET_FIREHOSE_STATUS_STREAM FLEET_FIREHOSE_RESULT_STREAM FLEET_FIREHOSE_ACCESS_KEY_ID FLEET_FIREHOSE_SECRET_ACCESS_KEY' \
2021-02-01 23:46:01 +00:00
'fleet-tls'
- name : check firehose sts values
run : |
.github/scripts/helm-check-expected.sh \
"helm-temp/logger-firehose-sts.yaml" \
2021-02-11 23:36:58 +00:00
'FLEET_FIREHOSE_REGION FLEET_FIREHOSE_STATUS_STREAM FLEET_FIREHOSE_RESULT_STREAM FLEET_FIREHOSE_STS_ASSUME_ROLE_ARN' \
2021-02-01 23:46:01 +00:00
'fleet-tls'
- name : check mysql tls enabled values
run : |
.github/scripts/helm-check-expected.sh \
"helm-temp/enable-mysql-tls.yaml" \
2021-02-11 23:36:58 +00:00
'FLEET_MYSQL_TLS_CA FLEET_MYSQL_TLS_CERT FLEET_MYSQL_TLS_KEY FLEET_MYSQL_TLS_CONFIG FLEET_MYSQL_TLS_SERVER_NAME' \
2021-02-01 23:46:01 +00:00
'fleet-tls osquery-logs mysql-tls'