Repository navigation
feat: Implement CNI plugin robustness improvements - #38
Merged
Merged
Conversation
bpalermo
force-pushed
the
feat/cni-robustness
branch
from
March 22, 2026 13:47
be136ad to
3496c1a
Compare
- Implement CmdCheck: validates network namespace existence, verifies expected interface via /proc/<pid>/net/dev, and confirms pod registration with the agent via gRPC call - Implement CmdStatus: parses config, creates agent client, and verifies gRPC endpoint reachability via connection state check - Add context timeouts to all gRPC calls (30s for Add/Del, 10s for Check operations) to prevent indefinite hangs - Add retry with exponential backoff for transient gRPC errors (Unavailable, DeadlineExceeded) on AddPod only, max 3 retries - Del operations are intentionally not retried to avoid duplicate deletion issues - Add comprehensive unit tests for all new functionality including retry logic, timeout behavior, transient error detection, netns verification, and interface checks Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
bpalermo
force-pushed
the
feat/cni-robustness
branch
from
March 22, 2026 13:54
3496c1a to
f04cd00
Compare
Set addTimeout and delTimeout to 5s and checkTimeout to 1s for faster failure detection. Remove gazelle:ignore directive from BUILD.bazel — gazelle now manages the file correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Move retry-with-backoff and gRPC transient error classification from the CNI plugin client into a reusable common/retry package. The package provides retry.Do with configurable max attempts, exponential backoff, and pluggable IsRetryable predicate. retry.GRPCTransient classifies Unavailable and DeadlineExceeded as retryable. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace `defer client.Close() //nolint:errcheck` with proper error handling that logs close failures via the plugin's zap logger. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Worktrees caused gazelle to see duplicate packages and drop internal deps. Now that worktrees are removed, gazelle resolves deps correctly and the keep directives are no longer needed. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
CmdCheck: validates network namespace exists, interface is present, pod is registered with agentCmdStatus: checks agent gRPC endpoint reachabilityFiles Changed
cni/internal/plugin/plugin.go— CmdCheck and CmdStatus implementationscni/internal/plugin/client.go— Timeouts, retry logic, new helper methodscni/internal/plugin/plugin_test.go— Tests for netns/interface verificationcni/internal/plugin/client_test.go— Tests for retry, timeout, connectivityTest plan
bazel test --config=llm //cni/internal/plugin:plugin_testpasses🤖 Generated with Claude Code