Skip to content

Commit d5dafed

Browse files
authored
fix!: prefix v and drop old resources from chart (#164)
Signed-off-by: Raffael Sahli <[email protected]>
1 parent 8282b6e commit d5dafed

35 files changed

+50
-147
lines changed

.github/workflows/pr-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- id: profiles
6060
name: Determine test profiles
6161
run: |
62-
profiles=$(ls deploy/tests/cases | jq -R -s -c 'split("\n")[:-1]')
62+
profiles=$(ls config/tests/cases | jq -R -s -c 'split("\n")[:-1]')
6363
echo $profiles
6464
echo "::set-output name=matrix::$profiles"
6565

.goreleaser.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project_name: mongodb-query-exporter
22

33
builds:
4-
- id: cli
4+
- id: main
55
main: cmd/main.go
66
binary: mongodb-query-exporter
77
goos:
@@ -12,10 +12,10 @@ builds:
1212
- CGO_ENABLED=0
1313

1414
archives:
15-
- id: cli
15+
- id: main
1616
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
1717
builds:
18-
- cli
18+
- main
1919

2020
checksum:
2121
name_template: 'checksums.txt'
@@ -35,11 +35,11 @@ sboms:
3535

3636
dockers:
3737
- image_templates:
38-
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-amd64
38+
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-amd64
3939
dockerfile: Dockerfile
4040
use: buildx
4141
ids:
42-
- cli
42+
- main
4343
build_flag_templates:
4444
- --platform=linux/amd64
4545
- --label=org.opencontainers.image.title={{ .ProjectName }}
@@ -51,12 +51,12 @@ dockers:
5151
- --label=org.opencontainers.image.revision={{ .FullCommit }}
5252
- --label=org.opencontainers.image.licenses=MIT
5353
- image_templates:
54-
- "ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-arm64v8"
54+
- "ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-arm64v8"
5555
goarch: arm64
5656
dockerfile: Dockerfile
5757
use: buildx
5858
ids:
59-
- cli
59+
- main
6060
build_flag_templates:
6161
- --platform=linux/arm64/v8
6262
- --label=org.opencontainers.image.title={{ .ProjectName }}
@@ -69,14 +69,14 @@ dockers:
6969
- --label=org.opencontainers.image.licenses=MIT
7070

7171
docker_manifests:
72-
- name_template: ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}
72+
- name_template: ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}
7373
image_templates:
74-
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-amd64
75-
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-arm64v8
74+
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-amd64
75+
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-arm64v8
7676
- name_template: ghcr.io/raffis/{{ .ProjectName }}:latest
7777
image_templates:
78-
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-amd64
79-
- ghcr.io/raffis/{{ .ProjectName }}:{{ .Version }}-arm64v8
78+
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-amd64
79+
- ghcr.io/raffis/{{ .ProjectName }}:v{{ .Version }}-arm64v8
8080

8181
signs:
8282
- cmd: cosign
@@ -96,9 +96,9 @@ docker_signs:
9696
- cmd: cosign
9797
env:
9898
- COSIGN_EXPERIMENTAL=1
99-
artifacts: images
99+
artifacts: all
100100
output: true
101101
args:
102102
- 'sign'
103103
- '${artifact}'
104-
- --yes
104+
- --yes

Makefile

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,28 +81,19 @@ CLUSTER=kind
8181
kind-test: ## Deploy including test
8282
kind load docker-image ${IMG} --name ${CLUSTER}
8383
kubectl --context kind-${CLUSTER} -n mongo-system delete pods --all
84-
kustomize build deploy/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} apply -f -
84+
kustomize build config/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} apply -f -
8585
kubectl --context kind-${CLUSTER} -n mongo-system wait --for=jsonpath='{.status.conditions[1].reason}'=PodCompleted pods -l app.kubernetes.io/managed-by!=Helm -l verify=yes --timeout=3m
86-
kustomize build deploy/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} delete -f -
86+
kustomize build config/tests/cases/${TEST_PROFILE} --enable-helm | kubectl --context kind-${CLUSTER} delete -f -
8787

