Skip to content

Commit c195d21

Browse files
committed
0.6.0
1 parent faea703 commit c195d21

19 files changed

+78
-67
lines changed

.github/workflows/release.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Release Charts
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
12+
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
13+
permissions:
14+
contents: write
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Configure Git
23+
run: |
24+
git config user.name "$GITHUB_ACTOR"
25+
git config user.email "[email protected]"
26+
27+
- name: Install Helm
28+
uses: azure/setup-helm@v4
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Run chart-releaser
33+
uses: helm/[email protected]
34+
env:
35+
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ repos:
1414
language: node
1515
name: schema-bundle
1616
pass_filenames: false
17+
additional_dependencies:
18+
- '@sourcemeta/jsonschema'
1719
- entry: ./scripts/test.sh
1820
id: helm-unittest
1921
language: script
File renamed without changes.

charts/inventory-agent/Chart.yaml charts/nhi-explorer/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
apiVersion: v2
3-
name: inventory-agent
3+
name: nhi-explorer
44
description: A Helm chart for Kubernetes
55

66
# A chart can be either an 'application' or a 'library' chart.

charts/inventory-agent/templates/NOTES.txt charts/nhi-explorer/templates/NOTES.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Thank you for installing {{ .Chart.Name }}.
22

33
Your release is named {{ .Release.Name }}.
44

5-
The agent will run with the following schedule: {{ .Values.inventory.schedule }}
5+
The container will run with the following schedule: {{ .Values.inventory.schedule }}
66

77
To learn more about the release, try:
88

charts/inventory-agent/templates/_helpers.tpl charts/nhi-explorer/templates/_helpers.tpl

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "inventory-agent.name" -}}
4+
{{- define "nhi-explorer.name" -}}
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

@@ -10,7 +10,7 @@ Create a default fully qualified app name.
1010
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1111
If release name contains chart name it will be used as a full name.
1212
*/}}
13-
{{- define "inventory-agent.fullname" -}}
13+
{{- define "nhi-explorer.fullname" -}}
1414
{{- if .Values.fullnameOverride }}
1515
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
1616
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
2626
{{/*
2727
Create chart name and version as used by the chart label.
2828
*/}}
29-
{{- define "inventory-agent.chart" -}}
29+
{{- define "nhi-explorer.chart" -}}
3030
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3131
{{- end }}
3232

