Documentation
¶
Overview ¶
Copyright 2025 HAProxy Technologies LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2025 HAProxy Technologies LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func ConvertListenerKeyToGatewayKey(listenerKey client.ObjectKey) client.ObjectKey
- func ConvertListenerKeyToGatewayKeyAndListenerName(listenerKey client.ObjectKey) (client.ObjectKey, string, error)
- func GetBackendRefNamespacedName(backendRef gatewayv1.BackendObjectReference, route *gatewayv1.HTTPRoute) types.NamespacedName
- func GetCertificateRefNamespacedName(certRef gatewayv1.SecretObjectReference, gw *gatewayv1.Gateway) types.NamespacedName
- func GetParentRefNamespacedName(parentRef gatewayv1.ParentReference, route *gatewayv1.HTTPRoute) types.NamespacedName
- func IsFilterExtensionRefKindMergeType(extensionRef *gatewayv1.LocalObjectReference, extractGVK utils.ExtractGVK) bool
- func IsFilterExtensionRefKindSupported(extensionRef *gatewayv1.LocalObjectReference, extractGVK utils.ExtractGVK) bool
- func ListenerKey(gw *gatewayv1.Gateway, listener gatewayv1.Listener) client.ObjectKey
- func ListenerKeyFromListenerName(gw *gatewayv1.Gateway, listenerName gatewayv1.SectionName) client.ObjectKey
- func ServiceNsNameKey(route *gatewayv1.HTTPRoute, backendRef gatewayv1.BackendObjectReference) client.ObjectKey
- type AttachedRoutes
- type Builder
- func NewCertificateBuilder(controllerStore ControllerStore, storeCertOnDisk, runtimeUpdate bool, ...) Builder
- func NewGatewayBuilder(params GatewayBuilderParams) Builder
- func NewGatewayClassBuilder(params GatewayClassBuilderParams) Builder
- func NewHTTPRouteBuilder(params HTTPRouteBuilderParams) Builder
- func NewSecretBuilder(controllerStore ControllerStore) Builder
- func NewServiceBuilder(controllerStore ControllerStore) Builder
- type CertUpdates
- type CertificateBuilderImpl
- type CheckResult
- type CheckResultRoute
- type ControllerStore
- type CrtListUpdates
- type GateBuilderImpl
- type GateTree
- type Gateway
- func (g *Gateway) BuildConditions()
- func (g *Gateway) DeepCopy() *Gateway
- func (g *Gateway) GetK8sResource() *gatewayv1.Gateway
- func (g *Gateway) GetTreeStatus() *TreeUpdate[Gateway]
- func (g *Gateway) SetAsDeleted(logger *slog.Logger)
- func (g *Gateway) SetAsManaged(logger *slog.Logger, cs ControllerStore)
- func (g *Gateway) SetAsUnmanaged(logger *slog.Logger, cs ControllerStore)
- func (g *Gateway) SetAsUpserted(logger *slog.Logger, newK8sResource *gatewayv1.Gateway)
- func (g *Gateway) SetTreeStatus(treeStatus TreeUpdate[Gateway])
- type GatewayBuilderImpl
- type GatewayBuilderParams
- type GatewayClass
- func (g *GatewayClass) BuildConditions(controllerStore ControllerStore)
- func (g *GatewayClass) DeepCopy() *GatewayClass
- func (g *GatewayClass) GetCreationTimestamp() metav1.Time
- func (g *GatewayClass) GetName() string
- func (g *GatewayClass) GetTreeStatus() *TreeUpdate[GatewayClass]
- func (g *GatewayClass) ResetChecks()
- func (g *GatewayClass) SetAsDeleted(logger *slog.Logger)
- func (g *GatewayClass) SetAsManaged(logger *slog.Logger, controllerStore ControllerStore)
- func (g *GatewayClass) SetAsUnmanaged(logger *slog.Logger, controllerStore ControllerStore)
- func (g *GatewayClass) SetAsUpserted(logger *slog.Logger, newK8sResource *gatewayv1.GatewayClass)
- func (g *GatewayClass) SetTreeStatus(treeStatus TreeUpdate[GatewayClass])
- type GatewayClassBuilderImpl
- type GatewayClassBuilderParams
- type HTTPRoute
- func (r *HTTPRoute) BuildConditions()
- func (r *HTTPRoute) DeepCopy() *HTTPRoute
- func (r *HTTPRoute) GetTreeStatus() *TreeUpdate[HTTPRoute]
- func (r *HTTPRoute) ResetChecks()
- func (r *HTTPRoute) SetAsDeleted(logger *slog.Logger)
- func (r *HTTPRoute) SetAsUpserted(logger *slog.Logger, newK8sResource *gatewayv1.HTTPRoute)
- func (r *HTTPRoute) SetTreeStatus(treeStatus TreeUpdate[HTTPRoute])
- type HTTPRouteBuilderImpl
- type HTTPRouteBuilderParams
- type HTTPRouteRule
- type HugConfBuilderImpl
- type HugConfBuilderParams
- type HugGateParamsRefChecker
- type InstalledVersions
- type InstalledVersionsBuilderImpl
- type Listener
- type Namespace
- type ReferenceManager
- type ReferencedObjects
- type RouteGroupKind
- type Secret
- func (s *Secret) DeepCopy() *Secret
- func (s *Secret) GetTreeStatus() *TreeUpdate[Secret]
- func (s *Secret) SetAsDeleted(logger *slog.Logger)
- func (s *Secret) SetAsManaged(logger *slog.Logger, cs ControllerStore)
- func (s *Secret) SetAsUpserted(logger *slog.Logger, newK8sResource *v1.Secret)
- func (s *Secret) SetTreeStatus(treeStatus TreeUpdate[Secret])
- type SecretBuilderImpl
- type Service
- func (s *Service) DeepCopy() *Service
- func (s *Service) GetTreeStatus() *TreeUpdate[Service]
- func (s *Service) SetAsDeleted(logger *slog.Logger)
- func (s *Service) SetAsManaged(logger *slog.Logger, cs ControllerStore)
- func (s *Service) SetAsUpserted(logger *slog.Logger, newK8sResource *v1.Service)
- func (s *Service) SetTreeStatus(treeStatus TreeUpdate[Service])
- type ServiceBuilderImpl
- type SupportedVersions
- type TreeObject
- type TreeResource
- type TreeResourcePointer
- type TreeUpdate
Constants ¶
This section is empty.
Variables ¶
var ( SupportedGatewayAPIBundleVersion = SupportedVersions{"v1.2", "v1.3"} SupportedParametersRefKind = gatewayv1.Kind("HugGate") SupportedParametersRefGroup = gatewayv1.Group("gate.v3.haproxy.org") )
Functions ¶
func ConvertListenerKeyToGatewayKey ¶
ConvertListenerKeyToGatewayKey converts a listener key back to a gateway key. It assumes the listener key is in the format "gateway-name_listener-name", built by the previous ListenerKey function. For a listener key with namespace "ns" and name "my-gateway_https", it returns a gateway key with namespace "ns" and name "my-gateway".
func ConvertListenerKeyToGatewayKeyAndListenerName ¶
func ConvertListenerKeyToGatewayKeyAndListenerName(listenerKey client.ObjectKey) (client.ObjectKey, string, error)
ConvertListenerKeyToGatewayKeyAndListenerName converts a listener key back to a gateway key and listener name. It assumes the listener key is in the format "gateway-name_listener-name", built by the ListenerKey function. For a listener key with namespace "ns" and name "my-gateway_https", it returns a gateway key with namespace "ns" and name "my-gateway", the listener name "https", and no error. If the format is invalid, it returns an error.
func GetBackendRefNamespacedName ¶
func GetBackendRefNamespacedName(backendRef gatewayv1.BackendObjectReference, route *gatewayv1.HTTPRoute) types.NamespacedName
GetBackendRefNamespacedName returns the namespaced name for a backendref reference, using the Route's namespace as a default if the reference does not specify one.
func GetCertificateRefNamespacedName ¶
func GetCertificateRefNamespacedName(certRef gatewayv1.SecretObjectReference, gw *gatewayv1.Gateway) types.NamespacedName
GetCertificateRefNamespacedName returns the namespaced name for a certificate reference, using the Gateway's namespace as a default if the reference does not specify one.
func GetParentRefNamespacedName ¶
func GetParentRefNamespacedName(parentRef gatewayv1.ParentReference, route *gatewayv1.HTTPRoute) types.NamespacedName
GetParentRefNamespacedName returns the namespaced name for a parentRef reference, using the Route's namespace as a default if the reference does not specify one.
func IsFilterExtensionRefKindMergeType ¶
func IsFilterExtensionRefKindMergeType(extensionRef *gatewayv1.LocalObjectReference, extractGVK utils.ExtractGVK) bool
func IsFilterExtensionRefKindSupported ¶
func IsFilterExtensionRefKindSupported(extensionRef *gatewayv1.LocalObjectReference, extractGVK utils.ExtractGVK) bool
IsFilterExtensionRefKindSupported checks if the provided filter ExtensionRef has a supported Group and Kind. It only supports `v3.Backend` resources.
func ListenerKey ¶
ListenerKey returns the Listener owner key appending the listener name to it For Gateway ns/gateway, if the Listener name is "https", will return ns/gateway_https = Listener Key
func ServiceNsNameKey ¶
func ServiceNsNameKey(route *gatewayv1.HTTPRoute, backendRef gatewayv1.BackendObjectReference) client.ObjectKey
ServiceNsNameKey returns the service Ns/Name If the backendRef namespace is empty or nil, fills with the Route Namesapce
Types ¶
type AttachedRoutes ¶
type AttachedRoutes map[types.NamespacedName]struct{} // map[routeKey]
AttachedRoutes is a map from a route's NamespacedName to a placeholder struct.
func (AttachedRoutes) MarshalJSON ¶
func (m AttachedRoutes) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for AttachedRoutes.
func (*AttachedRoutes) UnmarshalJSON ¶
func (m *AttachedRoutes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for AttachedRoutes.
type Builder ¶
type Builder interface {
ComputeTreeUpdates()
CleanTreeUpdates()
}
func NewCertificateBuilder ¶
func NewCertificateBuilder(controllerStore ControllerStore, storeCertOnDisk, runtimeUpdate bool, certStorage storage.CertificateStorage) Builder
func NewGatewayBuilder ¶
func NewGatewayBuilder(params GatewayBuilderParams) Builder
func NewGatewayClassBuilder ¶
func NewGatewayClassBuilder(params GatewayClassBuilderParams) Builder
func NewHTTPRouteBuilder ¶
func NewHTTPRouteBuilder(params HTTPRouteBuilderParams) Builder
func NewSecretBuilder ¶
func NewSecretBuilder(controllerStore ControllerStore) Builder
func NewServiceBuilder ¶
func NewServiceBuilder(controllerStore ControllerStore) Builder
type CertUpdates ¶
type CertUpdates struct {
Created map[string]certificate.CertificateData
Updated map[string]certificate.CertificateData
Deleted map[string]certificate.CertificateData
}
type CertificateBuilderImpl ¶
type CertificateBuilderImpl struct {
ControllerStore
// contains filtered or unexported fields
}
func (*CertificateBuilderImpl) CleanTreeUpdates ¶
func (*CertificateBuilderImpl) CleanTreeUpdates()
func (*CertificateBuilderImpl) ComputeTreeUpdates ¶
func (b *CertificateBuilderImpl) ComputeTreeUpdates()
type CheckResult ¶
type CheckResult struct {
Conditions generic.Conditions
// If Valid = true, then Conditions should be empty
// If Valid = false:
// - Conditions are set if there is an invalid check
// - Conditions is empty if the check does not make sense (for example no listener status for an invalid Gateway)
Valid bool
}
type CheckResultRoute ¶
type CheckResultRoute struct {
Conditions rc.RouteConditions
// If Valid = true, then Conditions should be empty
// If Valid = false:
// - Conditions are set if there is an invalid check
// - Conditions is empty if the check does not make sense (for example no listener status for an invalid Gateway)
Valid bool
}
type ControllerStore ¶
type ControllerStore struct {
ClusterStore *store.ClusterStore
GateTree *GateTree
UnmanagedGateTree *GateTree
ReferencedObjects *ReferencedObjects
// A Map of installed GwApi CRDs versions
InstalledGwAPIVersions *InstalledVersions
Logger *slog.Logger
ExtractGVK utils.ExtractGVK
CertUpdates *CertUpdates
CrtListUpdates *CrtListUpdates
// from config
ControllerName string
}
func (*ControllerStore) CheckGatewayClassExists ¶
func (b *ControllerStore) CheckGatewayClassExists(gwcName string) bool
func (*ControllerStore) CleanInstalledVersionsUpdates ¶
func (b *ControllerStore) CleanInstalledVersionsUpdates()
func (*ControllerStore) ResetCertificateUpdates ¶
func (b *ControllerStore) ResetCertificateUpdates()
func (*ControllerStore) ResetCrtListUpdates ¶
func (b *ControllerStore) ResetCrtListUpdates()
type CrtListUpdates ¶
type CrtListUpdates struct {
Created map[string]certificate.CrtListData
Updated map[string]certificate.CrtListData
Deleted map[string]certificate.CrtListData
}
type GateBuilderImpl ¶
type GateBuilderImpl struct {
ControllerStore
}
func NewGateBuilder ¶
func NewGateBuilder(params ControllerStore) *GateBuilderImpl
func (*GateBuilderImpl) BuildStatus ¶
func (*GateBuilderImpl) BuildStatus()
type GateTree ¶
type GateTree struct {
// GatewayClasses holds the GatewayClasses resource that are accepted and ignored
GatewayClasses map[types.NamespacedName]*GatewayClass
Gateways map[types.NamespacedName]*Gateway
Secrets map[types.NamespacedName]*Secret
HTTPRoutes map[types.NamespacedName]*HTTPRoute
Services map[types.NamespacedName]*Service
}
GateTree is a Graph-like representation of Gateway API resources.
func NewGateTree ¶
func NewGateTree() *GateTree
type Gateway ¶
type Gateway struct {
// K8sResource is the source resource.
K8sResource *gatewayv1.Gateway
// Conditions include Conditions for the Gateway.
// HugGate is a merge between the ParamsRef from GatewayClass and the one from Gateway
// If it is invalid at GatewayClass level, it is ignored and overridden by the one at Gateway level.
HugGate *v3.HugGate
// Final Conditions
Conditions generic.Conditions
// Listeners include the listeners of the Gateway.
Listeners map[string]*Listener // map[listenerName]
// TreeStatus
TreeStatus TreeUpdate[Gateway]
// Management Checks
CheckParamsRef CheckResult
CheckValidGatewayClass CheckResult
// Additional checks
CheckConflict CheckResult
// Valid shows whether the Gateway is valid.
Valid bool
}
Gateway represents the Gateway resource.
func NewGateway ¶
func (*Gateway) BuildConditions ¶
func (g *Gateway) BuildConditions()
func (*Gateway) GetK8sResource ¶
func (*Gateway) GetTreeStatus ¶
func (g *Gateway) GetTreeStatus() *TreeUpdate[Gateway]
GetTreeStatus returns the TreeStatus of the Gateway.
func (*Gateway) SetAsDeleted ¶
func (*Gateway) SetAsManaged ¶
func (g *Gateway) SetAsManaged(logger *slog.Logger, cs ControllerStore)
func (*Gateway) SetAsUnmanaged ¶
func (g *Gateway) SetAsUnmanaged(logger *slog.Logger, cs ControllerStore)
func (*Gateway) SetAsUpserted ¶
func (*Gateway) SetTreeStatus ¶
func (g *Gateway) SetTreeStatus(treeStatus TreeUpdate[Gateway])
SetTreeStatus sets the TreeStatus of the Gateway.
type GatewayBuilderImpl ¶
type GatewayBuilderImpl struct {
ControllerStore
// contains filtered or unexported fields
}
func (*GatewayBuilderImpl) CleanTreeUpdates ¶
func (b *GatewayBuilderImpl) CleanTreeUpdates()
func (*GatewayBuilderImpl) ComputeTreeUpdates ¶
func (b *GatewayBuilderImpl) ComputeTreeUpdates()
type GatewayBuilderParams ¶
type GatewayBuilderParams struct {
storage.CertificateStorage
ControllerStore
}
type GatewayClass ¶
type GatewayClass struct {
// TreeStatus
TreeStatus TreeUpdate[GatewayClass]
// K8sResource is the source resource.
K8sResource *gatewayv1.GatewayClass
// HugGate is the linked HugGate from ParamsRef
HugGate *v3.HugGate
// Conditions include Conditions for the GatewayClass.
Conditions generic.Conditions
// CheckParamsRef shows whether the GatewayClass is valid as for ParamsRef
CheckParamsRef CheckResult
// Valid is true if the GatewayClass is Valid (versions + haproxy gate paramsRef)
Valid bool
// Managed is true if the GatewayClass is Managed (should be always true)
Managed bool
}
GatewayClass represents the GatewayClass resource.
func NewGatewayClass ¶
func NewGatewayClass(k8sObject *gatewayv1.GatewayClass) *GatewayClass
func (*GatewayClass) BuildConditions ¶
func (g *GatewayClass) BuildConditions(controllerStore ControllerStore)
func (*GatewayClass) DeepCopy ¶
func (g *GatewayClass) DeepCopy() *GatewayClass
func (*GatewayClass) GetCreationTimestamp ¶
func (g *GatewayClass) GetCreationTimestamp() metav1.Time
func (*GatewayClass) GetName ¶
func (g *GatewayClass) GetName() string
func (*GatewayClass) GetTreeStatus ¶
func (g *GatewayClass) GetTreeStatus() *TreeUpdate[GatewayClass]
GetTreeStatus returns the TreeStatus of the GatewayClass.
func (*GatewayClass) ResetChecks ¶
func (g *GatewayClass) ResetChecks()
func (*GatewayClass) SetAsDeleted ¶
func (g *GatewayClass) SetAsDeleted(logger *slog.Logger)
func (*GatewayClass) SetAsManaged ¶
func (g *GatewayClass) SetAsManaged(logger *slog.Logger, controllerStore ControllerStore)
func (*GatewayClass) SetAsUnmanaged ¶
func (g *GatewayClass) SetAsUnmanaged(logger *slog.Logger, controllerStore ControllerStore)
func (*GatewayClass) SetAsUpserted ¶
func (g *GatewayClass) SetAsUpserted(logger *slog.Logger, newK8sResource *gatewayv1.GatewayClass)
func (*GatewayClass) SetTreeStatus ¶
func (g *GatewayClass) SetTreeStatus(treeStatus TreeUpdate[GatewayClass])
SetTreeStatus sets the TreeStatus of the GatewayClass.
type GatewayClassBuilderImpl ¶
type GatewayClassBuilderImpl struct {
ControllerStore
}
func (*GatewayClassBuilderImpl) CleanTreeUpdates ¶
func (b *GatewayClassBuilderImpl) CleanTreeUpdates()
func (*GatewayClassBuilderImpl) ComputeTreeUpdates ¶
func (b *GatewayClassBuilderImpl) ComputeTreeUpdates()
type GatewayClassBuilderParams ¶
type GatewayClassBuilderParams struct {
ControllerStore
}
type HTTPRoute ¶
type HTTPRoute struct {
// K8sResource is the source resource.
K8sResource *gatewayv1.HTTPRoute
// selected listener
Listeners utils.KeyMap[gatewayv1.ParentReference, *Listener] // map[parentRef]
// Rules
Rules []*HTTPRouteRule
// Final Conditions
Conditions rc.RouteConditions
// TreeStatus
TreeStatus TreeUpdate[HTTPRoute]
ControllerName string
// Management Checks
// CheckParentRefs will only contains conditions for parents (Gateways) managed by us
CheckParentRefs CheckResultRoute
// Valid
Valid bool
}
A HTTPRoute represents a Kubernetes HTTPRoute
func (*HTTPRoute) BuildConditions ¶
func (r *HTTPRoute) BuildConditions()
func (*HTTPRoute) GetTreeStatus ¶
func (r *HTTPRoute) GetTreeStatus() *TreeUpdate[HTTPRoute]
GetTreeStatus returns the TreeStatus of the HTTPRoute.
func (*HTTPRoute) ResetChecks ¶
func (r *HTTPRoute) ResetChecks()
func (*HTTPRoute) SetAsDeleted ¶
SetAsDeleted marks the Secret as deleted in the GateTree.
func (*HTTPRoute) SetAsUpserted ¶
SetAsUpserted marks the HTTPRoute as upserted in the GateTree.
func (*HTTPRoute) SetTreeStatus ¶
func (r *HTTPRoute) SetTreeStatus(treeStatus TreeUpdate[HTTPRoute])
SetTreeStatus sets the TreeStatus of the HTTPRoute.
type HTTPRouteBuilderImpl ¶
type HTTPRouteBuilderImpl struct {
ControllerStore
// contains filtered or unexported fields
}
func (*HTTPRouteBuilderImpl) CleanTreeUpdates ¶
func (b *HTTPRouteBuilderImpl) CleanTreeUpdates()
func (*HTTPRouteBuilderImpl) ComputeTreeUpdates ¶
func (b *HTTPRouteBuilderImpl) ComputeTreeUpdates()
func (*HTTPRouteBuilderImpl) SetAsManaged ¶
func (b *HTTPRouteBuilderImpl) SetAsManaged(route *HTTPRoute)
func (*HTTPRouteBuilderImpl) SetAsUnmanaged ¶
func (b *HTTPRouteBuilderImpl) SetAsUnmanaged(route *HTTPRoute)
type HTTPRouteBuilderParams ¶
type HTTPRouteBuilderParams struct {
storage.MapsStorage
ControllerStore
RuntimeUpdate bool
}
type HTTPRouteRule ¶
type HTTPRouteRule struct {
K8sResource gatewayv1.HTTPRouteRule
// CheckBackendRef contains the result of the BackendRef checks for each BackendRef
CheckBackendRef utils.KeyMap[gatewayv1.BackendObjectReference, CheckResult]
Valid bool
}
type HugConfBuilderImpl ¶
type HugConfBuilderImpl struct {
ControllerStore
// contains filtered or unexported fields
}
func NewHugConfBuilder ¶
func NewHugConfBuilder(params HugConfBuilderParams) *HugConfBuilderImpl
func (*HugConfBuilderImpl) Build ¶
func (b *HugConfBuilderImpl) Build()
func (*HugConfBuilderImpl) BuildStatus ¶
func (*HugConfBuilderImpl) BuildStatus()
type HugConfBuilderParams ¶
type HugConfBuilderParams struct {
ControllerStore
LogCategoryFilterHandler *logging.CategoryFilterHandler
HugConfNsName types.NamespacedName
}
type HugGateParamsRefChecker ¶
type HugGateParamsRefChecker struct {
ParamRef *gatewayv1.ParametersReference
StoreHugGates map[types.NamespacedName]*v3.HugGate
}
func (*HugGateParamsRefChecker) CheckGateway ¶
func (c *HugGateParamsRefChecker) CheckGateway() (CheckResult, *v3.HugGate)
func (*HugGateParamsRefChecker) CheckGatewayClass ¶
func (c *HugGateParamsRefChecker) CheckGatewayClass() (CheckResult, *v3.HugGate)
type InstalledVersions ¶
type InstalledVersionsBuilderImpl ¶
type InstalledVersionsBuilderImpl struct {
ControllerStore
}
func NewInstalledVersionsBuilder ¶
func NewInstalledVersionsBuilder(params ControllerStore) *InstalledVersionsBuilderImpl
func (*InstalledVersionsBuilderImpl) Build ¶
func (b *InstalledVersionsBuilderImpl) Build()
type Listener ¶
type Listener struct {
// K8sResource is the source resource.
K8sResource gatewayv1.Listener
// Final Conditions
Conditions generic.Conditions
AttachedRoutes AttachedRoutes
// Owner is the gateway that this listener is connected to
Owner client.ObjectKey
// Checks results
CheckRouteGroupKind CheckResult
CheckProtocol CheckResult
CheckSecret CheckResult
CheckConflict CheckResult
// AllowedRouteKinds is the list of allowed route kinds for this listener.
AllowedRouteKinds []gatewayv1.RouteGroupKind
// Valid
Valid bool
}
func (*Listener) BuildConditions ¶
type ReferenceManager ¶
type ReferenceManager struct {
ControllerStore
}
func NewReferenceManager ¶
func NewReferenceManager(controllerStore ControllerStore) *ReferenceManager
func (*ReferenceManager) UpdateRefences ¶
func (rm *ReferenceManager) UpdateRefences()
type ReferencedObjects ¶
type ReferencedObjects struct {
// ReferencedHugGates includes the Gates that are references by GatewayClasses and Gateways
ReferencedHugGates references.ReferencedBy
// ReferencedGatewayClasses includes the GatewayClasses that are references by Gateways
ReferencedGatewayClasses references.ReferencedBy
// ReferencedSecrets includes the GatewayClasses that are references by Gateways Listeners
// Owners are Listeners
ReferencedSecrets references.ReferencedBy
PreviousReferencedSecrets references.ReferencedBy
// ReferencedGateways includes the Gateways that are referenced by HTTPRoutes
ReferencedGateways references.ReferencedBy
// ReferencedServices includes the Services that are references by HTTPRoutes
ReferencedServices references.ReferencedBy
// ReferencedBackendCRs includes the Backends CR that are referenced by HTTPRoutes
ReferencedBackendCRs references.ReferencedBy
}
func NewReferencedObjects ¶
func NewReferencedObjects(extractGVK utils.ExtractGVK) *ReferencedObjects
type RouteGroupKind ¶
type Secret ¶
type Secret struct {
// K8sResource is the source resource.
K8sResource *v1.Secret
// TreeStatus
TreeStatus TreeUpdate[Secret]
}
A Secret represents a Kubernetes Secret
func (*Secret) GetTreeStatus ¶
func (s *Secret) GetTreeStatus() *TreeUpdate[Secret]
GetTreeStatus returns the TreeStatus of the Secret.
func (*Secret) SetAsDeleted ¶
SetAsDeleted marks the Secret as deleted in the GateTree.
func (*Secret) SetAsManaged ¶
func (s *Secret) SetAsManaged(logger *slog.Logger, cs ControllerStore)
SetAsManaged moves the Secret to the managed GateTree.
func (*Secret) SetAsUpserted ¶
SetAsUpserted marks the Secret as upserted in the GateTree.
func (*Secret) SetTreeStatus ¶
func (s *Secret) SetTreeStatus(treeStatus TreeUpdate[Secret])
SetTreeStatus sets the TreeStatus of the Secret.
type SecretBuilderImpl ¶
type SecretBuilderImpl struct {
ControllerStore
}
func (*SecretBuilderImpl) CleanTreeUpdates ¶
func (b *SecretBuilderImpl) CleanTreeUpdates()
func (*SecretBuilderImpl) ComputeTreeUpdates ¶
func (b *SecretBuilderImpl) ComputeTreeUpdates()
type Service ¶
type Service struct {
// K8sResource is the source resource.
K8sResource *v1.Service
// TreeStatus
TreeStatus TreeUpdate[Service]
}
A Service represents a Kubernetes Service
func NewService ¶
NewService creates a new Service for the GateTree.
func (*Service) GetTreeStatus ¶
func (s *Service) GetTreeStatus() *TreeUpdate[Service]
GetTreeStatus returns the TreeStatus of the Service.
func (*Service) SetAsDeleted ¶
SetAsDeleted marks the Service as deleted in the GateTree.
func (*Service) SetAsManaged ¶
func (s *Service) SetAsManaged(logger *slog.Logger, cs ControllerStore)
SetAsManaged moves the Service to the managed GateTree.
func (*Service) SetAsUpserted ¶
SetAsUpserted marks the Service as upserted in the GateTree.
func (*Service) SetTreeStatus ¶
func (s *Service) SetTreeStatus(treeStatus TreeUpdate[Service])
SetTreeStatus sets the TreeStatus of the Service.
type ServiceBuilderImpl ¶
type ServiceBuilderImpl struct {
ControllerStore
}
func (*ServiceBuilderImpl) CleanTreeUpdates ¶
func (b *ServiceBuilderImpl) CleanTreeUpdates()
func (*ServiceBuilderImpl) ComputeTreeUpdates ¶
func (b *ServiceBuilderImpl) ComputeTreeUpdates()
type SupportedVersions ¶
type SupportedVersions []string
func (SupportedVersions) String ¶
func (s SupportedVersions) String() string
type TreeObject ¶
type TreeObject[T TreeResource] interface { GetTreeStatus() *TreeUpdate[T] SetTreeStatus(TreeUpdate[T]) DeepCopy() *T }
type TreeResource ¶
type TreeResource interface {
GatewayClass | Gateway | Secret | HTTPRoute | Service
}
TreeResource is a constraint that permits any of the tree's resource types.
type TreeResourcePointer ¶
type TreeResourcePointer[T TreeResource] interface { *T TreeObject[T] }
TreeResourcePointer is a constraint for a pointer to a tree resource that implements the TreeObject interface.
type TreeUpdate ¶
Source Files
¶
- HTTPRoute-builder.go
- HTTPRoute.go
- attached_routes.go
- certificate_builder.go
- controller_store.go
- gate.go
- gateway.go
- gateway_builder.go
- gateway_listener.go
- gatewayclass.go
- gatewayclass_builder.go
- hug_conf.go
- installed_versions.go
- maps.go
- namespace.go
- references_manager.go
- route-rule.go
- secret.go
- secret_builder.go
- service.go
- service_builder.go
- tree.go