8888
.PHONY: deploy
8989
deploy:
9090
cd deploy/exporter && $(KUSTOMIZE) edit set image ghcr.io/raffis/mongodb-query-exporter=${IMG}
91-
$(KUSTOMIZE) build deploy/exporter | kubectl apply -f -
91+
$(KUSTOMIZE) build config/base | kubectl apply -f -
9292

9393
.PHONY: undeploy
9494
undeploy: ## Undeploy exporter from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
9595
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
9696

97-
.PHONY: deploy-test
98-
deploy-test:
99-
cd deploy/test && $(KUSTOMIZE) edit set image ghcr.io/raffis/mongodb-query-exporter=${IMG}
100-
$(KUSTOMIZE) build deploy/test | kubectl apply -f -
101-
102-
.PHONY: undeploy-test
103-
undeploy-test: ## Undeploy exporter from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
104-
$(KUSTOMIZE) build config/test | kubectl delete --ignore-not-found=$(ignore-not-found) -f -
105-
10697
.PHONY: all style fmt build test vet
10798

10899
# go-install-tool will 'go install' any package $2 and install it to $1

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Prometheus MongoDB query exporter
22
[![release](https://github.com/raffis/mongodb-query-exporter/actions/workflows/release.yaml/badge.svg)](https://github.com/raffis/mongodb-query-exporter/actions/workflows/release.yaml)
3-
[![Go Report Card](https://goreportcard.com/badge/github.com/raffis/mongodb-query-exporter/v2)](https://goreportcard.com/report/github.com/raffis/mongodb-query-exporter/v2)
4-
[![PkgGoDev](https://pkg.go.dev/badge/github.com/raffis/mongodb-query-exporter/v2)](https://pkg.go.dev/github.com/raffis/mongodb-query-exporter/v2)
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/raffis/mongodb-query-exporter/v3)](https://goreportcard.com/report/github.com/raffis/mongodb-query-exporter/v3)
54
[![Coverage Status](https://coveralls.io/repos/github/raffis/mongodb-query-exporter/badge.svg?branch=master)](https://coveralls.io/github/raffis/mongodb-query-exporter?branch=master)
65
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/mongodb-query-exporter)](https://artifacthub.io/packages/search?repo=mongodb-query-exporter)
76

chart/mongodb-query-exporter/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ keywords:
1515
name: mongodb-query-exporter
1616
sources:
1717
- https://github.com/raffis/mongodb-query-exporter
18-
version: 3.0.2
18+
version: 4.0.0

chart/mongodb-query-exporter/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,7 @@ spec:
121121
tolerations:
122122
{{- toYaml . | nindent 8 }}
123123
{{- end }}
124+
{{- with .Values.topologySpreadConstraints }}
125+
topologySpreadConstraints:
126+
{{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
127+
{{- end }}

chart/mongodb-query-exporter/templates/podsecuritypolicy.yaml

Lines changed: 0 additions & 42 deletions
This file was deleted.

chart/mongodb-query-exporter/templates/role.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

chart/mongodb-query-exporter/templates/rolebinding.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

chart/mongodb-query-exporter/values.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
image:
2+
pullPolicy: IfNotPresent
3+
repository: ghcr.io/raffis/mongodb-query-exporter
4+
tag:
5+
6+
17
affinity: {}
28

9+
topologySpreadConstraints: []
10+
311
chartLabels: true
412

513
labels: {}
@@ -10,11 +18,6 @@ extraArgs:
1018

1119
fullnameOverride: ""
1220

13-
image:
14-
pullPolicy: IfNotPresent
15-
repository: ghcr.io/raffis/mongodb-query-exporter
16-
tag:
17-
1821
imagePullSecrets: []
1922

2023
livenessProbe:
@@ -156,11 +159,6 @@ serviceAccount:
156159
# fullname template.
157160
name:
158161

159-
# Creates a PodSecurityPolicy and the role/rolebinding
160-
# allowing the serviceaccount to use it
161-
podSecurityPolicy:
162-
enabled: false
163-
164162
# Prometheus operator ServiceMonitor
165163
serviceMonitor:
166164
enabled: false

0 commit comments

Comments
 (0)