Documentation ¶
Index ¶
- Constants
- Variables
- func BothNilOrEqual[T comparable](one, two *T) bool
- func ConvertMapValuesToSlice[T comparable, U any](vs map[T]U) []U
- func ConvertSliceFunc[T any, U any](vs []T, fn func(T) U) []U
- func ConvertSliceFuncIf[T any, U any](vs []T, fn func(T) (U, bool)) []U
- func DefaultOrEqual(v, fallback, check string) bool
- func DerefAll[T any](vs []*T) []T
- func DerefConvertFunc[T any, U any](v *T, fn func(T) U) U
- func DerefEqual[T ~string](v *T, check string) bool
- func DerefIntOr[T ~int | ~int32, U ~int](v *T, val U) int
- func DerefLookup[T comparable, U any](v *T, lookup map[T]U) U
- func DerefStringOr[T ~string, U ~string](v *T, val U) string
- func EmptyOrEqual(v, check string) bool
- func EnsureFinalizer(object client.Object) bool
- func EntriesEqual(a, b api.ConfigEntry) bool
- func EntryToNamespacedName(entry api.ConfigEntry) types.NamespacedName
- func EntryToReference(entry api.ConfigEntry) api.ResourceReference
- func Filter[T any](vs []T, filterFn func(T) bool) []T
- func FilterIsExternalFilter(filter gwv1beta1.HTTPRouteFilter) bool
- func Flatten[T any](vs [][]T) []T
- func GatewayFromPod(pod *corev1.Pod) (types.NamespacedName, bool)
- func GatewayPolicyStatusesEqual(a, b v1alpha1.GatewayPolicyStatus) bool
- func GatewayStatusesEqual(a, b gwv1beta1.GatewayStatus) bool
- func IndexedNamespacedNameWithDefault[T ~string, U ~string, V ~string](t T, u *U, v V) types.NamespacedName
- func LabelsForGateway(gateway *gwv1beta1.Gateway) map[string]string
- func NilOrEqual[T ~string](v *T, check string) bool
- func NormalizeEmptyMetadataString(metaString string) string
- func NormalizeMeta(ref api.ResourceReference) api.ResourceReference
- func ObjectsToReconcileRequests[T metav1.Object](objects []T) []reconcile.Request
- func ParentRefs(group, kind, namespace string, refs []gwv1beta1.ParentReference) []types.NamespacedName
- func ParentsEqual(one, two gwv1beta1.ParentReference) bool
- func ParseCertificateData(secret corev1.Secret) (cert string, privateKey string, err error)
- func PointerTo[T any](v T) *T
- func RemoveFinalizer(object client.Object) bool
- func ResourceReferenceWithDefault[T ~string, U ~string, V ~string](kind string, name T, section string, u *U, v V, partition string) api.ResourceReference
- func RouteAuthFilterStatusesEqual(a, b v1alpha1.RouteAuthFilterStatus) bool
- func StringLikeSlice[T ~string](vs []T) []string
- func ToContainerPort(portNumber gwv1beta1.PortNumber, mapPrivilegedContainerPorts int32) int
- func ValidateKeyLength(privateKey string) error
- func ValueOr[T ~string](v *T, fallback string) string
- type ConsulConfig
- type ConsulUpdateOperation
- type HelmConfig
- type KubernetesUpdates
- type MetricsConfig
- type ReferenceMap
- func (r *ReferenceMap) Delete(ref api.ResourceReference)
- func (r *ReferenceMap) Diff(other *ReferenceMap) []api.ConfigEntry
- func (r *ReferenceMap) Entries() []api.ConfigEntry
- func (r *ReferenceMap) Get(ref api.ResourceReference) api.ConfigEntry
- func (r *ReferenceMap) IDs() []api.ResourceReference
- func (r *ReferenceMap) Set(ref api.ResourceReference, v api.ConfigEntry)
- type ReferenceSet
- type ReferenceValidator
- type ResourceMap
- func (s *ResourceMap) AddExternalFilter(filter client.Object)
- func (s *ResourceMap) AddGatewayPolicy(gatewayPolicy *v1alpha1.GatewayPolicy) *v1alpha1.GatewayPolicy
- func (s *ResourceMap) AddJWTProvider(provider *v1alpha1.JWTProvider)
- func (s *ResourceMap) AddMeshService(service v1alpha1.MeshService)
- func (s *ResourceMap) AddService(id types.NamespacedName, name string)
- func (s *ResourceMap) CanGCHTTPRouteOnUnbind(id api.ResourceReference) bool
- func (s *ResourceMap) CanGCTCPRouteOnUnbind(id api.ResourceReference) bool
- func (s *ResourceMap) Certificate(key types.NamespacedName) *corev1.Secret
- func (s *ResourceMap) ExternalFilterExists(filterRef gwv1beta1.LocalObjectReference, namespace string) bool
- func (s *ResourceMap) GatewayCanReferenceSecret(gateway gwv1beta1.Gateway, ref gwv1beta1.SecretObjectReference) bool
- func (s *ResourceMap) GetExternalAuthFilters() []*v1alpha1.RouteAuthFilter
- func (s *ResourceMap) GetExternalFilter(filterRef gwv1beta1.LocalObjectReference, namespace string) (client.Object, bool)
- func (s *ResourceMap) GetJWTProviderForGatewayJWTProvider(provider *v1alpha1.GatewayJWTProvider) (*v1alpha1.JWTProvider, bool)
- func (s *ResourceMap) GetPolicyForGatewayListener(gateway gwv1beta1.Gateway, gatewayListener gwv1beta1.Listener) (*v1alpha1.GatewayPolicy, bool)
- func (s *ResourceMap) HTTPRouteCanReferenceBackend(route gwv1beta1.HTTPRoute, ref gwv1beta1.BackendRef) bool
- func (s *ResourceMap) HasMeshService(id types.NamespacedName) bool
- func (s *ResourceMap) HasService(id types.NamespacedName) bool
- func (s *ResourceMap) MeshService(id types.NamespacedName) api.ResourceReference
- func (s *ResourceMap) MutateHTTPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), ...)
- func (s *ResourceMap) MutateTCPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), ...)
- func (s *ResourceMap) Mutations() []*ConsulUpdateOperation
- func (s *ResourceMap) ReferenceCountCertificate(secret corev1.Secret)
- func (s *ResourceMap) ReferenceCountConsulCertificate(cert api.FileSystemCertificateConfigEntry)
- func (s *ResourceMap) ReferenceCountConsulHTTPRoute(route api.HTTPRouteConfigEntry)
- func (s *ResourceMap) ReferenceCountConsulTCPRoute(route api.TCPRouteConfigEntry)
- func (s *ResourceMap) ReferenceCountGateway(gateway gwv1beta1.Gateway)
- func (s *ResourceMap) ReferenceCountHTTPRoute(route gwv1beta1.HTTPRoute)
- func (s *ResourceMap) ReferenceCountTCPRoute(route gwv1alpha2.TCPRoute)
- func (s *ResourceMap) ResourcesToGC(key types.NamespacedName) []api.ResourceReference
- func (s *ResourceMap) Service(id types.NamespacedName) api.ResourceReference
- func (s *ResourceMap) TCPRouteCanReferenceBackend(route gwv1alpha2.TCPRoute, ref gwv1beta1.BackendRef) bool
- func (s *ResourceMap) TranslateAndMutateHTTPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), ...)
- func (s *ResourceMap) TranslateAndMutateTCPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), ...)
- func (s *ResourceMap) TranslateFileSystemCertificate(key types.NamespacedName)
- type ResourceTranslator
- func (t ResourceTranslator) ConfigEntryReference(kind string, id types.NamespacedName) api.ResourceReference
- func (t ResourceTranslator) Namespace(namespace string) string
- func (t ResourceTranslator) NonNormalizedConfigEntryReference(kind string, id types.NamespacedName) api.ResourceReference
- func (t ResourceTranslator) NormalizedResourceReference(kind, namespace string, ref api.ResourceReference) api.ResourceReference
- func (t ResourceTranslator) ToAPIGateway(gateway gwv1beta1.Gateway, resources *ResourceMap, ...) *api.APIGatewayConfigEntry
- func (t ResourceTranslator) ToFileSystemCertificate(secret corev1.Secret) *api.FileSystemCertificateConfigEntry
- func (t ResourceTranslator) ToHTTPRoute(route gwv1beta1.HTTPRoute, resources *ResourceMap) *api.HTTPRouteConfigEntry
- func (t ResourceTranslator) ToTCPRoute(route gwv1alpha2.TCPRoute, resources *ResourceMap) *api.TCPRouteConfigEntry
Constants ¶
const ( GatewayClassControllerName = "consul.hashicorp.com/gateway-controller" AnnotationGatewayClassConfig = "consul.hashicorp.com/gateway-class-config" // The following annotation keys are used in the v1beta1.GatewayTLSConfig's Options on a v1beta1.Listener. TLSCipherSuitesAnnotationKey = "api-gateway.consul.hashicorp.com/tls_cipher_suites" TLSMaxVersionAnnotationKey = "api-gateway.consul.hashicorp.com/tls_max_version" TLSMinVersionAnnotationKey = "api-gateway.consul.hashicorp.com/tls_min_version" )
const ( // GatewayFinalizer is the finalizer we add to any gateway object. GatewayFinalizer = "gateway-finalizer.consul.hashicorp.com" // NamespaceNameLabel represents that label added automatically to namespaces in newer Kubernetes clusters. NamespaceNameLabel = "kubernetes.io/metadata.name" )
const (
ManagedLabel = "gateway.consul.hashicorp.com/managed"
)
const MinKeyLength = 2048
Envoy will silently reject any keys that are less than 2048 bytes long https://github.com/envoyproxy/envoy/blob/main/source/extensions/transport_sockets/tls/context_impl.cc#L238
Variables ¶
var ( // constants extracted for ease of use. KindGateway = "Gateway" KindSecret = "Secret" KindService = "Service" BetaGroup = gwv1beta1.GroupVersion.Group )
Functions ¶
func BothNilOrEqual ¶
func BothNilOrEqual[T comparable](one, two *T) bool
BothNilOrEqual is used to determine if two pointers to comparable object are either nil or both point to the same value.
func ConvertMapValuesToSlice ¶
func ConvertMapValuesToSlice[T comparable, U any](vs map[T]U) []U
func ConvertSliceFunc ¶
func ConvertSliceFuncIf ¶
func DefaultOrEqual ¶
func DerefConvertFunc ¶
func DerefEqual ¶
func DerefLookup ¶
func DerefLookup[T comparable, U any](v *T, lookup map[T]U) U
func DerefStringOr ¶
func EmptyOrEqual ¶
func EnsureFinalizer ¶
EnsureFinalizer ensures that our finalizer is set on an object returning whether or not it modified the object.
func EntriesEqual ¶
func EntriesEqual(a, b api.ConfigEntry) bool
func EntryToNamespacedName ¶
func EntryToNamespacedName(entry api.ConfigEntry) types.NamespacedName
func EntryToReference ¶
func EntryToReference(entry api.ConfigEntry) api.ResourceReference
func FilterIsExternalFilter ¶
func FilterIsExternalFilter(filter gwv1beta1.HTTPRouteFilter) bool
func GatewayFromPod ¶
func GatewayFromPod(pod *corev1.Pod) (types.NamespacedName, bool)
func GatewayPolicyStatusesEqual ¶
func GatewayPolicyStatusesEqual(a, b v1alpha1.GatewayPolicyStatus) bool
func GatewayStatusesEqual ¶
func GatewayStatusesEqual(a, b gwv1beta1.GatewayStatus) bool
func IndexedNamespacedNameWithDefault ¶
func IndexedNamespacedNameWithDefault[T ~string, U ~string, V ~string](t T, u *U, v V) types.NamespacedName
func LabelsForGateway ¶
LabelsForGateway formats the default labels that appear on objects managed by the controllers.
func NilOrEqual ¶
func NormalizeMeta ¶
func NormalizeMeta(ref api.ResourceReference) api.ResourceReference
func ObjectsToReconcileRequests ¶
ObjectsToReconcileRequests takes a list of objects and returns a list of reconcile Requests.
func ParentRefs ¶
func ParentRefs(group, kind, namespace string, refs []gwv1beta1.ParentReference) []types.NamespacedName
ParentRefs takes a list of ParentReference objects and returns a list of NamespacedName objects.
func ParentsEqual ¶
func ParentsEqual(one, two gwv1beta1.ParentReference) bool
ParentsEqual checks for equality between two parent references.
func ParseCertificateData ¶
func PointerTo ¶
func PointerTo[T any](v T) *T
PointerTo is a convenience method for taking a pointer of an object without having to declare an intermediate variable. It's also useful for making sure we don't accidentally take the pointer of a range variable directly.
func RemoveFinalizer ¶
RemoveFinalizer ensures that our finalizer is absent from an object returning whether or not it modified the object.
func RouteAuthFilterStatusesEqual ¶
func RouteAuthFilterStatusesEqual(a, b v1alpha1.RouteAuthFilterStatus) bool
func StringLikeSlice ¶
func ToContainerPort ¶
func ToContainerPort(portNumber gwv1beta1.PortNumber, mapPrivilegedContainerPorts int32) int
func ValidateKeyLength ¶
ValidateKeyLength ensures that the key length for a certificate is of a valid length for envoy dependent on if consul is running in FIPS mode or not.
Types ¶
type ConsulConfig ¶
type ConsulUpdateOperation ¶
type ConsulUpdateOperation struct { // Entry is the ConfigEntry to write to Consul. Entry api.ConfigEntry // OnUpdate is an optional callback to fire after running // the Consul update operation. If specified, then no more // error handling occurs after the function is called, otherwise // normal error handling logic applies. OnUpdate func(err error) }
ConsulUpdateOperation is an operation representing an update in Consul.
type HelmConfig ¶
type HelmConfig struct { // ImageDataplane is the Consul Dataplane image to use in gateway deployments. ImageDataplane string // ImageConsulK8S is the Consul Kubernetes Control Plane image to use in gateway deployments. ImageConsulK8S string // ImagePullSecrets reference one or more Secret(s) that contain the credentials to pull images from private image repos. ImagePullSecrets []v1.LocalObjectReference // GlobalImagePullPolicy is the pull policy to use for all images used in gateway deployments. GlobalImagePullPolicy string ConsulDestinationNamespace string NamespaceMirroringPrefix string EnableNamespaces bool EnableNamespaceMirroring bool AuthMethod string // LogLevel is the logging level of the deployed Consul Dataplanes. LogLevel string ConsulPartition string LogJSON bool TLSEnabled bool PeeringEnabled bool ConsulTLSServerName string ConsulCACert string ConsulConfig ConsulConfig // EnableOpenShift indicates whether we're deploying into an OpenShift environment // and should create SecurityContextConstraints. EnableOpenShift bool // MapPrivilegedServicePorts is the value which Consul will add to privileged container port values (ports < 1024) // defined on a Gateway. MapPrivilegedServicePorts int // EnableGatewayMetrics indicates whether or not gateway metrics should be enabled // by default on a deployed gateway, passed from the helm chart via command-line flags to our controller. EnableGatewayMetrics bool // The default path to use for scraping prometheus metrics, passed from the helm chart via command-line flags to our controller. DefaultPrometheusScrapePath string // The default port to use for scraping prometheus metrics, passed from the helm chart via command-line flags to our controller. DefaultPrometheusScrapePort string InitContainerResources *v1.ResourceRequirements }
HelmConfig is the configuration of gateways that comes in from the user's Helm values. This is a combination of the apiGateway stanza and other settings that impact api-gateways.
func (HelmConfig) Normalize ¶
func (h HelmConfig) Normalize() HelmConfig
type KubernetesUpdates ¶
type KubernetesUpdates struct {
// contains filtered or unexported fields
}
KubernetesUpdates holds all update operations (including status) that need to be synced to Kubernetes. So long as you're modifying the same pointer object passed in to its Add function, this de-duplicates any calls to Add, in order for us to Add any previously unseen entires, but ignore them if they've already been added.
func NewKubernetesUpdates ¶
func NewKubernetesUpdates() *KubernetesUpdates
func (*KubernetesUpdates) Add ¶
func (k *KubernetesUpdates) Add(object client.Object)
func (*KubernetesUpdates) Operations ¶
func (k *KubernetesUpdates) Operations() []client.Object
type MetricsConfig ¶
func GatewayMetricsConfig ¶
func GatewayMetricsConfig(gateway gwv1beta1.Gateway, gcc v1alpha1.GatewayClassConfig, config HelmConfig) MetricsConfig
type ReferenceMap ¶
type ReferenceMap struct {
// contains filtered or unexported fields
}
ReferenceMap is contains a map of config entries stored by their normalized resource references (with empty string for namespaces and partitions stored as "default").
func NewReferenceMap ¶
func NewReferenceMap() *ReferenceMap
NewReferenceMap constructs a reference map.
func (*ReferenceMap) Delete ¶
func (r *ReferenceMap) Delete(ref api.ResourceReference)
Delete deletes an entry stored in the reference map.
func (*ReferenceMap) Diff ¶
func (r *ReferenceMap) Diff(other *ReferenceMap) []api.ConfigEntry
Diff calculates the difference between the stored entries in two reference maps.
func (*ReferenceMap) Entries ¶
func (r *ReferenceMap) Entries() []api.ConfigEntry
Entries returns a list of entries stored in the reference map.
func (*ReferenceMap) Get ¶
func (r *ReferenceMap) Get(ref api.ResourceReference) api.ConfigEntry
Get returns an entry from the reference map.
func (*ReferenceMap) IDs ¶
func (r *ReferenceMap) IDs() []api.ResourceReference
func (*ReferenceMap) Set ¶
func (r *ReferenceMap) Set(ref api.ResourceReference, v api.ConfigEntry)
Set adds an entry to the reference map.
type ReferenceSet ¶
type ReferenceSet struct {
// contains filtered or unexported fields
}
ReferenceSet is a set of stored references.
func NewReferenceSet ¶
func NewReferenceSet() *ReferenceSet
NewReferenceSet constructs a new reference set.
func (*ReferenceSet) Contains ¶
func (r *ReferenceSet) Contains(ref api.ResourceReference) bool
Contains checks for the inclusion of a reference in the set.
func (*ReferenceSet) IDs ¶
func (r *ReferenceSet) IDs() []api.ResourceReference
func (*ReferenceSet) Mark ¶
func (r *ReferenceSet) Mark(ref api.ResourceReference)
Mark adds a reference to the reference set.
func (*ReferenceSet) Remove ¶
func (r *ReferenceSet) Remove(ref api.ResourceReference)
Remove drops a reference from the set.
type ReferenceValidator ¶
type ReferenceValidator interface { GatewayCanReferenceSecret(gateway gwv1beta1.Gateway, secretRef gwv1beta1.SecretObjectReference) bool HTTPRouteCanReferenceBackend(httproute gwv1beta1.HTTPRoute, backendRef gwv1beta1.BackendRef) bool TCPRouteCanReferenceBackend(tcpRoute gwv1alpha2.TCPRoute, backendRef gwv1beta1.BackendRef) bool }
type ResourceMap ¶
type ResourceMap struct {
// contains filtered or unexported fields
}
func NewResourceMap ¶
func NewResourceMap(translator ResourceTranslator, validator ReferenceValidator, logger logr.Logger) *ResourceMap
func (*ResourceMap) AddExternalFilter ¶
func (s *ResourceMap) AddExternalFilter(filter client.Object)
func (*ResourceMap) AddGatewayPolicy ¶
func (s *ResourceMap) AddGatewayPolicy(gatewayPolicy *v1alpha1.GatewayPolicy) *v1alpha1.GatewayPolicy
func (*ResourceMap) AddJWTProvider ¶
func (s *ResourceMap) AddJWTProvider(provider *v1alpha1.JWTProvider)
func (*ResourceMap) AddMeshService ¶
func (s *ResourceMap) AddMeshService(service v1alpha1.MeshService)
func (*ResourceMap) AddService ¶
func (s *ResourceMap) AddService(id types.NamespacedName, name string)
func (*ResourceMap) CanGCHTTPRouteOnUnbind ¶
func (s *ResourceMap) CanGCHTTPRouteOnUnbind(id api.ResourceReference) bool
func (*ResourceMap) CanGCTCPRouteOnUnbind ¶
func (s *ResourceMap) CanGCTCPRouteOnUnbind(id api.ResourceReference) bool
func (*ResourceMap) Certificate ¶
func (s *ResourceMap) Certificate(key types.NamespacedName) *corev1.Secret
func (*ResourceMap) ExternalFilterExists ¶
func (s *ResourceMap) ExternalFilterExists(filterRef gwv1beta1.LocalObjectReference, namespace string) bool
func (*ResourceMap) GatewayCanReferenceSecret ¶
func (s *ResourceMap) GatewayCanReferenceSecret(gateway gwv1beta1.Gateway, ref gwv1beta1.SecretObjectReference) bool
func (*ResourceMap) GetExternalAuthFilters ¶
func (s *ResourceMap) GetExternalAuthFilters() []*v1alpha1.RouteAuthFilter
func (*ResourceMap) GetExternalFilter ¶
func (s *ResourceMap) GetExternalFilter(filterRef gwv1beta1.LocalObjectReference, namespace string) (client.Object, bool)
func (*ResourceMap) GetJWTProviderForGatewayJWTProvider ¶
func (s *ResourceMap) GetJWTProviderForGatewayJWTProvider(provider *v1alpha1.GatewayJWTProvider) (*v1alpha1.JWTProvider, bool)
func (*ResourceMap) GetPolicyForGatewayListener ¶
func (s *ResourceMap) GetPolicyForGatewayListener(gateway gwv1beta1.Gateway, gatewayListener gwv1beta1.Listener) (*v1alpha1.GatewayPolicy, bool)
func (*ResourceMap) HTTPRouteCanReferenceBackend ¶
func (s *ResourceMap) HTTPRouteCanReferenceBackend(route gwv1beta1.HTTPRoute, ref gwv1beta1.BackendRef) bool
func (*ResourceMap) HasMeshService ¶
func (s *ResourceMap) HasMeshService(id types.NamespacedName) bool
func (*ResourceMap) HasService ¶
func (s *ResourceMap) HasService(id types.NamespacedName) bool
func (*ResourceMap) MeshService ¶
func (s *ResourceMap) MeshService(id types.NamespacedName) api.ResourceReference
func (*ResourceMap) MutateHTTPRoute ¶
func (s *ResourceMap) MutateHTTPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), mutateFn func(api.HTTPRouteConfigEntry) api.HTTPRouteConfigEntry)
func (*ResourceMap) MutateTCPRoute ¶
func (s *ResourceMap) MutateTCPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), mutateFn func(api.TCPRouteConfigEntry) api.TCPRouteConfigEntry)
func (*ResourceMap) Mutations ¶
func (s *ResourceMap) Mutations() []*ConsulUpdateOperation
func (*ResourceMap) ReferenceCountCertificate ¶
func (s *ResourceMap) ReferenceCountCertificate(secret corev1.Secret)
func (*ResourceMap) ReferenceCountConsulCertificate ¶
func (s *ResourceMap) ReferenceCountConsulCertificate(cert api.FileSystemCertificateConfigEntry)
func (*ResourceMap) ReferenceCountConsulHTTPRoute ¶
func (s *ResourceMap) ReferenceCountConsulHTTPRoute(route api.HTTPRouteConfigEntry)
func (*ResourceMap) ReferenceCountConsulTCPRoute ¶
func (s *ResourceMap) ReferenceCountConsulTCPRoute(route api.TCPRouteConfigEntry)
func (*ResourceMap) ReferenceCountGateway ¶
func (s *ResourceMap) ReferenceCountGateway(gateway gwv1beta1.Gateway)
func (*ResourceMap) ReferenceCountHTTPRoute ¶
func (s *ResourceMap) ReferenceCountHTTPRoute(route gwv1beta1.HTTPRoute)
func (*ResourceMap) ReferenceCountTCPRoute ¶
func (s *ResourceMap) ReferenceCountTCPRoute(route gwv1alpha2.TCPRoute)
func (*ResourceMap) ResourcesToGC ¶
func (s *ResourceMap) ResourcesToGC(key types.NamespacedName) []api.ResourceReference
func (*ResourceMap) Service ¶
func (s *ResourceMap) Service(id types.NamespacedName) api.ResourceReference
func (*ResourceMap) TCPRouteCanReferenceBackend ¶
func (s *ResourceMap) TCPRouteCanReferenceBackend(route gwv1alpha2.TCPRoute, ref gwv1beta1.BackendRef) bool
func (*ResourceMap) TranslateAndMutateHTTPRoute ¶
func (s *ResourceMap) TranslateAndMutateHTTPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), mutateFn func(old *api.HTTPRouteConfigEntry, new api.HTTPRouteConfigEntry) api.HTTPRouteConfigEntry)
func (*ResourceMap) TranslateAndMutateTCPRoute ¶
func (s *ResourceMap) TranslateAndMutateTCPRoute(key types.NamespacedName, onUpdate func(error, api.ConfigEntryStatus), mutateFn func(*api.TCPRouteConfigEntry, api.TCPRouteConfigEntry) api.TCPRouteConfigEntry)
func (*ResourceMap) TranslateFileSystemCertificate ¶
func (s *ResourceMap) TranslateFileSystemCertificate(key types.NamespacedName)
type ResourceTranslator ¶
type ResourceTranslator struct { EnableConsulNamespaces bool ConsulDestNamespace string EnableK8sMirroring bool MirroringPrefix string ConsulPartition string Datacenter string }
ResourceTranslator handles translating K8s resources into Consul config entries.
func (ResourceTranslator) ConfigEntryReference ¶
func (t ResourceTranslator) ConfigEntryReference(kind string, id types.NamespacedName) api.ResourceReference
func (ResourceTranslator) Namespace ¶
func (t ResourceTranslator) Namespace(namespace string) string
func (ResourceTranslator) NonNormalizedConfigEntryReference ¶
func (t ResourceTranslator) NonNormalizedConfigEntryReference(kind string, id types.NamespacedName) api.ResourceReference
func (ResourceTranslator) NormalizedResourceReference ¶
func (t ResourceTranslator) NormalizedResourceReference(kind, namespace string, ref api.ResourceReference) api.ResourceReference
func (ResourceTranslator) ToAPIGateway ¶
func (t ResourceTranslator) ToAPIGateway(gateway gwv1beta1.Gateway, resources *ResourceMap, gwcc *v1alpha1.GatewayClassConfig) *api.APIGatewayConfigEntry
ToAPIGateway translates a kuberenetes API gateway into a Consul APIGateway Config Entry.
func (ResourceTranslator) ToFileSystemCertificate ¶
func (t ResourceTranslator) ToFileSystemCertificate(secret corev1.Secret) *api.FileSystemCertificateConfigEntry
func (ResourceTranslator) ToHTTPRoute ¶
func (t ResourceTranslator) ToHTTPRoute(route gwv1beta1.HTTPRoute, resources *ResourceMap) *api.HTTPRouteConfigEntry
func (ResourceTranslator) ToTCPRoute ¶
func (t ResourceTranslator) ToTCPRoute(route gwv1alpha2.TCPRoute, resources *ResourceMap) *api.TCPRouteConfigEntry