common

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GatewayGVK = schema.GroupVersionKind{
		Group:   "gateway.networking.k8s.io",
		Version: "v1",
		Kind:    "Gateway",
	}

	HTTPRouteGVK = schema.GroupVersionKind{
		Group:   "gateway.networking.k8s.io",
		Version: "v1",
		Kind:    "HTTPRoute",
	}

	TLSRouteGVK = schema.GroupVersionKind{
		Group:   "gateway.networking.k8s.io",
		Version: "v1alpha2",
		Kind:    "TLSRoute",
	}

	TCPRouteGVK = schema.GroupVersionKind{
		Group:   "gateway.networking.k8s.io",
		Version: "v1alpha2",
		Kind:    "TCPRoute",
	}

	ReferenceGrantGVK = schema.GroupVersionKind{
		Group:   "gateway.networking.k8s.io",
		Version: "v1beta1",
		Kind:    "ReferenceGrant",
	}
)

Functions

func ExtractObjectsFromReader added in v0.2.0

func ExtractObjectsFromReader(reader io.Reader, namespace string) ([]*unstructured.Unstructured, error)

ExtractObjectsFromReader extracts all objects from a reader, which is created from YAML or JSON input files. It retrieves all objects, including nested ones if they are contained within a list. The function takes a namespace parameter to optionally return only namespaced resources.

func GetIngressClass

func GetIngressClass(ingress networkingv1.Ingress) string

func GetRuleGroups

func GetRuleGroups(ingresses []networkingv1.Ingress) map[string]IngressRuleGroup

func NameFromHost

func NameFromHost(host string) string

func PtrTo added in v0.2.0

func PtrTo[T any](a T) *T

func ReadIngressesFromCluster added in v0.2.0

func ReadIngressesFromCluster(ctx context.Context, client client.Client, ingressClasses sets.Set[string]) (map[types.NamespacedName]*networkingv1.Ingress, error)

func ReadIngressesFromFile added in v0.2.0

func ReadIngressesFromFile(filename, namespace string, ingressClasses sets.Set[string]) (map[types.NamespacedName]*networkingv1.Ingress, error)

func RouteName added in v0.2.0

func RouteName(ingressName, host string) string

func ToGatewayResources added in v0.4.0

func ToGatewayResources(ir intermediate.IR) (i2gw.GatewayResources, field.ErrorList)

ToGatewayResources converts the received intermediate.IR to i2gw.GatewayResource without taking into consideration any provider specific logic.

func ToIR added in v0.4.0

ToIR converts the received ingresses to intermediate.IR without taking into consideration any provider specific logic.

Types

type IngressRuleGroup

type IngressRuleGroup struct {
	Namespace    string
	Name         string
	IngressClass string
	Host         string
	TLS          []networkingv1.IngressTLS
	Rules        []Rule
}

type Rule

type Rule struct {
	Ingress     networkingv1.Ingress
	IngressRule networkingv1.IngressRule
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL