From d65b9f5369a0cae045ba9978c85dd43e113a9d12 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sun, 7 Dec 2025 22:04:49 +0000 Subject: [PATCH 01/20] feat:! update manifests --- Makefile | 5 ++++- manifests/controller/controller_config.yaml | 4 ++-- manifests/controller/controller_deployment.yaml | 2 +- manifests/netpol.yaml | 10 +++++----- manifests/rbac.yaml | 2 +- manifests/scheduler/scheduler_config.yaml | 10 +++++----- manifests/scheduler/scheduler_job.yaml | 2 +- manifests/serviceaccount.yaml | 2 +- scripts/controller/Makefile | 2 +- scripts/scheduler/Makefile | 2 +- 10 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 01d1d7e..b5a885a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,10 @@ run_scheduler: @make -C scripts/scheduler run_scheduler create_job: - @kubectl create job volume-cleaner-scheduler --from=cronjob/volume-cleaner-scheduler -n das + @kubectl create job volume-cleaner-scheduler-manual --from=cronjob/volume-cleaner-scheduler -n zone + +delete_job: + @kubectl delete job volume-cleaner-scheduler-manual -n zone test: go test -v -coverprofile cover.out ./... diff --git a/manifests/controller/controller_config.yaml b/manifests/controller/controller_config.yaml index 4e30e84..571e119 100644 --- a/manifests/controller/controller_config.yaml +++ b/manifests/controller/controller_config.yaml @@ -3,9 +3,9 @@ apiVersion: v1 kind: ConfigMap metadata: name: volume-cleaner-controller-config - namespace: das + namespace: zone data: - NAMESPACE: "anray-liu" + NAMESPACE: "" TIME_LABEL: "volume-cleaner/unattached-time" NOTIF_LABEL: "volume-cleaner/notification-count" TIME_FORMAT: "2006-01-02_15-04-05Z" diff --git a/manifests/controller/controller_deployment.yaml b/manifests/controller/controller_deployment.yaml index 8cbcca4..ca6020b 100644 --- a/manifests/controller/controller_deployment.yaml +++ b/manifests/controller/controller_deployment.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: volume-cleaner-controller - namespace: das + namespace: zone spec: replicas: 1 selector: diff --git a/manifests/netpol.yaml b/manifests/netpol.yaml index 1fa7bd2..f40bb2f 100644 --- a/manifests/netpol.yaml +++ b/manifests/netpol.yaml @@ -3,13 +3,11 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: volume-cleaner-controller-egress - namespace: das + namespace: zone spec: podSelector: matchLabels: app: volume-cleaner-controller - egress: - - {} policyTypes: - Egress --- @@ -17,12 +15,14 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: volume-cleaner-scheduler-egress - namespace: das + namespace: zone spec: podSelector: matchLabels: app: volume-cleaner-scheduler egress: - - {} + - ports: + - port: 443 + protocol: TCP policyTypes: - Egress diff --git a/manifests/rbac.yaml b/manifests/rbac.yaml index 3d0b510..2ffb39c 100644 --- a/manifests/rbac.yaml +++ b/manifests/rbac.yaml @@ -21,7 +21,7 @@ metadata: subjects: - kind: ServiceAccount name: volume-cleaner - namespace: das + namespace: zone roleRef: kind: ClusterRole name: volume-cleaner diff --git a/manifests/scheduler/scheduler_config.yaml b/manifests/scheduler/scheduler_config.yaml index 421bd2e..5b8fd43 100644 --- a/manifests/scheduler/scheduler_config.yaml +++ b/manifests/scheduler/scheduler_config.yaml @@ -3,14 +3,14 @@ apiVersion: v1 kind: ConfigMap metadata: name: volume-cleaner-scheduler-config - namespace: das + namespace: zone data: - NAMESPACE: "anray-liu" + NAMESPACE: "" TIME_LABEL: "volume-cleaner/unattached-time" NOTIF_LABEL: "volume-cleaner/notification-count" - GRACE_PERIOD: "5" + GRACE_PERIOD: "3" TIME_FORMAT: "2006-01-02_15-04-05Z" - DRY_RUN: "false" - NOTIF_TIMES: "1, 2, 3, 4" + DRY_RUN: "true" + NOTIF_TIMES: "1, 2, 3" BASE_URL: "https://api.notification.canada.ca" ENDPOINT: "/v2/notifications/email" diff --git a/manifests/scheduler/scheduler_job.yaml b/manifests/scheduler/scheduler_job.yaml index 17356c2..80f4adb 100644 --- a/manifests/scheduler/scheduler_job.yaml +++ b/manifests/scheduler/scheduler_job.yaml @@ -3,7 +3,7 @@ apiVersion: batch/v1 kind: CronJob metadata: name: volume-cleaner-scheduler - namespace: das + namespace: zone spec: schedule: "0 0 * * *" jobTemplate: diff --git a/manifests/serviceaccount.yaml b/manifests/serviceaccount.yaml index 1b2b0d4..5504c38 100644 --- a/manifests/serviceaccount.yaml +++ b/manifests/serviceaccount.yaml @@ -3,4 +3,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: volume-cleaner - namespace: das + namespace: zone diff --git a/scripts/controller/Makefile b/scripts/controller/Makefile index b2cf775..7943f61 100644 --- a/scripts/controller/Makefile +++ b/scripts/controller/Makefile @@ -5,5 +5,5 @@ run_controller: -f ../../manifests/serviceaccount.yaml \ -f ../../manifests/netpol.yaml \ -f ../../manifests/controller/controller_config.yaml - @kubectl -n das apply -f ../../manifests/controller/controller_deployment.yaml + @kubectl -n zone apply -f ../../manifests/controller/controller_deployment.yaml @echo "Ready to go!" \ No newline at end of file diff --git a/scripts/scheduler/Makefile b/scripts/scheduler/Makefile index c78675c..b7345b1 100644 --- a/scripts/scheduler/Makefile +++ b/scripts/scheduler/Makefile @@ -6,5 +6,5 @@ run_scheduler: -f ../../manifests/netpol.yaml \ -f ../../manifests/scheduler/scheduler_config.yaml \ -f ../../manifests/scheduler/scheduler_secret.yaml - @kubectl -n das apply -f ../../manifests/scheduler/scheduler_job.yaml + @kubectl -n zone apply -f ../../manifests/scheduler/scheduler_job.yaml @echo "Ready to go!" From 455a5b0f82a2579dd7b16cc53fab509c0a891ac8 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 17:41:28 +0000 Subject: [PATCH 02/20] docs: update instructions in readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0b5da66..48a05d6 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ cd volume-cleaner * `NAMESPACE`: Target namespace to scan for unused PVCs, leave this value as an empty string to scan all namespaces * `TIME_LABEL`: Must match controller's time label * `NOTIF_LABEL`: Must match controller's notification label + * `IGNORE_LABEL`: If this label is found on a PVC, the scheduler will skip it (e.g.: "volume-cleaner/ignore") * `GRACE_PERIOD`: Days before PVC deletion (e.g., "180") * `TIME_FORMAT`: Must match controller's time format * `DRY_RUN`: Set to "true" for testing without actual deletion @@ -286,6 +287,7 @@ Le volume-cleaner est composé de 2 composants principaux : * `NAMESPACE` : Espace de noms à scanner pour les PVC périmés; laissez cette valeur vide pour scanner tous les espaces de noms * `TIME_LABEL` : Doit correspondre au `TIME_LABEL` du contrôleur * `NOTIF_LABEL` : Doit correspondre au `NOTIF_LABEL` du contrôleur + * `IGNORE_LABEL` : Si cette étiquette est présente sur un PVC, le planificateur l’ignorera (par exemple : `volume-cleaner/ignore`). * `GRACE_PERIOD` : Nombre de jours avant suppression du PVC (par ex. `"180"`) * `TIME_FORMAT` : Doit correspondre au `TIME_FORMAT` du contrôleur * `DRY_RUN` : À `"true"` pour tester sans suppression réelle From 9903baff6b15ce953592d6d1972d4f54708ba823 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 17:44:55 +0000 Subject: [PATCH 03/20] feat: update references to new config value --- cmd/scheduler/main.go | 1 + internal/kubernetes/finder_test.go | 2 ++ internal/structure/configs.go | 2 ++ manifests/scheduler/scheduler_config.yaml | 1 + 4 files changed, 6 insertions(+) diff --git a/cmd/scheduler/main.go b/cmd/scheduler/main.go index f7ffd77..8eef4c5 100644 --- a/cmd/scheduler/main.go +++ b/cmd/scheduler/main.go @@ -28,6 +28,7 @@ func main() { Namespace: os.Getenv("NAMESPACE"), TimeLabel: os.Getenv("TIME_LABEL"), NotifLabel: os.Getenv("NOTIF_LABEL"), + IgnoreLabel: os.Getenv("IGNORE_LABEL"), TimeFormat: os.Getenv("TIME_FORMAT"), GracePeriod: utilsInternal.ParseGracePeriod(os.Getenv("GRACE_PERIOD")), DryRun: os.Getenv("DRY_RUN") == "true" || os.Getenv("DRY_RUN") == "1", diff --git a/internal/kubernetes/finder_test.go b/internal/kubernetes/finder_test.go index 1ddd301..ebb1c60 100644 --- a/internal/kubernetes/finder_test.go +++ b/internal/kubernetes/finder_test.go @@ -37,6 +37,7 @@ func TestFindStale(t *testing.T) { Namespace: "test", TimeLabel: "volume-cleaner/unattached-time", NotifLabel: "volume-cleaner/notification-count", + IgnoreLabel: "volume-cleaner/ignore", GracePeriod: 0, TimeFormat: "2006-01-02_15-04-05Z", DryRun: true, @@ -159,6 +160,7 @@ func TestShouldSendMail(t *testing.T) { Namespace: "test", TimeLabel: "volume-cleaner/unattached-time", NotifLabel: "volume-cleaner/notification-count", + IgnoreLabel: "volume-cleaner/ignore", GracePeriod: 180, TimeFormat: "2006-01-02_15-04-05Z", DryRun: true, diff --git a/internal/structure/configs.go b/internal/structure/configs.go index 737cf4a..5f5e865 100644 --- a/internal/structure/configs.go +++ b/internal/structure/configs.go @@ -16,6 +16,7 @@ scheduler: NAMESPACE: "anray-liu" TIME_LABEL: "volume-cleaner/unattached-time" NOTIF_LABEL: "volume-cleaner/notification-count" +IGNORE_LABEL: "volume-cleaner/ignore" GRACE_PERIOD: "180" TIME_FORMAT: "2006-01-02_15-04-05Z" DRY_RUN: "true" @@ -40,6 +41,7 @@ type SchedulerConfig struct { Namespace string TimeLabel string NotifLabel string + IgnoreLabel string TimeFormat string GracePeriod int DryRun bool diff --git a/manifests/scheduler/scheduler_config.yaml b/manifests/scheduler/scheduler_config.yaml index 5b8fd43..41fb704 100644 --- a/manifests/scheduler/scheduler_config.yaml +++ b/manifests/scheduler/scheduler_config.yaml @@ -8,6 +8,7 @@ data: NAMESPACE: "" TIME_LABEL: "volume-cleaner/unattached-time" NOTIF_LABEL: "volume-cleaner/notification-count" + IGNORE_LABEL: "volume-cleaner/ignore" GRACE_PERIOD: "3" TIME_FORMAT: "2006-01-02_15-04-05Z" DRY_RUN: "true" From 38cbf078b0c5c8b5ea0a06256f1951abb9c8f239 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 17:46:39 +0000 Subject: [PATCH 04/20] feat(scheduler): skip pvcs labeled with ignore --- internal/kubernetes/finder.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/kubernetes/finder.go b/internal/kubernetes/finder.go index 44a2432..4b011ba 100644 --- a/internal/kubernetes/finder.go +++ b/internal/kubernetes/finder.go @@ -47,6 +47,12 @@ func FindStale(kube kubernetes.Interface, cfg structInternal.SchedulerConfig) (i continue } + _, ok = pvc.Labels[cfg.IgnoreLabel] + if ok { + log.Printf("[INFO][IGNORE] Label %s found. Skipping.", cfg.IgnoreLabel) + continue + } + // check if pvc should be deleted stale, staleError := IsStale(timestamp, cfg.TimeFormat, cfg.GracePeriod) if staleError != nil { From da5ffea345cb351cb61971bf490432a95a3b1564 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:17:51 +0000 Subject: [PATCH 05/20] feat: ignore label must be true --- internal/kubernetes/finder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/kubernetes/finder.go b/internal/kubernetes/finder.go index 4b011ba..67da7de 100644 --- a/internal/kubernetes/finder.go +++ b/internal/kubernetes/finder.go @@ -47,8 +47,8 @@ func FindStale(kube kubernetes.Interface, cfg structInternal.SchedulerConfig) (i continue } - _, ok = pvc.Labels[cfg.IgnoreLabel] - if ok { + ignore, ok := pvc.Labels[cfg.IgnoreLabel] + if ok && ignore == "true" { log.Printf("[INFO][IGNORE] Label %s found. Skipping.", cfg.IgnoreLabel) continue } From 6f3a90f90a3cac374d3296c270eb15251a21d390 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:18:07 +0000 Subject: [PATCH 06/20] test: unit test ignore label --- internal/kubernetes/finder_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/kubernetes/finder_test.go b/internal/kubernetes/finder_test.go index ebb1c60..cd045d5 100644 --- a/internal/kubernetes/finder_test.go +++ b/internal/kubernetes/finder_test.go @@ -66,6 +66,16 @@ func TestFindStale(t *testing.T) { assert.Equal(t, deleted, 2) assert.Equal(t, emailed, 0) + SetPvcLabel(kube, "volume-cleaner/ignore", "true", "test", "pvc1") + + deleted, emailed = FindStale(kube, schedulerCfg) + + // now pvc1 should be skipped + assert.Equal(t, deleted, 1) + assert.Equal(t, emailed, 0) + + RemovePvcLabel(kube, "volume-cleaner/ignore", "test", "pvc1") + schedulerCfg.GracePeriod = 5 deleted, emailed = FindStale(kube, schedulerCfg) From 0532e722b43016b27258061ceb3d4534cd47f26a Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:19:58 +0000 Subject: [PATCH 07/20] docs: update readme instructions --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 48a05d6..ad31e44 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ cd volume-cleaner * `NAMESPACE`: Target namespace to scan for unused PVCs, leave this value as an empty string to scan all namespaces * `TIME_LABEL`: Must match controller's time label * `NOTIF_LABEL`: Must match controller's notification label - * `IGNORE_LABEL`: If this label is found on a PVC, the scheduler will skip it (e.g.: "volume-cleaner/ignore") + * `IGNORE_LABEL`: If this label is true on a PVC, the scheduler will skip it (e.g.: "volume-cleaner/ignore") * `GRACE_PERIOD`: Days before PVC deletion (e.g., "180") * `TIME_FORMAT`: Must match controller's time format * `DRY_RUN`: Set to "true" for testing without actual deletion @@ -287,7 +287,7 @@ Le volume-cleaner est composé de 2 composants principaux : * `NAMESPACE` : Espace de noms à scanner pour les PVC périmés; laissez cette valeur vide pour scanner tous les espaces de noms * `TIME_LABEL` : Doit correspondre au `TIME_LABEL` du contrôleur * `NOTIF_LABEL` : Doit correspondre au `NOTIF_LABEL` du contrôleur - * `IGNORE_LABEL` : Si cette étiquette est présente sur un PVC, le planificateur l’ignorera (par exemple : `volume-cleaner/ignore`). + * `IGNORE_LABEL` : Si cette étiquette est définie à true sur un PVC, le planificateur l’ignorera (par exemple : `volume-cleaner/ignore`). * `GRACE_PERIOD` : Nombre de jours avant suppression du PVC (par ex. `"180"`) * `TIME_FORMAT` : Doit correspondre au `TIME_FORMAT` du contrôleur * `DRY_RUN` : À `"true"` pour tester sans suppression réelle From 75b3679cbeaba7c19bb67ec2044a2e5c74be4e6d Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:27:19 +0000 Subject: [PATCH 08/20] chore: remove accidental manifest changes --- Makefile | 5 +---- manifests/controller/controller_config.yaml | 4 ++-- manifests/controller/controller_deployment.yaml | 2 +- manifests/netpol.yaml | 10 +++++----- manifests/rbac.yaml | 2 +- manifests/scheduler/scheduler_config.yaml | 11 +++++------ manifests/scheduler/scheduler_job.yaml | 2 +- manifests/serviceaccount.yaml | 2 +- scripts/controller/Makefile | 2 +- scripts/scheduler/Makefile | 2 +- 10 files changed, 19 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index b5a885a..01d1d7e 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,7 @@ run_scheduler: @make -C scripts/scheduler run_scheduler create_job: - @kubectl create job volume-cleaner-scheduler-manual --from=cronjob/volume-cleaner-scheduler -n zone - -delete_job: - @kubectl delete job volume-cleaner-scheduler-manual -n zone + @kubectl create job volume-cleaner-scheduler --from=cronjob/volume-cleaner-scheduler -n das test: go test -v -coverprofile cover.out ./... diff --git a/manifests/controller/controller_config.yaml b/manifests/controller/controller_config.yaml index 571e119..4e30e84 100644 --- a/manifests/controller/controller_config.yaml +++ b/manifests/controller/controller_config.yaml @@ -3,9 +3,9 @@ apiVersion: v1 kind: ConfigMap metadata: name: volume-cleaner-controller-config - namespace: zone + namespace: das data: - NAMESPACE: "" + NAMESPACE: "anray-liu" TIME_LABEL: "volume-cleaner/unattached-time" NOTIF_LABEL: "volume-cleaner/notification-count" TIME_FORMAT: "2006-01-02_15-04-05Z" diff --git a/manifests/controller/controller_deployment.yaml b/manifests/controller/controller_deployment.yaml index ca6020b..8cbcca4 100644 --- a/manifests/controller/controller_deployment.yaml +++ b/manifests/controller/controller_deployment.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: volume-cleaner-controller - namespace: zone + namespace: das spec: replicas: 1 selector: diff --git a/manifests/netpol.yaml b/manifests/netpol.yaml index f40bb2f..1fa7bd2 100644 --- a/manifests/netpol.yaml +++ b/manifests/netpol.yaml @@ -3,11 +3,13 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: volume-cleaner-controller-egress - namespace: zone + namespace: das spec: podSelector: matchLabels: app: volume-cleaner-controller + egress: + - {} policyTypes: - Egress --- @@ -15,14 +17,12 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: volume-cleaner-scheduler-egress - namespace: zone + namespace: das spec: podSelector: matchLabels: app: volume-cleaner-scheduler egress: - - ports: - - port: 443 - protocol: TCP + - {} policyTypes: - Egress diff --git a/manifests/rbac.yaml b/manifests/rbac.yaml index 2ffb39c..3d0b510 100644 --- a/manifests/rbac.yaml +++ b/manifests/rbac.yaml @@ -21,7 +21,7 @@ metadata: subjects: - kind: ServiceAccount name: volume-cleaner - namespace: zone + namespace: das roleRef: kind: ClusterRole name: volume-cleaner diff --git a/manifests/scheduler/scheduler_config.yaml b/manifests/scheduler/scheduler_config.yaml index 41fb704..421bd2e 100644 --- a/manifests/scheduler/scheduler_config.yaml +++ b/manifests/scheduler/scheduler_config.yaml @@ -3,15 +3,14 @@ apiVersion: v1 kind: ConfigMap metadata: name: volume-cleaner-scheduler-config - namespace: zone + namespace: das data: - NAMESPACE: "" + NAMESPACE: "anray-liu" TIME_LABEL: "volume-cleaner/unattached-time" NOTIF_LABEL: "volume-cleaner/notification-count" - IGNORE_LABEL: "volume-cleaner/ignore" - GRACE_PERIOD: "3" + GRACE_PERIOD: "5" TIME_FORMAT: "2006-01-02_15-04-05Z" - DRY_RUN: "true" - NOTIF_TIMES: "1, 2, 3" + DRY_RUN: "false" + NOTIF_TIMES: "1, 2, 3, 4" BASE_URL: "https://api.notification.canada.ca" ENDPOINT: "/v2/notifications/email" diff --git a/manifests/scheduler/scheduler_job.yaml b/manifests/scheduler/scheduler_job.yaml index 80f4adb..17356c2 100644 --- a/manifests/scheduler/scheduler_job.yaml +++ b/manifests/scheduler/scheduler_job.yaml @@ -3,7 +3,7 @@ apiVersion: batch/v1 kind: CronJob metadata: name: volume-cleaner-scheduler - namespace: zone + namespace: das spec: schedule: "0 0 * * *" jobTemplate: diff --git a/manifests/serviceaccount.yaml b/manifests/serviceaccount.yaml index 5504c38..1b2b0d4 100644 --- a/manifests/serviceaccount.yaml +++ b/manifests/serviceaccount.yaml @@ -3,4 +3,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: volume-cleaner - namespace: zone + namespace: das diff --git a/scripts/controller/Makefile b/scripts/controller/Makefile index 7943f61..b2cf775 100644 --- a/scripts/controller/Makefile +++ b/scripts/controller/Makefile @@ -5,5 +5,5 @@ run_controller: -f ../../manifests/serviceaccount.yaml \ -f ../../manifests/netpol.yaml \ -f ../../manifests/controller/controller_config.yaml - @kubectl -n zone apply -f ../../manifests/controller/controller_deployment.yaml + @kubectl -n das apply -f ../../manifests/controller/controller_deployment.yaml @echo "Ready to go!" \ No newline at end of file diff --git a/scripts/scheduler/Makefile b/scripts/scheduler/Makefile index b7345b1..c78675c 100644 --- a/scripts/scheduler/Makefile +++ b/scripts/scheduler/Makefile @@ -6,5 +6,5 @@ run_scheduler: -f ../../manifests/netpol.yaml \ -f ../../manifests/scheduler/scheduler_config.yaml \ -f ../../manifests/scheduler/scheduler_secret.yaml - @kubectl -n zone apply -f ../../manifests/scheduler/scheduler_job.yaml + @kubectl -n das apply -f ../../manifests/scheduler/scheduler_job.yaml @echo "Ready to go!" From 8db43a6c1fbde1d91e0ca62de89d7fcc6fd1ea0d Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:41:54 +0000 Subject: [PATCH 09/20] cd: change go linter config --- .github/linters/.golangci.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/linters/.golangci.yaml diff --git a/.github/linters/.golangci.yaml b/.github/linters/.golangci.yaml new file mode 100644 index 0000000..13d0eb9 --- /dev/null +++ b/.github/linters/.golangci.yaml @@ -0,0 +1,7 @@ +linters: + enable: + - gocyclo + +linters-settings: + gocyclo: + min-complexity: 16 From 7b746412008844c05914a13aa5135664b7697c3b Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:50:34 +0000 Subject: [PATCH 10/20] ci(lint): disable gocyclo --- .github/linters/.golangci.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/linters/.golangci.yaml b/.github/linters/.golangci.yaml index 13d0eb9..0d8520f 100644 --- a/.github/linters/.golangci.yaml +++ b/.github/linters/.golangci.yaml @@ -1,7 +1,4 @@ +--- linters: - enable: + disable: - gocyclo - -linters-settings: - gocyclo: - min-complexity: 16 From 624a61b20c8f4bf6649c5929bd3d4e019c5af911 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 18:57:41 +0000 Subject: [PATCH 11/20] fix: lint config --- .github/linters/.golangci.yaml | 4 ---- .github/workflows/ci.yaml | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .github/linters/.golangci.yaml diff --git a/.github/linters/.golangci.yaml b/.github/linters/.golangci.yaml deleted file mode 100644 index 0d8520f..0000000 --- a/.github/linters/.golangci.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -linters: - disable: - - gocyclo diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 03951a9..5cfb5bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,6 +23,7 @@ jobs: uses: super-linter/super-linter@v7 env: DEFAULT_BRANCH: main + GOCYCLO_COMPLEXITY: 16 VALIDATE_ALL_CODEBASE: false VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_GITHUB_ACTIONS: true From 55897ca47c0f424fcd5324da7bb8d45762fe5bb6 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 19:04:44 +0000 Subject: [PATCH 12/20] Revert "fix: lint config" This reverts commit 624a61b20c8f4bf6649c5929bd3d4e019c5af911. --- .github/linters/.golangci.yaml | 4 ++++ .github/workflows/ci.yaml | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .github/linters/.golangci.yaml diff --git a/.github/linters/.golangci.yaml b/.github/linters/.golangci.yaml new file mode 100644 index 0000000..0d8520f --- /dev/null +++ b/.github/linters/.golangci.yaml @@ -0,0 +1,4 @@ +--- +linters: + disable: + - gocyclo diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5cfb5bc..03951a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,6 @@ jobs: uses: super-linter/super-linter@v7 env: DEFAULT_BRANCH: main - GOCYCLO_COMPLEXITY: 16 VALIDATE_ALL_CODEBASE: false VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_GITHUB_ACTIONS: true From 72faf3acb984f2c21c5bd4e3a82c1f140e98ce05 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Thu, 25 Dec 2025 19:06:14 +0000 Subject: [PATCH 13/20] test: put config in root --- .golangci.yaml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..0d8520f --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,4 @@ +--- +linters: + disable: + - gocyclo From 1d5fa1ff05ac45638b0d7ed1f896105f26c185d5 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sat, 27 Dec 2025 18:45:51 +0000 Subject: [PATCH 14/20] fix: fix linter config --- .github/workflows/ci.yaml | 1 + .golangci.yaml | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .golangci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 03951a9..63e7b07 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,6 +29,7 @@ jobs: VALIDATE_GO_MODULES: true VALIDATE_GITLEAKS: true VALIDATE_YAML: true + GO_CONFIG_FILE: .github/linters/.golangci.yaml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: diff --git a/.golangci.yaml b/.golangci.yaml deleted file mode 100644 index 0d8520f..0000000 --- a/.golangci.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -linters: - disable: - - gocyclo From b8738a8460818b6593ac6ab3bc5996965c38de0f Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sat, 27 Dec 2025 18:51:01 +0000 Subject: [PATCH 15/20] fix: fix linter config --- .github/workflows/ci.yaml | 2 +- .github/linters/.golangci.yaml => .golangci.yaml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/linters/.golangci.yaml => .golangci.yaml (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 63e7b07..10252c0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,7 +29,7 @@ jobs: VALIDATE_GO_MODULES: true VALIDATE_GITLEAKS: true VALIDATE_YAML: true - GO_CONFIG_FILE: .github/linters/.golangci.yaml + GO_CONFIG_FILE: .golangci.yaml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: diff --git a/.github/linters/.golangci.yaml b/.golangci.yaml similarity index 100% rename from .github/linters/.golangci.yaml rename to .golangci.yaml From 49543192449b0ccd36a9ef9c3043f2085f268ec2 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sat, 27 Dec 2025 18:53:34 +0000 Subject: [PATCH 16/20] fix: fix linter config --- .github/workflows/ci.yaml | 1 - .golangci.yaml => .golangci.yml | 0 2 files changed, 1 deletion(-) rename .golangci.yaml => .golangci.yml (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 10252c0..03951a9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,7 +29,6 @@ jobs: VALIDATE_GO_MODULES: true VALIDATE_GITLEAKS: true VALIDATE_YAML: true - GO_CONFIG_FILE: .golangci.yaml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: diff --git a/.golangci.yaml b/.golangci.yml similarity index 100% rename from .golangci.yaml rename to .golangci.yml From 374d823499a13a3f4d8e2b78858360cbcc232378 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sat, 27 Dec 2025 19:05:52 +0000 Subject: [PATCH 17/20] fix: fix linter config --- .golangci.yml => .github/linters/.golangci.yaml | 0 .github/workflows/ci.yaml | 1 + 2 files changed, 1 insertion(+) rename .golangci.yml => .github/linters/.golangci.yaml (100%) diff --git a/.golangci.yml b/.github/linters/.golangci.yaml similarity index 100% rename from .golangci.yml rename to .github/linters/.golangci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 03951a9..a28d536 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,6 +26,7 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_GITHUB_ACTIONS: true + GO_CONFIG_FILE: ${{ GITHUB_WORKSPACE }}/.github/linters/.golangci.yaml VALIDATE_GO_MODULES: true VALIDATE_GITLEAKS: true VALIDATE_YAML: true From e4ecba04efb91a54ce8cd9f217fa38165704a786 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sat, 27 Dec 2025 19:09:39 +0000 Subject: [PATCH 18/20] fix: workflow file --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a28d536..3f9b879 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,7 +26,7 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_GITHUB_ACTIONS: true - GO_CONFIG_FILE: ${{ GITHUB_WORKSPACE }}/.github/linters/.golangci.yaml + GO_CONFIG_FILE: ${{ github.workspace }}/.github/linters/.golangci.yaml VALIDATE_GO_MODULES: true VALIDATE_GITLEAKS: true VALIDATE_YAML: true From 6baf9b6d07c52b8955dbab36163b7bc6323486de Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sat, 27 Dec 2025 19:14:09 +0000 Subject: [PATCH 19/20] fix: workflow file --- .github/linters/.golangci.yaml | 4 ---- .github/workflows/ci.yaml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 .github/linters/.golangci.yaml diff --git a/.github/linters/.golangci.yaml b/.github/linters/.golangci.yaml deleted file mode 100644 index 0d8520f..0000000 --- a/.github/linters/.golangci.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -linters: - disable: - - gocyclo diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3f9b879..ec0d0be 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,7 +26,7 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_GITHUB_ACTIONS: true - GO_CONFIG_FILE: ${{ github.workspace }}/.github/linters/.golangci.yaml + GO_GOLANGCI_LINT_ARGS: "-D gocyclo" VALIDATE_GO_MODULES: true VALIDATE_GITLEAKS: true VALIDATE_YAML: true From e359b37180cfc9aba2e7994832bd3fa48e3a3531 Mon Sep 17 00:00:00 2001 From: Anray Liu Date: Sun, 28 Dec 2025 00:06:47 +0000 Subject: [PATCH 20/20] ci: remove go lint --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ec0d0be..a01a664 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -26,8 +26,7 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_DOCKERFILE_HADOLINT: true VALIDATE_GITHUB_ACTIONS: true - GO_GOLANGCI_LINT_ARGS: "-D gocyclo" - VALIDATE_GO_MODULES: true + # VALIDATE_GO_MODULES: true - cyclo config seems to be broken VALIDATE_GITLEAKS: true VALIDATE_YAML: true GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}