17 Commits

Author SHA1 Message Date
argoyle f60ca960d6 Merge pull request 'chore(release): prepare for 1.4.0' (#306) from next-release into main
Release / release (push) Successful in 3m15s
cron-checker / test (push) Successful in 4m25s
cron-checker / vulnerabilities (push) Successful in 7m34s
Reviewed-on: #306
2026-01-09 15:56:02 +00:00
releaser 69b24e9e09 chore(release): prepare for 1.4.0 2026-01-09 15:55:21 +00:00
releaser 651682092a chore(release): prepare for 1.4.0 2026-01-09 15:55:10 +00:00
argoyle e982d69dd6 Merge pull request 'docs: add CLAUDE.md for Claude Code guidance' (#310) from docs/claude-md into main
cron-checker / test (push) Has been cancelled
cron-checker / vulnerabilities (push) Has been cancelled
Release / release (push) Has been cancelled
Reviewed-on: #310
2026-01-09 15:52:49 +00:00
argoyle 7a9b1cb675 Merge pull request 'feat: add release workflow using shared workflow' (#311) from feat/release-workflow into main
cron-checker / test (push) Has been cancelled
cron-checker / vulnerabilities (push) Has been cancelled
Release / release (push) Has been cancelled
Reviewed-on: #311
2026-01-09 15:52:39 +00:00
argoyle 9be8681761 feat: add release workflow using shared workflow
cron-checker / vulnerabilities (pull_request) Successful in 4m25s
cron-checker / test (pull_request) Successful in 6m2s
2026-01-09 16:40:51 +01:00
argoyle 5293e94e21 docs: add CLAUDE.md for Claude Code guidance
cron-checker / vulnerabilities (pull_request) Successful in 4m29s
cron-checker / test (pull_request) Successful in 6m6s
2026-01-09 16:39:14 +01:00
argoyle 83cd217fb5 Merge pull request 'chore(deps): update actions/setup-go action to v6' (#309) from renovate/actions-setup-go-6.x into main
cron-checker / vulnerabilities (push) Successful in 8m43s
cron-checker / test (push) Successful in 11m20s
Reviewed-on: #309
2026-01-08 16:18:42 +00:00
renovate 5b9dc135e3 chore(deps): update actions/setup-go action to v6
cron-checker / vulnerabilities (pull_request) Successful in 5m35s
cron-checker / test (pull_request) Successful in 6m43s
2026-01-08 16:01:37 +00:00
argoyle 8170cbaa0d Merge pull request 'chore(deps): update actions/checkout action to v6' (#308) from renovate/actions-checkout-6.x into main
cron-checker / vulnerabilities (push) Successful in 3m8s
cron-checker / test (push) Successful in 4m57s
Reviewed-on: #308
2026-01-08 15:07:28 +00:00
renovate a5a8ac6090 chore(deps): update actions/checkout action to v6
cron-checker / vulnerabilities (pull_request) Successful in 3m38s
cron-checker / test (pull_request) Successful in 4m6s
2026-01-08 15:01:46 +00:00
argoyle 9d56171a31 Merge pull request 'feat: migrate from GitLab CI to Gitea Actions' (#307) from feat/gitea-actions into main
cron-checker / test (push) Successful in 4m5s
cron-checker / vulnerabilities (push) Successful in 4m53s
Reviewed-on: #307
2026-01-08 14:36:41 +00:00
argoyle 8582f07d3f feat: migrate from GitLab CI to Gitea Actions
cron-checker / vulnerabilities (pull_request) Successful in 1m46s
cron-checker / test (pull_request) Successful in 2m17s
2026-01-08 15:21:26 +01:00
Unbound Release a257fabbc8 chore(release): prepare for 1.3.19 2025-12-30 17:59:43 +00:00
Unbound Release d95d216e0b chore(release): prepare for 1.3.19 2025-12-30 17:59:42 +00:00
argoyle ad1db6b5e3 Merge branch 'renovate/golang-1.25.5' into 'master'
chore(deps): update golang:1.25.5 docker digest to ad03ba9

See merge request unboundsoftware/cron-checker!302
2025-12-30 17:42:31 +01:00
Renovate 85f607ac20 chore(deps): update golang:1.25.5 docker digest to ad03ba9 2025-12-30 04:03:31 +00:00
6 changed files with 121 additions and 2 deletions
+30
View File
@@ -0,0 +1,30 @@
name: cron-checker
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Run tests
run: go test -race -coverprofile=coverage.txt ./...
vulnerabilities:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Check vulnerabilities
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
+9
View File
@@ -0,0 +1,9 @@
name: Release
on:
push:
branches: [main]
jobs:
release:
uses: unboundsoftware/shared-workflows/.gitea/workflows/Release.yml@main
+3 -1
View File
@@ -1 +1,3 @@
{"version":"1.3.18"}
{
"version": "1.4.0"
}
+17
View File
@@ -2,6 +2,23 @@
All notable changes to this project will be documented in this file.
## [1.4.0] - 2026-01-09
### 🚀 Features
- Migrate from GitLab CI to Gitea Actions
- Add release workflow using shared workflow
### 📚 Documentation
- Add CLAUDE.md for Claude Code guidance
### ⚙️ Miscellaneous Tasks
- *(deps)* Update golang:1.25.5 docker digest to ad03ba9
- *(deps)* Update actions/checkout action to v6
- *(deps)* Update actions/setup-go action to v6
## [1.3.18] - 2025-12-18
### 🐛 Bug Fixes
+61
View File
@@ -0,0 +1,61 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
A Kubernetes monitoring tool that checks for CronJobs not running according to schedule and sends Slack notifications. It runs as a container inside a K8s cluster, polling all CronJobs every 60 seconds.
## Common Commands
```bash
# Run tests
go test ./...
# Run tests with race detection and coverage
go test -race -coverprofile=coverage.txt ./...
# Build the binary
CGO_ENABLED=0 go build -o release/cron-checker -ldflags '-w -s'
# Check for vulnerabilities
govulncheck ./...
# Format and vet
go fmt ./...
go vet ./...
# Check for unused modules
go mod tidy
```
## Architecture
This is a single-file Go application (`main.go`) with comprehensive tests (`main_test.go`).
**Core Components:**
- `doCheck()` - Main loop that polls K8s CronJobs, parses cron schedules, and sends Slack alerts for overdue jobs
- `Client` / `ClientProvider` interfaces - Abstractions over K8s client for testability
- `ConfigProvider` / `InClusterProvider` - Handles K8s in-cluster authentication
**Key Dependencies:**
- `k8s.io/client-go` - Kubernetes API client
- `github.com/robfig/cron` - Cron schedule parsing
- `github.com/multiplay/go-slack` - Slack webhook integration
- `github.com/alecthomas/kingpin/v2` - CLI flag parsing
**Configuration:**
- `SLACK_URL` env var or `--slack-url` flag (required) - Slack webhook URL for notifications
## Building Docker Image
The Dockerfile performs a multi-stage build that runs fmt, vet, and tests before building:
```bash
docker build -t cron-checker .
```
To extract coverage report:
```bash
docker build --target export -o . .
```
+1 -1
View File
@@ -1,4 +1,4 @@
FROM amd64/golang:1.25.5@sha256:0c27bcf0df81eca89f87e1e78be5ad5e36487f0eaf71cd900ba14ee7621d3e70 as build
FROM amd64/golang:1.25.5@sha256:ad03ba93327b8a6143b49373790b5d92c28067bdb814418509466122ee9c9e63 as build
WORKDIR /build
ENV CGO_ENABLED=0
ADD . /build