3333
{{/*
3434
Common labels
3535
*/}}
36-
{{- define "inventory-agent.labels" -}}
37-
helm.sh/chart: {{ include "inventory-agent.chart" . }}
38-
{{ include "inventory-agent.selectorLabels" . }}
36+
{{- define "nhi-explorer.labels" -}}
37+
helm.sh/chart: {{ include "nhi-explorer.chart" . }}
38+
{{ include "nhi-explorer.selectorLabels" . }}
3939
{{- if .Chart.AppVersion }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4545
{{/*
4646
Selector labels
4747
*/}}
48-
{{- define "inventory-agent.selectorLabels" -}}
49-
app.kubernetes.io/name: {{ include "inventory-agent.name" . }}
48+
{{- define "nhi-explorer.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "nhi-explorer.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

5353
{{/*
5454
Create the name of the service account to use
5555
*/}}
56-
{{- define "inventory-agent.serviceAccountName" -}}
56+
{{- define "nhi-explorer.serviceAccountName" -}}
5757
{{- if .Values.serviceAccount.create }}
58-
{{- default (include "inventory-agent.fullname" .) .Values.serviceAccount.name }}
58+
{{- default (include "nhi-explorer.fullname" .) .Values.serviceAccount.name }}
5959
{{- else }}
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v1
22
kind: ConfigMap
33
metadata:
4-
name: {{ include "inventory-agent.fullname" . }}
4+
name: {{ include "nhi-explorer.fullname" . }}
55
labels:
6-
{{- include "inventory-agent.labels" . | nindent 4 }}
6+
{{- include "nhi-explorer.labels" . | nindent 4 }}
77
data:
88
config.yml: {{ toYaml .Values.inventory.config|quote }}

charts/inventory-agent/templates/cronjob.yaml charts/nhi-explorer/templates/cronjob.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
apiVersion: batch/v1
22
kind: CronJob
33
metadata:
4-
name: {{ include "inventory-agent.fullname" . }}
4+
name: {{ include "nhi-explorer.fullname" . }}
55
labels:
6-
{{- include "inventory-agent.labels" . | nindent 4 }}
6+
{{- include "nhi-explorer.labels" . | nindent 4 }}
77
spec:
88
schedule: {{ toJson .Values.inventory.schedule }}
99
jobTemplate:
@@ -14,7 +14,7 @@ spec:
1414
annotations: {{- toJson . }}
1515
{{- end }}
1616
labels:
17-
{{- include "inventory-agent.labels" . | nindent 12 }}
17+
{{- include "nhi-explorer.labels" . | nindent 12 }}
1818
{{- with .Values.podLabels }}
1919
{{ toYaml . | nindent 12 }}
2020
{{- end }}
@@ -34,7 +34,7 @@ spec:
3434
{{- with .Values.imagePullSecrets }}
3535
imagePullSecrets: {{ toJson . }}
3636
{{- end }}
37-
serviceAccountName: {{ include "inventory-agent.serviceAccountName" . }}
37+
serviceAccountName: {{ include "nhi-explorer.serviceAccountName" . }}
3838
securityContext: {{ toJson .Values.podSecurityContext }}
3939
{{- with .Values.nodeSelector }}
4040
nodeSelector: {{ toJson . }}
@@ -52,4 +52,4 @@ spec:
5252
configMap:
5353
# Provide the name of the ConfigMap containing the files you want
5454
# to add to the container
55-
name: {{ include "inventory-agent.fullname" . }}
55+
name: {{ include "nhi-explorer.fullname" . }}

charts/inventory-agent/templates/serviceaccount.yaml charts/nhi-explorer/templates/serviceaccount.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
apiVersion: v1
33
kind: ServiceAccount
44
metadata:
5-
name: {{ include "inventory-agent.serviceAccountName" . }}
5+
name: {{ include "nhi-explorer.serviceAccountName" . }}
66
labels:
7-
{{- include "inventory-agent.labels" . | nindent 4 }}
7+
{{- include "nhi-explorer.labels" . | nindent 4 }}
88
{{- with .Values.serviceAccount.annotations }}
99
annotations:
1010
{{- toYaml . | nindent 4 }}
File renamed without changes.

charts/inventory-agent/tests/configmap_test.yaml charts/nhi-explorer/tests/configmap_test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tests:
1616
of: ConfigMap
1717
- matchRegex:
1818
path: metadata.name
19-
pattern: -inventory-agent$
19+
pattern: -nhi-explorer$
2020
- equal:
2121
path: data["config.yml"]
2222
value: |-

charts/inventory-agent/tests/cronjob_test.yaml charts/nhi-explorer/tests/cronjob_test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ tests:
1414
of: CronJob
1515
- matchRegex:
1616
path: metadata.name
17-
pattern: -inventory-agent$
17+
pattern: -nhi-explorer$
1818
- equal:
1919
path: spec.jobTemplate.spec.template.spec.containers[0].image
20-
value: ghcr.io/gitguardian/gg-inventory-agent:latest
20+
value: ghcr.io/gitguardian/gg-nhi-explorer:latest
2121

2222
- it: should set schedule
2323
set:
@@ -70,7 +70,7 @@ tests:
7070
content:
7171
name: config
7272
configMap:
73-
name: RELEASE-NAME-inventory-agent
73+
name: RELEASE-NAME-nhi-explorer
7474
- contains:
7575
path: spec.jobTemplate.spec.template.spec.containers[0].env
7676
content:

charts/inventory-agent/values-base-schema.schema.json charts/nhi-explorer/values-base-schema.schema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"version": {"type": "string"},
1010
"schedule": {"type": "string"},
1111
"config": {
12-
"$ref": "inventory-agent-config.schema.json"
12+
"$ref": "inventory-config.schema.json"
1313
}
1414
},
1515
"required": ["config"]

charts/inventory-agent/values.schema.json charts/nhi-explorer/values.schema.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"minProperties": 1,
1515
"properties": {
1616
"config": {
17-
"$ref": "#/definitions/inventory-agent-config.schema.json"
17+
"$ref": "#/definitions/inventory-config.schema.json"
1818
},
1919
"schedule": {
2020
"type": "string",
@@ -40,7 +40,7 @@
4040
]
4141
},
4242
"definitions": {
43-
"inventory-agent-config.schema.json": {
43+
"inventory-config.schema.json": {
4444
"$schema": "http://json-schema.org/draft-07/schema#",
4545
"title": "Config",
4646
"type": "object",
@@ -54,13 +54,13 @@
5454
"minProperties": 0,
5555
"properties": {},
5656
"additionalProperties": {
57-
"$ref": "#/definitions/inventory-agent-config.schema.json/definitions/FetchSource"
57+
"$ref": "#/definitions/inventory-config.schema.json/definitions/FetchSource"
5858
}
5959
},
6060
"upload": {
6161
"anyOf": [
6262
{
63-
"$ref": "#/definitions/inventory-agent-config.schema.json/definitions/UploadConfig"
63+
"$ref": "#/definitions/inventory-config.schema.json/definitions/UploadConfig"
6464
},
6565
{
6666
"enum": [
@@ -294,7 +294,7 @@
294294
"description": "Auth mode: using Conjur Cloud workloads or CyberArk identity service",
295295
"allOf": [
296296
{
297-
"$ref": "#/definitions/inventory-agent-config.schema.json/definitions/AuthMode"
297+
"$ref": "#/definitions/inventory-config.schema.json/definitions/AuthMode"
298298
}
299299
]
300300
},

charts/inventory-agent/values.yaml charts/nhi-explorer/values.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
# yaml-language-server: $schema=values.schema.json
3-
# Default values for inventory-agent.
3+
# Default values for nhi-explorer.
44

5-
# Options for the agent configuration.
5+
# Options for the inventory configuration.
66
inventory:
7-
# Specific version of the agent to use
8-
version: 0.2.0
9-
# Schedule to run the agent on
7+
# Specific version of the image to use
8+
version: 0.6.0
9+
# Schedule to run the collection on
1010
schedule: '* * * * *'
1111
config:
1212

1313
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
1414
image:
15-
repository: ghcr.io/gitguardian/gg-inventory-agent
15+
repository: ghcr.io/gitguardian/gg-nhi-explorer
1616
# This sets the pull policy for images.
1717
pullPolicy: IfNotPresent
1818

package-lock.json

-21
This file was deleted.

package.json

-5
This file was deleted.

schemas/config.schema.json schemas/inventory-config.schema.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "inventory-agent-config.schema.json",
3+
"$id": "inventory-config.schema.json",
44
"title": "Config",
55
"type": "object",
66
"required": [
@@ -281,4 +281,4 @@
281281
}
282282
}
283283
}
284-
}
284+
}

scripts/bundle_schemas.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ process_json_schema() {
1010
temp_dir="$(mktemp -d)"
1111
local bundled_path="${temp_dir}"/resolved.json
1212
echo "Bundling schema from ${base_values_schema_path} to ${bundled_path}"
13-
npx --yes @sourcemeta/jsonschema bundle --resolve schemas/ "${base_values_schema_path}" --without-id > "${bundled_path}"
13+
jsonschema bundle --resolve schemas/ "${base_values_schema_path}" --without-id > "${bundled_path}"
1414
echo "Normalizing schema from ${bundled_path} to ${values_schema_path}"
15-
npx --yes @sourcemeta/jsonschema canonicalize "${bundled_path}" > "${values_schema_path}"
15+
jsonschema canonicalize "${bundled_path}" > "${values_schema_path}"
1616
}
1717

1818
for chart in charts/*/

0 commit comments

Comments
 (0)