Documentation
¶
Overview ¶
Package k8s is a generated GoMock package.
Index ¶
- Constants
- func FindControlledParents(ctx context.Context, client client.Client, route core.Route) ([]*gwv1.Gateway, error)
- func GetStandaloneModeForRoute(ctx context.Context, c client.Client, route core.Route) (bool, error)
- func GetStandaloneModeForRouteWithValidation(ctx context.Context, c client.Client, route core.Route) (bool, []string, error)
- func HasFinalizer(obj metav1.Object, finalizer string) bool
- func IsControlledByLatticeGatewayController(ctx context.Context, c client.Client, gw *gwv1.Gateway) bool
- func IsGVKSupported(mgr ctrl.Manager, groupVersion string, kind string) (bool, error)
- func IsStandaloneAnnotationEnabled(obj client.Object) bool
- func NamespaceOrDefault(namespace *gwv1.Namespace) string
- func NamespacedName(obj client.Object) types.NamespacedName
- func ObjExists(ctx context.Context, c client.Client, key types.NamespacedName, ...) (bool, error)
- func ParseBoolAnnotation(value string) bool
- func ValidateStandaloneAnnotation(obj client.Object) (bool, error)
- type FinalizerManager
- type MockFinalizerManager
- type MockFinalizerManagerMockRecorder
Constants ¶
const ( // Generic events ReconcilingEvent = "Reconciling" ReconciledEvent = "Reconciled" FailedReconcileEvent = "FailedReconcile" // Gateway events GatewayEventReasonFailedAddFinalizer = "FailedAddFinalizer" GatewayEventReasonFailedBuildModel = "FailedBuildModel" GatewayEventReasonFailedDeployModel = "FailedDeployModel" // Route events RouteEventReasonReconcile = "Reconcile" RouteEventReasonDeploySucceed = "DeploySucceed" RouteEventReasonFailedAddFinalizer = "FailedAddFinalizer" RouteEventReasonFailedBuildModel = "FailedBuildModel" RouteEventReasonFailedDeployModel = "FailedDeployModel" RouteEventReasonRetryReconcile = "Retry-Reconcile" // Service events ServiceEventReasonFailedAddFinalizer = "FailedAddFinalizer" ServiceEventReasonFailedBuildModel = "FailedBuildModel" ServiceEventReasonFailedDeployModel = "FailedDeployModel" // ServiceExport events ServiceExportEventReasonFailedAddFinalizer = "FailedAddFinalizer" ServiceExportEventReasonFailedBuildModel = "FailedBuildModel" ServiceExportEventReasonFailedDeployModel = "FailedDeployModel" // ServiceImport events ServiceImportEventReasonFailedAddFinalizer = "FailedAddFinalizer" ServiceImportEventReasonFailedBuildModel = "FailedBuildModel" ServiceImportEventReasonFailedDeployModel = "FailedDeployModel" )
const ( AnnotationPrefix = "application-networking.k8s.aws/" // Standalone annotation controls whether VPC Lattice services are created // without automatic service network association StandaloneAnnotation = AnnotationPrefix + "standalone" )
Variables ¶
This section is empty.
Functions ¶
func FindControlledParents ¶ added in v1.1.1
func FindControlledParents(ctx context.Context, client client.Client, route core.Route) ([]*gwv1.Gateway, error)
FindControlledParents returns parent gateways that are controlled by lattice gateway controller
func GetStandaloneModeForRoute ¶ added in v1.1.5
func GetStandaloneModeForRoute(ctx context.Context, c client.Client, route core.Route) (bool, error)
GetStandaloneModeForRoute determines if standalone mode should be enabled for a route. It checks the route-level annotation first (highest precedence), then falls back to the gateway-level annotation. Returns false if neither annotation is present or set to "true". This function implements graceful error handling - gateway lookup failures are handled appropriately based on the context (deletion vs normal operation).
func GetStandaloneModeForRouteWithValidation ¶ added in v1.1.5
func GetStandaloneModeForRouteWithValidation(ctx context.Context, c client.Client, route core.Route) (bool, []string, error)
GetStandaloneModeForRouteWithValidation determines standalone mode with detailed validation. This function provides enhanced error reporting for debugging annotation issues. It returns the standalone mode, validation warnings, and any critical errors.
func HasFinalizer ¶
HasFinalizer tests whether k8s object has specified finalizer
func IsControlledByLatticeGatewayController ¶ added in v1.1.1
func IsControlledByLatticeGatewayController(ctx context.Context, c client.Client, gw *gwv1.Gateway) bool
validate if the gateway is managed by the lattice gateway controller
func IsGVKSupported ¶ added in v0.0.16
func IsStandaloneAnnotationEnabled ¶ added in v1.1.5
IsStandaloneAnnotationEnabled checks if the standalone annotation is set to "true" on the given object. It returns false for any other value or if the annotation is missing. This function implements defensive programming - it handles nil objects and missing annotations gracefully.
func NamespaceOrDefault ¶ added in v0.0.18
func NamespacedName ¶
func NamespacedName(obj client.Object) types.NamespacedName
NamespacedName returns the namespaced name for k8s objects
func ParseBoolAnnotation ¶ added in v1.1.5
ParseBoolAnnotation parses a string annotation value as a boolean. It returns true only if the value is "true" (case-insensitive). All other values, including empty string, return false. This function is designed to be forgiving - any invalid or unexpected values are treated as false to ensure graceful degradation.
func ValidateStandaloneAnnotation ¶ added in v1.1.5
ValidateStandaloneAnnotation validates the standalone annotation value on an object. It returns the parsed boolean value and any validation errors. This function provides detailed validation feedback for debugging and error reporting.
Types ¶
type FinalizerManager ¶
type FinalizerManager interface { AddFinalizers(ctx context.Context, object client.Object, finalizers ...string) error RemoveFinalizers(ctx context.Context, object client.Object, finalizers ...string) error }
func NewDefaultFinalizerManager ¶
func NewDefaultFinalizerManager(k8sClient client.Client) FinalizerManager
type MockFinalizerManager ¶ added in v0.0.18
type MockFinalizerManager struct {
// contains filtered or unexported fields
}
MockFinalizerManager is a mock of FinalizerManager interface.
func NewMockFinalizerManager ¶ added in v0.0.18
func NewMockFinalizerManager(ctrl *gomock.Controller) *MockFinalizerManager
NewMockFinalizerManager creates a new mock instance.
func (*MockFinalizerManager) AddFinalizers ¶ added in v0.0.18
func (m *MockFinalizerManager) AddFinalizers(arg0 context.Context, arg1 client.Object, arg2 ...string) error
AddFinalizers mocks base method.
func (*MockFinalizerManager) EXPECT ¶ added in v0.0.18
func (m *MockFinalizerManager) EXPECT() *MockFinalizerManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockFinalizerManager) RemoveFinalizers ¶ added in v0.0.18
func (m *MockFinalizerManager) RemoveFinalizers(arg0 context.Context, arg1 client.Object, arg2 ...string) error
RemoveFinalizers mocks base method.
type MockFinalizerManagerMockRecorder ¶ added in v0.0.18
type MockFinalizerManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockFinalizerManagerMockRecorder is the mock recorder for MockFinalizerManager.
func (*MockFinalizerManagerMockRecorder) AddFinalizers ¶ added in v0.0.18
func (mr *MockFinalizerManagerMockRecorder) AddFinalizers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
AddFinalizers indicates an expected call of AddFinalizers.
func (*MockFinalizerManagerMockRecorder) RemoveFinalizers ¶ added in v0.0.18
func (mr *MockFinalizerManagerMockRecorder) RemoveFinalizers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
RemoveFinalizers indicates an expected call of RemoveFinalizers.