Documentation
¶
Overview ¶
Package utils provides utility functions for the ROR agent. It contains helper functions for handling Kubernetes resources and managing their representation in the ROR system.
Index ¶
- func GetIngressDetails(ctx context.Context, k8sClient *kubernetes.Clientset, ...) (*apicontracts.Ingress, error)
- func GetIngressHealth(thisIngress apicontracts.Ingress) (*apicontracts.Ingress, error)
- func GetIngressService(ctx context.Context, k8sClient *kubernetes.Clientset, namespace string, ...) (apicontracts.Service, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIngressDetails ¶
func GetIngressDetails(ctx context.Context, k8sClient *kubernetes.Clientset, ingress *networkingV1.Ingress) (*apicontracts.Ingress, error)
GetIngressDetails extracts information from a Kubernetes Ingress resource and converts it to an apicontracts.Ingress. It gathers details about the Ingress rules, associated services, IP addresses, and paths. The function also evaluates the health status of the ingress based on its configuration.
Parameters:
- ctx: Context for the operation.
- k8sClient: Kubernetes client to use for API calls.
- ingress: Pointer to a Kubernetes Ingress resource to extract information from.
Returns:
- *apicontracts.Ingress: A pointer to the constructed Ingress object with complete details.
- error: An error if the ingress is invalid or if there was a problem fetching related information.
func GetIngressHealth ¶
func GetIngressHealth(thisIngress apicontracts.Ingress) (*apicontracts.Ingress, error)
GetIngressHealth evaluates the health status of an Ingress resource based on predefined criteria. It checks for valid ingress class, presence of rules, IP addresses, paths, and service configurations. Health status is updated in the Ingress object itself.
Parameters:
- thisIngress: The apicontracts.Ingress object to evaluate health for.
Returns:
- *apicontracts.Ingress: A pointer to the same Ingress object with updated health status.
- error: Error if any issues occur during health evaluation.
func GetIngressService ¶
func GetIngressService(ctx context.Context, k8sClient *kubernetes.Clientset, namespace string, serviceName string) (apicontracts.Service, error)
GetIngressService retrieves detailed information about a Kubernetes Service associated with an Ingress. It fetches service details including type, ports, selectors, and endpoints.
Parameters:
- ctx: Context for the operation.
- k8sClient: Kubernetes client to use for API calls.
- namespace: Namespace where the service is located.
- serviceName: Name of the service to retrieve information for.
Returns:
- apicontracts.Service: A Service object containing details about the requested service.
- error: Error if any issues occur while retrieving service information.
Types ¶
This section is empty.