Skip to content

Commit 13e7e06

Browse files
committed
fix: pvc checks
1 parent c8bb07f commit 13e7e06

File tree

2 files changed

+79
-1
lines changed

2 files changed

+79
-1
lines changed

internal/collector/pvcs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
func (c *Collector) CollectPVCs(ctx context.Context, namespace string) (*corev1.PersistentVolumeClaimList, error) {
13-
labelRequirements1, _ := labels.NewRequirement("lagoon.sh/service", selection.Exists, nil)
13+
labelRequirements1, _ := labels.NewRequirement("lagoon.sh/template", selection.Exists, nil)
1414
listOption := (&client.ListOptions{}).ApplyOptions([]client.ListOption{
1515
client.InNamespace(namespace),
1616
client.MatchingLabelsSelector{

internal/collector/testdata/json-result/result-2.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,84 @@
367367
"pvcs": {
368368
"metadata": {},
369369
"items": [
370+
{
371+
"kind": "PersistentVolumeClaim",
372+
"apiVersion": "v1",
373+
"metadata": {
374+
"name": "custom-config",
375+
"namespace": "example-project-main",
376+
"resourceVersion": "1",
377+
"creationTimestamp": null,
378+
"labels": {
379+
"app.kubernetes.io/instance": "custom-config",
380+
"app.kubernetes.io/managed-by": "build-deploy-tool",
381+
"app.kubernetes.io/name": "config",
382+
"lagoon.sh/buildType": "branch",
383+
"lagoon.sh/environment": "main",
384+
"lagoon.sh/environmentType": "production",
385+
"lagoon.sh/project": "example-project",
386+
"lagoon.sh/service-type": "additional-volume",
387+
"lagoon.sh/template": "additional-volume-0.1.0"
388+
},
389+
"annotations": {
390+
"k8up.io/backup": "true",
391+
"k8up.syn.tools/backup": "true",
392+
"lagoon.sh/branch": "main",
393+
"lagoon.sh/version": "v2.7.x"
394+
}
395+
},
396+
"spec": {
397+
"accessModes": [
398+
"ReadWriteMany"
399+
],
400+
"resources": {
401+
"requests": {
402+
"storage": "5Gi"
403+
}
404+
},
405+
"storageClassName": "bulk"
406+
},
407+
"status": {}
408+
},
409+
{
410+
"kind": "PersistentVolumeClaim",
411+
"apiVersion": "v1",
412+
"metadata": {
413+
"name": "custom-files",
414+
"namespace": "example-project-main",
415+
"resourceVersion": "1",
416+
"creationTimestamp": null,
417+
"labels": {
418+
"app.kubernetes.io/instance": "custom-files",
419+
"app.kubernetes.io/managed-by": "build-deploy-tool",
420+
"app.kubernetes.io/name": "files",
421+
"lagoon.sh/buildType": "branch",
422+
"lagoon.sh/environment": "main",
423+
"lagoon.sh/environmentType": "production",
424+
"lagoon.sh/project": "example-project",
425+
"lagoon.sh/service-type": "additional-volume",
426+
"lagoon.sh/template": "additional-volume-0.1.0"
427+
},
428+
"annotations": {
429+
"k8up.io/backup": "true",
430+
"k8up.syn.tools/backup": "true",
431+
"lagoon.sh/branch": "main",
432+
"lagoon.sh/version": "v2.7.x"
433+
}
434+
},
435+
"spec": {
436+
"accessModes": [
437+
"ReadWriteMany"
438+
],
439+
"resources": {
440+
"requests": {
441+
"storage": "10Gi"
442+
}
443+
},
444+
"storageClassName": "bulk"
445+
},
446+
"status": {}
447+
},
370448
{
371449
"kind": "PersistentVolumeClaim",
372450
"apiVersion": "v1",

0 commit comments

Comments
 (0)