fix: validate and clamp container log tail parameter (closes #24) #33
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#33
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch ":fix/validate-tail-parameter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Validates and clamps the
tailquery parameter inHandleAppLogs()to prevent invalid values from reaching the Docker API.Changes
sanitizeTail()helper function that:sanitizeTail()calltail_validation_test.go) with 11 test casesTest Results
All tests pass. See comments for full output.
Closes #24
Test Results ✅
sanitizeTail unit tests
Full test suite (make test)
Lint Results (golangci-lint)
46 pre-existing issues (none introduced by this PR). The only lint note referencing new code:
tail_validation_test.go:testpackagesuggests usinghandlers_testpackage, but internal package is needed to test the unexportedsanitizeTail()function.