Skip to content

Commit

Permalink
Merge pull request #41 from rspier/tvial
Browse files Browse the repository at this point in the history
  • Loading branch information
georglauterbach authored Dec 29, 2021
2 parents a45475d + e4acd3e commit a6bce57
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 46 deletions.
8 changes: 6 additions & 2 deletions .ci/scripts/local-kube-score.sh → .ci/scripts/kube-score.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#!/bin/bash

KUBE_SCORE=${KUBE_SCORE:-kube-score}

for chart in `ls charts`;
do
helm template --values charts/$chart/ci/ci-values.yaml charts/$chart | kube-score score - \
helm template --values charts/$chart/ci/ci-values.yaml charts/$chart | ${KUBE_SCORE} score - \
--ignore-test pod-networkpolicy \
--ignore-test deployment-has-poddisruptionbudget \
--ignore-test deployment-has-host-podantiaffinity \
--ignore-test pod-probes \
--ignore-test container-image-tag \
--enable-optional-test container-security-context-privileged \
--ignore-test container-security-context
--ignore-test container-security-context \
--ignore-test container-security-context-user-group-id \
--ignore-test container-security-context-readonlyrootfilesystem \
#
done
70 changes: 31 additions & 39 deletions .github/workflows/on-push-lint-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ on:
workflow_dispatch:

env:
KUBE_SCORE_VERSION: 1.10.0
KUBE_SCORE_VERSION: 1.12.0
HELM_VERSION: v3.4.1

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
lint-test:
runs-on: ubuntu-latest
Expand All @@ -31,26 +35,35 @@ jobs:

- name: Set up kube-score
run: |
wget https://github.com/zegl/kube-score/releases/download/v${{ env.KUBE_SCORE_VERSION }}/kube-score_${{ env.KUBE_SCORE_VERSION }}_linux_amd64 -O kube-score
chmod 755 kube-score
mkdir /tmp/bin
wget https://github.com/zegl/kube-score/releases/download/v${{ env.KUBE_SCORE_VERSION }}/kube-score_${{ env.KUBE_SCORE_VERSION }}_linux_amd64 -O /tmp/bin/kube-score
chmod 755 /tmp/bin/kube-score
- name: Kube-score generated manifests
run: helm template --values .ci/values-kube-score.yaml charts/* | ./kube-score score -
--ignore-test pod-networkpolicy
--ignore-test deployment-has-poddisruptionbudget
--ignore-test deployment-has-host-podantiaffinity
--ignore-test container-security-context
--ignore-test pod-probes
--ignore-test container-image-tag
--enable-optional-test container-security-context-privileged
env:
KUBE_SCORE: /tmp/bin/kube-score
run: .ci/scripts/kube-score.sh

chart-testing:
runs-on: ubuntu-latest
strategy:
matrix:
# Choose from https://hub.docker.com/r/kindest/node/tags
KubeVersion: [1.18.15,1.19.11,1.20.2]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

# python is a requirement for the chart-testing action below (supports yamllint among other tests)
- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
uses: helm/chart-testing-action@v2.1.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -63,33 +76,12 @@ jobs:
- name: Run chart-testing (lint)
run: ct lint --config .ci/ct-config.yaml

# Refer to https://github.com/kubernetes-sigs/kind/releases when updating the node_images
- name: Create 1.20 kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v1.20.2@sha256:8f7ea6e7642c0da54f04a7ee10431549c0257315b3a634f6ef2fecaaedb19bab
cluster_name: kubernetes-1.20
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install) against 1.20
run: ct install --config .ci/ct-config.yaml

- name: Create 1.19 kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v1.19.7@sha256:a70639454e97a4b733f9d9b67e12c01f6b0297449d5b9cbbef87473458e26dca
cluster_name: kubernetes-1.19
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install) against 1.19
run: ct install --config .ci/ct-config.yaml

- name: Create 1.18 kind cluster
uses: helm/[email protected]
- name: Create ${{matrix.KubeVersion}} kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v1.18.15@sha256:5c1b980c4d0e0e8e7eb9f36f7df525d079a96169c8a8f20d8bd108c0d0889cc4
cluster_name: kubernetes-1.18
node_image: kindest/node:v${{matrix.KubeVersion}}
cluster_name: kubernetes-${{matrix.KubeVersion}}
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install) against 1.18
run: ct install --config .ci/ct-config.yaml
- name: Run chart-testing (install) against ${{matrix.KubeVersion}}
run: ct install --config .ci/ct-config.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ The following table lists the configurable parameters of the docker-mailserver c

| Parameter | Description | Default |
|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| `image.name` | The name of the container image to use | `tvial/docker-mailserver` |
| `image.name` | The name of the container image to use | `mailserver/docker-mailserver` |
| `image.tag` | The image tag to use (You may prefer "latest" over "v6.1.0", for example) | `release-v6.1.0` |
| `demoMode.enabled` | Start the container with a demo "[email protected]" user (password is "password") | `true` |
| `haproxy.enabled` | Support HAProxy PROXY protocol on SMTP, IMAP(S), and POP3(S) connections. Provides real source IP instead of load balancer IP | `true` |
Expand Down
2 changes: 1 addition & 1 deletion charts/docker-mailserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "8.0.1"
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
name: docker-mailserver
version: 0.3.0
version: 0.3.1
sources:
- https://github.com/funkypenguin/helm-docker-mailserver
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/docker-mailserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ The following table lists the configurable parameters of the docker-mailserver c

| Parameter | Description | Default |
|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| `image.name` | The name of the container image to use | `tvial/docker-mailserver` |
| `image.name` | The name of the container image to use | `mailserver/docker-mailserver` |
| `image.tag` | The image tag to use (You may prefer "latest" over "v6.1.0", for example) | `release-v6.1.0` |
| `demoMode.enabled` | Start the container with a demo "[email protected]" user (password is "password") | `true` |
| `haproxy.enabled` | Support HAProxy PROXY protocol on SMTP, IMAP(S), and POP3(S) connections. Provides real source IP instead of load balancer IP | `true` |
Expand Down
4 changes: 2 additions & 2 deletions charts/docker-mailserver/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
image:
# image.name is the name of the container image to use. Refer to https://hub.docker.com/r/tvial/docker-mailserver
# image.name is the name of the container image to use. Refer to https://hub.docker.com/r/mailserver/docker-mailserver
name: "mailserver/docker-mailserver"
# image.tag is the tag of the container image to use. Refer to https://hub.docker.com/r/tvial/docker-mailserver
# image.tag is the tag of the container image to use. Refer to https://hub.docker.com/r/mailserver/docker-mailserver
tag: "8.0.1"
pullPolicy: "IfNotPresent"

Expand Down

0 comments on commit a6bce57

Please sign in to comment.