Skip to content

Commit e5d24c9

Browse files
committed
feat(docs,ci): add docs generation and PR checks
1 parent 3d0ca07 commit e5d24c9

File tree

7 files changed

+62
-4
lines changed

7 files changed

+62
-4
lines changed

.github/workflows/ci-pr.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "[CI] PR"
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- synchronize
8+
jobs:
9+
check-generate:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
13+
- run: |
14+
go install github.com/norwoodj/helm-docs/cmd/helm-docs@37d3055fece566105cf8cff7c17b7b2355a01677
15+
- run: hack/check-generate.sh
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Dependency Review"
2+
on:
3+
pull_request:
4+
branches:
5+
- "main"
6+
permissions:
7+
contents: read
8+
jobs:
9+
dependency-review:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
13+
- uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # 4.5.0

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.PHONY: helm-docs
2+
helm-docs:
3+
hack/helm-docs.sh charts/eks-node-monitoring-agent/README.md
4+
5+
generate: helm-docs

charts/eks-node-monitoring-agent/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ helm uninstall eks-node-monitoring-agent --namespace kube-system
2525

2626
The following table lists the configurable parameters for this chart and their default values.
2727

28+
<!-- table:start -->
2829
| Key | Type | Default | Description |
2930
|-----|------|---------|-------------|
30-
| dcgmAgent.affinity | object | (see [`values.yaml`](./values.yaml)) | Map of dcgm pod affinities |
31+
| dcgmAgent.affinity | object | see [`values.yaml`](./values.yaml) | Map of dcgm pod affinities |
3132
| dcgmAgent.image.account | string | `"602401143452"` | ECR repository account number for the dcgm-exporter |
3233
| dcgmAgent.image.domain | string | `"amazonaws.com"` | ECR repository domain for the dcgm-exporter |
3334
| dcgmAgent.image.endpoint | string | `"ecr"` | ECR repository endpoint for the dcgm-exporter |
@@ -39,17 +40,18 @@ The following table lists the configurable parameters for this chart and their d
3940
| imagePullSecrets | list | `[]` | Docker registry pull secrets |
4041
| nameOverride | string | `"eks-node-monitoring-agent"` | A name override for the chart |
4142
| nodeAgent.additionalArgs | list | `[]` | List of addittional container arguments for the eks-node-monitoring-agent |
42-
| nodeAgent.affinity | object | (see [`values.yaml`](./values.yaml)) | Map of pod affinities for the eks-node-monitoring-agent |
43+
| nodeAgent.affinity | object | see [`values.yaml`](./values.yaml) | Map of pod affinities for the eks-node-monitoring-agent |
4344
| nodeAgent.image.account | string | `"602401143452"` | ECR repository account number for the eks-node-monitoring-agent |
4445
| nodeAgent.image.domain | string | `"amazonaws.com"` | ECR repository domain for the eks-node-monitoring-agent |
4546
| nodeAgent.image.endpoint | string | `"ecr"` | ECR repository endpoint for the eks-node-monitoring-agent |
4647
| nodeAgent.image.pullPolicy | string | `"IfNotPresent"` | Container pull policyfor the eks-node-monitoring-agent |
4748
| nodeAgent.image.region | string | `"us-west-2"` | ECR repository region for the eks-node-monitoring-agent |
48-
| nodeAgent.image.tag | string | `"v1.0.2-eksbuild.2"` | Image tag for the eks-node-monitoring-agent |
49+
| nodeAgent.image.tag | string | `"v1.1.0-eksbuild.1"` | Image tag for the eks-node-monitoring-agent |
4950
| nodeAgent.resources | object | `{"limits":{"cpu":"250m","memory":"100Mi"},"requests":{"cpu":"10m","memory":"30Mi"}}` | Container resources for the eks-node-monitoring-agent |
5051
| nodeAgent.securityContext | object | `{"capabilities":{"add":["NET_ADMIN"]},"privileged":true}` | Container Security context for the eks-node-monitoring-agent |
5152
| nodeAgent.tolerations | list | `[{"operator":"Exists"}]` | Deployment tolerations for the eks-node-monitoring-agent |
5253
| updateStrategy | object | `{"rollingUpdate":{"maxUnavailable":"10%"},"type":"RollingUpdate"}` | Update strategy for all daemon sets |
54+
<!-- table:end -->
5355

5456
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install` or provide a YAML file
5557
containing the values for the above parameters.

charts/eks-node-monitoring-agent/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ serviceAccount:
2020
nodeAgent:
2121
image:
2222
# -- Image tag for the eks-node-monitoring-agent
23-
tag: v1.0.2-eksbuild.2
23+
tag: v1.1.0-eksbuild.1
2424
# -- ECR repository domain for the eks-node-monitoring-agent
2525
domain: amazonaws.com
2626
# -- ECR repository region for the eks-node-monitoring-agent

hack/check-generate.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
make generate
4+
if ! git diff --exit-code .; then
5+
echo >&2 "ERROR: generated code is out of date. Please run 'make generate' and commit the changes."
6+
exit 1
7+
fi

hack/helm-docs.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
set -o nounset
4+
set -o errexit
5+
set -o pipefail
6+
7+
README_PATH=$1
8+
9+
template() {
10+
sed '0,/<!-- table:start -->/!d' $README_PATH;
11+
helm-docs --dry-run --ignore-non-descriptions 2>/dev/null | sed -e 's#`.\{100,\}`#see [`values.yaml`](./values.yaml)#g' | tail -n +15 | head -n -1;
12+
tac $README_PATH | sed '0,/<!-- table:end -->/!d' | tac;
13+
}
14+
15+
template > $README_PATH.tmp
16+
mv $README_PATH.tmp $README_PATH

0 commit comments

Comments
 (0)