Documentation ¶
Index ¶
- func NewEndpointsResolver(k8sClient client.Client, logger logr.Logger) *defaultEndpointsResolver
- func NewPolicyReferenceResolver(k8sClient client.Client, policyTracker PolicyTracker, logger logr.Logger) *defaultPolicyReferenceResolver
- type EndpointsResolver
- type PolicyReferenceResolver
- type PolicyTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEndpointsResolver ¶
NewEndpointsResolver constructs a new defaultEndpointsResolver
func NewPolicyReferenceResolver ¶
func NewPolicyReferenceResolver(k8sClient client.Client, policyTracker PolicyTracker, logger logr.Logger) *defaultPolicyReferenceResolver
Types ¶
type EndpointsResolver ¶
type EndpointsResolver interface { // Resolve returns the resolved endpoints for the given policy ingress, egress rules and pod selector labels. Resolve(ctx context.Context, policy *networking.NetworkPolicy) ([]policyinfo.EndpointInfo, []policyinfo.EndpointInfo, []policyinfo.PodEndpoint, error) }
type PolicyReferenceResolver ¶
type PolicyReferenceResolver interface { GetReferredPoliciesForPod(ctx context.Context, pod, podOld *corev1.Pod) ([]networking.NetworkPolicy, error) GetReferredPoliciesForNamespace(ctx context.Context, ns, nsOld *corev1.Namespace) ([]networking.NetworkPolicy, error) GetReferredPoliciesForService(ctx context.Context, svc, svcOld *corev1.Service) ([]networking.NetworkPolicy, error) }
PolicyReferenceResolver resolves the referred network policies for a given pod, namespace or service.
type PolicyTracker ¶ added in v0.5.1
type PolicyTracker interface { UpdatePolicy(policy *networking.NetworkPolicy) RemovePolicy(policy *networking.NetworkPolicy) GetPoliciesWithNamespaceReferences() sets.Set[types.NamespacedName] GetPoliciesWithEgressRules() sets.Set[types.NamespacedName] }
func NewPolicyTracker ¶ added in v0.5.1
func NewPolicyTracker(logger logr.Logger) PolicyTracker
Click to show internal directories.
Click to hide internal directories.