-
Notifications
You must be signed in to change notification settings - Fork 1
chore: code review fixes 2026-05 (with breaking API tightenings) #2
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
0662629
fix(auth): enforce session expiry in VerifySession
CMGS f97272e
fix(auth): panic on crypto/rand failure in RandomState
CMGS 11b7499
fix(k8s): fall back to self-signed when on-disk cert expired
CMGS 2353d97
feat(cocoonset): mark Agents/Toolboxes as listType=map
CMGS b055bdb
refactor(meta): table-driven LifecycleState.IsTerminal
CMGS d9156b8
refactor(apis): table-driven enum IsValid + cmp.Or-based Default
CMGS c2e70e0
refactor(meta): split meta.go by concern
CMGS a11df46
refactor(meta): drop unused LabelManagedBy
CMGS 59c391f
fix(log)!: return error from Setup instead of Fatalf
CMGS 758b4ee
refactor(meta)!: return (string, bool) from OwnerDeploymentName
CMGS 2127a96
fix(k8s)!: DetectNodeIP returns (string, error)
CMGS dcb11a9
refactor(meta)!: rename HasCocoonToleration to HasCocoonTolerationKey
CMGS 4c7f78a
feat(meta): add toolbox-safe agent-slot helpers
CMGS 4a44490
style: drop "previous behavior" leaks from godoc
CMGS 6b51984
style: tighten godocs across packages
CMGS 9134970
refactor!: thread ctx through LoadOrGenerateCert; tighten meta helpers
CMGS 27035ab
fix(meta): InferRoleFromAgentSlot returns RoleToolbox for slot<0
CMGS 4714e5c
fix(auth): reject session at Exp == now (JWT-style)
CMGS e451b5e
fix(k8s): surface partial TLS keypair misconfig as error
CMGS d15dd3c
style: trim verbose comments added in prior fixes
CMGS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,31 @@ | ||
| package k8s | ||
|
|
||
| import "net" | ||
| import ( | ||
| "errors" | ||
| "fmt" | ||
| "net" | ||
| ) | ||
|
|
||
| // DetectNodeIP returns the first non-loopback IPv4 address, or "127.0.0.1" if none found. | ||
| func DetectNodeIP() string { | ||
| // ErrNoNodeIP is returned when no non-loopback IPv4 address is | ||
| // reachable. Callers pick the fallback — auto-substituting localhost | ||
| // would mask misconfigured network namespaces. | ||
| var ErrNoNodeIP = errors.New("no non-loopback IPv4 address found") | ||
|
|
||
| // DetectNodeIP returns the first non-loopback IPv4 address, or | ||
| // ErrNoNodeIP if none exists. | ||
| func DetectNodeIP() (string, error) { | ||
| addrs, err := net.InterfaceAddrs() | ||
| if err != nil { | ||
| return localhost | ||
| return "", fmt.Errorf("list interface addresses: %w", err) | ||
| } | ||
| for _, addr := range addrs { | ||
| ipNet, ok := addr.(*net.IPNet) | ||
| if !ok || ipNet.IP == nil || ipNet.IP.IsLoopback() { | ||
| continue | ||
| } | ||
| if ip4 := ipNet.IP.To4(); ip4 != nil { | ||
| return ip4.String() | ||
| return ip4.String(), nil | ||
| } | ||
| } | ||
| return localhost | ||
| return "", ErrNoNodeIP | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.