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.
Index ¶
- func FilterStatusByControllerName(routeStatus gatewayv1.HTTPRouteStatus, controllerName string) gatewayv1.HTTPRouteStatus
- func FilterTLSRouteStatusByControllerName(tlsRouteStatus v1alpha2.TLSRouteStatus, controllerName string) v1alpha2.TLSRouteStatus
- func ListenerStatusesEqual(a, b []gatewayv1.ListenerStatus) bool
- func RouteStatusesEqual(a, b rc.RouteConditions) bool
- func TryPatchStatusFunc[T client.Object](param StatusUpdateParams[T]) func(ctx context.Context) (bool, error)
- func TryUpdateStatusFunc[T client.Object](param StatusUpdateParams[T]) func(ctx context.Context) (bool, error)
- type PreparedStatusUpdates
- type StatusPatcher
- type StatusUpdateParams
- type StatusUpdater
- type StatusUpdaterConf
- type StatusUpdaterImpl
- func (s *StatusUpdaterImpl) PrepareFeedbackStatusUpdate(result diffs.HaproxyConfResult, ...) PreparedStatusUpdates
- func (s *StatusUpdaterImpl) PrepareStatusUpdate(ctx context.Context, ...) PreparedStatusUpdates
- func (s *StatusUpdaterImpl) Start(ctx context.Context)
- func (s *StatusUpdaterImpl) UpdateStatus(ctx context.Context, updates PreparedStatusUpdates)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterStatusByControllerName ¶
func FilterStatusByControllerName(routeStatus gatewayv1.HTTPRouteStatus, controllerName string) gatewayv1.HTTPRouteStatus
func FilterTLSRouteStatusByControllerName ¶ added in v0.8.0
func FilterTLSRouteStatusByControllerName(tlsRouteStatus v1alpha2.TLSRouteStatus, controllerName string) v1alpha2.TLSRouteStatus
func ListenerStatusesEqual ¶
func ListenerStatusesEqual(a, b []gatewayv1.ListenerStatus) bool
func RouteStatusesEqual ¶
func RouteStatusesEqual(a, b rc.RouteConditions) bool
func TryPatchStatusFunc ¶
func TryUpdateStatusFunc ¶
Types ¶
type PreparedStatusUpdates ¶ added in v1.0.1
PreparedStatusUpdates holds status write operations prepared from a tree snapshot. It is produced synchronously by PrepareStatusUpdate and consumed asynchronously by UpdateStatus.
type StatusPatcher ¶
type StatusUpdateParams ¶
type StatusUpdateParams[T client.Object] struct { Object T StatusPatcher StatusPatcher Getter client.Client StatusUpdater client.SubResourceWriter Logger *slog.Logger NsName types.NamespacedName // contains filtered or unexported fields }
type StatusUpdater ¶
type StatusUpdater interface {
// Start launches the background goroutine that processes status writes.
// It must be called once before UpdateStatus.
Start(ctx context.Context)
// PrepareStatusUpdate must be called synchronously in the batch loop while
// the tree is still valid. It snapshots all relevant state from the tree
// nodes into self-contained write operations and returns them.
PrepareStatusUpdate(ctx context.Context,
gatewayClasses map[types.NamespacedName]*tree.GatewayClass,
gateways map[types.NamespacedName]*tree.Gateway,
httpRoutes map[types.NamespacedName]*tree.HTTPRoute,
tlsRoutes map[types.NamespacedName]*tree.TLSRoute) PreparedStatusUpdates
// UpdateStatus dispatches a previously prepared batch of writes to the
// background goroutine. Any stale pending batch is replaced by the new one.
UpdateStatus(ctx context.Context, updates PreparedStatusUpdates)
// PrepareFeedbackStatusUpdate builds status updates for gateway listener
// Programmed conditions from the tree's current listener state (already
// updated by UpdateListenerProgrammedCondition). Only gateways present in
// result.GatewayObservedGenerations are updated.
PrepareFeedbackStatusUpdate(result diffs.HaproxyConfResult, gateways map[types.NamespacedName]*tree.Gateway) PreparedStatusUpdates
}
func NewStatusUpdater ¶
func NewStatusUpdater(cfg StatusUpdaterConf) StatusUpdater
type StatusUpdaterConf ¶
type StatusUpdaterConf struct {
// contains filtered or unexported fields
}
func NewStatusUpdaterConf ¶
func NewStatusUpdaterConf( k8sClient client.Client, extractGVK utilsk8s.ExtractGVK, controllerName string, logger *slog.Logger, disableIPv4 bool, disableIPv6 bool, ) StatusUpdaterConf
type StatusUpdaterImpl ¶
type StatusUpdaterImpl struct {
// contains filtered or unexported fields
}
func (*StatusUpdaterImpl) PrepareFeedbackStatusUpdate ¶ added in v1.0.1
func (s *StatusUpdaterImpl) PrepareFeedbackStatusUpdate(result diffs.HaproxyConfResult, gateways map[types.NamespacedName]*tree.Gateway) PreparedStatusUpdates
PrepareFeedbackStatusUpdate builds a PreparedStatusUpdates from the tree's current gateway listener Programmed conditions. Only gateways present in result.GatewayObservedGenerations are included; the listener conditions must already have been updated via GateTree.UpdateListenerProgrammedCondition before this is called.
func (*StatusUpdaterImpl) PrepareStatusUpdate ¶ added in v1.0.1
func (s *StatusUpdaterImpl) PrepareStatusUpdate(ctx context.Context, gatewayClasses map[types.NamespacedName]*tree.GatewayClass, gateways map[types.NamespacedName]*tree.Gateway, httpRoutes map[types.NamespacedName]*tree.HTTPRoute, tlsRoutes map[types.NamespacedName]*tree.TLSRoute, ) PreparedStatusUpdates
PrepareStatusUpdate must be called synchronously in the batch loop while the tree is still valid. It snapshots all relevant state from the tree nodes into self-contained write operations and returns them as a PreparedStatusUpdates batch ready to be dispatched via UpdateStatus.
func (*StatusUpdaterImpl) Start ¶ added in v1.0.1
func (s *StatusUpdaterImpl) Start(ctx context.Context)
Start launches a background goroutine that drains the updates channel and executes each write using the provided context for its lifetime.
func (*StatusUpdaterImpl) UpdateStatus ¶
func (s *StatusUpdaterImpl) UpdateStatus(ctx context.Context, updates PreparedStatusUpdates)
UpdateStatus dispatches a previously prepared batch of writes to the background goroutine. If the channel buffer is full the batch is discarded and a warning is logged so the reconciler never blocks on status writes.