-
Notifications
You must be signed in to change notification settings - Fork 0
Fix critical bugs #273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix critical bugs #273
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix elapsed time reset in opslevelAppendLogProcessor.go: time.Since(time.Now()) always returns ~0, so elapsed never reset. Changed to `s.elapsed = 0` - Use dynamic ImageTagVersion in k8s.go instead of hardcoded v2024.1.3 for the init container image to prevent version mismatches - Fix memory calculation typo in k8s_config.go: 1024*1204 → 1024*1024 (was allocating ~17% more memory than intended) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move defer cleanup after error checks in k8s.go Run() method Previously, defer was called before error check, causing delete attempts on failed/nil resources - Add sync.RWMutex protection for isLeader variable in leaderElection.go The variable was accessed from multiple goroutines without synchronization Added setLeader()/getLeader() functions for thread-safe access Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8ec7346 to
bbaa91d
Compare
Tests added:
- TestSetLeaderGetLeader: basic setLeader/getLeader functionality
- TestSetLeaderGetLeader_ConcurrentAccess: race condition verification
- TestSetLeaderGetLeader_ConcurrentReadWrite: simulates callback pattern
- TestDeleteConfigMap_NilSafe, TestDeletePDB_NilSafe, TestDeletePod_NilSafe
- TestGetConfigMapObject, TestGetPBDObject: verify object creation
- TestDeleteFunctions_RequireClientset: documents expected behavior
Additional fixes:
- Add nil guards to DeleteConfigMap, DeletePDB, DeletePod for defensive safety
- Fix log message typo in DeletePDB ("configmap" -> "pod disruption budget")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bbaa91d to
a65559e
Compare
| { | ||
| Name: "helper", | ||
| Image: "public.ecr.aws/opslevel/opslevel-runner:v2024.1.3", // TODO: fmt.Sprintf("public.ecr.aws/opslevel/opslevel-runner:v%s", ImageTagVersion), | ||
| Image: fmt.Sprintf("public.ecr.aws/opslevel/opslevel-runner:v%s", ImageTagVersion), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goreleaser config doesn't explicitly set ldflags, but goreleaser has default behavior that automatically injects:
-X main.version={{.Version}}
-X main.commit={{.Commit}}
-X main.date={{.Date}}
| @@ -0,0 +1,44 @@ | |||
| # SQLite databases | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying out using beads. This adds a bunch of boilerplate. I can do in a separate MR, but the actual fixes are relatively small.
Issues
This fixes some security / correctness issues.
Changelog
changieentryTophatting