Skip to content

Feature/add cilium network policies#371

Draft
pavankumarinnamuri wants to merge 28 commits intomainfrom
feature/add-cilium-network-policies
Draft

Feature/add cilium network policies#371
pavankumarinnamuri wants to merge 28 commits intomainfrom
feature/add-cilium-network-policies

Conversation

@pavankumarinnamuri
Copy link
Contributor

No description provided.

pavankumarinnamuri and others added 28 commits March 18, 2026 22:12
Move code into logical subdirectories for better organization:
- auth/: Authentication and onboarding logic
- collector/: Flow collectors (Cilium, Falco, OVN-K)
- logging/: gRPC logging infrastructure

Split streams.go into smaller, focused files:
- stream_types.go: Type definitions and constants
- stream_flows.go: Flow stream handling
- stream_logs.go: Log stream handling
- stream_config.go: Config stream handling
- stream_resources.go: Resource stream handling

Add FlowSink interface for dependency injection in collectors.
Add tests for collector package.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- stream/: Contains stream management code (cache, config, flows, logs, resources)
- k8sclient/: Contains Kubernetes client abstraction
- Remove old stream-related files from controller/ root (now in stream/)
- Remove duplicate k8s_client files (now in k8sclient/)
- Remove duplicate resource_manager files (now in stream/resources/)
- Export functions in k8s_resources.go for cross-package access
- Update k8s_resources_test.go to use exported function names
- Remove duplicate tests that are now in stream/resources/
- Fix import ordering (gci)
- Replace lambda with direct function reference (gocritic)
- Add nolint:contextcheck for flow collector lambdas
- Add nolint:maintidx for table-driven cilium test
- Remove duplicate IsRunningInCluster from auth/authenticator.go (use k8sclient)
- Remove duplicate NewClientSet/newClientForConfig from k8s_resources.go (use k8sclient)
- Remove unused LogStream interface from stream/interfaces.go
- Add proxy-disable to k8sclient.NewClient() for consistent behavior
- Fix IPFIX naming convention (IpfixCollectorPort → IPFIXCollectorPort)
- Fix jitterTime to use random jitter instead of deterministic value
- Update tests to use k8sclient.NewClientSet()
The test was expecting a "Forbidden" error from the proxy, but in CI
environments (GitHub Actions), the HTTPS request bypasses the httptest
proxy and fails with a DNS "no such host" error instead.

Updated the assertion to accept either proxy rejection, DNS failure,
or connection refused errors since all indicate the OAuth connection
failed as expected.
Use sm.K8sClient.GetClientset() instead of creating a new clientset
with k8sclient.NewClientSet() on every call. This avoids unnecessary
connection overhead and follows the established pattern of reusing
the injected client.
- Add IsRunningInCluster() and getKubeConfig() to client.go
- NewClient() now supports both in-cluster and kubeconfig (local dev)
- Delete clientset.go (duplicate functionality)
- Update manager.go to use NewClient().GetClientset()
- Update tests to use NewClient().GetClientset()
- Add CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy to watched resources
- Add RBAC permissions for cilium.io CRDs
- Add proto definitions for Cilium policy data (selectors, rules, CIDRs, ports, entities)
- Add conversion logic to extract full Cilium policy specs from unstructured objects
- Update watcher to handle Cilium policies specially during list and watch operations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant