Help us shape the future of Go! Take the 2026 Go Developer Survey

resource

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindConfigMap            = "ConfigMap"
	KindClientTrafficPolicy  = "ClientTrafficPolicy"
	KindBackendTrafficPolicy = "BackendTrafficPolicy"
	KindBackendTLSPolicy     = "BackendTLSPolicy"
	KindBackend              = "Backend"
	KindEnvoyPatchPolicy     = "EnvoyPatchPolicy"
	KindEnvoyExtensionPolicy = "EnvoyExtensionPolicy"
	KindSecurityPolicy       = "SecurityPolicy"
	KindEnvoyProxy           = "EnvoyProxy"
	KindGateway              = "Gateway"
	KindGatewayClass         = "GatewayClass"
	KindGRPCRoute            = "GRPCRoute"
	KindHTTPRoute            = "HTTPRoute"
	KindNamespace            = "Namespace"
	KindTLSRoute             = "TLSRoute"
	KindTCPRoute             = "TCPRoute"
	KindUDPRoute             = "UDPRoute"
	KindService              = "Service"
	KindServiceImport        = "ServiceImport"
	KindSecret               = "Secret"
	KindHTTPRouteFilter      = "HTTPRouteFilter"
	KindReferenceGrant       = "ReferenceGrant"
	KindClusterTrustBundle   = "ClusterTrustBundle"
	KindXListenerSet         = "XListenerSet"
)

Variables

This section is empty.

Functions

func IterYAMLBytes

func IterYAMLBytes(input []byte, handle func([]byte) error) error

IterYAMLBytes iters every valid YAML resource from YAML bytes and process each of them by calling `handle` callback.

Types

type ControllerResources

type ControllerResources []*Resources

ControllerResources holds all the GatewayAPI resources per GatewayClass

func (*ControllerResources) DeepCopy

DeepCopy creates a new ControllerResources. It is handwritten since the tooling was unable to copy into a new slice

func (ControllerResources) Sort added in v1.5.0

func (c ControllerResources) Sort()

type ControllerResourcesContext added in v1.7.0

type ControllerResourcesContext struct {
	Resources *ControllerResources
	Context   context.Context
}

ControllerResourcesContext wraps ControllerResources with trace context for propagating spans across async message boundaries

func (*ControllerResourcesContext) DeepCopy added in v1.7.0

DeepCopy creates a new ControllerResourcesContext. The Context field is preserved (not deep copied) since contexts are meant to be passed around.

func (*ControllerResourcesContext) Equal added in v1.7.0

Equal compares two Resources objects for equality.

type Defaulter added in v1.3.1

type Defaulter struct {
	// contains filtered or unexported fields
}

Defaulter can set default values for crd object according to their schema.

func GetGatewaySchemaDefaulter added in v1.5.0

func GetGatewaySchemaDefaulter() *Defaulter

func (*Defaulter) ApplyDefault added in v1.3.1

ApplyDefault applies default values for input object, and return the object with default values.

type InfraIRMap

type InfraIRMap map[string]*ir.Infra

type Resources

type Resources struct {

	// EnvoyProxyForGatewayClass holds EnvoyProxy attached to GatewayClass
	EnvoyProxyForGatewayClass *egv1a1.EnvoyProxy `json:"envoyProxyForGatewayClass,omitempty" yaml:"envoyProxyForGatewayClass,omitempty"`
	// EnvoyProxiesForGateways holds EnvoyProxiesForGateways attached to Gateways
	EnvoyProxiesForGateways []*egv1a1.EnvoyProxy `json:"envoyProxiesForGateways,omitempty" yaml:"envoyProxiesForGateways,omitempty"`
	// EnvoyProxyDefaultSpec holds the default EnvoyProxySpec from EnvoyGateway configuration.
	// This serves as the lowest priority fallback when no GatewayClass or Gateway level EnvoyProxy is specified.
	EnvoyProxyDefaultSpec *egv1a1.EnvoyProxySpec `json:"envoyProxyDefaultSpec,omitempty" yaml:"envoyProxyDefaultSpec,omitempty"`

	GatewayClass            *gwapiv1.GatewayClass          `json:"gatewayClass,omitempty" yaml:"gatewayClass,omitempty"`
	Gateways                []*gwapiv1.Gateway             `json:"gateways,omitempty" yaml:"gateways,omitempty"`
	XListenerSets           []*gwapixv1a1.XListenerSet     `json:"xListenerSets,omitempty" yaml:"xListenerSets,omitempty"`
	HTTPRoutes              []*gwapiv1.HTTPRoute           `json:"httpRoutes,omitempty" yaml:"httpRoutes,omitempty"`
	GRPCRoutes              []*gwapiv1.GRPCRoute           `json:"grpcRoutes,omitempty" yaml:"grpcRoutes,omitempty"`
	TLSRoutes               []*gwapiv1a3.TLSRoute          `json:"tlsRoutes,omitempty" yaml:"tlsRoutes,omitempty"`
	TCPRoutes               []*gwapiv1a2.TCPRoute          `json:"tcpRoutes,omitempty" yaml:"tcpRoutes,omitempty"`
	UDPRoutes               []*gwapiv1a2.UDPRoute          `json:"udpRoutes,omitempty" yaml:"udpRoutes,omitempty"`
	ReferenceGrants         []*gwapiv1b1.ReferenceGrant    `json:"referenceGrants,omitempty" yaml:"referenceGrants,omitempty"`
	Namespaces              []*corev1.Namespace            `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
	Services                []*corev1.Service              `json:"services,omitempty" yaml:"services,omitempty"`
	ServiceImports          []*mcsapiv1a1.ServiceImport    `json:"serviceImports,omitempty" yaml:"serviceImports,omitempty"`
	EndpointSlices          []*discoveryv1.EndpointSlice   `json:"endpointSlices,omitempty" yaml:"endpointSlices,omitempty"`
	Secrets                 []*corev1.Secret               `json:"secrets,omitempty" yaml:"secrets,omitempty"`
	ConfigMaps              []*corev1.ConfigMap            `json:"configMaps,omitempty" yaml:"configMaps,omitempty"`
	ExtensionRefFilters     []unstructured.Unstructured    `json:"extensionRefFilters,omitempty" yaml:"extensionRefFilters,omitempty"`
	EnvoyPatchPolicies      []*egv1a1.EnvoyPatchPolicy     `json:"envoyPatchPolicies,omitempty" yaml:"envoyPatchPolicies,omitempty"`
	ClientTrafficPolicies   []*egv1a1.ClientTrafficPolicy  `json:"clientTrafficPolicies,omitempty" yaml:"clientTrafficPolicies,omitempty"`
	BackendTrafficPolicies  []*egv1a1.BackendTrafficPolicy `json:"backendTrafficPolicies,omitempty" yaml:"backendTrafficPolicies,omitempty"`
	SecurityPolicies        []*egv1a1.SecurityPolicy       `json:"securityPolicies,omitempty" yaml:"securityPolicies,omitempty"`
	BackendTLSPolicies      []*gwapiv1.BackendTLSPolicy    `json:"backendTLSPolicies,omitempty" yaml:"backendTLSPolicies,omitempty"`
	EnvoyExtensionPolicies  []*egv1a1.EnvoyExtensionPolicy `json:"envoyExtensionPolicies,omitempty" yaml:"envoyExtensionPolicies,omitempty"`
	ExtensionServerPolicies []unstructured.Unstructured    `json:"extensionServerPolicies,omitempty" yaml:"extensionServerPolicies,omitempty"`
	Backends                []*egv1a1.Backend              `json:"backends,omitempty" yaml:"backends,omitempty"`
	HTTPRouteFilters        []*egv1a1.HTTPRouteFilter      `json:"httpFilters,omitempty" yaml:"httpFilters,omitempty"`

	ClusterTrustBundles []*certificatesv1b1.ClusterTrustBundle `json:"clusterTrustBundles,omitempty" yaml:"clusterTrustBundles,omitempty"`
}

Resources holds the Gateway API and related resources that the translators needs as inputs. +k8s:deepcopy-gen=true

func LoadResourcesFromYAMLBytes

func LoadResourcesFromYAMLBytes(yamlBytes []byte, addMissingResources bool, envoyGateway *egv1a1.EnvoyGateway) (*Resources, error)

LoadResourcesFromYAMLBytes will load Resources from given Kubernetes YAML string. TODO: This function should be able to process arbitrary number of resources, tracked by https://github.com/envoyproxy/gateway/issues/3207.

func NewResources

func NewResources() *Resources

func (*Resources) DeepCopy

func (in *Resources) DeepCopy() *Resources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.

func (*Resources) DeepCopyInto

func (in *Resources) DeepCopyInto(out *Resources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Resources) GetEndpointSlicesForBackend

func (r *Resources) GetEndpointSlicesForBackend(svcNamespace, svcName, backendKind string) []*discoveryv1.EndpointSlice

TODO: this method is only used in testfile. SHOULD be removed after refactoring the gatewayapi package structure to resolve the cyclic import issue.

func (*Resources) GetEnvoyProxy

func (r *Resources) GetEnvoyProxy(namespace, name string) *egv1a1.EnvoyProxy

func (*Resources) GetServiceByLabels added in v1.5.0

func (r *Resources) GetServiceByLabels(labels map[string]string, namespace string) *corev1.Service

GetServiceByLabels returns the Service matching the given labels and namespace target.

func (*Resources) Sort added in v1.5.0

func (r *Resources) Sort()

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator is a local/offline Kubernetes resources validator.

func GetDefaultValidator added in v1.5.0

func GetDefaultValidator() *Validator

func (*Validator) Validate

func (v *Validator) Validate(content []byte) error

Validate validates one Kubernetes resource.

type XdsIRMap

type XdsIRMap map[string]*ir.Xds

Jump to

Keyboard shortcuts

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