diff --git a/codegen/istio_groups.go b/codegen/istio_groups.go index 53c2fe3..9ce323f 100644 --- a/codegen/istio_groups.go +++ b/codegen/istio_groups.go @@ -5,7 +5,8 @@ import ( extensionsv1alpha1 "istio.io/client-go/pkg/apis/extensions/v1alpha1" networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" - "istio.io/client-go/pkg/apis/security/v1beta1" + securityv1 "istio.io/client-go/pkg/apis/security/v1" + securityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" istiotelemetryv1alpha1 "istio.io/client-go/pkg/apis/telemetry/v1alpha1" operator "istio.io/istio/operator/pkg/apis/istio/v1alpha1" ) @@ -21,6 +22,7 @@ const ( func istioGroups() []model.Group { return []model.Group{ + // networking.istio.io { GroupVersion: networkingv1beta1.SchemeGroupVersion, Module: istioModule, @@ -58,6 +60,27 @@ func istioGroups() []model.Group { GroupVersion: networkingv1alpha3.SchemeGroupVersion, Module: istioModule, Resources: []model.Resource{ + { + Kind: "DestinationRule", + }, + { + Kind: "Gateway", + }, + { + Kind: "ServiceEntry", + }, + { + Kind: "WorkloadEntry", + }, + { + Kind: "WorkloadGroup", + }, + { + Kind: "VirtualService", + }, + { + Kind: "Sidecar", + }, { Kind: "EnvoyFilter", }, @@ -66,8 +89,27 @@ func istioGroups() []model.Group { ApiRoot: istioApiRoot, PointerSlices: true, }, + // security.istio.io + { + GroupVersion: securityv1beta1.SchemeGroupVersion, + Module: istioModule, + Resources: []model.Resource{ + { + Kind: "AuthorizationPolicy", + }, + { + Kind: "PeerAuthentication", + }, + { + Kind: "RequestAuthentication", + }, + }, + CustomTypesImportPath: "istio.io/client-go/pkg/apis/security/v1beta1", + ApiRoot: istioApiRoot, + PointerSlices: true, + }, { - GroupVersion: v1beta1.SchemeGroupVersion, + GroupVersion: securityv1.SchemeGroupVersion, Module: istioModule, Resources: []model.Resource{ { @@ -84,6 +126,7 @@ func istioGroups() []model.Group { ApiRoot: istioApiRoot, PointerSlices: true, }, + // install.istio.io { GroupVersion: operator.SchemeGroupVersion, Module: "install.istio.io", @@ -95,6 +138,7 @@ func istioGroups() []model.Group { CustomTypesImportPath: "istio.io/istio/operator/pkg/apis/istio/v1alpha1", ApiRoot: istioApiRoot, }, + // telemetry.istio.io { GroupVersion: istiotelemetryv1alpha1.SchemeGroupVersion, Module: istioModule, @@ -107,6 +151,7 @@ func istioGroups() []model.Group { ApiRoot: istioApiRoot, PointerSlices: true, }, + // extensions.istio.io { GroupVersion: extensionsv1alpha1.SchemeGroupVersion, Module: istioModule, diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/clients.go b/pkg/api/istio/networking.istio.io/v1alpha3/clients.go index 63a954c..fd839a3 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/clients.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/clients.go @@ -40,6 +40,20 @@ func (m *multiclusterClientset) Cluster(cluster string) (Clientset, error) { // clienset for the networking.istio.io/v1alpha3 APIs type Clientset interface { + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + DestinationRules() DestinationRuleClient + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + Gateways() GatewayClient + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + ServiceEntries() ServiceEntryClient + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + WorkloadEntries() WorkloadEntryClient + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + WorkloadGroups() WorkloadGroupClient + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + VirtualServices() VirtualServiceClient + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs + Sidecars() SidecarClient // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs EnvoyFilters() EnvoyFilterClient } @@ -66,11 +80,1040 @@ func NewClientset(client client.Client) Clientset { return &clientSet{client: client} } +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) DestinationRules() DestinationRuleClient { + return NewDestinationRuleClient(c.client) +} + +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) Gateways() GatewayClient { + return NewGatewayClient(c.client) +} + +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) ServiceEntries() ServiceEntryClient { + return NewServiceEntryClient(c.client) +} + +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) WorkloadEntries() WorkloadEntryClient { + return NewWorkloadEntryClient(c.client) +} + +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) WorkloadGroups() WorkloadGroupClient { + return NewWorkloadGroupClient(c.client) +} + +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) VirtualServices() VirtualServiceClient { + return NewVirtualServiceClient(c.client) +} + +// clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs +func (c *clientSet) Sidecars() SidecarClient { + return NewSidecarClient(c.client) +} + // clienset for the networking.istio.io/v1alpha3/v1alpha3 APIs func (c *clientSet) EnvoyFilters() EnvoyFilterClient { return NewEnvoyFilterClient(c.client) } +// Reader knows how to read and list DestinationRules. +type DestinationRuleReader interface { + // Get retrieves a DestinationRule for the given object key + GetDestinationRule(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.DestinationRule, error) + + // List retrieves list of DestinationRules for a given namespace and list options. + ListDestinationRule(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.DestinationRuleList, error) +} + +// DestinationRuleTransitionFunction instructs the DestinationRuleWriter how to transition between an existing +// DestinationRule object and a desired on an Upsert +type DestinationRuleTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.DestinationRule) error + +// Writer knows how to create, delete, and update DestinationRules. +type DestinationRuleWriter interface { + // Create saves the DestinationRule object. + CreateDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, opts ...client.CreateOption) error + + // Delete deletes the DestinationRule object. + DeleteDestinationRule(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given DestinationRule object. + UpdateDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, opts ...client.UpdateOption) error + + // Patch patches the given DestinationRule object. + PatchDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all DestinationRule objects matching the given options. + DeleteAllOfDestinationRule(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the DestinationRule object. + UpsertDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, transitionFuncs ...DestinationRuleTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a DestinationRule object. +type DestinationRuleStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given DestinationRule object. + UpdateDestinationRuleStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given DestinationRule object's subresource. + PatchDestinationRuleStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on DestinationRules. +type DestinationRuleClient interface { + DestinationRuleReader + DestinationRuleWriter + DestinationRuleStatusWriter +} + +type destinationRuleClient struct { + client client.Client +} + +func NewDestinationRuleClient(client client.Client) *destinationRuleClient { + return &destinationRuleClient{client: client} +} + +func (c *destinationRuleClient) GetDestinationRule(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.DestinationRule, error) { + obj := &networking_istio_io_v1alpha3.DestinationRule{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *destinationRuleClient) ListDestinationRule(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.DestinationRuleList, error) { + list := &networking_istio_io_v1alpha3.DestinationRuleList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *destinationRuleClient) CreateDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *destinationRuleClient) DeleteDestinationRule(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.DestinationRule{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *destinationRuleClient) UpdateDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *destinationRuleClient) PatchDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *destinationRuleClient) DeleteAllOfDestinationRule(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.DestinationRule{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *destinationRuleClient) UpsertDestinationRule(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, transitionFuncs ...DestinationRuleTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.DestinationRule), desired.(*networking_istio_io_v1alpha3.DestinationRule)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *destinationRuleClient) UpdateDestinationRuleStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *destinationRuleClient) PatchDestinationRuleStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.DestinationRule, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides DestinationRuleClients for multiple clusters. +type MulticlusterDestinationRuleClient interface { + // Cluster returns a DestinationRuleClient for the given cluster + Cluster(cluster string) (DestinationRuleClient, error) +} + +type multiclusterDestinationRuleClient struct { + client multicluster.Client +} + +func NewMulticlusterDestinationRuleClient(client multicluster.Client) MulticlusterDestinationRuleClient { + return &multiclusterDestinationRuleClient{client: client} +} + +func (m *multiclusterDestinationRuleClient) Cluster(cluster string) (DestinationRuleClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewDestinationRuleClient(client), nil +} + +// Reader knows how to read and list Gateways. +type GatewayReader interface { + // Get retrieves a Gateway for the given object key + GetGateway(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.Gateway, error) + + // List retrieves list of Gateways for a given namespace and list options. + ListGateway(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.GatewayList, error) +} + +// GatewayTransitionFunction instructs the GatewayWriter how to transition between an existing +// Gateway object and a desired on an Upsert +type GatewayTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.Gateway) error + +// Writer knows how to create, delete, and update Gateways. +type GatewayWriter interface { + // Create saves the Gateway object. + CreateGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, opts ...client.CreateOption) error + + // Delete deletes the Gateway object. + DeleteGateway(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given Gateway object. + UpdateGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, opts ...client.UpdateOption) error + + // Patch patches the given Gateway object. + PatchGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all Gateway objects matching the given options. + DeleteAllOfGateway(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the Gateway object. + UpsertGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, transitionFuncs ...GatewayTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a Gateway object. +type GatewayStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given Gateway object. + UpdateGatewayStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given Gateway object's subresource. + PatchGatewayStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on Gateways. +type GatewayClient interface { + GatewayReader + GatewayWriter + GatewayStatusWriter +} + +type gatewayClient struct { + client client.Client +} + +func NewGatewayClient(client client.Client) *gatewayClient { + return &gatewayClient{client: client} +} + +func (c *gatewayClient) GetGateway(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.Gateway, error) { + obj := &networking_istio_io_v1alpha3.Gateway{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *gatewayClient) ListGateway(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.GatewayList, error) { + list := &networking_istio_io_v1alpha3.GatewayList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *gatewayClient) CreateGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *gatewayClient) DeleteGateway(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.Gateway{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *gatewayClient) UpdateGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *gatewayClient) PatchGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *gatewayClient) DeleteAllOfGateway(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.Gateway{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *gatewayClient) UpsertGateway(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, transitionFuncs ...GatewayTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.Gateway), desired.(*networking_istio_io_v1alpha3.Gateway)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *gatewayClient) UpdateGatewayStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *gatewayClient) PatchGatewayStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Gateway, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides GatewayClients for multiple clusters. +type MulticlusterGatewayClient interface { + // Cluster returns a GatewayClient for the given cluster + Cluster(cluster string) (GatewayClient, error) +} + +type multiclusterGatewayClient struct { + client multicluster.Client +} + +func NewMulticlusterGatewayClient(client multicluster.Client) MulticlusterGatewayClient { + return &multiclusterGatewayClient{client: client} +} + +func (m *multiclusterGatewayClient) Cluster(cluster string) (GatewayClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewGatewayClient(client), nil +} + +// Reader knows how to read and list ServiceEntrys. +type ServiceEntryReader interface { + // Get retrieves a ServiceEntry for the given object key + GetServiceEntry(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.ServiceEntry, error) + + // List retrieves list of ServiceEntrys for a given namespace and list options. + ListServiceEntry(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.ServiceEntryList, error) +} + +// ServiceEntryTransitionFunction instructs the ServiceEntryWriter how to transition between an existing +// ServiceEntry object and a desired on an Upsert +type ServiceEntryTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.ServiceEntry) error + +// Writer knows how to create, delete, and update ServiceEntrys. +type ServiceEntryWriter interface { + // Create saves the ServiceEntry object. + CreateServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, opts ...client.CreateOption) error + + // Delete deletes the ServiceEntry object. + DeleteServiceEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given ServiceEntry object. + UpdateServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, opts ...client.UpdateOption) error + + // Patch patches the given ServiceEntry object. + PatchServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all ServiceEntry objects matching the given options. + DeleteAllOfServiceEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the ServiceEntry object. + UpsertServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, transitionFuncs ...ServiceEntryTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a ServiceEntry object. +type ServiceEntryStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given ServiceEntry object. + UpdateServiceEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given ServiceEntry object's subresource. + PatchServiceEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on ServiceEntrys. +type ServiceEntryClient interface { + ServiceEntryReader + ServiceEntryWriter + ServiceEntryStatusWriter +} + +type serviceEntryClient struct { + client client.Client +} + +func NewServiceEntryClient(client client.Client) *serviceEntryClient { + return &serviceEntryClient{client: client} +} + +func (c *serviceEntryClient) GetServiceEntry(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.ServiceEntry, error) { + obj := &networking_istio_io_v1alpha3.ServiceEntry{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *serviceEntryClient) ListServiceEntry(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.ServiceEntryList, error) { + list := &networking_istio_io_v1alpha3.ServiceEntryList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *serviceEntryClient) CreateServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *serviceEntryClient) DeleteServiceEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.ServiceEntry{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *serviceEntryClient) UpdateServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *serviceEntryClient) PatchServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *serviceEntryClient) DeleteAllOfServiceEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.ServiceEntry{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *serviceEntryClient) UpsertServiceEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, transitionFuncs ...ServiceEntryTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.ServiceEntry), desired.(*networking_istio_io_v1alpha3.ServiceEntry)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *serviceEntryClient) UpdateServiceEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *serviceEntryClient) PatchServiceEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.ServiceEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides ServiceEntryClients for multiple clusters. +type MulticlusterServiceEntryClient interface { + // Cluster returns a ServiceEntryClient for the given cluster + Cluster(cluster string) (ServiceEntryClient, error) +} + +type multiclusterServiceEntryClient struct { + client multicluster.Client +} + +func NewMulticlusterServiceEntryClient(client multicluster.Client) MulticlusterServiceEntryClient { + return &multiclusterServiceEntryClient{client: client} +} + +func (m *multiclusterServiceEntryClient) Cluster(cluster string) (ServiceEntryClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewServiceEntryClient(client), nil +} + +// Reader knows how to read and list WorkloadEntrys. +type WorkloadEntryReader interface { + // Get retrieves a WorkloadEntry for the given object key + GetWorkloadEntry(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.WorkloadEntry, error) + + // List retrieves list of WorkloadEntrys for a given namespace and list options. + ListWorkloadEntry(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.WorkloadEntryList, error) +} + +// WorkloadEntryTransitionFunction instructs the WorkloadEntryWriter how to transition between an existing +// WorkloadEntry object and a desired on an Upsert +type WorkloadEntryTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.WorkloadEntry) error + +// Writer knows how to create, delete, and update WorkloadEntrys. +type WorkloadEntryWriter interface { + // Create saves the WorkloadEntry object. + CreateWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, opts ...client.CreateOption) error + + // Delete deletes the WorkloadEntry object. + DeleteWorkloadEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given WorkloadEntry object. + UpdateWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, opts ...client.UpdateOption) error + + // Patch patches the given WorkloadEntry object. + PatchWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all WorkloadEntry objects matching the given options. + DeleteAllOfWorkloadEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the WorkloadEntry object. + UpsertWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, transitionFuncs ...WorkloadEntryTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a WorkloadEntry object. +type WorkloadEntryStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given WorkloadEntry object. + UpdateWorkloadEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given WorkloadEntry object's subresource. + PatchWorkloadEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on WorkloadEntrys. +type WorkloadEntryClient interface { + WorkloadEntryReader + WorkloadEntryWriter + WorkloadEntryStatusWriter +} + +type workloadEntryClient struct { + client client.Client +} + +func NewWorkloadEntryClient(client client.Client) *workloadEntryClient { + return &workloadEntryClient{client: client} +} + +func (c *workloadEntryClient) GetWorkloadEntry(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.WorkloadEntry, error) { + obj := &networking_istio_io_v1alpha3.WorkloadEntry{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *workloadEntryClient) ListWorkloadEntry(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.WorkloadEntryList, error) { + list := &networking_istio_io_v1alpha3.WorkloadEntryList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *workloadEntryClient) CreateWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *workloadEntryClient) DeleteWorkloadEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.WorkloadEntry{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *workloadEntryClient) UpdateWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *workloadEntryClient) PatchWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *workloadEntryClient) DeleteAllOfWorkloadEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.WorkloadEntry{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *workloadEntryClient) UpsertWorkloadEntry(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, transitionFuncs ...WorkloadEntryTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.WorkloadEntry), desired.(*networking_istio_io_v1alpha3.WorkloadEntry)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *workloadEntryClient) UpdateWorkloadEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *workloadEntryClient) PatchWorkloadEntryStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides WorkloadEntryClients for multiple clusters. +type MulticlusterWorkloadEntryClient interface { + // Cluster returns a WorkloadEntryClient for the given cluster + Cluster(cluster string) (WorkloadEntryClient, error) +} + +type multiclusterWorkloadEntryClient struct { + client multicluster.Client +} + +func NewMulticlusterWorkloadEntryClient(client multicluster.Client) MulticlusterWorkloadEntryClient { + return &multiclusterWorkloadEntryClient{client: client} +} + +func (m *multiclusterWorkloadEntryClient) Cluster(cluster string) (WorkloadEntryClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewWorkloadEntryClient(client), nil +} + +// Reader knows how to read and list WorkloadGroups. +type WorkloadGroupReader interface { + // Get retrieves a WorkloadGroup for the given object key + GetWorkloadGroup(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.WorkloadGroup, error) + + // List retrieves list of WorkloadGroups for a given namespace and list options. + ListWorkloadGroup(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.WorkloadGroupList, error) +} + +// WorkloadGroupTransitionFunction instructs the WorkloadGroupWriter how to transition between an existing +// WorkloadGroup object and a desired on an Upsert +type WorkloadGroupTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.WorkloadGroup) error + +// Writer knows how to create, delete, and update WorkloadGroups. +type WorkloadGroupWriter interface { + // Create saves the WorkloadGroup object. + CreateWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, opts ...client.CreateOption) error + + // Delete deletes the WorkloadGroup object. + DeleteWorkloadGroup(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given WorkloadGroup object. + UpdateWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, opts ...client.UpdateOption) error + + // Patch patches the given WorkloadGroup object. + PatchWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all WorkloadGroup objects matching the given options. + DeleteAllOfWorkloadGroup(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the WorkloadGroup object. + UpsertWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, transitionFuncs ...WorkloadGroupTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a WorkloadGroup object. +type WorkloadGroupStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given WorkloadGroup object. + UpdateWorkloadGroupStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given WorkloadGroup object's subresource. + PatchWorkloadGroupStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on WorkloadGroups. +type WorkloadGroupClient interface { + WorkloadGroupReader + WorkloadGroupWriter + WorkloadGroupStatusWriter +} + +type workloadGroupClient struct { + client client.Client +} + +func NewWorkloadGroupClient(client client.Client) *workloadGroupClient { + return &workloadGroupClient{client: client} +} + +func (c *workloadGroupClient) GetWorkloadGroup(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.WorkloadGroup, error) { + obj := &networking_istio_io_v1alpha3.WorkloadGroup{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *workloadGroupClient) ListWorkloadGroup(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.WorkloadGroupList, error) { + list := &networking_istio_io_v1alpha3.WorkloadGroupList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *workloadGroupClient) CreateWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *workloadGroupClient) DeleteWorkloadGroup(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.WorkloadGroup{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *workloadGroupClient) UpdateWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *workloadGroupClient) PatchWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *workloadGroupClient) DeleteAllOfWorkloadGroup(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.WorkloadGroup{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *workloadGroupClient) UpsertWorkloadGroup(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, transitionFuncs ...WorkloadGroupTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.WorkloadGroup), desired.(*networking_istio_io_v1alpha3.WorkloadGroup)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *workloadGroupClient) UpdateWorkloadGroupStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *workloadGroupClient) PatchWorkloadGroupStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.WorkloadGroup, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides WorkloadGroupClients for multiple clusters. +type MulticlusterWorkloadGroupClient interface { + // Cluster returns a WorkloadGroupClient for the given cluster + Cluster(cluster string) (WorkloadGroupClient, error) +} + +type multiclusterWorkloadGroupClient struct { + client multicluster.Client +} + +func NewMulticlusterWorkloadGroupClient(client multicluster.Client) MulticlusterWorkloadGroupClient { + return &multiclusterWorkloadGroupClient{client: client} +} + +func (m *multiclusterWorkloadGroupClient) Cluster(cluster string) (WorkloadGroupClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewWorkloadGroupClient(client), nil +} + +// Reader knows how to read and list VirtualServices. +type VirtualServiceReader interface { + // Get retrieves a VirtualService for the given object key + GetVirtualService(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.VirtualService, error) + + // List retrieves list of VirtualServices for a given namespace and list options. + ListVirtualService(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.VirtualServiceList, error) +} + +// VirtualServiceTransitionFunction instructs the VirtualServiceWriter how to transition between an existing +// VirtualService object and a desired on an Upsert +type VirtualServiceTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.VirtualService) error + +// Writer knows how to create, delete, and update VirtualServices. +type VirtualServiceWriter interface { + // Create saves the VirtualService object. + CreateVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, opts ...client.CreateOption) error + + // Delete deletes the VirtualService object. + DeleteVirtualService(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given VirtualService object. + UpdateVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, opts ...client.UpdateOption) error + + // Patch patches the given VirtualService object. + PatchVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all VirtualService objects matching the given options. + DeleteAllOfVirtualService(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the VirtualService object. + UpsertVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, transitionFuncs ...VirtualServiceTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a VirtualService object. +type VirtualServiceStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given VirtualService object. + UpdateVirtualServiceStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given VirtualService object's subresource. + PatchVirtualServiceStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on VirtualServices. +type VirtualServiceClient interface { + VirtualServiceReader + VirtualServiceWriter + VirtualServiceStatusWriter +} + +type virtualServiceClient struct { + client client.Client +} + +func NewVirtualServiceClient(client client.Client) *virtualServiceClient { + return &virtualServiceClient{client: client} +} + +func (c *virtualServiceClient) GetVirtualService(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.VirtualService, error) { + obj := &networking_istio_io_v1alpha3.VirtualService{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *virtualServiceClient) ListVirtualService(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.VirtualServiceList, error) { + list := &networking_istio_io_v1alpha3.VirtualServiceList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *virtualServiceClient) CreateVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *virtualServiceClient) DeleteVirtualService(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.VirtualService{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *virtualServiceClient) UpdateVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *virtualServiceClient) PatchVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *virtualServiceClient) DeleteAllOfVirtualService(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.VirtualService{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *virtualServiceClient) UpsertVirtualService(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, transitionFuncs ...VirtualServiceTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.VirtualService), desired.(*networking_istio_io_v1alpha3.VirtualService)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *virtualServiceClient) UpdateVirtualServiceStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *virtualServiceClient) PatchVirtualServiceStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.VirtualService, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides VirtualServiceClients for multiple clusters. +type MulticlusterVirtualServiceClient interface { + // Cluster returns a VirtualServiceClient for the given cluster + Cluster(cluster string) (VirtualServiceClient, error) +} + +type multiclusterVirtualServiceClient struct { + client multicluster.Client +} + +func NewMulticlusterVirtualServiceClient(client multicluster.Client) MulticlusterVirtualServiceClient { + return &multiclusterVirtualServiceClient{client: client} +} + +func (m *multiclusterVirtualServiceClient) Cluster(cluster string) (VirtualServiceClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewVirtualServiceClient(client), nil +} + +// Reader knows how to read and list Sidecars. +type SidecarReader interface { + // Get retrieves a Sidecar for the given object key + GetSidecar(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.Sidecar, error) + + // List retrieves list of Sidecars for a given namespace and list options. + ListSidecar(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.SidecarList, error) +} + +// SidecarTransitionFunction instructs the SidecarWriter how to transition between an existing +// Sidecar object and a desired on an Upsert +type SidecarTransitionFunction func(existing, desired *networking_istio_io_v1alpha3.Sidecar) error + +// Writer knows how to create, delete, and update Sidecars. +type SidecarWriter interface { + // Create saves the Sidecar object. + CreateSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, opts ...client.CreateOption) error + + // Delete deletes the Sidecar object. + DeleteSidecar(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given Sidecar object. + UpdateSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, opts ...client.UpdateOption) error + + // Patch patches the given Sidecar object. + PatchSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all Sidecar objects matching the given options. + DeleteAllOfSidecar(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the Sidecar object. + UpsertSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, transitionFuncs ...SidecarTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a Sidecar object. +type SidecarStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given Sidecar object. + UpdateSidecarStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given Sidecar object's subresource. + PatchSidecarStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on Sidecars. +type SidecarClient interface { + SidecarReader + SidecarWriter + SidecarStatusWriter +} + +type sidecarClient struct { + client client.Client +} + +func NewSidecarClient(client client.Client) *sidecarClient { + return &sidecarClient{client: client} +} + +func (c *sidecarClient) GetSidecar(ctx context.Context, key client.ObjectKey) (*networking_istio_io_v1alpha3.Sidecar, error) { + obj := &networking_istio_io_v1alpha3.Sidecar{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *sidecarClient) ListSidecar(ctx context.Context, opts ...client.ListOption) (*networking_istio_io_v1alpha3.SidecarList, error) { + list := &networking_istio_io_v1alpha3.SidecarList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *sidecarClient) CreateSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *sidecarClient) DeleteSidecar(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &networking_istio_io_v1alpha3.Sidecar{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *sidecarClient) UpdateSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *sidecarClient) PatchSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *sidecarClient) DeleteAllOfSidecar(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &networking_istio_io_v1alpha3.Sidecar{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *sidecarClient) UpsertSidecar(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, transitionFuncs ...SidecarTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*networking_istio_io_v1alpha3.Sidecar), desired.(*networking_istio_io_v1alpha3.Sidecar)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *sidecarClient) UpdateSidecarStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *sidecarClient) PatchSidecarStatus(ctx context.Context, obj *networking_istio_io_v1alpha3.Sidecar, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides SidecarClients for multiple clusters. +type MulticlusterSidecarClient interface { + // Cluster returns a SidecarClient for the given cluster + Cluster(cluster string) (SidecarClient, error) +} + +type multiclusterSidecarClient struct { + client multicluster.Client +} + +func NewMulticlusterSidecarClient(client multicluster.Client) MulticlusterSidecarClient { + return &multiclusterSidecarClient{client: client} +} + +func (m *multiclusterSidecarClient) Cluster(cluster string) (SidecarClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewSidecarClient(client), nil +} + // Reader knows how to read and list EnvoyFilters. type EnvoyFilterReader interface { // Get retrieves a EnvoyFilter for the given object key diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/controller/event_handlers.go b/pkg/api/istio/networking.istio.io/v1alpha3/controller/event_handlers.go index 3a2266b..30c38d1 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/controller/event_handlers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/controller/event_handlers.go @@ -17,6 +17,755 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// Handle events for the DestinationRule Resource +// DEPRECATED: Prefer reconciler pattern. +type DestinationRuleEventHandler interface { + CreateDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error + UpdateDestinationRule(old, new *networking_istio_io_v1alpha3.DestinationRule) error + DeleteDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error + GenericDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error +} + +type DestinationRuleEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.DestinationRule) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.DestinationRule) error + OnDelete func(obj *networking_istio_io_v1alpha3.DestinationRule) error + OnGeneric func(obj *networking_istio_io_v1alpha3.DestinationRule) error +} + +func (f *DestinationRuleEventHandlerFuncs) CreateDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *DestinationRuleEventHandlerFuncs) DeleteDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *DestinationRuleEventHandlerFuncs) UpdateDestinationRule(objOld, objNew *networking_istio_io_v1alpha3.DestinationRule) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *DestinationRuleEventHandlerFuncs) GenericDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type DestinationRuleEventWatcher interface { + AddEventHandler(ctx context.Context, h DestinationRuleEventHandler, predicates ...predicate.Predicate) error +} + +type destinationRuleEventWatcher struct { + watcher events.EventWatcher +} + +func NewDestinationRuleEventWatcher(name string, mgr manager.Manager) DestinationRuleEventWatcher { + return &destinationRuleEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.DestinationRule{}), + } +} + +func (c *destinationRuleEventWatcher) AddEventHandler(ctx context.Context, h DestinationRuleEventHandler, predicates ...predicate.Predicate) error { + handler := genericDestinationRuleHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericDestinationRuleHandler implements a generic events.EventHandler +type genericDestinationRuleHandler struct { + handler DestinationRuleEventHandler +} + +func (h genericDestinationRuleHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return errors.Errorf("internal error: DestinationRule handler received event for %T", object) + } + return h.handler.CreateDestinationRule(obj) +} + +func (h genericDestinationRuleHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return errors.Errorf("internal error: DestinationRule handler received event for %T", object) + } + return h.handler.DeleteDestinationRule(obj) +} + +func (h genericDestinationRuleHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return errors.Errorf("internal error: DestinationRule handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return errors.Errorf("internal error: DestinationRule handler received event for %T", new) + } + return h.handler.UpdateDestinationRule(objOld, objNew) +} + +func (h genericDestinationRuleHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return errors.Errorf("internal error: DestinationRule handler received event for %T", object) + } + return h.handler.GenericDestinationRule(obj) +} + +// Handle events for the Gateway Resource +// DEPRECATED: Prefer reconciler pattern. +type GatewayEventHandler interface { + CreateGateway(obj *networking_istio_io_v1alpha3.Gateway) error + UpdateGateway(old, new *networking_istio_io_v1alpha3.Gateway) error + DeleteGateway(obj *networking_istio_io_v1alpha3.Gateway) error + GenericGateway(obj *networking_istio_io_v1alpha3.Gateway) error +} + +type GatewayEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.Gateway) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.Gateway) error + OnDelete func(obj *networking_istio_io_v1alpha3.Gateway) error + OnGeneric func(obj *networking_istio_io_v1alpha3.Gateway) error +} + +func (f *GatewayEventHandlerFuncs) CreateGateway(obj *networking_istio_io_v1alpha3.Gateway) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *GatewayEventHandlerFuncs) DeleteGateway(obj *networking_istio_io_v1alpha3.Gateway) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *GatewayEventHandlerFuncs) UpdateGateway(objOld, objNew *networking_istio_io_v1alpha3.Gateway) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *GatewayEventHandlerFuncs) GenericGateway(obj *networking_istio_io_v1alpha3.Gateway) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type GatewayEventWatcher interface { + AddEventHandler(ctx context.Context, h GatewayEventHandler, predicates ...predicate.Predicate) error +} + +type gatewayEventWatcher struct { + watcher events.EventWatcher +} + +func NewGatewayEventWatcher(name string, mgr manager.Manager) GatewayEventWatcher { + return &gatewayEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.Gateway{}), + } +} + +func (c *gatewayEventWatcher) AddEventHandler(ctx context.Context, h GatewayEventHandler, predicates ...predicate.Predicate) error { + handler := genericGatewayHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericGatewayHandler implements a generic events.EventHandler +type genericGatewayHandler struct { + handler GatewayEventHandler +} + +func (h genericGatewayHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return errors.Errorf("internal error: Gateway handler received event for %T", object) + } + return h.handler.CreateGateway(obj) +} + +func (h genericGatewayHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return errors.Errorf("internal error: Gateway handler received event for %T", object) + } + return h.handler.DeleteGateway(obj) +} + +func (h genericGatewayHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return errors.Errorf("internal error: Gateway handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return errors.Errorf("internal error: Gateway handler received event for %T", new) + } + return h.handler.UpdateGateway(objOld, objNew) +} + +func (h genericGatewayHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return errors.Errorf("internal error: Gateway handler received event for %T", object) + } + return h.handler.GenericGateway(obj) +} + +// Handle events for the ServiceEntry Resource +// DEPRECATED: Prefer reconciler pattern. +type ServiceEntryEventHandler interface { + CreateServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error + UpdateServiceEntry(old, new *networking_istio_io_v1alpha3.ServiceEntry) error + DeleteServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error + GenericServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error +} + +type ServiceEntryEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.ServiceEntry) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.ServiceEntry) error + OnDelete func(obj *networking_istio_io_v1alpha3.ServiceEntry) error + OnGeneric func(obj *networking_istio_io_v1alpha3.ServiceEntry) error +} + +func (f *ServiceEntryEventHandlerFuncs) CreateServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *ServiceEntryEventHandlerFuncs) DeleteServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *ServiceEntryEventHandlerFuncs) UpdateServiceEntry(objOld, objNew *networking_istio_io_v1alpha3.ServiceEntry) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *ServiceEntryEventHandlerFuncs) GenericServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type ServiceEntryEventWatcher interface { + AddEventHandler(ctx context.Context, h ServiceEntryEventHandler, predicates ...predicate.Predicate) error +} + +type serviceEntryEventWatcher struct { + watcher events.EventWatcher +} + +func NewServiceEntryEventWatcher(name string, mgr manager.Manager) ServiceEntryEventWatcher { + return &serviceEntryEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.ServiceEntry{}), + } +} + +func (c *serviceEntryEventWatcher) AddEventHandler(ctx context.Context, h ServiceEntryEventHandler, predicates ...predicate.Predicate) error { + handler := genericServiceEntryHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericServiceEntryHandler implements a generic events.EventHandler +type genericServiceEntryHandler struct { + handler ServiceEntryEventHandler +} + +func (h genericServiceEntryHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return errors.Errorf("internal error: ServiceEntry handler received event for %T", object) + } + return h.handler.CreateServiceEntry(obj) +} + +func (h genericServiceEntryHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return errors.Errorf("internal error: ServiceEntry handler received event for %T", object) + } + return h.handler.DeleteServiceEntry(obj) +} + +func (h genericServiceEntryHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return errors.Errorf("internal error: ServiceEntry handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return errors.Errorf("internal error: ServiceEntry handler received event for %T", new) + } + return h.handler.UpdateServiceEntry(objOld, objNew) +} + +func (h genericServiceEntryHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return errors.Errorf("internal error: ServiceEntry handler received event for %T", object) + } + return h.handler.GenericServiceEntry(obj) +} + +// Handle events for the WorkloadEntry Resource +// DEPRECATED: Prefer reconciler pattern. +type WorkloadEntryEventHandler interface { + CreateWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error + UpdateWorkloadEntry(old, new *networking_istio_io_v1alpha3.WorkloadEntry) error + DeleteWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error + GenericWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error +} + +type WorkloadEntryEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.WorkloadEntry) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.WorkloadEntry) error + OnDelete func(obj *networking_istio_io_v1alpha3.WorkloadEntry) error + OnGeneric func(obj *networking_istio_io_v1alpha3.WorkloadEntry) error +} + +func (f *WorkloadEntryEventHandlerFuncs) CreateWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *WorkloadEntryEventHandlerFuncs) DeleteWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *WorkloadEntryEventHandlerFuncs) UpdateWorkloadEntry(objOld, objNew *networking_istio_io_v1alpha3.WorkloadEntry) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *WorkloadEntryEventHandlerFuncs) GenericWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type WorkloadEntryEventWatcher interface { + AddEventHandler(ctx context.Context, h WorkloadEntryEventHandler, predicates ...predicate.Predicate) error +} + +type workloadEntryEventWatcher struct { + watcher events.EventWatcher +} + +func NewWorkloadEntryEventWatcher(name string, mgr manager.Manager) WorkloadEntryEventWatcher { + return &workloadEntryEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.WorkloadEntry{}), + } +} + +func (c *workloadEntryEventWatcher) AddEventHandler(ctx context.Context, h WorkloadEntryEventHandler, predicates ...predicate.Predicate) error { + handler := genericWorkloadEntryHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericWorkloadEntryHandler implements a generic events.EventHandler +type genericWorkloadEntryHandler struct { + handler WorkloadEntryEventHandler +} + +func (h genericWorkloadEntryHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return errors.Errorf("internal error: WorkloadEntry handler received event for %T", object) + } + return h.handler.CreateWorkloadEntry(obj) +} + +func (h genericWorkloadEntryHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return errors.Errorf("internal error: WorkloadEntry handler received event for %T", object) + } + return h.handler.DeleteWorkloadEntry(obj) +} + +func (h genericWorkloadEntryHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return errors.Errorf("internal error: WorkloadEntry handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return errors.Errorf("internal error: WorkloadEntry handler received event for %T", new) + } + return h.handler.UpdateWorkloadEntry(objOld, objNew) +} + +func (h genericWorkloadEntryHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return errors.Errorf("internal error: WorkloadEntry handler received event for %T", object) + } + return h.handler.GenericWorkloadEntry(obj) +} + +// Handle events for the WorkloadGroup Resource +// DEPRECATED: Prefer reconciler pattern. +type WorkloadGroupEventHandler interface { + CreateWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error + UpdateWorkloadGroup(old, new *networking_istio_io_v1alpha3.WorkloadGroup) error + DeleteWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error + GenericWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error +} + +type WorkloadGroupEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.WorkloadGroup) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.WorkloadGroup) error + OnDelete func(obj *networking_istio_io_v1alpha3.WorkloadGroup) error + OnGeneric func(obj *networking_istio_io_v1alpha3.WorkloadGroup) error +} + +func (f *WorkloadGroupEventHandlerFuncs) CreateWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *WorkloadGroupEventHandlerFuncs) DeleteWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *WorkloadGroupEventHandlerFuncs) UpdateWorkloadGroup(objOld, objNew *networking_istio_io_v1alpha3.WorkloadGroup) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *WorkloadGroupEventHandlerFuncs) GenericWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type WorkloadGroupEventWatcher interface { + AddEventHandler(ctx context.Context, h WorkloadGroupEventHandler, predicates ...predicate.Predicate) error +} + +type workloadGroupEventWatcher struct { + watcher events.EventWatcher +} + +func NewWorkloadGroupEventWatcher(name string, mgr manager.Manager) WorkloadGroupEventWatcher { + return &workloadGroupEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.WorkloadGroup{}), + } +} + +func (c *workloadGroupEventWatcher) AddEventHandler(ctx context.Context, h WorkloadGroupEventHandler, predicates ...predicate.Predicate) error { + handler := genericWorkloadGroupHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericWorkloadGroupHandler implements a generic events.EventHandler +type genericWorkloadGroupHandler struct { + handler WorkloadGroupEventHandler +} + +func (h genericWorkloadGroupHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return errors.Errorf("internal error: WorkloadGroup handler received event for %T", object) + } + return h.handler.CreateWorkloadGroup(obj) +} + +func (h genericWorkloadGroupHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return errors.Errorf("internal error: WorkloadGroup handler received event for %T", object) + } + return h.handler.DeleteWorkloadGroup(obj) +} + +func (h genericWorkloadGroupHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return errors.Errorf("internal error: WorkloadGroup handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return errors.Errorf("internal error: WorkloadGroup handler received event for %T", new) + } + return h.handler.UpdateWorkloadGroup(objOld, objNew) +} + +func (h genericWorkloadGroupHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return errors.Errorf("internal error: WorkloadGroup handler received event for %T", object) + } + return h.handler.GenericWorkloadGroup(obj) +} + +// Handle events for the VirtualService Resource +// DEPRECATED: Prefer reconciler pattern. +type VirtualServiceEventHandler interface { + CreateVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error + UpdateVirtualService(old, new *networking_istio_io_v1alpha3.VirtualService) error + DeleteVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error + GenericVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error +} + +type VirtualServiceEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.VirtualService) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.VirtualService) error + OnDelete func(obj *networking_istio_io_v1alpha3.VirtualService) error + OnGeneric func(obj *networking_istio_io_v1alpha3.VirtualService) error +} + +func (f *VirtualServiceEventHandlerFuncs) CreateVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *VirtualServiceEventHandlerFuncs) DeleteVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *VirtualServiceEventHandlerFuncs) UpdateVirtualService(objOld, objNew *networking_istio_io_v1alpha3.VirtualService) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *VirtualServiceEventHandlerFuncs) GenericVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type VirtualServiceEventWatcher interface { + AddEventHandler(ctx context.Context, h VirtualServiceEventHandler, predicates ...predicate.Predicate) error +} + +type virtualServiceEventWatcher struct { + watcher events.EventWatcher +} + +func NewVirtualServiceEventWatcher(name string, mgr manager.Manager) VirtualServiceEventWatcher { + return &virtualServiceEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.VirtualService{}), + } +} + +func (c *virtualServiceEventWatcher) AddEventHandler(ctx context.Context, h VirtualServiceEventHandler, predicates ...predicate.Predicate) error { + handler := genericVirtualServiceHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericVirtualServiceHandler implements a generic events.EventHandler +type genericVirtualServiceHandler struct { + handler VirtualServiceEventHandler +} + +func (h genericVirtualServiceHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return errors.Errorf("internal error: VirtualService handler received event for %T", object) + } + return h.handler.CreateVirtualService(obj) +} + +func (h genericVirtualServiceHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return errors.Errorf("internal error: VirtualService handler received event for %T", object) + } + return h.handler.DeleteVirtualService(obj) +} + +func (h genericVirtualServiceHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return errors.Errorf("internal error: VirtualService handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return errors.Errorf("internal error: VirtualService handler received event for %T", new) + } + return h.handler.UpdateVirtualService(objOld, objNew) +} + +func (h genericVirtualServiceHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return errors.Errorf("internal error: VirtualService handler received event for %T", object) + } + return h.handler.GenericVirtualService(obj) +} + +// Handle events for the Sidecar Resource +// DEPRECATED: Prefer reconciler pattern. +type SidecarEventHandler interface { + CreateSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error + UpdateSidecar(old, new *networking_istio_io_v1alpha3.Sidecar) error + DeleteSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error + GenericSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error +} + +type SidecarEventHandlerFuncs struct { + OnCreate func(obj *networking_istio_io_v1alpha3.Sidecar) error + OnUpdate func(old, new *networking_istio_io_v1alpha3.Sidecar) error + OnDelete func(obj *networking_istio_io_v1alpha3.Sidecar) error + OnGeneric func(obj *networking_istio_io_v1alpha3.Sidecar) error +} + +func (f *SidecarEventHandlerFuncs) CreateSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *SidecarEventHandlerFuncs) DeleteSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *SidecarEventHandlerFuncs) UpdateSidecar(objOld, objNew *networking_istio_io_v1alpha3.Sidecar) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *SidecarEventHandlerFuncs) GenericSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type SidecarEventWatcher interface { + AddEventHandler(ctx context.Context, h SidecarEventHandler, predicates ...predicate.Predicate) error +} + +type sidecarEventWatcher struct { + watcher events.EventWatcher +} + +func NewSidecarEventWatcher(name string, mgr manager.Manager) SidecarEventWatcher { + return &sidecarEventWatcher{ + watcher: events.NewWatcher(name, mgr, &networking_istio_io_v1alpha3.Sidecar{}), + } +} + +func (c *sidecarEventWatcher) AddEventHandler(ctx context.Context, h SidecarEventHandler, predicates ...predicate.Predicate) error { + handler := genericSidecarHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericSidecarHandler implements a generic events.EventHandler +type genericSidecarHandler struct { + handler SidecarEventHandler +} + +func (h genericSidecarHandler) Create(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return errors.Errorf("internal error: Sidecar handler received event for %T", object) + } + return h.handler.CreateSidecar(obj) +} + +func (h genericSidecarHandler) Delete(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return errors.Errorf("internal error: Sidecar handler received event for %T", object) + } + return h.handler.DeleteSidecar(obj) +} + +func (h genericSidecarHandler) Update(old, new client.Object) error { + objOld, ok := old.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return errors.Errorf("internal error: Sidecar handler received event for %T", old) + } + objNew, ok := new.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return errors.Errorf("internal error: Sidecar handler received event for %T", new) + } + return h.handler.UpdateSidecar(objOld, objNew) +} + +func (h genericSidecarHandler) Generic(object client.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return errors.Errorf("internal error: Sidecar handler received event for %T", object) + } + return h.handler.GenericSidecar(obj) +} + // Handle events for the EnvoyFilter Resource // DEPRECATED: Prefer reconciler pattern. type EnvoyFilterEventHandler interface { diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/event_handlers.go b/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/event_handlers.go index 1582b16..87be91f 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/event_handlers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/event_handlers.go @@ -14,6 +14,853 @@ import ( predicate "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// MockDestinationRuleEventHandler is a mock of DestinationRuleEventHandler interface. +type MockDestinationRuleEventHandler struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleEventHandlerMockRecorder +} + +// MockDestinationRuleEventHandlerMockRecorder is the mock recorder for MockDestinationRuleEventHandler. +type MockDestinationRuleEventHandlerMockRecorder struct { + mock *MockDestinationRuleEventHandler +} + +// NewMockDestinationRuleEventHandler creates a new mock instance. +func NewMockDestinationRuleEventHandler(ctrl *gomock.Controller) *MockDestinationRuleEventHandler { + mock := &MockDestinationRuleEventHandler{ctrl: ctrl} + mock.recorder = &MockDestinationRuleEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleEventHandler) EXPECT() *MockDestinationRuleEventHandlerMockRecorder { + return m.recorder +} + +// CreateDestinationRule mocks base method. +func (m *MockDestinationRuleEventHandler) CreateDestinationRule(obj *v1alpha3.DestinationRule) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateDestinationRule", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateDestinationRule indicates an expected call of CreateDestinationRule. +func (mr *MockDestinationRuleEventHandlerMockRecorder) CreateDestinationRule(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDestinationRule", reflect.TypeOf((*MockDestinationRuleEventHandler)(nil).CreateDestinationRule), obj) +} + +// DeleteDestinationRule mocks base method. +func (m *MockDestinationRuleEventHandler) DeleteDestinationRule(obj *v1alpha3.DestinationRule) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteDestinationRule", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteDestinationRule indicates an expected call of DeleteDestinationRule. +func (mr *MockDestinationRuleEventHandlerMockRecorder) DeleteDestinationRule(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDestinationRule", reflect.TypeOf((*MockDestinationRuleEventHandler)(nil).DeleteDestinationRule), obj) +} + +// GenericDestinationRule mocks base method. +func (m *MockDestinationRuleEventHandler) GenericDestinationRule(obj *v1alpha3.DestinationRule) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericDestinationRule", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericDestinationRule indicates an expected call of GenericDestinationRule. +func (mr *MockDestinationRuleEventHandlerMockRecorder) GenericDestinationRule(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericDestinationRule", reflect.TypeOf((*MockDestinationRuleEventHandler)(nil).GenericDestinationRule), obj) +} + +// UpdateDestinationRule mocks base method. +func (m *MockDestinationRuleEventHandler) UpdateDestinationRule(old, new *v1alpha3.DestinationRule) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateDestinationRule", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDestinationRule indicates an expected call of UpdateDestinationRule. +func (mr *MockDestinationRuleEventHandlerMockRecorder) UpdateDestinationRule(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDestinationRule", reflect.TypeOf((*MockDestinationRuleEventHandler)(nil).UpdateDestinationRule), old, new) +} + +// MockDestinationRuleEventWatcher is a mock of DestinationRuleEventWatcher interface. +type MockDestinationRuleEventWatcher struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleEventWatcherMockRecorder +} + +// MockDestinationRuleEventWatcherMockRecorder is the mock recorder for MockDestinationRuleEventWatcher. +type MockDestinationRuleEventWatcherMockRecorder struct { + mock *MockDestinationRuleEventWatcher +} + +// NewMockDestinationRuleEventWatcher creates a new mock instance. +func NewMockDestinationRuleEventWatcher(ctrl *gomock.Controller) *MockDestinationRuleEventWatcher { + mock := &MockDestinationRuleEventWatcher{ctrl: ctrl} + mock.recorder = &MockDestinationRuleEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleEventWatcher) EXPECT() *MockDestinationRuleEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockDestinationRuleEventWatcher) AddEventHandler(ctx context.Context, h controller.DestinationRuleEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockDestinationRuleEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockDestinationRuleEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockGatewayEventHandler is a mock of GatewayEventHandler interface. +type MockGatewayEventHandler struct { + ctrl *gomock.Controller + recorder *MockGatewayEventHandlerMockRecorder +} + +// MockGatewayEventHandlerMockRecorder is the mock recorder for MockGatewayEventHandler. +type MockGatewayEventHandlerMockRecorder struct { + mock *MockGatewayEventHandler +} + +// NewMockGatewayEventHandler creates a new mock instance. +func NewMockGatewayEventHandler(ctrl *gomock.Controller) *MockGatewayEventHandler { + mock := &MockGatewayEventHandler{ctrl: ctrl} + mock.recorder = &MockGatewayEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayEventHandler) EXPECT() *MockGatewayEventHandlerMockRecorder { + return m.recorder +} + +// CreateGateway mocks base method. +func (m *MockGatewayEventHandler) CreateGateway(obj *v1alpha3.Gateway) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateGateway", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateGateway indicates an expected call of CreateGateway. +func (mr *MockGatewayEventHandlerMockRecorder) CreateGateway(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateGateway", reflect.TypeOf((*MockGatewayEventHandler)(nil).CreateGateway), obj) +} + +// DeleteGateway mocks base method. +func (m *MockGatewayEventHandler) DeleteGateway(obj *v1alpha3.Gateway) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteGateway", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteGateway indicates an expected call of DeleteGateway. +func (mr *MockGatewayEventHandlerMockRecorder) DeleteGateway(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteGateway", reflect.TypeOf((*MockGatewayEventHandler)(nil).DeleteGateway), obj) +} + +// GenericGateway mocks base method. +func (m *MockGatewayEventHandler) GenericGateway(obj *v1alpha3.Gateway) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericGateway", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericGateway indicates an expected call of GenericGateway. +func (mr *MockGatewayEventHandlerMockRecorder) GenericGateway(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericGateway", reflect.TypeOf((*MockGatewayEventHandler)(nil).GenericGateway), obj) +} + +// UpdateGateway mocks base method. +func (m *MockGatewayEventHandler) UpdateGateway(old, new *v1alpha3.Gateway) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateGateway", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateGateway indicates an expected call of UpdateGateway. +func (mr *MockGatewayEventHandlerMockRecorder) UpdateGateway(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGateway", reflect.TypeOf((*MockGatewayEventHandler)(nil).UpdateGateway), old, new) +} + +// MockGatewayEventWatcher is a mock of GatewayEventWatcher interface. +type MockGatewayEventWatcher struct { + ctrl *gomock.Controller + recorder *MockGatewayEventWatcherMockRecorder +} + +// MockGatewayEventWatcherMockRecorder is the mock recorder for MockGatewayEventWatcher. +type MockGatewayEventWatcherMockRecorder struct { + mock *MockGatewayEventWatcher +} + +// NewMockGatewayEventWatcher creates a new mock instance. +func NewMockGatewayEventWatcher(ctrl *gomock.Controller) *MockGatewayEventWatcher { + mock := &MockGatewayEventWatcher{ctrl: ctrl} + mock.recorder = &MockGatewayEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayEventWatcher) EXPECT() *MockGatewayEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockGatewayEventWatcher) AddEventHandler(ctx context.Context, h controller.GatewayEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockGatewayEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockGatewayEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockServiceEntryEventHandler is a mock of ServiceEntryEventHandler interface. +type MockServiceEntryEventHandler struct { + ctrl *gomock.Controller + recorder *MockServiceEntryEventHandlerMockRecorder +} + +// MockServiceEntryEventHandlerMockRecorder is the mock recorder for MockServiceEntryEventHandler. +type MockServiceEntryEventHandlerMockRecorder struct { + mock *MockServiceEntryEventHandler +} + +// NewMockServiceEntryEventHandler creates a new mock instance. +func NewMockServiceEntryEventHandler(ctrl *gomock.Controller) *MockServiceEntryEventHandler { + mock := &MockServiceEntryEventHandler{ctrl: ctrl} + mock.recorder = &MockServiceEntryEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryEventHandler) EXPECT() *MockServiceEntryEventHandlerMockRecorder { + return m.recorder +} + +// CreateServiceEntry mocks base method. +func (m *MockServiceEntryEventHandler) CreateServiceEntry(obj *v1alpha3.ServiceEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateServiceEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateServiceEntry indicates an expected call of CreateServiceEntry. +func (mr *MockServiceEntryEventHandlerMockRecorder) CreateServiceEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceEntry", reflect.TypeOf((*MockServiceEntryEventHandler)(nil).CreateServiceEntry), obj) +} + +// DeleteServiceEntry mocks base method. +func (m *MockServiceEntryEventHandler) DeleteServiceEntry(obj *v1alpha3.ServiceEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteServiceEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteServiceEntry indicates an expected call of DeleteServiceEntry. +func (mr *MockServiceEntryEventHandlerMockRecorder) DeleteServiceEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceEntry", reflect.TypeOf((*MockServiceEntryEventHandler)(nil).DeleteServiceEntry), obj) +} + +// GenericServiceEntry mocks base method. +func (m *MockServiceEntryEventHandler) GenericServiceEntry(obj *v1alpha3.ServiceEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericServiceEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericServiceEntry indicates an expected call of GenericServiceEntry. +func (mr *MockServiceEntryEventHandlerMockRecorder) GenericServiceEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericServiceEntry", reflect.TypeOf((*MockServiceEntryEventHandler)(nil).GenericServiceEntry), obj) +} + +// UpdateServiceEntry mocks base method. +func (m *MockServiceEntryEventHandler) UpdateServiceEntry(old, new *v1alpha3.ServiceEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateServiceEntry", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateServiceEntry indicates an expected call of UpdateServiceEntry. +func (mr *MockServiceEntryEventHandlerMockRecorder) UpdateServiceEntry(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceEntry", reflect.TypeOf((*MockServiceEntryEventHandler)(nil).UpdateServiceEntry), old, new) +} + +// MockServiceEntryEventWatcher is a mock of ServiceEntryEventWatcher interface. +type MockServiceEntryEventWatcher struct { + ctrl *gomock.Controller + recorder *MockServiceEntryEventWatcherMockRecorder +} + +// MockServiceEntryEventWatcherMockRecorder is the mock recorder for MockServiceEntryEventWatcher. +type MockServiceEntryEventWatcherMockRecorder struct { + mock *MockServiceEntryEventWatcher +} + +// NewMockServiceEntryEventWatcher creates a new mock instance. +func NewMockServiceEntryEventWatcher(ctrl *gomock.Controller) *MockServiceEntryEventWatcher { + mock := &MockServiceEntryEventWatcher{ctrl: ctrl} + mock.recorder = &MockServiceEntryEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryEventWatcher) EXPECT() *MockServiceEntryEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockServiceEntryEventWatcher) AddEventHandler(ctx context.Context, h controller.ServiceEntryEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockServiceEntryEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockServiceEntryEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockWorkloadEntryEventHandler is a mock of WorkloadEntryEventHandler interface. +type MockWorkloadEntryEventHandler struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryEventHandlerMockRecorder +} + +// MockWorkloadEntryEventHandlerMockRecorder is the mock recorder for MockWorkloadEntryEventHandler. +type MockWorkloadEntryEventHandlerMockRecorder struct { + mock *MockWorkloadEntryEventHandler +} + +// NewMockWorkloadEntryEventHandler creates a new mock instance. +func NewMockWorkloadEntryEventHandler(ctrl *gomock.Controller) *MockWorkloadEntryEventHandler { + mock := &MockWorkloadEntryEventHandler{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryEventHandler) EXPECT() *MockWorkloadEntryEventHandlerMockRecorder { + return m.recorder +} + +// CreateWorkloadEntry mocks base method. +func (m *MockWorkloadEntryEventHandler) CreateWorkloadEntry(obj *v1alpha3.WorkloadEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateWorkloadEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateWorkloadEntry indicates an expected call of CreateWorkloadEntry. +func (mr *MockWorkloadEntryEventHandlerMockRecorder) CreateWorkloadEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryEventHandler)(nil).CreateWorkloadEntry), obj) +} + +// DeleteWorkloadEntry mocks base method. +func (m *MockWorkloadEntryEventHandler) DeleteWorkloadEntry(obj *v1alpha3.WorkloadEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteWorkloadEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteWorkloadEntry indicates an expected call of DeleteWorkloadEntry. +func (mr *MockWorkloadEntryEventHandlerMockRecorder) DeleteWorkloadEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryEventHandler)(nil).DeleteWorkloadEntry), obj) +} + +// GenericWorkloadEntry mocks base method. +func (m *MockWorkloadEntryEventHandler) GenericWorkloadEntry(obj *v1alpha3.WorkloadEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericWorkloadEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericWorkloadEntry indicates an expected call of GenericWorkloadEntry. +func (mr *MockWorkloadEntryEventHandlerMockRecorder) GenericWorkloadEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryEventHandler)(nil).GenericWorkloadEntry), obj) +} + +// UpdateWorkloadEntry mocks base method. +func (m *MockWorkloadEntryEventHandler) UpdateWorkloadEntry(old, new *v1alpha3.WorkloadEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateWorkloadEntry", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadEntry indicates an expected call of UpdateWorkloadEntry. +func (mr *MockWorkloadEntryEventHandlerMockRecorder) UpdateWorkloadEntry(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryEventHandler)(nil).UpdateWorkloadEntry), old, new) +} + +// MockWorkloadEntryEventWatcher is a mock of WorkloadEntryEventWatcher interface. +type MockWorkloadEntryEventWatcher struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryEventWatcherMockRecorder +} + +// MockWorkloadEntryEventWatcherMockRecorder is the mock recorder for MockWorkloadEntryEventWatcher. +type MockWorkloadEntryEventWatcherMockRecorder struct { + mock *MockWorkloadEntryEventWatcher +} + +// NewMockWorkloadEntryEventWatcher creates a new mock instance. +func NewMockWorkloadEntryEventWatcher(ctrl *gomock.Controller) *MockWorkloadEntryEventWatcher { + mock := &MockWorkloadEntryEventWatcher{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryEventWatcher) EXPECT() *MockWorkloadEntryEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockWorkloadEntryEventWatcher) AddEventHandler(ctx context.Context, h controller.WorkloadEntryEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockWorkloadEntryEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockWorkloadEntryEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockWorkloadGroupEventHandler is a mock of WorkloadGroupEventHandler interface. +type MockWorkloadGroupEventHandler struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupEventHandlerMockRecorder +} + +// MockWorkloadGroupEventHandlerMockRecorder is the mock recorder for MockWorkloadGroupEventHandler. +type MockWorkloadGroupEventHandlerMockRecorder struct { + mock *MockWorkloadGroupEventHandler +} + +// NewMockWorkloadGroupEventHandler creates a new mock instance. +func NewMockWorkloadGroupEventHandler(ctrl *gomock.Controller) *MockWorkloadGroupEventHandler { + mock := &MockWorkloadGroupEventHandler{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupEventHandler) EXPECT() *MockWorkloadGroupEventHandlerMockRecorder { + return m.recorder +} + +// CreateWorkloadGroup mocks base method. +func (m *MockWorkloadGroupEventHandler) CreateWorkloadGroup(obj *v1alpha3.WorkloadGroup) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateWorkloadGroup", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateWorkloadGroup indicates an expected call of CreateWorkloadGroup. +func (mr *MockWorkloadGroupEventHandlerMockRecorder) CreateWorkloadGroup(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupEventHandler)(nil).CreateWorkloadGroup), obj) +} + +// DeleteWorkloadGroup mocks base method. +func (m *MockWorkloadGroupEventHandler) DeleteWorkloadGroup(obj *v1alpha3.WorkloadGroup) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteWorkloadGroup", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteWorkloadGroup indicates an expected call of DeleteWorkloadGroup. +func (mr *MockWorkloadGroupEventHandlerMockRecorder) DeleteWorkloadGroup(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupEventHandler)(nil).DeleteWorkloadGroup), obj) +} + +// GenericWorkloadGroup mocks base method. +func (m *MockWorkloadGroupEventHandler) GenericWorkloadGroup(obj *v1alpha3.WorkloadGroup) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericWorkloadGroup", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericWorkloadGroup indicates an expected call of GenericWorkloadGroup. +func (mr *MockWorkloadGroupEventHandlerMockRecorder) GenericWorkloadGroup(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupEventHandler)(nil).GenericWorkloadGroup), obj) +} + +// UpdateWorkloadGroup mocks base method. +func (m *MockWorkloadGroupEventHandler) UpdateWorkloadGroup(old, new *v1alpha3.WorkloadGroup) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateWorkloadGroup", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadGroup indicates an expected call of UpdateWorkloadGroup. +func (mr *MockWorkloadGroupEventHandlerMockRecorder) UpdateWorkloadGroup(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupEventHandler)(nil).UpdateWorkloadGroup), old, new) +} + +// MockWorkloadGroupEventWatcher is a mock of WorkloadGroupEventWatcher interface. +type MockWorkloadGroupEventWatcher struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupEventWatcherMockRecorder +} + +// MockWorkloadGroupEventWatcherMockRecorder is the mock recorder for MockWorkloadGroupEventWatcher. +type MockWorkloadGroupEventWatcherMockRecorder struct { + mock *MockWorkloadGroupEventWatcher +} + +// NewMockWorkloadGroupEventWatcher creates a new mock instance. +func NewMockWorkloadGroupEventWatcher(ctrl *gomock.Controller) *MockWorkloadGroupEventWatcher { + mock := &MockWorkloadGroupEventWatcher{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupEventWatcher) EXPECT() *MockWorkloadGroupEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockWorkloadGroupEventWatcher) AddEventHandler(ctx context.Context, h controller.WorkloadGroupEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockWorkloadGroupEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockWorkloadGroupEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockVirtualServiceEventHandler is a mock of VirtualServiceEventHandler interface. +type MockVirtualServiceEventHandler struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceEventHandlerMockRecorder +} + +// MockVirtualServiceEventHandlerMockRecorder is the mock recorder for MockVirtualServiceEventHandler. +type MockVirtualServiceEventHandlerMockRecorder struct { + mock *MockVirtualServiceEventHandler +} + +// NewMockVirtualServiceEventHandler creates a new mock instance. +func NewMockVirtualServiceEventHandler(ctrl *gomock.Controller) *MockVirtualServiceEventHandler { + mock := &MockVirtualServiceEventHandler{ctrl: ctrl} + mock.recorder = &MockVirtualServiceEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceEventHandler) EXPECT() *MockVirtualServiceEventHandlerMockRecorder { + return m.recorder +} + +// CreateVirtualService mocks base method. +func (m *MockVirtualServiceEventHandler) CreateVirtualService(obj *v1alpha3.VirtualService) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateVirtualService", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateVirtualService indicates an expected call of CreateVirtualService. +func (mr *MockVirtualServiceEventHandlerMockRecorder) CreateVirtualService(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVirtualService", reflect.TypeOf((*MockVirtualServiceEventHandler)(nil).CreateVirtualService), obj) +} + +// DeleteVirtualService mocks base method. +func (m *MockVirtualServiceEventHandler) DeleteVirtualService(obj *v1alpha3.VirtualService) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteVirtualService", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteVirtualService indicates an expected call of DeleteVirtualService. +func (mr *MockVirtualServiceEventHandlerMockRecorder) DeleteVirtualService(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVirtualService", reflect.TypeOf((*MockVirtualServiceEventHandler)(nil).DeleteVirtualService), obj) +} + +// GenericVirtualService mocks base method. +func (m *MockVirtualServiceEventHandler) GenericVirtualService(obj *v1alpha3.VirtualService) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericVirtualService", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericVirtualService indicates an expected call of GenericVirtualService. +func (mr *MockVirtualServiceEventHandlerMockRecorder) GenericVirtualService(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericVirtualService", reflect.TypeOf((*MockVirtualServiceEventHandler)(nil).GenericVirtualService), obj) +} + +// UpdateVirtualService mocks base method. +func (m *MockVirtualServiceEventHandler) UpdateVirtualService(old, new *v1alpha3.VirtualService) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateVirtualService", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateVirtualService indicates an expected call of UpdateVirtualService. +func (mr *MockVirtualServiceEventHandlerMockRecorder) UpdateVirtualService(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVirtualService", reflect.TypeOf((*MockVirtualServiceEventHandler)(nil).UpdateVirtualService), old, new) +} + +// MockVirtualServiceEventWatcher is a mock of VirtualServiceEventWatcher interface. +type MockVirtualServiceEventWatcher struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceEventWatcherMockRecorder +} + +// MockVirtualServiceEventWatcherMockRecorder is the mock recorder for MockVirtualServiceEventWatcher. +type MockVirtualServiceEventWatcherMockRecorder struct { + mock *MockVirtualServiceEventWatcher +} + +// NewMockVirtualServiceEventWatcher creates a new mock instance. +func NewMockVirtualServiceEventWatcher(ctrl *gomock.Controller) *MockVirtualServiceEventWatcher { + mock := &MockVirtualServiceEventWatcher{ctrl: ctrl} + mock.recorder = &MockVirtualServiceEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceEventWatcher) EXPECT() *MockVirtualServiceEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockVirtualServiceEventWatcher) AddEventHandler(ctx context.Context, h controller.VirtualServiceEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockVirtualServiceEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockVirtualServiceEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockSidecarEventHandler is a mock of SidecarEventHandler interface. +type MockSidecarEventHandler struct { + ctrl *gomock.Controller + recorder *MockSidecarEventHandlerMockRecorder +} + +// MockSidecarEventHandlerMockRecorder is the mock recorder for MockSidecarEventHandler. +type MockSidecarEventHandlerMockRecorder struct { + mock *MockSidecarEventHandler +} + +// NewMockSidecarEventHandler creates a new mock instance. +func NewMockSidecarEventHandler(ctrl *gomock.Controller) *MockSidecarEventHandler { + mock := &MockSidecarEventHandler{ctrl: ctrl} + mock.recorder = &MockSidecarEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarEventHandler) EXPECT() *MockSidecarEventHandlerMockRecorder { + return m.recorder +} + +// CreateSidecar mocks base method. +func (m *MockSidecarEventHandler) CreateSidecar(obj *v1alpha3.Sidecar) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateSidecar", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateSidecar indicates an expected call of CreateSidecar. +func (mr *MockSidecarEventHandlerMockRecorder) CreateSidecar(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSidecar", reflect.TypeOf((*MockSidecarEventHandler)(nil).CreateSidecar), obj) +} + +// DeleteSidecar mocks base method. +func (m *MockSidecarEventHandler) DeleteSidecar(obj *v1alpha3.Sidecar) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteSidecar", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteSidecar indicates an expected call of DeleteSidecar. +func (mr *MockSidecarEventHandlerMockRecorder) DeleteSidecar(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSidecar", reflect.TypeOf((*MockSidecarEventHandler)(nil).DeleteSidecar), obj) +} + +// GenericSidecar mocks base method. +func (m *MockSidecarEventHandler) GenericSidecar(obj *v1alpha3.Sidecar) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericSidecar", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericSidecar indicates an expected call of GenericSidecar. +func (mr *MockSidecarEventHandlerMockRecorder) GenericSidecar(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericSidecar", reflect.TypeOf((*MockSidecarEventHandler)(nil).GenericSidecar), obj) +} + +// UpdateSidecar mocks base method. +func (m *MockSidecarEventHandler) UpdateSidecar(old, new *v1alpha3.Sidecar) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateSidecar", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateSidecar indicates an expected call of UpdateSidecar. +func (mr *MockSidecarEventHandlerMockRecorder) UpdateSidecar(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSidecar", reflect.TypeOf((*MockSidecarEventHandler)(nil).UpdateSidecar), old, new) +} + +// MockSidecarEventWatcher is a mock of SidecarEventWatcher interface. +type MockSidecarEventWatcher struct { + ctrl *gomock.Controller + recorder *MockSidecarEventWatcherMockRecorder +} + +// MockSidecarEventWatcherMockRecorder is the mock recorder for MockSidecarEventWatcher. +type MockSidecarEventWatcherMockRecorder struct { + mock *MockSidecarEventWatcher +} + +// NewMockSidecarEventWatcher creates a new mock instance. +func NewMockSidecarEventWatcher(ctrl *gomock.Controller) *MockSidecarEventWatcher { + mock := &MockSidecarEventWatcher{ctrl: ctrl} + mock.recorder = &MockSidecarEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarEventWatcher) EXPECT() *MockSidecarEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockSidecarEventWatcher) AddEventHandler(ctx context.Context, h controller.SidecarEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockSidecarEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockSidecarEventWatcher)(nil).AddEventHandler), varargs...) +} + // MockEnvoyFilterEventHandler is a mock of EnvoyFilterEventHandler interface. type MockEnvoyFilterEventHandler struct { ctrl *gomock.Controller diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/multicluster_reconcilers.go b/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/multicluster_reconcilers.go index e8b9ad8..e215697 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/multicluster_reconcilers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/multicluster_reconcilers.go @@ -15,6 +15,811 @@ import ( predicate "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// MockMulticlusterDestinationRuleReconciler is a mock of MulticlusterDestinationRuleReconciler interface. +type MockMulticlusterDestinationRuleReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterDestinationRuleReconcilerMockRecorder +} + +// MockMulticlusterDestinationRuleReconcilerMockRecorder is the mock recorder for MockMulticlusterDestinationRuleReconciler. +type MockMulticlusterDestinationRuleReconcilerMockRecorder struct { + mock *MockMulticlusterDestinationRuleReconciler +} + +// NewMockMulticlusterDestinationRuleReconciler creates a new mock instance. +func NewMockMulticlusterDestinationRuleReconciler(ctrl *gomock.Controller) *MockMulticlusterDestinationRuleReconciler { + mock := &MockMulticlusterDestinationRuleReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterDestinationRuleReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterDestinationRuleReconciler) EXPECT() *MockMulticlusterDestinationRuleReconcilerMockRecorder { + return m.recorder +} + +// ReconcileDestinationRule mocks base method. +func (m *MockMulticlusterDestinationRuleReconciler) ReconcileDestinationRule(clusterName string, obj *v1alpha3.DestinationRule) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileDestinationRule", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileDestinationRule indicates an expected call of ReconcileDestinationRule. +func (mr *MockMulticlusterDestinationRuleReconcilerMockRecorder) ReconcileDestinationRule(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileDestinationRule", reflect.TypeOf((*MockMulticlusterDestinationRuleReconciler)(nil).ReconcileDestinationRule), clusterName, obj) +} + +// MockMulticlusterDestinationRuleDeletionReconciler is a mock of MulticlusterDestinationRuleDeletionReconciler interface. +type MockMulticlusterDestinationRuleDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterDestinationRuleDeletionReconcilerMockRecorder +} + +// MockMulticlusterDestinationRuleDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterDestinationRuleDeletionReconciler. +type MockMulticlusterDestinationRuleDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterDestinationRuleDeletionReconciler +} + +// NewMockMulticlusterDestinationRuleDeletionReconciler creates a new mock instance. +func NewMockMulticlusterDestinationRuleDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterDestinationRuleDeletionReconciler { + mock := &MockMulticlusterDestinationRuleDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterDestinationRuleDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterDestinationRuleDeletionReconciler) EXPECT() *MockMulticlusterDestinationRuleDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileDestinationRuleDeletion mocks base method. +func (m *MockMulticlusterDestinationRuleDeletionReconciler) ReconcileDestinationRuleDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileDestinationRuleDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileDestinationRuleDeletion indicates an expected call of ReconcileDestinationRuleDeletion. +func (mr *MockMulticlusterDestinationRuleDeletionReconcilerMockRecorder) ReconcileDestinationRuleDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileDestinationRuleDeletion", reflect.TypeOf((*MockMulticlusterDestinationRuleDeletionReconciler)(nil).ReconcileDestinationRuleDeletion), clusterName, req) +} + +// MockMulticlusterDestinationRuleReconcileLoop is a mock of MulticlusterDestinationRuleReconcileLoop interface. +type MockMulticlusterDestinationRuleReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterDestinationRuleReconcileLoopMockRecorder +} + +// MockMulticlusterDestinationRuleReconcileLoopMockRecorder is the mock recorder for MockMulticlusterDestinationRuleReconcileLoop. +type MockMulticlusterDestinationRuleReconcileLoopMockRecorder struct { + mock *MockMulticlusterDestinationRuleReconcileLoop +} + +// NewMockMulticlusterDestinationRuleReconcileLoop creates a new mock instance. +func NewMockMulticlusterDestinationRuleReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterDestinationRuleReconcileLoop { + mock := &MockMulticlusterDestinationRuleReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterDestinationRuleReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterDestinationRuleReconcileLoop) EXPECT() *MockMulticlusterDestinationRuleReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterDestinationRuleReconciler mocks base method. +func (m *MockMulticlusterDestinationRuleReconcileLoop) AddMulticlusterDestinationRuleReconciler(ctx context.Context, rec controller.MulticlusterDestinationRuleReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterDestinationRuleReconciler", varargs...) +} + +// AddMulticlusterDestinationRuleReconciler indicates an expected call of AddMulticlusterDestinationRuleReconciler. +func (mr *MockMulticlusterDestinationRuleReconcileLoopMockRecorder) AddMulticlusterDestinationRuleReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterDestinationRuleReconciler", reflect.TypeOf((*MockMulticlusterDestinationRuleReconcileLoop)(nil).AddMulticlusterDestinationRuleReconciler), varargs...) +} + +// MockMulticlusterGatewayReconciler is a mock of MulticlusterGatewayReconciler interface. +type MockMulticlusterGatewayReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterGatewayReconcilerMockRecorder +} + +// MockMulticlusterGatewayReconcilerMockRecorder is the mock recorder for MockMulticlusterGatewayReconciler. +type MockMulticlusterGatewayReconcilerMockRecorder struct { + mock *MockMulticlusterGatewayReconciler +} + +// NewMockMulticlusterGatewayReconciler creates a new mock instance. +func NewMockMulticlusterGatewayReconciler(ctrl *gomock.Controller) *MockMulticlusterGatewayReconciler { + mock := &MockMulticlusterGatewayReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterGatewayReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterGatewayReconciler) EXPECT() *MockMulticlusterGatewayReconcilerMockRecorder { + return m.recorder +} + +// ReconcileGateway mocks base method. +func (m *MockMulticlusterGatewayReconciler) ReconcileGateway(clusterName string, obj *v1alpha3.Gateway) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileGateway", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileGateway indicates an expected call of ReconcileGateway. +func (mr *MockMulticlusterGatewayReconcilerMockRecorder) ReconcileGateway(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileGateway", reflect.TypeOf((*MockMulticlusterGatewayReconciler)(nil).ReconcileGateway), clusterName, obj) +} + +// MockMulticlusterGatewayDeletionReconciler is a mock of MulticlusterGatewayDeletionReconciler interface. +type MockMulticlusterGatewayDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterGatewayDeletionReconcilerMockRecorder +} + +// MockMulticlusterGatewayDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterGatewayDeletionReconciler. +type MockMulticlusterGatewayDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterGatewayDeletionReconciler +} + +// NewMockMulticlusterGatewayDeletionReconciler creates a new mock instance. +func NewMockMulticlusterGatewayDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterGatewayDeletionReconciler { + mock := &MockMulticlusterGatewayDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterGatewayDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterGatewayDeletionReconciler) EXPECT() *MockMulticlusterGatewayDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileGatewayDeletion mocks base method. +func (m *MockMulticlusterGatewayDeletionReconciler) ReconcileGatewayDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileGatewayDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileGatewayDeletion indicates an expected call of ReconcileGatewayDeletion. +func (mr *MockMulticlusterGatewayDeletionReconcilerMockRecorder) ReconcileGatewayDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileGatewayDeletion", reflect.TypeOf((*MockMulticlusterGatewayDeletionReconciler)(nil).ReconcileGatewayDeletion), clusterName, req) +} + +// MockMulticlusterGatewayReconcileLoop is a mock of MulticlusterGatewayReconcileLoop interface. +type MockMulticlusterGatewayReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterGatewayReconcileLoopMockRecorder +} + +// MockMulticlusterGatewayReconcileLoopMockRecorder is the mock recorder for MockMulticlusterGatewayReconcileLoop. +type MockMulticlusterGatewayReconcileLoopMockRecorder struct { + mock *MockMulticlusterGatewayReconcileLoop +} + +// NewMockMulticlusterGatewayReconcileLoop creates a new mock instance. +func NewMockMulticlusterGatewayReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterGatewayReconcileLoop { + mock := &MockMulticlusterGatewayReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterGatewayReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterGatewayReconcileLoop) EXPECT() *MockMulticlusterGatewayReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterGatewayReconciler mocks base method. +func (m *MockMulticlusterGatewayReconcileLoop) AddMulticlusterGatewayReconciler(ctx context.Context, rec controller.MulticlusterGatewayReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterGatewayReconciler", varargs...) +} + +// AddMulticlusterGatewayReconciler indicates an expected call of AddMulticlusterGatewayReconciler. +func (mr *MockMulticlusterGatewayReconcileLoopMockRecorder) AddMulticlusterGatewayReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterGatewayReconciler", reflect.TypeOf((*MockMulticlusterGatewayReconcileLoop)(nil).AddMulticlusterGatewayReconciler), varargs...) +} + +// MockMulticlusterServiceEntryReconciler is a mock of MulticlusterServiceEntryReconciler interface. +type MockMulticlusterServiceEntryReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterServiceEntryReconcilerMockRecorder +} + +// MockMulticlusterServiceEntryReconcilerMockRecorder is the mock recorder for MockMulticlusterServiceEntryReconciler. +type MockMulticlusterServiceEntryReconcilerMockRecorder struct { + mock *MockMulticlusterServiceEntryReconciler +} + +// NewMockMulticlusterServiceEntryReconciler creates a new mock instance. +func NewMockMulticlusterServiceEntryReconciler(ctrl *gomock.Controller) *MockMulticlusterServiceEntryReconciler { + mock := &MockMulticlusterServiceEntryReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterServiceEntryReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterServiceEntryReconciler) EXPECT() *MockMulticlusterServiceEntryReconcilerMockRecorder { + return m.recorder +} + +// ReconcileServiceEntry mocks base method. +func (m *MockMulticlusterServiceEntryReconciler) ReconcileServiceEntry(clusterName string, obj *v1alpha3.ServiceEntry) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileServiceEntry", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileServiceEntry indicates an expected call of ReconcileServiceEntry. +func (mr *MockMulticlusterServiceEntryReconcilerMockRecorder) ReconcileServiceEntry(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileServiceEntry", reflect.TypeOf((*MockMulticlusterServiceEntryReconciler)(nil).ReconcileServiceEntry), clusterName, obj) +} + +// MockMulticlusterServiceEntryDeletionReconciler is a mock of MulticlusterServiceEntryDeletionReconciler interface. +type MockMulticlusterServiceEntryDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterServiceEntryDeletionReconcilerMockRecorder +} + +// MockMulticlusterServiceEntryDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterServiceEntryDeletionReconciler. +type MockMulticlusterServiceEntryDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterServiceEntryDeletionReconciler +} + +// NewMockMulticlusterServiceEntryDeletionReconciler creates a new mock instance. +func NewMockMulticlusterServiceEntryDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterServiceEntryDeletionReconciler { + mock := &MockMulticlusterServiceEntryDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterServiceEntryDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterServiceEntryDeletionReconciler) EXPECT() *MockMulticlusterServiceEntryDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileServiceEntryDeletion mocks base method. +func (m *MockMulticlusterServiceEntryDeletionReconciler) ReconcileServiceEntryDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileServiceEntryDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileServiceEntryDeletion indicates an expected call of ReconcileServiceEntryDeletion. +func (mr *MockMulticlusterServiceEntryDeletionReconcilerMockRecorder) ReconcileServiceEntryDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileServiceEntryDeletion", reflect.TypeOf((*MockMulticlusterServiceEntryDeletionReconciler)(nil).ReconcileServiceEntryDeletion), clusterName, req) +} + +// MockMulticlusterServiceEntryReconcileLoop is a mock of MulticlusterServiceEntryReconcileLoop interface. +type MockMulticlusterServiceEntryReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterServiceEntryReconcileLoopMockRecorder +} + +// MockMulticlusterServiceEntryReconcileLoopMockRecorder is the mock recorder for MockMulticlusterServiceEntryReconcileLoop. +type MockMulticlusterServiceEntryReconcileLoopMockRecorder struct { + mock *MockMulticlusterServiceEntryReconcileLoop +} + +// NewMockMulticlusterServiceEntryReconcileLoop creates a new mock instance. +func NewMockMulticlusterServiceEntryReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterServiceEntryReconcileLoop { + mock := &MockMulticlusterServiceEntryReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterServiceEntryReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterServiceEntryReconcileLoop) EXPECT() *MockMulticlusterServiceEntryReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterServiceEntryReconciler mocks base method. +func (m *MockMulticlusterServiceEntryReconcileLoop) AddMulticlusterServiceEntryReconciler(ctx context.Context, rec controller.MulticlusterServiceEntryReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterServiceEntryReconciler", varargs...) +} + +// AddMulticlusterServiceEntryReconciler indicates an expected call of AddMulticlusterServiceEntryReconciler. +func (mr *MockMulticlusterServiceEntryReconcileLoopMockRecorder) AddMulticlusterServiceEntryReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterServiceEntryReconciler", reflect.TypeOf((*MockMulticlusterServiceEntryReconcileLoop)(nil).AddMulticlusterServiceEntryReconciler), varargs...) +} + +// MockMulticlusterWorkloadEntryReconciler is a mock of MulticlusterWorkloadEntryReconciler interface. +type MockMulticlusterWorkloadEntryReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadEntryReconcilerMockRecorder +} + +// MockMulticlusterWorkloadEntryReconcilerMockRecorder is the mock recorder for MockMulticlusterWorkloadEntryReconciler. +type MockMulticlusterWorkloadEntryReconcilerMockRecorder struct { + mock *MockMulticlusterWorkloadEntryReconciler +} + +// NewMockMulticlusterWorkloadEntryReconciler creates a new mock instance. +func NewMockMulticlusterWorkloadEntryReconciler(ctrl *gomock.Controller) *MockMulticlusterWorkloadEntryReconciler { + mock := &MockMulticlusterWorkloadEntryReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadEntryReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadEntryReconciler) EXPECT() *MockMulticlusterWorkloadEntryReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadEntry mocks base method. +func (m *MockMulticlusterWorkloadEntryReconciler) ReconcileWorkloadEntry(clusterName string, obj *v1alpha3.WorkloadEntry) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadEntry", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileWorkloadEntry indicates an expected call of ReconcileWorkloadEntry. +func (mr *MockMulticlusterWorkloadEntryReconcilerMockRecorder) ReconcileWorkloadEntry(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadEntry", reflect.TypeOf((*MockMulticlusterWorkloadEntryReconciler)(nil).ReconcileWorkloadEntry), clusterName, obj) +} + +// MockMulticlusterWorkloadEntryDeletionReconciler is a mock of MulticlusterWorkloadEntryDeletionReconciler interface. +type MockMulticlusterWorkloadEntryDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadEntryDeletionReconcilerMockRecorder +} + +// MockMulticlusterWorkloadEntryDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterWorkloadEntryDeletionReconciler. +type MockMulticlusterWorkloadEntryDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterWorkloadEntryDeletionReconciler +} + +// NewMockMulticlusterWorkloadEntryDeletionReconciler creates a new mock instance. +func NewMockMulticlusterWorkloadEntryDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterWorkloadEntryDeletionReconciler { + mock := &MockMulticlusterWorkloadEntryDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadEntryDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadEntryDeletionReconciler) EXPECT() *MockMulticlusterWorkloadEntryDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadEntryDeletion mocks base method. +func (m *MockMulticlusterWorkloadEntryDeletionReconciler) ReconcileWorkloadEntryDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadEntryDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileWorkloadEntryDeletion indicates an expected call of ReconcileWorkloadEntryDeletion. +func (mr *MockMulticlusterWorkloadEntryDeletionReconcilerMockRecorder) ReconcileWorkloadEntryDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadEntryDeletion", reflect.TypeOf((*MockMulticlusterWorkloadEntryDeletionReconciler)(nil).ReconcileWorkloadEntryDeletion), clusterName, req) +} + +// MockMulticlusterWorkloadEntryReconcileLoop is a mock of MulticlusterWorkloadEntryReconcileLoop interface. +type MockMulticlusterWorkloadEntryReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadEntryReconcileLoopMockRecorder +} + +// MockMulticlusterWorkloadEntryReconcileLoopMockRecorder is the mock recorder for MockMulticlusterWorkloadEntryReconcileLoop. +type MockMulticlusterWorkloadEntryReconcileLoopMockRecorder struct { + mock *MockMulticlusterWorkloadEntryReconcileLoop +} + +// NewMockMulticlusterWorkloadEntryReconcileLoop creates a new mock instance. +func NewMockMulticlusterWorkloadEntryReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterWorkloadEntryReconcileLoop { + mock := &MockMulticlusterWorkloadEntryReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadEntryReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadEntryReconcileLoop) EXPECT() *MockMulticlusterWorkloadEntryReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterWorkloadEntryReconciler mocks base method. +func (m *MockMulticlusterWorkloadEntryReconcileLoop) AddMulticlusterWorkloadEntryReconciler(ctx context.Context, rec controller.MulticlusterWorkloadEntryReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterWorkloadEntryReconciler", varargs...) +} + +// AddMulticlusterWorkloadEntryReconciler indicates an expected call of AddMulticlusterWorkloadEntryReconciler. +func (mr *MockMulticlusterWorkloadEntryReconcileLoopMockRecorder) AddMulticlusterWorkloadEntryReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterWorkloadEntryReconciler", reflect.TypeOf((*MockMulticlusterWorkloadEntryReconcileLoop)(nil).AddMulticlusterWorkloadEntryReconciler), varargs...) +} + +// MockMulticlusterWorkloadGroupReconciler is a mock of MulticlusterWorkloadGroupReconciler interface. +type MockMulticlusterWorkloadGroupReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadGroupReconcilerMockRecorder +} + +// MockMulticlusterWorkloadGroupReconcilerMockRecorder is the mock recorder for MockMulticlusterWorkloadGroupReconciler. +type MockMulticlusterWorkloadGroupReconcilerMockRecorder struct { + mock *MockMulticlusterWorkloadGroupReconciler +} + +// NewMockMulticlusterWorkloadGroupReconciler creates a new mock instance. +func NewMockMulticlusterWorkloadGroupReconciler(ctrl *gomock.Controller) *MockMulticlusterWorkloadGroupReconciler { + mock := &MockMulticlusterWorkloadGroupReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadGroupReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadGroupReconciler) EXPECT() *MockMulticlusterWorkloadGroupReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadGroup mocks base method. +func (m *MockMulticlusterWorkloadGroupReconciler) ReconcileWorkloadGroup(clusterName string, obj *v1alpha3.WorkloadGroup) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadGroup", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileWorkloadGroup indicates an expected call of ReconcileWorkloadGroup. +func (mr *MockMulticlusterWorkloadGroupReconcilerMockRecorder) ReconcileWorkloadGroup(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadGroup", reflect.TypeOf((*MockMulticlusterWorkloadGroupReconciler)(nil).ReconcileWorkloadGroup), clusterName, obj) +} + +// MockMulticlusterWorkloadGroupDeletionReconciler is a mock of MulticlusterWorkloadGroupDeletionReconciler interface. +type MockMulticlusterWorkloadGroupDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadGroupDeletionReconcilerMockRecorder +} + +// MockMulticlusterWorkloadGroupDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterWorkloadGroupDeletionReconciler. +type MockMulticlusterWorkloadGroupDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterWorkloadGroupDeletionReconciler +} + +// NewMockMulticlusterWorkloadGroupDeletionReconciler creates a new mock instance. +func NewMockMulticlusterWorkloadGroupDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterWorkloadGroupDeletionReconciler { + mock := &MockMulticlusterWorkloadGroupDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadGroupDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadGroupDeletionReconciler) EXPECT() *MockMulticlusterWorkloadGroupDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadGroupDeletion mocks base method. +func (m *MockMulticlusterWorkloadGroupDeletionReconciler) ReconcileWorkloadGroupDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadGroupDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileWorkloadGroupDeletion indicates an expected call of ReconcileWorkloadGroupDeletion. +func (mr *MockMulticlusterWorkloadGroupDeletionReconcilerMockRecorder) ReconcileWorkloadGroupDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadGroupDeletion", reflect.TypeOf((*MockMulticlusterWorkloadGroupDeletionReconciler)(nil).ReconcileWorkloadGroupDeletion), clusterName, req) +} + +// MockMulticlusterWorkloadGroupReconcileLoop is a mock of MulticlusterWorkloadGroupReconcileLoop interface. +type MockMulticlusterWorkloadGroupReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadGroupReconcileLoopMockRecorder +} + +// MockMulticlusterWorkloadGroupReconcileLoopMockRecorder is the mock recorder for MockMulticlusterWorkloadGroupReconcileLoop. +type MockMulticlusterWorkloadGroupReconcileLoopMockRecorder struct { + mock *MockMulticlusterWorkloadGroupReconcileLoop +} + +// NewMockMulticlusterWorkloadGroupReconcileLoop creates a new mock instance. +func NewMockMulticlusterWorkloadGroupReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterWorkloadGroupReconcileLoop { + mock := &MockMulticlusterWorkloadGroupReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadGroupReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadGroupReconcileLoop) EXPECT() *MockMulticlusterWorkloadGroupReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterWorkloadGroupReconciler mocks base method. +func (m *MockMulticlusterWorkloadGroupReconcileLoop) AddMulticlusterWorkloadGroupReconciler(ctx context.Context, rec controller.MulticlusterWorkloadGroupReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterWorkloadGroupReconciler", varargs...) +} + +// AddMulticlusterWorkloadGroupReconciler indicates an expected call of AddMulticlusterWorkloadGroupReconciler. +func (mr *MockMulticlusterWorkloadGroupReconcileLoopMockRecorder) AddMulticlusterWorkloadGroupReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterWorkloadGroupReconciler", reflect.TypeOf((*MockMulticlusterWorkloadGroupReconcileLoop)(nil).AddMulticlusterWorkloadGroupReconciler), varargs...) +} + +// MockMulticlusterVirtualServiceReconciler is a mock of MulticlusterVirtualServiceReconciler interface. +type MockMulticlusterVirtualServiceReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterVirtualServiceReconcilerMockRecorder +} + +// MockMulticlusterVirtualServiceReconcilerMockRecorder is the mock recorder for MockMulticlusterVirtualServiceReconciler. +type MockMulticlusterVirtualServiceReconcilerMockRecorder struct { + mock *MockMulticlusterVirtualServiceReconciler +} + +// NewMockMulticlusterVirtualServiceReconciler creates a new mock instance. +func NewMockMulticlusterVirtualServiceReconciler(ctrl *gomock.Controller) *MockMulticlusterVirtualServiceReconciler { + mock := &MockMulticlusterVirtualServiceReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterVirtualServiceReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterVirtualServiceReconciler) EXPECT() *MockMulticlusterVirtualServiceReconcilerMockRecorder { + return m.recorder +} + +// ReconcileVirtualService mocks base method. +func (m *MockMulticlusterVirtualServiceReconciler) ReconcileVirtualService(clusterName string, obj *v1alpha3.VirtualService) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileVirtualService", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileVirtualService indicates an expected call of ReconcileVirtualService. +func (mr *MockMulticlusterVirtualServiceReconcilerMockRecorder) ReconcileVirtualService(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileVirtualService", reflect.TypeOf((*MockMulticlusterVirtualServiceReconciler)(nil).ReconcileVirtualService), clusterName, obj) +} + +// MockMulticlusterVirtualServiceDeletionReconciler is a mock of MulticlusterVirtualServiceDeletionReconciler interface. +type MockMulticlusterVirtualServiceDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterVirtualServiceDeletionReconcilerMockRecorder +} + +// MockMulticlusterVirtualServiceDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterVirtualServiceDeletionReconciler. +type MockMulticlusterVirtualServiceDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterVirtualServiceDeletionReconciler +} + +// NewMockMulticlusterVirtualServiceDeletionReconciler creates a new mock instance. +func NewMockMulticlusterVirtualServiceDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterVirtualServiceDeletionReconciler { + mock := &MockMulticlusterVirtualServiceDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterVirtualServiceDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterVirtualServiceDeletionReconciler) EXPECT() *MockMulticlusterVirtualServiceDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileVirtualServiceDeletion mocks base method. +func (m *MockMulticlusterVirtualServiceDeletionReconciler) ReconcileVirtualServiceDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileVirtualServiceDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileVirtualServiceDeletion indicates an expected call of ReconcileVirtualServiceDeletion. +func (mr *MockMulticlusterVirtualServiceDeletionReconcilerMockRecorder) ReconcileVirtualServiceDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileVirtualServiceDeletion", reflect.TypeOf((*MockMulticlusterVirtualServiceDeletionReconciler)(nil).ReconcileVirtualServiceDeletion), clusterName, req) +} + +// MockMulticlusterVirtualServiceReconcileLoop is a mock of MulticlusterVirtualServiceReconcileLoop interface. +type MockMulticlusterVirtualServiceReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterVirtualServiceReconcileLoopMockRecorder +} + +// MockMulticlusterVirtualServiceReconcileLoopMockRecorder is the mock recorder for MockMulticlusterVirtualServiceReconcileLoop. +type MockMulticlusterVirtualServiceReconcileLoopMockRecorder struct { + mock *MockMulticlusterVirtualServiceReconcileLoop +} + +// NewMockMulticlusterVirtualServiceReconcileLoop creates a new mock instance. +func NewMockMulticlusterVirtualServiceReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterVirtualServiceReconcileLoop { + mock := &MockMulticlusterVirtualServiceReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterVirtualServiceReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterVirtualServiceReconcileLoop) EXPECT() *MockMulticlusterVirtualServiceReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterVirtualServiceReconciler mocks base method. +func (m *MockMulticlusterVirtualServiceReconcileLoop) AddMulticlusterVirtualServiceReconciler(ctx context.Context, rec controller.MulticlusterVirtualServiceReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterVirtualServiceReconciler", varargs...) +} + +// AddMulticlusterVirtualServiceReconciler indicates an expected call of AddMulticlusterVirtualServiceReconciler. +func (mr *MockMulticlusterVirtualServiceReconcileLoopMockRecorder) AddMulticlusterVirtualServiceReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterVirtualServiceReconciler", reflect.TypeOf((*MockMulticlusterVirtualServiceReconcileLoop)(nil).AddMulticlusterVirtualServiceReconciler), varargs...) +} + +// MockMulticlusterSidecarReconciler is a mock of MulticlusterSidecarReconciler interface. +type MockMulticlusterSidecarReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterSidecarReconcilerMockRecorder +} + +// MockMulticlusterSidecarReconcilerMockRecorder is the mock recorder for MockMulticlusterSidecarReconciler. +type MockMulticlusterSidecarReconcilerMockRecorder struct { + mock *MockMulticlusterSidecarReconciler +} + +// NewMockMulticlusterSidecarReconciler creates a new mock instance. +func NewMockMulticlusterSidecarReconciler(ctrl *gomock.Controller) *MockMulticlusterSidecarReconciler { + mock := &MockMulticlusterSidecarReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterSidecarReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterSidecarReconciler) EXPECT() *MockMulticlusterSidecarReconcilerMockRecorder { + return m.recorder +} + +// ReconcileSidecar mocks base method. +func (m *MockMulticlusterSidecarReconciler) ReconcileSidecar(clusterName string, obj *v1alpha3.Sidecar) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileSidecar", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileSidecar indicates an expected call of ReconcileSidecar. +func (mr *MockMulticlusterSidecarReconcilerMockRecorder) ReconcileSidecar(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileSidecar", reflect.TypeOf((*MockMulticlusterSidecarReconciler)(nil).ReconcileSidecar), clusterName, obj) +} + +// MockMulticlusterSidecarDeletionReconciler is a mock of MulticlusterSidecarDeletionReconciler interface. +type MockMulticlusterSidecarDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterSidecarDeletionReconcilerMockRecorder +} + +// MockMulticlusterSidecarDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterSidecarDeletionReconciler. +type MockMulticlusterSidecarDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterSidecarDeletionReconciler +} + +// NewMockMulticlusterSidecarDeletionReconciler creates a new mock instance. +func NewMockMulticlusterSidecarDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterSidecarDeletionReconciler { + mock := &MockMulticlusterSidecarDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterSidecarDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterSidecarDeletionReconciler) EXPECT() *MockMulticlusterSidecarDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileSidecarDeletion mocks base method. +func (m *MockMulticlusterSidecarDeletionReconciler) ReconcileSidecarDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileSidecarDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileSidecarDeletion indicates an expected call of ReconcileSidecarDeletion. +func (mr *MockMulticlusterSidecarDeletionReconcilerMockRecorder) ReconcileSidecarDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileSidecarDeletion", reflect.TypeOf((*MockMulticlusterSidecarDeletionReconciler)(nil).ReconcileSidecarDeletion), clusterName, req) +} + +// MockMulticlusterSidecarReconcileLoop is a mock of MulticlusterSidecarReconcileLoop interface. +type MockMulticlusterSidecarReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterSidecarReconcileLoopMockRecorder +} + +// MockMulticlusterSidecarReconcileLoopMockRecorder is the mock recorder for MockMulticlusterSidecarReconcileLoop. +type MockMulticlusterSidecarReconcileLoopMockRecorder struct { + mock *MockMulticlusterSidecarReconcileLoop +} + +// NewMockMulticlusterSidecarReconcileLoop creates a new mock instance. +func NewMockMulticlusterSidecarReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterSidecarReconcileLoop { + mock := &MockMulticlusterSidecarReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterSidecarReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterSidecarReconcileLoop) EXPECT() *MockMulticlusterSidecarReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterSidecarReconciler mocks base method. +func (m *MockMulticlusterSidecarReconcileLoop) AddMulticlusterSidecarReconciler(ctx context.Context, rec controller.MulticlusterSidecarReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterSidecarReconciler", varargs...) +} + +// AddMulticlusterSidecarReconciler indicates an expected call of AddMulticlusterSidecarReconciler. +func (mr *MockMulticlusterSidecarReconcileLoopMockRecorder) AddMulticlusterSidecarReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterSidecarReconciler", reflect.TypeOf((*MockMulticlusterSidecarReconcileLoop)(nil).AddMulticlusterSidecarReconciler), varargs...) +} + // MockMulticlusterEnvoyFilterReconciler is a mock of MulticlusterEnvoyFilterReconciler interface. type MockMulticlusterEnvoyFilterReconciler struct { ctrl *gomock.Controller diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/reconcilers.go b/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/reconcilers.go index f566ff4..c4b9e7f 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/reconcilers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/controller/mocks/reconcilers.go @@ -15,6 +15,1287 @@ import ( predicate "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// MockDestinationRuleReconciler is a mock of DestinationRuleReconciler interface. +type MockDestinationRuleReconciler struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleReconcilerMockRecorder +} + +// MockDestinationRuleReconcilerMockRecorder is the mock recorder for MockDestinationRuleReconciler. +type MockDestinationRuleReconcilerMockRecorder struct { + mock *MockDestinationRuleReconciler +} + +// NewMockDestinationRuleReconciler creates a new mock instance. +func NewMockDestinationRuleReconciler(ctrl *gomock.Controller) *MockDestinationRuleReconciler { + mock := &MockDestinationRuleReconciler{ctrl: ctrl} + mock.recorder = &MockDestinationRuleReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleReconciler) EXPECT() *MockDestinationRuleReconcilerMockRecorder { + return m.recorder +} + +// ReconcileDestinationRule mocks base method. +func (m *MockDestinationRuleReconciler) ReconcileDestinationRule(obj *v1alpha3.DestinationRule) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileDestinationRule", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileDestinationRule indicates an expected call of ReconcileDestinationRule. +func (mr *MockDestinationRuleReconcilerMockRecorder) ReconcileDestinationRule(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileDestinationRule", reflect.TypeOf((*MockDestinationRuleReconciler)(nil).ReconcileDestinationRule), obj) +} + +// MockDestinationRuleDeletionReconciler is a mock of DestinationRuleDeletionReconciler interface. +type MockDestinationRuleDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleDeletionReconcilerMockRecorder +} + +// MockDestinationRuleDeletionReconcilerMockRecorder is the mock recorder for MockDestinationRuleDeletionReconciler. +type MockDestinationRuleDeletionReconcilerMockRecorder struct { + mock *MockDestinationRuleDeletionReconciler +} + +// NewMockDestinationRuleDeletionReconciler creates a new mock instance. +func NewMockDestinationRuleDeletionReconciler(ctrl *gomock.Controller) *MockDestinationRuleDeletionReconciler { + mock := &MockDestinationRuleDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockDestinationRuleDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleDeletionReconciler) EXPECT() *MockDestinationRuleDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileDestinationRuleDeletion mocks base method. +func (m *MockDestinationRuleDeletionReconciler) ReconcileDestinationRuleDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileDestinationRuleDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileDestinationRuleDeletion indicates an expected call of ReconcileDestinationRuleDeletion. +func (mr *MockDestinationRuleDeletionReconcilerMockRecorder) ReconcileDestinationRuleDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileDestinationRuleDeletion", reflect.TypeOf((*MockDestinationRuleDeletionReconciler)(nil).ReconcileDestinationRuleDeletion), req) +} + +// MockDestinationRuleFinalizer is a mock of DestinationRuleFinalizer interface. +type MockDestinationRuleFinalizer struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleFinalizerMockRecorder +} + +// MockDestinationRuleFinalizerMockRecorder is the mock recorder for MockDestinationRuleFinalizer. +type MockDestinationRuleFinalizerMockRecorder struct { + mock *MockDestinationRuleFinalizer +} + +// NewMockDestinationRuleFinalizer creates a new mock instance. +func NewMockDestinationRuleFinalizer(ctrl *gomock.Controller) *MockDestinationRuleFinalizer { + mock := &MockDestinationRuleFinalizer{ctrl: ctrl} + mock.recorder = &MockDestinationRuleFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleFinalizer) EXPECT() *MockDestinationRuleFinalizerMockRecorder { + return m.recorder +} + +// DestinationRuleFinalizerName mocks base method. +func (m *MockDestinationRuleFinalizer) DestinationRuleFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DestinationRuleFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// DestinationRuleFinalizerName indicates an expected call of DestinationRuleFinalizerName. +func (mr *MockDestinationRuleFinalizerMockRecorder) DestinationRuleFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestinationRuleFinalizerName", reflect.TypeOf((*MockDestinationRuleFinalizer)(nil).DestinationRuleFinalizerName)) +} + +// FinalizeDestinationRule mocks base method. +func (m *MockDestinationRuleFinalizer) FinalizeDestinationRule(obj *v1alpha3.DestinationRule) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeDestinationRule", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeDestinationRule indicates an expected call of FinalizeDestinationRule. +func (mr *MockDestinationRuleFinalizerMockRecorder) FinalizeDestinationRule(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeDestinationRule", reflect.TypeOf((*MockDestinationRuleFinalizer)(nil).FinalizeDestinationRule), obj) +} + +// ReconcileDestinationRule mocks base method. +func (m *MockDestinationRuleFinalizer) ReconcileDestinationRule(obj *v1alpha3.DestinationRule) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileDestinationRule", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileDestinationRule indicates an expected call of ReconcileDestinationRule. +func (mr *MockDestinationRuleFinalizerMockRecorder) ReconcileDestinationRule(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileDestinationRule", reflect.TypeOf((*MockDestinationRuleFinalizer)(nil).ReconcileDestinationRule), obj) +} + +// MockDestinationRuleReconcileLoop is a mock of DestinationRuleReconcileLoop interface. +type MockDestinationRuleReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleReconcileLoopMockRecorder +} + +// MockDestinationRuleReconcileLoopMockRecorder is the mock recorder for MockDestinationRuleReconcileLoop. +type MockDestinationRuleReconcileLoopMockRecorder struct { + mock *MockDestinationRuleReconcileLoop +} + +// NewMockDestinationRuleReconcileLoop creates a new mock instance. +func NewMockDestinationRuleReconcileLoop(ctrl *gomock.Controller) *MockDestinationRuleReconcileLoop { + mock := &MockDestinationRuleReconcileLoop{ctrl: ctrl} + mock.recorder = &MockDestinationRuleReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleReconcileLoop) EXPECT() *MockDestinationRuleReconcileLoopMockRecorder { + return m.recorder +} + +// RunDestinationRuleReconciler mocks base method. +func (m *MockDestinationRuleReconcileLoop) RunDestinationRuleReconciler(ctx context.Context, rec controller.DestinationRuleReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunDestinationRuleReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunDestinationRuleReconciler indicates an expected call of RunDestinationRuleReconciler. +func (mr *MockDestinationRuleReconcileLoopMockRecorder) RunDestinationRuleReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunDestinationRuleReconciler", reflect.TypeOf((*MockDestinationRuleReconcileLoop)(nil).RunDestinationRuleReconciler), varargs...) +} + +// MockGatewayReconciler is a mock of GatewayReconciler interface. +type MockGatewayReconciler struct { + ctrl *gomock.Controller + recorder *MockGatewayReconcilerMockRecorder +} + +// MockGatewayReconcilerMockRecorder is the mock recorder for MockGatewayReconciler. +type MockGatewayReconcilerMockRecorder struct { + mock *MockGatewayReconciler +} + +// NewMockGatewayReconciler creates a new mock instance. +func NewMockGatewayReconciler(ctrl *gomock.Controller) *MockGatewayReconciler { + mock := &MockGatewayReconciler{ctrl: ctrl} + mock.recorder = &MockGatewayReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayReconciler) EXPECT() *MockGatewayReconcilerMockRecorder { + return m.recorder +} + +// ReconcileGateway mocks base method. +func (m *MockGatewayReconciler) ReconcileGateway(obj *v1alpha3.Gateway) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileGateway", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileGateway indicates an expected call of ReconcileGateway. +func (mr *MockGatewayReconcilerMockRecorder) ReconcileGateway(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileGateway", reflect.TypeOf((*MockGatewayReconciler)(nil).ReconcileGateway), obj) +} + +// MockGatewayDeletionReconciler is a mock of GatewayDeletionReconciler interface. +type MockGatewayDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockGatewayDeletionReconcilerMockRecorder +} + +// MockGatewayDeletionReconcilerMockRecorder is the mock recorder for MockGatewayDeletionReconciler. +type MockGatewayDeletionReconcilerMockRecorder struct { + mock *MockGatewayDeletionReconciler +} + +// NewMockGatewayDeletionReconciler creates a new mock instance. +func NewMockGatewayDeletionReconciler(ctrl *gomock.Controller) *MockGatewayDeletionReconciler { + mock := &MockGatewayDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockGatewayDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayDeletionReconciler) EXPECT() *MockGatewayDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileGatewayDeletion mocks base method. +func (m *MockGatewayDeletionReconciler) ReconcileGatewayDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileGatewayDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileGatewayDeletion indicates an expected call of ReconcileGatewayDeletion. +func (mr *MockGatewayDeletionReconcilerMockRecorder) ReconcileGatewayDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileGatewayDeletion", reflect.TypeOf((*MockGatewayDeletionReconciler)(nil).ReconcileGatewayDeletion), req) +} + +// MockGatewayFinalizer is a mock of GatewayFinalizer interface. +type MockGatewayFinalizer struct { + ctrl *gomock.Controller + recorder *MockGatewayFinalizerMockRecorder +} + +// MockGatewayFinalizerMockRecorder is the mock recorder for MockGatewayFinalizer. +type MockGatewayFinalizerMockRecorder struct { + mock *MockGatewayFinalizer +} + +// NewMockGatewayFinalizer creates a new mock instance. +func NewMockGatewayFinalizer(ctrl *gomock.Controller) *MockGatewayFinalizer { + mock := &MockGatewayFinalizer{ctrl: ctrl} + mock.recorder = &MockGatewayFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayFinalizer) EXPECT() *MockGatewayFinalizerMockRecorder { + return m.recorder +} + +// FinalizeGateway mocks base method. +func (m *MockGatewayFinalizer) FinalizeGateway(obj *v1alpha3.Gateway) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeGateway", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeGateway indicates an expected call of FinalizeGateway. +func (mr *MockGatewayFinalizerMockRecorder) FinalizeGateway(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeGateway", reflect.TypeOf((*MockGatewayFinalizer)(nil).FinalizeGateway), obj) +} + +// GatewayFinalizerName mocks base method. +func (m *MockGatewayFinalizer) GatewayFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GatewayFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// GatewayFinalizerName indicates an expected call of GatewayFinalizerName. +func (mr *MockGatewayFinalizerMockRecorder) GatewayFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GatewayFinalizerName", reflect.TypeOf((*MockGatewayFinalizer)(nil).GatewayFinalizerName)) +} + +// ReconcileGateway mocks base method. +func (m *MockGatewayFinalizer) ReconcileGateway(obj *v1alpha3.Gateway) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileGateway", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileGateway indicates an expected call of ReconcileGateway. +func (mr *MockGatewayFinalizerMockRecorder) ReconcileGateway(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileGateway", reflect.TypeOf((*MockGatewayFinalizer)(nil).ReconcileGateway), obj) +} + +// MockGatewayReconcileLoop is a mock of GatewayReconcileLoop interface. +type MockGatewayReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockGatewayReconcileLoopMockRecorder +} + +// MockGatewayReconcileLoopMockRecorder is the mock recorder for MockGatewayReconcileLoop. +type MockGatewayReconcileLoopMockRecorder struct { + mock *MockGatewayReconcileLoop +} + +// NewMockGatewayReconcileLoop creates a new mock instance. +func NewMockGatewayReconcileLoop(ctrl *gomock.Controller) *MockGatewayReconcileLoop { + mock := &MockGatewayReconcileLoop{ctrl: ctrl} + mock.recorder = &MockGatewayReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayReconcileLoop) EXPECT() *MockGatewayReconcileLoopMockRecorder { + return m.recorder +} + +// RunGatewayReconciler mocks base method. +func (m *MockGatewayReconcileLoop) RunGatewayReconciler(ctx context.Context, rec controller.GatewayReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunGatewayReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunGatewayReconciler indicates an expected call of RunGatewayReconciler. +func (mr *MockGatewayReconcileLoopMockRecorder) RunGatewayReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunGatewayReconciler", reflect.TypeOf((*MockGatewayReconcileLoop)(nil).RunGatewayReconciler), varargs...) +} + +// MockServiceEntryReconciler is a mock of ServiceEntryReconciler interface. +type MockServiceEntryReconciler struct { + ctrl *gomock.Controller + recorder *MockServiceEntryReconcilerMockRecorder +} + +// MockServiceEntryReconcilerMockRecorder is the mock recorder for MockServiceEntryReconciler. +type MockServiceEntryReconcilerMockRecorder struct { + mock *MockServiceEntryReconciler +} + +// NewMockServiceEntryReconciler creates a new mock instance. +func NewMockServiceEntryReconciler(ctrl *gomock.Controller) *MockServiceEntryReconciler { + mock := &MockServiceEntryReconciler{ctrl: ctrl} + mock.recorder = &MockServiceEntryReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryReconciler) EXPECT() *MockServiceEntryReconcilerMockRecorder { + return m.recorder +} + +// ReconcileServiceEntry mocks base method. +func (m *MockServiceEntryReconciler) ReconcileServiceEntry(obj *v1alpha3.ServiceEntry) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileServiceEntry", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileServiceEntry indicates an expected call of ReconcileServiceEntry. +func (mr *MockServiceEntryReconcilerMockRecorder) ReconcileServiceEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileServiceEntry", reflect.TypeOf((*MockServiceEntryReconciler)(nil).ReconcileServiceEntry), obj) +} + +// MockServiceEntryDeletionReconciler is a mock of ServiceEntryDeletionReconciler interface. +type MockServiceEntryDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockServiceEntryDeletionReconcilerMockRecorder +} + +// MockServiceEntryDeletionReconcilerMockRecorder is the mock recorder for MockServiceEntryDeletionReconciler. +type MockServiceEntryDeletionReconcilerMockRecorder struct { + mock *MockServiceEntryDeletionReconciler +} + +// NewMockServiceEntryDeletionReconciler creates a new mock instance. +func NewMockServiceEntryDeletionReconciler(ctrl *gomock.Controller) *MockServiceEntryDeletionReconciler { + mock := &MockServiceEntryDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockServiceEntryDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryDeletionReconciler) EXPECT() *MockServiceEntryDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileServiceEntryDeletion mocks base method. +func (m *MockServiceEntryDeletionReconciler) ReconcileServiceEntryDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileServiceEntryDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileServiceEntryDeletion indicates an expected call of ReconcileServiceEntryDeletion. +func (mr *MockServiceEntryDeletionReconcilerMockRecorder) ReconcileServiceEntryDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileServiceEntryDeletion", reflect.TypeOf((*MockServiceEntryDeletionReconciler)(nil).ReconcileServiceEntryDeletion), req) +} + +// MockServiceEntryFinalizer is a mock of ServiceEntryFinalizer interface. +type MockServiceEntryFinalizer struct { + ctrl *gomock.Controller + recorder *MockServiceEntryFinalizerMockRecorder +} + +// MockServiceEntryFinalizerMockRecorder is the mock recorder for MockServiceEntryFinalizer. +type MockServiceEntryFinalizerMockRecorder struct { + mock *MockServiceEntryFinalizer +} + +// NewMockServiceEntryFinalizer creates a new mock instance. +func NewMockServiceEntryFinalizer(ctrl *gomock.Controller) *MockServiceEntryFinalizer { + mock := &MockServiceEntryFinalizer{ctrl: ctrl} + mock.recorder = &MockServiceEntryFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryFinalizer) EXPECT() *MockServiceEntryFinalizerMockRecorder { + return m.recorder +} + +// FinalizeServiceEntry mocks base method. +func (m *MockServiceEntryFinalizer) FinalizeServiceEntry(obj *v1alpha3.ServiceEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeServiceEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeServiceEntry indicates an expected call of FinalizeServiceEntry. +func (mr *MockServiceEntryFinalizerMockRecorder) FinalizeServiceEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeServiceEntry", reflect.TypeOf((*MockServiceEntryFinalizer)(nil).FinalizeServiceEntry), obj) +} + +// ReconcileServiceEntry mocks base method. +func (m *MockServiceEntryFinalizer) ReconcileServiceEntry(obj *v1alpha3.ServiceEntry) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileServiceEntry", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileServiceEntry indicates an expected call of ReconcileServiceEntry. +func (mr *MockServiceEntryFinalizerMockRecorder) ReconcileServiceEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileServiceEntry", reflect.TypeOf((*MockServiceEntryFinalizer)(nil).ReconcileServiceEntry), obj) +} + +// ServiceEntryFinalizerName mocks base method. +func (m *MockServiceEntryFinalizer) ServiceEntryFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ServiceEntryFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// ServiceEntryFinalizerName indicates an expected call of ServiceEntryFinalizerName. +func (mr *MockServiceEntryFinalizerMockRecorder) ServiceEntryFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceEntryFinalizerName", reflect.TypeOf((*MockServiceEntryFinalizer)(nil).ServiceEntryFinalizerName)) +} + +// MockServiceEntryReconcileLoop is a mock of ServiceEntryReconcileLoop interface. +type MockServiceEntryReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockServiceEntryReconcileLoopMockRecorder +} + +// MockServiceEntryReconcileLoopMockRecorder is the mock recorder for MockServiceEntryReconcileLoop. +type MockServiceEntryReconcileLoopMockRecorder struct { + mock *MockServiceEntryReconcileLoop +} + +// NewMockServiceEntryReconcileLoop creates a new mock instance. +func NewMockServiceEntryReconcileLoop(ctrl *gomock.Controller) *MockServiceEntryReconcileLoop { + mock := &MockServiceEntryReconcileLoop{ctrl: ctrl} + mock.recorder = &MockServiceEntryReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryReconcileLoop) EXPECT() *MockServiceEntryReconcileLoopMockRecorder { + return m.recorder +} + +// RunServiceEntryReconciler mocks base method. +func (m *MockServiceEntryReconcileLoop) RunServiceEntryReconciler(ctx context.Context, rec controller.ServiceEntryReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunServiceEntryReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunServiceEntryReconciler indicates an expected call of RunServiceEntryReconciler. +func (mr *MockServiceEntryReconcileLoopMockRecorder) RunServiceEntryReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunServiceEntryReconciler", reflect.TypeOf((*MockServiceEntryReconcileLoop)(nil).RunServiceEntryReconciler), varargs...) +} + +// MockWorkloadEntryReconciler is a mock of WorkloadEntryReconciler interface. +type MockWorkloadEntryReconciler struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryReconcilerMockRecorder +} + +// MockWorkloadEntryReconcilerMockRecorder is the mock recorder for MockWorkloadEntryReconciler. +type MockWorkloadEntryReconcilerMockRecorder struct { + mock *MockWorkloadEntryReconciler +} + +// NewMockWorkloadEntryReconciler creates a new mock instance. +func NewMockWorkloadEntryReconciler(ctrl *gomock.Controller) *MockWorkloadEntryReconciler { + mock := &MockWorkloadEntryReconciler{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryReconciler) EXPECT() *MockWorkloadEntryReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadEntry mocks base method. +func (m *MockWorkloadEntryReconciler) ReconcileWorkloadEntry(obj *v1alpha3.WorkloadEntry) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadEntry", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileWorkloadEntry indicates an expected call of ReconcileWorkloadEntry. +func (mr *MockWorkloadEntryReconcilerMockRecorder) ReconcileWorkloadEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryReconciler)(nil).ReconcileWorkloadEntry), obj) +} + +// MockWorkloadEntryDeletionReconciler is a mock of WorkloadEntryDeletionReconciler interface. +type MockWorkloadEntryDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryDeletionReconcilerMockRecorder +} + +// MockWorkloadEntryDeletionReconcilerMockRecorder is the mock recorder for MockWorkloadEntryDeletionReconciler. +type MockWorkloadEntryDeletionReconcilerMockRecorder struct { + mock *MockWorkloadEntryDeletionReconciler +} + +// NewMockWorkloadEntryDeletionReconciler creates a new mock instance. +func NewMockWorkloadEntryDeletionReconciler(ctrl *gomock.Controller) *MockWorkloadEntryDeletionReconciler { + mock := &MockWorkloadEntryDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryDeletionReconciler) EXPECT() *MockWorkloadEntryDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadEntryDeletion mocks base method. +func (m *MockWorkloadEntryDeletionReconciler) ReconcileWorkloadEntryDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadEntryDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileWorkloadEntryDeletion indicates an expected call of ReconcileWorkloadEntryDeletion. +func (mr *MockWorkloadEntryDeletionReconcilerMockRecorder) ReconcileWorkloadEntryDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadEntryDeletion", reflect.TypeOf((*MockWorkloadEntryDeletionReconciler)(nil).ReconcileWorkloadEntryDeletion), req) +} + +// MockWorkloadEntryFinalizer is a mock of WorkloadEntryFinalizer interface. +type MockWorkloadEntryFinalizer struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryFinalizerMockRecorder +} + +// MockWorkloadEntryFinalizerMockRecorder is the mock recorder for MockWorkloadEntryFinalizer. +type MockWorkloadEntryFinalizerMockRecorder struct { + mock *MockWorkloadEntryFinalizer +} + +// NewMockWorkloadEntryFinalizer creates a new mock instance. +func NewMockWorkloadEntryFinalizer(ctrl *gomock.Controller) *MockWorkloadEntryFinalizer { + mock := &MockWorkloadEntryFinalizer{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryFinalizer) EXPECT() *MockWorkloadEntryFinalizerMockRecorder { + return m.recorder +} + +// FinalizeWorkloadEntry mocks base method. +func (m *MockWorkloadEntryFinalizer) FinalizeWorkloadEntry(obj *v1alpha3.WorkloadEntry) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeWorkloadEntry", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeWorkloadEntry indicates an expected call of FinalizeWorkloadEntry. +func (mr *MockWorkloadEntryFinalizerMockRecorder) FinalizeWorkloadEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryFinalizer)(nil).FinalizeWorkloadEntry), obj) +} + +// ReconcileWorkloadEntry mocks base method. +func (m *MockWorkloadEntryFinalizer) ReconcileWorkloadEntry(obj *v1alpha3.WorkloadEntry) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadEntry", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileWorkloadEntry indicates an expected call of ReconcileWorkloadEntry. +func (mr *MockWorkloadEntryFinalizerMockRecorder) ReconcileWorkloadEntry(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryFinalizer)(nil).ReconcileWorkloadEntry), obj) +} + +// WorkloadEntryFinalizerName mocks base method. +func (m *MockWorkloadEntryFinalizer) WorkloadEntryFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WorkloadEntryFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// WorkloadEntryFinalizerName indicates an expected call of WorkloadEntryFinalizerName. +func (mr *MockWorkloadEntryFinalizerMockRecorder) WorkloadEntryFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkloadEntryFinalizerName", reflect.TypeOf((*MockWorkloadEntryFinalizer)(nil).WorkloadEntryFinalizerName)) +} + +// MockWorkloadEntryReconcileLoop is a mock of WorkloadEntryReconcileLoop interface. +type MockWorkloadEntryReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryReconcileLoopMockRecorder +} + +// MockWorkloadEntryReconcileLoopMockRecorder is the mock recorder for MockWorkloadEntryReconcileLoop. +type MockWorkloadEntryReconcileLoopMockRecorder struct { + mock *MockWorkloadEntryReconcileLoop +} + +// NewMockWorkloadEntryReconcileLoop creates a new mock instance. +func NewMockWorkloadEntryReconcileLoop(ctrl *gomock.Controller) *MockWorkloadEntryReconcileLoop { + mock := &MockWorkloadEntryReconcileLoop{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryReconcileLoop) EXPECT() *MockWorkloadEntryReconcileLoopMockRecorder { + return m.recorder +} + +// RunWorkloadEntryReconciler mocks base method. +func (m *MockWorkloadEntryReconcileLoop) RunWorkloadEntryReconciler(ctx context.Context, rec controller.WorkloadEntryReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunWorkloadEntryReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunWorkloadEntryReconciler indicates an expected call of RunWorkloadEntryReconciler. +func (mr *MockWorkloadEntryReconcileLoopMockRecorder) RunWorkloadEntryReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunWorkloadEntryReconciler", reflect.TypeOf((*MockWorkloadEntryReconcileLoop)(nil).RunWorkloadEntryReconciler), varargs...) +} + +// MockWorkloadGroupReconciler is a mock of WorkloadGroupReconciler interface. +type MockWorkloadGroupReconciler struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupReconcilerMockRecorder +} + +// MockWorkloadGroupReconcilerMockRecorder is the mock recorder for MockWorkloadGroupReconciler. +type MockWorkloadGroupReconcilerMockRecorder struct { + mock *MockWorkloadGroupReconciler +} + +// NewMockWorkloadGroupReconciler creates a new mock instance. +func NewMockWorkloadGroupReconciler(ctrl *gomock.Controller) *MockWorkloadGroupReconciler { + mock := &MockWorkloadGroupReconciler{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupReconciler) EXPECT() *MockWorkloadGroupReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadGroup mocks base method. +func (m *MockWorkloadGroupReconciler) ReconcileWorkloadGroup(obj *v1alpha3.WorkloadGroup) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadGroup", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileWorkloadGroup indicates an expected call of ReconcileWorkloadGroup. +func (mr *MockWorkloadGroupReconcilerMockRecorder) ReconcileWorkloadGroup(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupReconciler)(nil).ReconcileWorkloadGroup), obj) +} + +// MockWorkloadGroupDeletionReconciler is a mock of WorkloadGroupDeletionReconciler interface. +type MockWorkloadGroupDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupDeletionReconcilerMockRecorder +} + +// MockWorkloadGroupDeletionReconcilerMockRecorder is the mock recorder for MockWorkloadGroupDeletionReconciler. +type MockWorkloadGroupDeletionReconcilerMockRecorder struct { + mock *MockWorkloadGroupDeletionReconciler +} + +// NewMockWorkloadGroupDeletionReconciler creates a new mock instance. +func NewMockWorkloadGroupDeletionReconciler(ctrl *gomock.Controller) *MockWorkloadGroupDeletionReconciler { + mock := &MockWorkloadGroupDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupDeletionReconciler) EXPECT() *MockWorkloadGroupDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileWorkloadGroupDeletion mocks base method. +func (m *MockWorkloadGroupDeletionReconciler) ReconcileWorkloadGroupDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadGroupDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileWorkloadGroupDeletion indicates an expected call of ReconcileWorkloadGroupDeletion. +func (mr *MockWorkloadGroupDeletionReconcilerMockRecorder) ReconcileWorkloadGroupDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadGroupDeletion", reflect.TypeOf((*MockWorkloadGroupDeletionReconciler)(nil).ReconcileWorkloadGroupDeletion), req) +} + +// MockWorkloadGroupFinalizer is a mock of WorkloadGroupFinalizer interface. +type MockWorkloadGroupFinalizer struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupFinalizerMockRecorder +} + +// MockWorkloadGroupFinalizerMockRecorder is the mock recorder for MockWorkloadGroupFinalizer. +type MockWorkloadGroupFinalizerMockRecorder struct { + mock *MockWorkloadGroupFinalizer +} + +// NewMockWorkloadGroupFinalizer creates a new mock instance. +func NewMockWorkloadGroupFinalizer(ctrl *gomock.Controller) *MockWorkloadGroupFinalizer { + mock := &MockWorkloadGroupFinalizer{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupFinalizer) EXPECT() *MockWorkloadGroupFinalizerMockRecorder { + return m.recorder +} + +// FinalizeWorkloadGroup mocks base method. +func (m *MockWorkloadGroupFinalizer) FinalizeWorkloadGroup(obj *v1alpha3.WorkloadGroup) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeWorkloadGroup", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeWorkloadGroup indicates an expected call of FinalizeWorkloadGroup. +func (mr *MockWorkloadGroupFinalizerMockRecorder) FinalizeWorkloadGroup(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupFinalizer)(nil).FinalizeWorkloadGroup), obj) +} + +// ReconcileWorkloadGroup mocks base method. +func (m *MockWorkloadGroupFinalizer) ReconcileWorkloadGroup(obj *v1alpha3.WorkloadGroup) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileWorkloadGroup", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileWorkloadGroup indicates an expected call of ReconcileWorkloadGroup. +func (mr *MockWorkloadGroupFinalizerMockRecorder) ReconcileWorkloadGroup(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupFinalizer)(nil).ReconcileWorkloadGroup), obj) +} + +// WorkloadGroupFinalizerName mocks base method. +func (m *MockWorkloadGroupFinalizer) WorkloadGroupFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WorkloadGroupFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// WorkloadGroupFinalizerName indicates an expected call of WorkloadGroupFinalizerName. +func (mr *MockWorkloadGroupFinalizerMockRecorder) WorkloadGroupFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkloadGroupFinalizerName", reflect.TypeOf((*MockWorkloadGroupFinalizer)(nil).WorkloadGroupFinalizerName)) +} + +// MockWorkloadGroupReconcileLoop is a mock of WorkloadGroupReconcileLoop interface. +type MockWorkloadGroupReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupReconcileLoopMockRecorder +} + +// MockWorkloadGroupReconcileLoopMockRecorder is the mock recorder for MockWorkloadGroupReconcileLoop. +type MockWorkloadGroupReconcileLoopMockRecorder struct { + mock *MockWorkloadGroupReconcileLoop +} + +// NewMockWorkloadGroupReconcileLoop creates a new mock instance. +func NewMockWorkloadGroupReconcileLoop(ctrl *gomock.Controller) *MockWorkloadGroupReconcileLoop { + mock := &MockWorkloadGroupReconcileLoop{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupReconcileLoop) EXPECT() *MockWorkloadGroupReconcileLoopMockRecorder { + return m.recorder +} + +// RunWorkloadGroupReconciler mocks base method. +func (m *MockWorkloadGroupReconcileLoop) RunWorkloadGroupReconciler(ctx context.Context, rec controller.WorkloadGroupReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunWorkloadGroupReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunWorkloadGroupReconciler indicates an expected call of RunWorkloadGroupReconciler. +func (mr *MockWorkloadGroupReconcileLoopMockRecorder) RunWorkloadGroupReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunWorkloadGroupReconciler", reflect.TypeOf((*MockWorkloadGroupReconcileLoop)(nil).RunWorkloadGroupReconciler), varargs...) +} + +// MockVirtualServiceReconciler is a mock of VirtualServiceReconciler interface. +type MockVirtualServiceReconciler struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceReconcilerMockRecorder +} + +// MockVirtualServiceReconcilerMockRecorder is the mock recorder for MockVirtualServiceReconciler. +type MockVirtualServiceReconcilerMockRecorder struct { + mock *MockVirtualServiceReconciler +} + +// NewMockVirtualServiceReconciler creates a new mock instance. +func NewMockVirtualServiceReconciler(ctrl *gomock.Controller) *MockVirtualServiceReconciler { + mock := &MockVirtualServiceReconciler{ctrl: ctrl} + mock.recorder = &MockVirtualServiceReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceReconciler) EXPECT() *MockVirtualServiceReconcilerMockRecorder { + return m.recorder +} + +// ReconcileVirtualService mocks base method. +func (m *MockVirtualServiceReconciler) ReconcileVirtualService(obj *v1alpha3.VirtualService) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileVirtualService", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileVirtualService indicates an expected call of ReconcileVirtualService. +func (mr *MockVirtualServiceReconcilerMockRecorder) ReconcileVirtualService(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileVirtualService", reflect.TypeOf((*MockVirtualServiceReconciler)(nil).ReconcileVirtualService), obj) +} + +// MockVirtualServiceDeletionReconciler is a mock of VirtualServiceDeletionReconciler interface. +type MockVirtualServiceDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceDeletionReconcilerMockRecorder +} + +// MockVirtualServiceDeletionReconcilerMockRecorder is the mock recorder for MockVirtualServiceDeletionReconciler. +type MockVirtualServiceDeletionReconcilerMockRecorder struct { + mock *MockVirtualServiceDeletionReconciler +} + +// NewMockVirtualServiceDeletionReconciler creates a new mock instance. +func NewMockVirtualServiceDeletionReconciler(ctrl *gomock.Controller) *MockVirtualServiceDeletionReconciler { + mock := &MockVirtualServiceDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockVirtualServiceDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceDeletionReconciler) EXPECT() *MockVirtualServiceDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileVirtualServiceDeletion mocks base method. +func (m *MockVirtualServiceDeletionReconciler) ReconcileVirtualServiceDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileVirtualServiceDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileVirtualServiceDeletion indicates an expected call of ReconcileVirtualServiceDeletion. +func (mr *MockVirtualServiceDeletionReconcilerMockRecorder) ReconcileVirtualServiceDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileVirtualServiceDeletion", reflect.TypeOf((*MockVirtualServiceDeletionReconciler)(nil).ReconcileVirtualServiceDeletion), req) +} + +// MockVirtualServiceFinalizer is a mock of VirtualServiceFinalizer interface. +type MockVirtualServiceFinalizer struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceFinalizerMockRecorder +} + +// MockVirtualServiceFinalizerMockRecorder is the mock recorder for MockVirtualServiceFinalizer. +type MockVirtualServiceFinalizerMockRecorder struct { + mock *MockVirtualServiceFinalizer +} + +// NewMockVirtualServiceFinalizer creates a new mock instance. +func NewMockVirtualServiceFinalizer(ctrl *gomock.Controller) *MockVirtualServiceFinalizer { + mock := &MockVirtualServiceFinalizer{ctrl: ctrl} + mock.recorder = &MockVirtualServiceFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceFinalizer) EXPECT() *MockVirtualServiceFinalizerMockRecorder { + return m.recorder +} + +// FinalizeVirtualService mocks base method. +func (m *MockVirtualServiceFinalizer) FinalizeVirtualService(obj *v1alpha3.VirtualService) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeVirtualService", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeVirtualService indicates an expected call of FinalizeVirtualService. +func (mr *MockVirtualServiceFinalizerMockRecorder) FinalizeVirtualService(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeVirtualService", reflect.TypeOf((*MockVirtualServiceFinalizer)(nil).FinalizeVirtualService), obj) +} + +// ReconcileVirtualService mocks base method. +func (m *MockVirtualServiceFinalizer) ReconcileVirtualService(obj *v1alpha3.VirtualService) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileVirtualService", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileVirtualService indicates an expected call of ReconcileVirtualService. +func (mr *MockVirtualServiceFinalizerMockRecorder) ReconcileVirtualService(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileVirtualService", reflect.TypeOf((*MockVirtualServiceFinalizer)(nil).ReconcileVirtualService), obj) +} + +// VirtualServiceFinalizerName mocks base method. +func (m *MockVirtualServiceFinalizer) VirtualServiceFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "VirtualServiceFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// VirtualServiceFinalizerName indicates an expected call of VirtualServiceFinalizerName. +func (mr *MockVirtualServiceFinalizerMockRecorder) VirtualServiceFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VirtualServiceFinalizerName", reflect.TypeOf((*MockVirtualServiceFinalizer)(nil).VirtualServiceFinalizerName)) +} + +// MockVirtualServiceReconcileLoop is a mock of VirtualServiceReconcileLoop interface. +type MockVirtualServiceReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceReconcileLoopMockRecorder +} + +// MockVirtualServiceReconcileLoopMockRecorder is the mock recorder for MockVirtualServiceReconcileLoop. +type MockVirtualServiceReconcileLoopMockRecorder struct { + mock *MockVirtualServiceReconcileLoop +} + +// NewMockVirtualServiceReconcileLoop creates a new mock instance. +func NewMockVirtualServiceReconcileLoop(ctrl *gomock.Controller) *MockVirtualServiceReconcileLoop { + mock := &MockVirtualServiceReconcileLoop{ctrl: ctrl} + mock.recorder = &MockVirtualServiceReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceReconcileLoop) EXPECT() *MockVirtualServiceReconcileLoopMockRecorder { + return m.recorder +} + +// RunVirtualServiceReconciler mocks base method. +func (m *MockVirtualServiceReconcileLoop) RunVirtualServiceReconciler(ctx context.Context, rec controller.VirtualServiceReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunVirtualServiceReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunVirtualServiceReconciler indicates an expected call of RunVirtualServiceReconciler. +func (mr *MockVirtualServiceReconcileLoopMockRecorder) RunVirtualServiceReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunVirtualServiceReconciler", reflect.TypeOf((*MockVirtualServiceReconcileLoop)(nil).RunVirtualServiceReconciler), varargs...) +} + +// MockSidecarReconciler is a mock of SidecarReconciler interface. +type MockSidecarReconciler struct { + ctrl *gomock.Controller + recorder *MockSidecarReconcilerMockRecorder +} + +// MockSidecarReconcilerMockRecorder is the mock recorder for MockSidecarReconciler. +type MockSidecarReconcilerMockRecorder struct { + mock *MockSidecarReconciler +} + +// NewMockSidecarReconciler creates a new mock instance. +func NewMockSidecarReconciler(ctrl *gomock.Controller) *MockSidecarReconciler { + mock := &MockSidecarReconciler{ctrl: ctrl} + mock.recorder = &MockSidecarReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarReconciler) EXPECT() *MockSidecarReconcilerMockRecorder { + return m.recorder +} + +// ReconcileSidecar mocks base method. +func (m *MockSidecarReconciler) ReconcileSidecar(obj *v1alpha3.Sidecar) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileSidecar", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileSidecar indicates an expected call of ReconcileSidecar. +func (mr *MockSidecarReconcilerMockRecorder) ReconcileSidecar(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileSidecar", reflect.TypeOf((*MockSidecarReconciler)(nil).ReconcileSidecar), obj) +} + +// MockSidecarDeletionReconciler is a mock of SidecarDeletionReconciler interface. +type MockSidecarDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockSidecarDeletionReconcilerMockRecorder +} + +// MockSidecarDeletionReconcilerMockRecorder is the mock recorder for MockSidecarDeletionReconciler. +type MockSidecarDeletionReconcilerMockRecorder struct { + mock *MockSidecarDeletionReconciler +} + +// NewMockSidecarDeletionReconciler creates a new mock instance. +func NewMockSidecarDeletionReconciler(ctrl *gomock.Controller) *MockSidecarDeletionReconciler { + mock := &MockSidecarDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockSidecarDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarDeletionReconciler) EXPECT() *MockSidecarDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileSidecarDeletion mocks base method. +func (m *MockSidecarDeletionReconciler) ReconcileSidecarDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileSidecarDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileSidecarDeletion indicates an expected call of ReconcileSidecarDeletion. +func (mr *MockSidecarDeletionReconcilerMockRecorder) ReconcileSidecarDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileSidecarDeletion", reflect.TypeOf((*MockSidecarDeletionReconciler)(nil).ReconcileSidecarDeletion), req) +} + +// MockSidecarFinalizer is a mock of SidecarFinalizer interface. +type MockSidecarFinalizer struct { + ctrl *gomock.Controller + recorder *MockSidecarFinalizerMockRecorder +} + +// MockSidecarFinalizerMockRecorder is the mock recorder for MockSidecarFinalizer. +type MockSidecarFinalizerMockRecorder struct { + mock *MockSidecarFinalizer +} + +// NewMockSidecarFinalizer creates a new mock instance. +func NewMockSidecarFinalizer(ctrl *gomock.Controller) *MockSidecarFinalizer { + mock := &MockSidecarFinalizer{ctrl: ctrl} + mock.recorder = &MockSidecarFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarFinalizer) EXPECT() *MockSidecarFinalizerMockRecorder { + return m.recorder +} + +// FinalizeSidecar mocks base method. +func (m *MockSidecarFinalizer) FinalizeSidecar(obj *v1alpha3.Sidecar) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeSidecar", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeSidecar indicates an expected call of FinalizeSidecar. +func (mr *MockSidecarFinalizerMockRecorder) FinalizeSidecar(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeSidecar", reflect.TypeOf((*MockSidecarFinalizer)(nil).FinalizeSidecar), obj) +} + +// ReconcileSidecar mocks base method. +func (m *MockSidecarFinalizer) ReconcileSidecar(obj *v1alpha3.Sidecar) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileSidecar", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileSidecar indicates an expected call of ReconcileSidecar. +func (mr *MockSidecarFinalizerMockRecorder) ReconcileSidecar(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileSidecar", reflect.TypeOf((*MockSidecarFinalizer)(nil).ReconcileSidecar), obj) +} + +// SidecarFinalizerName mocks base method. +func (m *MockSidecarFinalizer) SidecarFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SidecarFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// SidecarFinalizerName indicates an expected call of SidecarFinalizerName. +func (mr *MockSidecarFinalizerMockRecorder) SidecarFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SidecarFinalizerName", reflect.TypeOf((*MockSidecarFinalizer)(nil).SidecarFinalizerName)) +} + +// MockSidecarReconcileLoop is a mock of SidecarReconcileLoop interface. +type MockSidecarReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockSidecarReconcileLoopMockRecorder +} + +// MockSidecarReconcileLoopMockRecorder is the mock recorder for MockSidecarReconcileLoop. +type MockSidecarReconcileLoopMockRecorder struct { + mock *MockSidecarReconcileLoop +} + +// NewMockSidecarReconcileLoop creates a new mock instance. +func NewMockSidecarReconcileLoop(ctrl *gomock.Controller) *MockSidecarReconcileLoop { + mock := &MockSidecarReconcileLoop{ctrl: ctrl} + mock.recorder = &MockSidecarReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarReconcileLoop) EXPECT() *MockSidecarReconcileLoopMockRecorder { + return m.recorder +} + +// RunSidecarReconciler mocks base method. +func (m *MockSidecarReconcileLoop) RunSidecarReconciler(ctx context.Context, rec controller.SidecarReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunSidecarReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunSidecarReconciler indicates an expected call of RunSidecarReconciler. +func (mr *MockSidecarReconcileLoopMockRecorder) RunSidecarReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunSidecarReconciler", reflect.TypeOf((*MockSidecarReconcileLoop)(nil).RunSidecarReconciler), varargs...) +} + // MockEnvoyFilterReconciler is a mock of EnvoyFilterReconciler interface. type MockEnvoyFilterReconciler struct { ctrl *gomock.Controller diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/controller/multicluster_reconcilers.go b/pkg/api/istio/networking.istio.io/v1alpha3/controller/multicluster_reconcilers.go index 3f9bcaa..e932799 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/controller/multicluster_reconcilers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/controller/multicluster_reconcilers.go @@ -18,6 +18,503 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// Reconcile Upsert events for the DestinationRule Resource across clusters. +// implemented by the user +type MulticlusterDestinationRuleReconciler interface { + ReconcileDestinationRule(clusterName string, obj *networking_istio_io_v1alpha3.DestinationRule) (reconcile.Result, error) +} + +// Reconcile deletion events for the DestinationRule Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterDestinationRuleDeletionReconciler interface { + ReconcileDestinationRuleDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterDestinationRuleReconcilerFuncs struct { + OnReconcileDestinationRule func(clusterName string, obj *networking_istio_io_v1alpha3.DestinationRule) (reconcile.Result, error) + OnReconcileDestinationRuleDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterDestinationRuleReconcilerFuncs) ReconcileDestinationRule(clusterName string, obj *networking_istio_io_v1alpha3.DestinationRule) (reconcile.Result, error) { + if f.OnReconcileDestinationRule == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileDestinationRule(clusterName, obj) +} + +func (f *MulticlusterDestinationRuleReconcilerFuncs) ReconcileDestinationRuleDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileDestinationRuleDeletion == nil { + return nil + } + return f.OnReconcileDestinationRuleDeletion(clusterName, req) +} + +type MulticlusterDestinationRuleReconcileLoop interface { + // AddMulticlusterDestinationRuleReconciler adds a MulticlusterDestinationRuleReconciler to the MulticlusterDestinationRuleReconcileLoop. + AddMulticlusterDestinationRuleReconciler(ctx context.Context, rec MulticlusterDestinationRuleReconciler, predicates ...predicate.Predicate) +} + +type multiclusterDestinationRuleReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterDestinationRuleReconcileLoop) AddMulticlusterDestinationRuleReconciler(ctx context.Context, rec MulticlusterDestinationRuleReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericDestinationRuleMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterDestinationRuleReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterDestinationRuleReconcileLoop { + return &multiclusterDestinationRuleReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.DestinationRule{}, options)} +} + +type genericDestinationRuleMulticlusterReconciler struct { + reconciler MulticlusterDestinationRuleReconciler +} + +func (g genericDestinationRuleMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterDestinationRuleDeletionReconciler); ok { + return deletionReconciler.ReconcileDestinationRuleDeletion(cluster, req) + } + return nil +} + +func (g genericDestinationRuleMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: DestinationRule handler received event for %T", object) + } + return g.reconciler.ReconcileDestinationRule(cluster, obj) +} + +// Reconcile Upsert events for the Gateway Resource across clusters. +// implemented by the user +type MulticlusterGatewayReconciler interface { + ReconcileGateway(clusterName string, obj *networking_istio_io_v1alpha3.Gateway) (reconcile.Result, error) +} + +// Reconcile deletion events for the Gateway Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterGatewayDeletionReconciler interface { + ReconcileGatewayDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterGatewayReconcilerFuncs struct { + OnReconcileGateway func(clusterName string, obj *networking_istio_io_v1alpha3.Gateway) (reconcile.Result, error) + OnReconcileGatewayDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterGatewayReconcilerFuncs) ReconcileGateway(clusterName string, obj *networking_istio_io_v1alpha3.Gateway) (reconcile.Result, error) { + if f.OnReconcileGateway == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileGateway(clusterName, obj) +} + +func (f *MulticlusterGatewayReconcilerFuncs) ReconcileGatewayDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileGatewayDeletion == nil { + return nil + } + return f.OnReconcileGatewayDeletion(clusterName, req) +} + +type MulticlusterGatewayReconcileLoop interface { + // AddMulticlusterGatewayReconciler adds a MulticlusterGatewayReconciler to the MulticlusterGatewayReconcileLoop. + AddMulticlusterGatewayReconciler(ctx context.Context, rec MulticlusterGatewayReconciler, predicates ...predicate.Predicate) +} + +type multiclusterGatewayReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterGatewayReconcileLoop) AddMulticlusterGatewayReconciler(ctx context.Context, rec MulticlusterGatewayReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericGatewayMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterGatewayReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterGatewayReconcileLoop { + return &multiclusterGatewayReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.Gateway{}, options)} +} + +type genericGatewayMulticlusterReconciler struct { + reconciler MulticlusterGatewayReconciler +} + +func (g genericGatewayMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterGatewayDeletionReconciler); ok { + return deletionReconciler.ReconcileGatewayDeletion(cluster, req) + } + return nil +} + +func (g genericGatewayMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: Gateway handler received event for %T", object) + } + return g.reconciler.ReconcileGateway(cluster, obj) +} + +// Reconcile Upsert events for the ServiceEntry Resource across clusters. +// implemented by the user +type MulticlusterServiceEntryReconciler interface { + ReconcileServiceEntry(clusterName string, obj *networking_istio_io_v1alpha3.ServiceEntry) (reconcile.Result, error) +} + +// Reconcile deletion events for the ServiceEntry Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterServiceEntryDeletionReconciler interface { + ReconcileServiceEntryDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterServiceEntryReconcilerFuncs struct { + OnReconcileServiceEntry func(clusterName string, obj *networking_istio_io_v1alpha3.ServiceEntry) (reconcile.Result, error) + OnReconcileServiceEntryDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterServiceEntryReconcilerFuncs) ReconcileServiceEntry(clusterName string, obj *networking_istio_io_v1alpha3.ServiceEntry) (reconcile.Result, error) { + if f.OnReconcileServiceEntry == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileServiceEntry(clusterName, obj) +} + +func (f *MulticlusterServiceEntryReconcilerFuncs) ReconcileServiceEntryDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileServiceEntryDeletion == nil { + return nil + } + return f.OnReconcileServiceEntryDeletion(clusterName, req) +} + +type MulticlusterServiceEntryReconcileLoop interface { + // AddMulticlusterServiceEntryReconciler adds a MulticlusterServiceEntryReconciler to the MulticlusterServiceEntryReconcileLoop. + AddMulticlusterServiceEntryReconciler(ctx context.Context, rec MulticlusterServiceEntryReconciler, predicates ...predicate.Predicate) +} + +type multiclusterServiceEntryReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterServiceEntryReconcileLoop) AddMulticlusterServiceEntryReconciler(ctx context.Context, rec MulticlusterServiceEntryReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericServiceEntryMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterServiceEntryReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterServiceEntryReconcileLoop { + return &multiclusterServiceEntryReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.ServiceEntry{}, options)} +} + +type genericServiceEntryMulticlusterReconciler struct { + reconciler MulticlusterServiceEntryReconciler +} + +func (g genericServiceEntryMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterServiceEntryDeletionReconciler); ok { + return deletionReconciler.ReconcileServiceEntryDeletion(cluster, req) + } + return nil +} + +func (g genericServiceEntryMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: ServiceEntry handler received event for %T", object) + } + return g.reconciler.ReconcileServiceEntry(cluster, obj) +} + +// Reconcile Upsert events for the WorkloadEntry Resource across clusters. +// implemented by the user +type MulticlusterWorkloadEntryReconciler interface { + ReconcileWorkloadEntry(clusterName string, obj *networking_istio_io_v1alpha3.WorkloadEntry) (reconcile.Result, error) +} + +// Reconcile deletion events for the WorkloadEntry Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterWorkloadEntryDeletionReconciler interface { + ReconcileWorkloadEntryDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterWorkloadEntryReconcilerFuncs struct { + OnReconcileWorkloadEntry func(clusterName string, obj *networking_istio_io_v1alpha3.WorkloadEntry) (reconcile.Result, error) + OnReconcileWorkloadEntryDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterWorkloadEntryReconcilerFuncs) ReconcileWorkloadEntry(clusterName string, obj *networking_istio_io_v1alpha3.WorkloadEntry) (reconcile.Result, error) { + if f.OnReconcileWorkloadEntry == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileWorkloadEntry(clusterName, obj) +} + +func (f *MulticlusterWorkloadEntryReconcilerFuncs) ReconcileWorkloadEntryDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileWorkloadEntryDeletion == nil { + return nil + } + return f.OnReconcileWorkloadEntryDeletion(clusterName, req) +} + +type MulticlusterWorkloadEntryReconcileLoop interface { + // AddMulticlusterWorkloadEntryReconciler adds a MulticlusterWorkloadEntryReconciler to the MulticlusterWorkloadEntryReconcileLoop. + AddMulticlusterWorkloadEntryReconciler(ctx context.Context, rec MulticlusterWorkloadEntryReconciler, predicates ...predicate.Predicate) +} + +type multiclusterWorkloadEntryReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterWorkloadEntryReconcileLoop) AddMulticlusterWorkloadEntryReconciler(ctx context.Context, rec MulticlusterWorkloadEntryReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericWorkloadEntryMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterWorkloadEntryReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterWorkloadEntryReconcileLoop { + return &multiclusterWorkloadEntryReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.WorkloadEntry{}, options)} +} + +type genericWorkloadEntryMulticlusterReconciler struct { + reconciler MulticlusterWorkloadEntryReconciler +} + +func (g genericWorkloadEntryMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterWorkloadEntryDeletionReconciler); ok { + return deletionReconciler.ReconcileWorkloadEntryDeletion(cluster, req) + } + return nil +} + +func (g genericWorkloadEntryMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: WorkloadEntry handler received event for %T", object) + } + return g.reconciler.ReconcileWorkloadEntry(cluster, obj) +} + +// Reconcile Upsert events for the WorkloadGroup Resource across clusters. +// implemented by the user +type MulticlusterWorkloadGroupReconciler interface { + ReconcileWorkloadGroup(clusterName string, obj *networking_istio_io_v1alpha3.WorkloadGroup) (reconcile.Result, error) +} + +// Reconcile deletion events for the WorkloadGroup Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterWorkloadGroupDeletionReconciler interface { + ReconcileWorkloadGroupDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterWorkloadGroupReconcilerFuncs struct { + OnReconcileWorkloadGroup func(clusterName string, obj *networking_istio_io_v1alpha3.WorkloadGroup) (reconcile.Result, error) + OnReconcileWorkloadGroupDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterWorkloadGroupReconcilerFuncs) ReconcileWorkloadGroup(clusterName string, obj *networking_istio_io_v1alpha3.WorkloadGroup) (reconcile.Result, error) { + if f.OnReconcileWorkloadGroup == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileWorkloadGroup(clusterName, obj) +} + +func (f *MulticlusterWorkloadGroupReconcilerFuncs) ReconcileWorkloadGroupDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileWorkloadGroupDeletion == nil { + return nil + } + return f.OnReconcileWorkloadGroupDeletion(clusterName, req) +} + +type MulticlusterWorkloadGroupReconcileLoop interface { + // AddMulticlusterWorkloadGroupReconciler adds a MulticlusterWorkloadGroupReconciler to the MulticlusterWorkloadGroupReconcileLoop. + AddMulticlusterWorkloadGroupReconciler(ctx context.Context, rec MulticlusterWorkloadGroupReconciler, predicates ...predicate.Predicate) +} + +type multiclusterWorkloadGroupReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterWorkloadGroupReconcileLoop) AddMulticlusterWorkloadGroupReconciler(ctx context.Context, rec MulticlusterWorkloadGroupReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericWorkloadGroupMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterWorkloadGroupReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterWorkloadGroupReconcileLoop { + return &multiclusterWorkloadGroupReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.WorkloadGroup{}, options)} +} + +type genericWorkloadGroupMulticlusterReconciler struct { + reconciler MulticlusterWorkloadGroupReconciler +} + +func (g genericWorkloadGroupMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterWorkloadGroupDeletionReconciler); ok { + return deletionReconciler.ReconcileWorkloadGroupDeletion(cluster, req) + } + return nil +} + +func (g genericWorkloadGroupMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: WorkloadGroup handler received event for %T", object) + } + return g.reconciler.ReconcileWorkloadGroup(cluster, obj) +} + +// Reconcile Upsert events for the VirtualService Resource across clusters. +// implemented by the user +type MulticlusterVirtualServiceReconciler interface { + ReconcileVirtualService(clusterName string, obj *networking_istio_io_v1alpha3.VirtualService) (reconcile.Result, error) +} + +// Reconcile deletion events for the VirtualService Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterVirtualServiceDeletionReconciler interface { + ReconcileVirtualServiceDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterVirtualServiceReconcilerFuncs struct { + OnReconcileVirtualService func(clusterName string, obj *networking_istio_io_v1alpha3.VirtualService) (reconcile.Result, error) + OnReconcileVirtualServiceDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterVirtualServiceReconcilerFuncs) ReconcileVirtualService(clusterName string, obj *networking_istio_io_v1alpha3.VirtualService) (reconcile.Result, error) { + if f.OnReconcileVirtualService == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileVirtualService(clusterName, obj) +} + +func (f *MulticlusterVirtualServiceReconcilerFuncs) ReconcileVirtualServiceDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileVirtualServiceDeletion == nil { + return nil + } + return f.OnReconcileVirtualServiceDeletion(clusterName, req) +} + +type MulticlusterVirtualServiceReconcileLoop interface { + // AddMulticlusterVirtualServiceReconciler adds a MulticlusterVirtualServiceReconciler to the MulticlusterVirtualServiceReconcileLoop. + AddMulticlusterVirtualServiceReconciler(ctx context.Context, rec MulticlusterVirtualServiceReconciler, predicates ...predicate.Predicate) +} + +type multiclusterVirtualServiceReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterVirtualServiceReconcileLoop) AddMulticlusterVirtualServiceReconciler(ctx context.Context, rec MulticlusterVirtualServiceReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericVirtualServiceMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterVirtualServiceReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterVirtualServiceReconcileLoop { + return &multiclusterVirtualServiceReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.VirtualService{}, options)} +} + +type genericVirtualServiceMulticlusterReconciler struct { + reconciler MulticlusterVirtualServiceReconciler +} + +func (g genericVirtualServiceMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterVirtualServiceDeletionReconciler); ok { + return deletionReconciler.ReconcileVirtualServiceDeletion(cluster, req) + } + return nil +} + +func (g genericVirtualServiceMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: VirtualService handler received event for %T", object) + } + return g.reconciler.ReconcileVirtualService(cluster, obj) +} + +// Reconcile Upsert events for the Sidecar Resource across clusters. +// implemented by the user +type MulticlusterSidecarReconciler interface { + ReconcileSidecar(clusterName string, obj *networking_istio_io_v1alpha3.Sidecar) (reconcile.Result, error) +} + +// Reconcile deletion events for the Sidecar Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterSidecarDeletionReconciler interface { + ReconcileSidecarDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterSidecarReconcilerFuncs struct { + OnReconcileSidecar func(clusterName string, obj *networking_istio_io_v1alpha3.Sidecar) (reconcile.Result, error) + OnReconcileSidecarDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterSidecarReconcilerFuncs) ReconcileSidecar(clusterName string, obj *networking_istio_io_v1alpha3.Sidecar) (reconcile.Result, error) { + if f.OnReconcileSidecar == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileSidecar(clusterName, obj) +} + +func (f *MulticlusterSidecarReconcilerFuncs) ReconcileSidecarDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileSidecarDeletion == nil { + return nil + } + return f.OnReconcileSidecarDeletion(clusterName, req) +} + +type MulticlusterSidecarReconcileLoop interface { + // AddMulticlusterSidecarReconciler adds a MulticlusterSidecarReconciler to the MulticlusterSidecarReconcileLoop. + AddMulticlusterSidecarReconciler(ctx context.Context, rec MulticlusterSidecarReconciler, predicates ...predicate.Predicate) +} + +type multiclusterSidecarReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterSidecarReconcileLoop) AddMulticlusterSidecarReconciler(ctx context.Context, rec MulticlusterSidecarReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericSidecarMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterSidecarReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterSidecarReconcileLoop { + return &multiclusterSidecarReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &networking_istio_io_v1alpha3.Sidecar{}, options)} +} + +type genericSidecarMulticlusterReconciler struct { + reconciler MulticlusterSidecarReconciler +} + +func (g genericSidecarMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterSidecarDeletionReconciler); ok { + return deletionReconciler.ReconcileSidecarDeletion(cluster, req) + } + return nil +} + +func (g genericSidecarMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: Sidecar handler received event for %T", object) + } + return g.reconciler.ReconcileSidecar(cluster, obj) +} + // Reconcile Upsert events for the EnvoyFilter Resource across clusters. // implemented by the user type MulticlusterEnvoyFilterReconciler interface { diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/controller/reconcilers.go b/pkg/api/istio/networking.istio.io/v1alpha3/controller/reconcilers.go index 79e0494..ac07071 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/controller/reconcilers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/controller/reconcilers.go @@ -17,6 +17,825 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" ) +// Reconcile Upsert events for the DestinationRule Resource. +// implemented by the user +type DestinationRuleReconciler interface { + ReconcileDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) (reconcile.Result, error) +} + +// Reconcile deletion events for the DestinationRule Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type DestinationRuleDeletionReconciler interface { + ReconcileDestinationRuleDeletion(req reconcile.Request) error +} + +type DestinationRuleReconcilerFuncs struct { + OnReconcileDestinationRule func(obj *networking_istio_io_v1alpha3.DestinationRule) (reconcile.Result, error) + OnReconcileDestinationRuleDeletion func(req reconcile.Request) error +} + +func (f *DestinationRuleReconcilerFuncs) ReconcileDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) (reconcile.Result, error) { + if f.OnReconcileDestinationRule == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileDestinationRule(obj) +} + +func (f *DestinationRuleReconcilerFuncs) ReconcileDestinationRuleDeletion(req reconcile.Request) error { + if f.OnReconcileDestinationRuleDeletion == nil { + return nil + } + return f.OnReconcileDestinationRuleDeletion(req) +} + +// Reconcile and finalize the DestinationRule Resource +// implemented by the user +type DestinationRuleFinalizer interface { + DestinationRuleReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + DestinationRuleFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeDestinationRule(obj *networking_istio_io_v1alpha3.DestinationRule) error +} + +type DestinationRuleReconcileLoop interface { + RunDestinationRuleReconciler(ctx context.Context, rec DestinationRuleReconciler, predicates ...predicate.Predicate) error +} + +type destinationRuleReconcileLoop struct { + loop reconcile.Loop +} + +func NewDestinationRuleReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) DestinationRuleReconcileLoop { + return &destinationRuleReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.DestinationRule{}, options), + } +} + +func (c *destinationRuleReconcileLoop) RunDestinationRuleReconciler(ctx context.Context, reconciler DestinationRuleReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericDestinationRuleReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(DestinationRuleFinalizer); ok { + reconcilerWrapper = genericDestinationRuleFinalizer{ + genericDestinationRuleReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericDestinationRuleHandler implements a generic reconcile.Reconciler +type genericDestinationRuleReconciler struct { + reconciler DestinationRuleReconciler +} + +func (r genericDestinationRuleReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: DestinationRule handler received event for %T", object) + } + return r.reconciler.ReconcileDestinationRule(obj) +} + +func (r genericDestinationRuleReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(DestinationRuleDeletionReconciler); ok { + return deletionReconciler.ReconcileDestinationRuleDeletion(request) + } + return nil +} + +// genericDestinationRuleFinalizer implements a generic reconcile.FinalizingReconciler +type genericDestinationRuleFinalizer struct { + genericDestinationRuleReconciler + finalizingReconciler DestinationRuleFinalizer +} + +func (r genericDestinationRuleFinalizer) FinalizerName() string { + return r.finalizingReconciler.DestinationRuleFinalizerName() +} + +func (r genericDestinationRuleFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.DestinationRule) + if !ok { + return errors.Errorf("internal error: DestinationRule handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeDestinationRule(obj) +} + +// Reconcile Upsert events for the Gateway Resource. +// implemented by the user +type GatewayReconciler interface { + ReconcileGateway(obj *networking_istio_io_v1alpha3.Gateway) (reconcile.Result, error) +} + +// Reconcile deletion events for the Gateway Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type GatewayDeletionReconciler interface { + ReconcileGatewayDeletion(req reconcile.Request) error +} + +type GatewayReconcilerFuncs struct { + OnReconcileGateway func(obj *networking_istio_io_v1alpha3.Gateway) (reconcile.Result, error) + OnReconcileGatewayDeletion func(req reconcile.Request) error +} + +func (f *GatewayReconcilerFuncs) ReconcileGateway(obj *networking_istio_io_v1alpha3.Gateway) (reconcile.Result, error) { + if f.OnReconcileGateway == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileGateway(obj) +} + +func (f *GatewayReconcilerFuncs) ReconcileGatewayDeletion(req reconcile.Request) error { + if f.OnReconcileGatewayDeletion == nil { + return nil + } + return f.OnReconcileGatewayDeletion(req) +} + +// Reconcile and finalize the Gateway Resource +// implemented by the user +type GatewayFinalizer interface { + GatewayReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + GatewayFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeGateway(obj *networking_istio_io_v1alpha3.Gateway) error +} + +type GatewayReconcileLoop interface { + RunGatewayReconciler(ctx context.Context, rec GatewayReconciler, predicates ...predicate.Predicate) error +} + +type gatewayReconcileLoop struct { + loop reconcile.Loop +} + +func NewGatewayReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) GatewayReconcileLoop { + return &gatewayReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.Gateway{}, options), + } +} + +func (c *gatewayReconcileLoop) RunGatewayReconciler(ctx context.Context, reconciler GatewayReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericGatewayReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(GatewayFinalizer); ok { + reconcilerWrapper = genericGatewayFinalizer{ + genericGatewayReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericGatewayHandler implements a generic reconcile.Reconciler +type genericGatewayReconciler struct { + reconciler GatewayReconciler +} + +func (r genericGatewayReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: Gateway handler received event for %T", object) + } + return r.reconciler.ReconcileGateway(obj) +} + +func (r genericGatewayReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(GatewayDeletionReconciler); ok { + return deletionReconciler.ReconcileGatewayDeletion(request) + } + return nil +} + +// genericGatewayFinalizer implements a generic reconcile.FinalizingReconciler +type genericGatewayFinalizer struct { + genericGatewayReconciler + finalizingReconciler GatewayFinalizer +} + +func (r genericGatewayFinalizer) FinalizerName() string { + return r.finalizingReconciler.GatewayFinalizerName() +} + +func (r genericGatewayFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Gateway) + if !ok { + return errors.Errorf("internal error: Gateway handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeGateway(obj) +} + +// Reconcile Upsert events for the ServiceEntry Resource. +// implemented by the user +type ServiceEntryReconciler interface { + ReconcileServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) (reconcile.Result, error) +} + +// Reconcile deletion events for the ServiceEntry Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type ServiceEntryDeletionReconciler interface { + ReconcileServiceEntryDeletion(req reconcile.Request) error +} + +type ServiceEntryReconcilerFuncs struct { + OnReconcileServiceEntry func(obj *networking_istio_io_v1alpha3.ServiceEntry) (reconcile.Result, error) + OnReconcileServiceEntryDeletion func(req reconcile.Request) error +} + +func (f *ServiceEntryReconcilerFuncs) ReconcileServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) (reconcile.Result, error) { + if f.OnReconcileServiceEntry == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileServiceEntry(obj) +} + +func (f *ServiceEntryReconcilerFuncs) ReconcileServiceEntryDeletion(req reconcile.Request) error { + if f.OnReconcileServiceEntryDeletion == nil { + return nil + } + return f.OnReconcileServiceEntryDeletion(req) +} + +// Reconcile and finalize the ServiceEntry Resource +// implemented by the user +type ServiceEntryFinalizer interface { + ServiceEntryReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + ServiceEntryFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeServiceEntry(obj *networking_istio_io_v1alpha3.ServiceEntry) error +} + +type ServiceEntryReconcileLoop interface { + RunServiceEntryReconciler(ctx context.Context, rec ServiceEntryReconciler, predicates ...predicate.Predicate) error +} + +type serviceEntryReconcileLoop struct { + loop reconcile.Loop +} + +func NewServiceEntryReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) ServiceEntryReconcileLoop { + return &serviceEntryReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.ServiceEntry{}, options), + } +} + +func (c *serviceEntryReconcileLoop) RunServiceEntryReconciler(ctx context.Context, reconciler ServiceEntryReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericServiceEntryReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(ServiceEntryFinalizer); ok { + reconcilerWrapper = genericServiceEntryFinalizer{ + genericServiceEntryReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericServiceEntryHandler implements a generic reconcile.Reconciler +type genericServiceEntryReconciler struct { + reconciler ServiceEntryReconciler +} + +func (r genericServiceEntryReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: ServiceEntry handler received event for %T", object) + } + return r.reconciler.ReconcileServiceEntry(obj) +} + +func (r genericServiceEntryReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(ServiceEntryDeletionReconciler); ok { + return deletionReconciler.ReconcileServiceEntryDeletion(request) + } + return nil +} + +// genericServiceEntryFinalizer implements a generic reconcile.FinalizingReconciler +type genericServiceEntryFinalizer struct { + genericServiceEntryReconciler + finalizingReconciler ServiceEntryFinalizer +} + +func (r genericServiceEntryFinalizer) FinalizerName() string { + return r.finalizingReconciler.ServiceEntryFinalizerName() +} + +func (r genericServiceEntryFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.ServiceEntry) + if !ok { + return errors.Errorf("internal error: ServiceEntry handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeServiceEntry(obj) +} + +// Reconcile Upsert events for the WorkloadEntry Resource. +// implemented by the user +type WorkloadEntryReconciler interface { + ReconcileWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) (reconcile.Result, error) +} + +// Reconcile deletion events for the WorkloadEntry Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type WorkloadEntryDeletionReconciler interface { + ReconcileWorkloadEntryDeletion(req reconcile.Request) error +} + +type WorkloadEntryReconcilerFuncs struct { + OnReconcileWorkloadEntry func(obj *networking_istio_io_v1alpha3.WorkloadEntry) (reconcile.Result, error) + OnReconcileWorkloadEntryDeletion func(req reconcile.Request) error +} + +func (f *WorkloadEntryReconcilerFuncs) ReconcileWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) (reconcile.Result, error) { + if f.OnReconcileWorkloadEntry == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileWorkloadEntry(obj) +} + +func (f *WorkloadEntryReconcilerFuncs) ReconcileWorkloadEntryDeletion(req reconcile.Request) error { + if f.OnReconcileWorkloadEntryDeletion == nil { + return nil + } + return f.OnReconcileWorkloadEntryDeletion(req) +} + +// Reconcile and finalize the WorkloadEntry Resource +// implemented by the user +type WorkloadEntryFinalizer interface { + WorkloadEntryReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + WorkloadEntryFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeWorkloadEntry(obj *networking_istio_io_v1alpha3.WorkloadEntry) error +} + +type WorkloadEntryReconcileLoop interface { + RunWorkloadEntryReconciler(ctx context.Context, rec WorkloadEntryReconciler, predicates ...predicate.Predicate) error +} + +type workloadEntryReconcileLoop struct { + loop reconcile.Loop +} + +func NewWorkloadEntryReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) WorkloadEntryReconcileLoop { + return &workloadEntryReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.WorkloadEntry{}, options), + } +} + +func (c *workloadEntryReconcileLoop) RunWorkloadEntryReconciler(ctx context.Context, reconciler WorkloadEntryReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericWorkloadEntryReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(WorkloadEntryFinalizer); ok { + reconcilerWrapper = genericWorkloadEntryFinalizer{ + genericWorkloadEntryReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericWorkloadEntryHandler implements a generic reconcile.Reconciler +type genericWorkloadEntryReconciler struct { + reconciler WorkloadEntryReconciler +} + +func (r genericWorkloadEntryReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: WorkloadEntry handler received event for %T", object) + } + return r.reconciler.ReconcileWorkloadEntry(obj) +} + +func (r genericWorkloadEntryReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(WorkloadEntryDeletionReconciler); ok { + return deletionReconciler.ReconcileWorkloadEntryDeletion(request) + } + return nil +} + +// genericWorkloadEntryFinalizer implements a generic reconcile.FinalizingReconciler +type genericWorkloadEntryFinalizer struct { + genericWorkloadEntryReconciler + finalizingReconciler WorkloadEntryFinalizer +} + +func (r genericWorkloadEntryFinalizer) FinalizerName() string { + return r.finalizingReconciler.WorkloadEntryFinalizerName() +} + +func (r genericWorkloadEntryFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadEntry) + if !ok { + return errors.Errorf("internal error: WorkloadEntry handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeWorkloadEntry(obj) +} + +// Reconcile Upsert events for the WorkloadGroup Resource. +// implemented by the user +type WorkloadGroupReconciler interface { + ReconcileWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) (reconcile.Result, error) +} + +// Reconcile deletion events for the WorkloadGroup Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type WorkloadGroupDeletionReconciler interface { + ReconcileWorkloadGroupDeletion(req reconcile.Request) error +} + +type WorkloadGroupReconcilerFuncs struct { + OnReconcileWorkloadGroup func(obj *networking_istio_io_v1alpha3.WorkloadGroup) (reconcile.Result, error) + OnReconcileWorkloadGroupDeletion func(req reconcile.Request) error +} + +func (f *WorkloadGroupReconcilerFuncs) ReconcileWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) (reconcile.Result, error) { + if f.OnReconcileWorkloadGroup == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileWorkloadGroup(obj) +} + +func (f *WorkloadGroupReconcilerFuncs) ReconcileWorkloadGroupDeletion(req reconcile.Request) error { + if f.OnReconcileWorkloadGroupDeletion == nil { + return nil + } + return f.OnReconcileWorkloadGroupDeletion(req) +} + +// Reconcile and finalize the WorkloadGroup Resource +// implemented by the user +type WorkloadGroupFinalizer interface { + WorkloadGroupReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + WorkloadGroupFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeWorkloadGroup(obj *networking_istio_io_v1alpha3.WorkloadGroup) error +} + +type WorkloadGroupReconcileLoop interface { + RunWorkloadGroupReconciler(ctx context.Context, rec WorkloadGroupReconciler, predicates ...predicate.Predicate) error +} + +type workloadGroupReconcileLoop struct { + loop reconcile.Loop +} + +func NewWorkloadGroupReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) WorkloadGroupReconcileLoop { + return &workloadGroupReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.WorkloadGroup{}, options), + } +} + +func (c *workloadGroupReconcileLoop) RunWorkloadGroupReconciler(ctx context.Context, reconciler WorkloadGroupReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericWorkloadGroupReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(WorkloadGroupFinalizer); ok { + reconcilerWrapper = genericWorkloadGroupFinalizer{ + genericWorkloadGroupReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericWorkloadGroupHandler implements a generic reconcile.Reconciler +type genericWorkloadGroupReconciler struct { + reconciler WorkloadGroupReconciler +} + +func (r genericWorkloadGroupReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: WorkloadGroup handler received event for %T", object) + } + return r.reconciler.ReconcileWorkloadGroup(obj) +} + +func (r genericWorkloadGroupReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(WorkloadGroupDeletionReconciler); ok { + return deletionReconciler.ReconcileWorkloadGroupDeletion(request) + } + return nil +} + +// genericWorkloadGroupFinalizer implements a generic reconcile.FinalizingReconciler +type genericWorkloadGroupFinalizer struct { + genericWorkloadGroupReconciler + finalizingReconciler WorkloadGroupFinalizer +} + +func (r genericWorkloadGroupFinalizer) FinalizerName() string { + return r.finalizingReconciler.WorkloadGroupFinalizerName() +} + +func (r genericWorkloadGroupFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.WorkloadGroup) + if !ok { + return errors.Errorf("internal error: WorkloadGroup handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeWorkloadGroup(obj) +} + +// Reconcile Upsert events for the VirtualService Resource. +// implemented by the user +type VirtualServiceReconciler interface { + ReconcileVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) (reconcile.Result, error) +} + +// Reconcile deletion events for the VirtualService Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type VirtualServiceDeletionReconciler interface { + ReconcileVirtualServiceDeletion(req reconcile.Request) error +} + +type VirtualServiceReconcilerFuncs struct { + OnReconcileVirtualService func(obj *networking_istio_io_v1alpha3.VirtualService) (reconcile.Result, error) + OnReconcileVirtualServiceDeletion func(req reconcile.Request) error +} + +func (f *VirtualServiceReconcilerFuncs) ReconcileVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) (reconcile.Result, error) { + if f.OnReconcileVirtualService == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileVirtualService(obj) +} + +func (f *VirtualServiceReconcilerFuncs) ReconcileVirtualServiceDeletion(req reconcile.Request) error { + if f.OnReconcileVirtualServiceDeletion == nil { + return nil + } + return f.OnReconcileVirtualServiceDeletion(req) +} + +// Reconcile and finalize the VirtualService Resource +// implemented by the user +type VirtualServiceFinalizer interface { + VirtualServiceReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + VirtualServiceFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeVirtualService(obj *networking_istio_io_v1alpha3.VirtualService) error +} + +type VirtualServiceReconcileLoop interface { + RunVirtualServiceReconciler(ctx context.Context, rec VirtualServiceReconciler, predicates ...predicate.Predicate) error +} + +type virtualServiceReconcileLoop struct { + loop reconcile.Loop +} + +func NewVirtualServiceReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) VirtualServiceReconcileLoop { + return &virtualServiceReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.VirtualService{}, options), + } +} + +func (c *virtualServiceReconcileLoop) RunVirtualServiceReconciler(ctx context.Context, reconciler VirtualServiceReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericVirtualServiceReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(VirtualServiceFinalizer); ok { + reconcilerWrapper = genericVirtualServiceFinalizer{ + genericVirtualServiceReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericVirtualServiceHandler implements a generic reconcile.Reconciler +type genericVirtualServiceReconciler struct { + reconciler VirtualServiceReconciler +} + +func (r genericVirtualServiceReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: VirtualService handler received event for %T", object) + } + return r.reconciler.ReconcileVirtualService(obj) +} + +func (r genericVirtualServiceReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(VirtualServiceDeletionReconciler); ok { + return deletionReconciler.ReconcileVirtualServiceDeletion(request) + } + return nil +} + +// genericVirtualServiceFinalizer implements a generic reconcile.FinalizingReconciler +type genericVirtualServiceFinalizer struct { + genericVirtualServiceReconciler + finalizingReconciler VirtualServiceFinalizer +} + +func (r genericVirtualServiceFinalizer) FinalizerName() string { + return r.finalizingReconciler.VirtualServiceFinalizerName() +} + +func (r genericVirtualServiceFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.VirtualService) + if !ok { + return errors.Errorf("internal error: VirtualService handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeVirtualService(obj) +} + +// Reconcile Upsert events for the Sidecar Resource. +// implemented by the user +type SidecarReconciler interface { + ReconcileSidecar(obj *networking_istio_io_v1alpha3.Sidecar) (reconcile.Result, error) +} + +// Reconcile deletion events for the Sidecar Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type SidecarDeletionReconciler interface { + ReconcileSidecarDeletion(req reconcile.Request) error +} + +type SidecarReconcilerFuncs struct { + OnReconcileSidecar func(obj *networking_istio_io_v1alpha3.Sidecar) (reconcile.Result, error) + OnReconcileSidecarDeletion func(req reconcile.Request) error +} + +func (f *SidecarReconcilerFuncs) ReconcileSidecar(obj *networking_istio_io_v1alpha3.Sidecar) (reconcile.Result, error) { + if f.OnReconcileSidecar == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileSidecar(obj) +} + +func (f *SidecarReconcilerFuncs) ReconcileSidecarDeletion(req reconcile.Request) error { + if f.OnReconcileSidecarDeletion == nil { + return nil + } + return f.OnReconcileSidecarDeletion(req) +} + +// Reconcile and finalize the Sidecar Resource +// implemented by the user +type SidecarFinalizer interface { + SidecarReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + SidecarFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeSidecar(obj *networking_istio_io_v1alpha3.Sidecar) error +} + +type SidecarReconcileLoop interface { + RunSidecarReconciler(ctx context.Context, rec SidecarReconciler, predicates ...predicate.Predicate) error +} + +type sidecarReconcileLoop struct { + loop reconcile.Loop +} + +func NewSidecarReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) SidecarReconcileLoop { + return &sidecarReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &networking_istio_io_v1alpha3.Sidecar{}, options), + } +} + +func (c *sidecarReconcileLoop) RunSidecarReconciler(ctx context.Context, reconciler SidecarReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericSidecarReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(SidecarFinalizer); ok { + reconcilerWrapper = genericSidecarFinalizer{ + genericSidecarReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericSidecarHandler implements a generic reconcile.Reconciler +type genericSidecarReconciler struct { + reconciler SidecarReconciler +} + +func (r genericSidecarReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: Sidecar handler received event for %T", object) + } + return r.reconciler.ReconcileSidecar(obj) +} + +func (r genericSidecarReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(SidecarDeletionReconciler); ok { + return deletionReconciler.ReconcileSidecarDeletion(request) + } + return nil +} + +// genericSidecarFinalizer implements a generic reconcile.FinalizingReconciler +type genericSidecarFinalizer struct { + genericSidecarReconciler + finalizingReconciler SidecarFinalizer +} + +func (r genericSidecarFinalizer) FinalizerName() string { + return r.finalizingReconciler.SidecarFinalizerName() +} + +func (r genericSidecarFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*networking_istio_io_v1alpha3.Sidecar) + if !ok { + return errors.Errorf("internal error: Sidecar handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeSidecar(obj) +} + // Reconcile Upsert events for the EnvoyFilter Resource. // implemented by the user type EnvoyFilterReconciler interface { diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/mocks/clients.go b/pkg/api/istio/networking.istio.io/v1alpha3/mocks/clients.go index 305f76b..3df4a69 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/mocks/clients.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/mocks/clients.go @@ -75,6 +75,20 @@ func (m *MockClientset) EXPECT() *MockClientsetMockRecorder { return m.recorder } +// DestinationRules mocks base method. +func (m *MockClientset) DestinationRules() v1alpha3.DestinationRuleClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DestinationRules") + ret0, _ := ret[0].(v1alpha3.DestinationRuleClient) + return ret0 +} + +// DestinationRules indicates an expected call of DestinationRules. +func (mr *MockClientsetMockRecorder) DestinationRules() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DestinationRules", reflect.TypeOf((*MockClientset)(nil).DestinationRules)) +} + // EnvoyFilters mocks base method. func (m *MockClientset) EnvoyFilters() v1alpha3.EnvoyFilterClient { m.ctrl.T.Helper() @@ -89,6 +103,3618 @@ func (mr *MockClientsetMockRecorder) EnvoyFilters() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnvoyFilters", reflect.TypeOf((*MockClientset)(nil).EnvoyFilters)) } +// Gateways mocks base method. +func (m *MockClientset) Gateways() v1alpha3.GatewayClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Gateways") + ret0, _ := ret[0].(v1alpha3.GatewayClient) + return ret0 +} + +// Gateways indicates an expected call of Gateways. +func (mr *MockClientsetMockRecorder) Gateways() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Gateways", reflect.TypeOf((*MockClientset)(nil).Gateways)) +} + +// ServiceEntries mocks base method. +func (m *MockClientset) ServiceEntries() v1alpha3.ServiceEntryClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ServiceEntries") + ret0, _ := ret[0].(v1alpha3.ServiceEntryClient) + return ret0 +} + +// ServiceEntries indicates an expected call of ServiceEntries. +func (mr *MockClientsetMockRecorder) ServiceEntries() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServiceEntries", reflect.TypeOf((*MockClientset)(nil).ServiceEntries)) +} + +// Sidecars mocks base method. +func (m *MockClientset) Sidecars() v1alpha3.SidecarClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Sidecars") + ret0, _ := ret[0].(v1alpha3.SidecarClient) + return ret0 +} + +// Sidecars indicates an expected call of Sidecars. +func (mr *MockClientsetMockRecorder) Sidecars() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Sidecars", reflect.TypeOf((*MockClientset)(nil).Sidecars)) +} + +// VirtualServices mocks base method. +func (m *MockClientset) VirtualServices() v1alpha3.VirtualServiceClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "VirtualServices") + ret0, _ := ret[0].(v1alpha3.VirtualServiceClient) + return ret0 +} + +// VirtualServices indicates an expected call of VirtualServices. +func (mr *MockClientsetMockRecorder) VirtualServices() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VirtualServices", reflect.TypeOf((*MockClientset)(nil).VirtualServices)) +} + +// WorkloadEntries mocks base method. +func (m *MockClientset) WorkloadEntries() v1alpha3.WorkloadEntryClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WorkloadEntries") + ret0, _ := ret[0].(v1alpha3.WorkloadEntryClient) + return ret0 +} + +// WorkloadEntries indicates an expected call of WorkloadEntries. +func (mr *MockClientsetMockRecorder) WorkloadEntries() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkloadEntries", reflect.TypeOf((*MockClientset)(nil).WorkloadEntries)) +} + +// WorkloadGroups mocks base method. +func (m *MockClientset) WorkloadGroups() v1alpha3.WorkloadGroupClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "WorkloadGroups") + ret0, _ := ret[0].(v1alpha3.WorkloadGroupClient) + return ret0 +} + +// WorkloadGroups indicates an expected call of WorkloadGroups. +func (mr *MockClientsetMockRecorder) WorkloadGroups() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WorkloadGroups", reflect.TypeOf((*MockClientset)(nil).WorkloadGroups)) +} + +// MockDestinationRuleReader is a mock of DestinationRuleReader interface. +type MockDestinationRuleReader struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleReaderMockRecorder +} + +// MockDestinationRuleReaderMockRecorder is the mock recorder for MockDestinationRuleReader. +type MockDestinationRuleReaderMockRecorder struct { + mock *MockDestinationRuleReader +} + +// NewMockDestinationRuleReader creates a new mock instance. +func NewMockDestinationRuleReader(ctrl *gomock.Controller) *MockDestinationRuleReader { + mock := &MockDestinationRuleReader{ctrl: ctrl} + mock.recorder = &MockDestinationRuleReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleReader) EXPECT() *MockDestinationRuleReaderMockRecorder { + return m.recorder +} + +// GetDestinationRule mocks base method. +func (m *MockDestinationRuleReader) GetDestinationRule(ctx context.Context, key client.ObjectKey) (*v1alpha30.DestinationRule, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDestinationRule", ctx, key) + ret0, _ := ret[0].(*v1alpha30.DestinationRule) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDestinationRule indicates an expected call of GetDestinationRule. +func (mr *MockDestinationRuleReaderMockRecorder) GetDestinationRule(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDestinationRule", reflect.TypeOf((*MockDestinationRuleReader)(nil).GetDestinationRule), ctx, key) +} + +// ListDestinationRule mocks base method. +func (m *MockDestinationRuleReader) ListDestinationRule(ctx context.Context, opts ...client.ListOption) (*v1alpha30.DestinationRuleList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListDestinationRule", varargs...) + ret0, _ := ret[0].(*v1alpha30.DestinationRuleList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListDestinationRule indicates an expected call of ListDestinationRule. +func (mr *MockDestinationRuleReaderMockRecorder) ListDestinationRule(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDestinationRule", reflect.TypeOf((*MockDestinationRuleReader)(nil).ListDestinationRule), varargs...) +} + +// MockDestinationRuleWriter is a mock of DestinationRuleWriter interface. +type MockDestinationRuleWriter struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleWriterMockRecorder +} + +// MockDestinationRuleWriterMockRecorder is the mock recorder for MockDestinationRuleWriter. +type MockDestinationRuleWriterMockRecorder struct { + mock *MockDestinationRuleWriter +} + +// NewMockDestinationRuleWriter creates a new mock instance. +func NewMockDestinationRuleWriter(ctrl *gomock.Controller) *MockDestinationRuleWriter { + mock := &MockDestinationRuleWriter{ctrl: ctrl} + mock.recorder = &MockDestinationRuleWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleWriter) EXPECT() *MockDestinationRuleWriterMockRecorder { + return m.recorder +} + +// CreateDestinationRule mocks base method. +func (m *MockDestinationRuleWriter) CreateDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateDestinationRule indicates an expected call of CreateDestinationRule. +func (mr *MockDestinationRuleWriterMockRecorder) CreateDestinationRule(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDestinationRule", reflect.TypeOf((*MockDestinationRuleWriter)(nil).CreateDestinationRule), varargs...) +} + +// DeleteAllOfDestinationRule mocks base method. +func (m *MockDestinationRuleWriter) DeleteAllOfDestinationRule(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfDestinationRule indicates an expected call of DeleteAllOfDestinationRule. +func (mr *MockDestinationRuleWriterMockRecorder) DeleteAllOfDestinationRule(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfDestinationRule", reflect.TypeOf((*MockDestinationRuleWriter)(nil).DeleteAllOfDestinationRule), varargs...) +} + +// DeleteDestinationRule mocks base method. +func (m *MockDestinationRuleWriter) DeleteDestinationRule(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteDestinationRule indicates an expected call of DeleteDestinationRule. +func (mr *MockDestinationRuleWriterMockRecorder) DeleteDestinationRule(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDestinationRule", reflect.TypeOf((*MockDestinationRuleWriter)(nil).DeleteDestinationRule), varargs...) +} + +// PatchDestinationRule mocks base method. +func (m *MockDestinationRuleWriter) PatchDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchDestinationRule indicates an expected call of PatchDestinationRule. +func (mr *MockDestinationRuleWriterMockRecorder) PatchDestinationRule(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchDestinationRule", reflect.TypeOf((*MockDestinationRuleWriter)(nil).PatchDestinationRule), varargs...) +} + +// UpdateDestinationRule mocks base method. +func (m *MockDestinationRuleWriter) UpdateDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDestinationRule indicates an expected call of UpdateDestinationRule. +func (mr *MockDestinationRuleWriterMockRecorder) UpdateDestinationRule(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDestinationRule", reflect.TypeOf((*MockDestinationRuleWriter)(nil).UpdateDestinationRule), varargs...) +} + +// UpsertDestinationRule mocks base method. +func (m *MockDestinationRuleWriter) UpsertDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, transitionFuncs ...v1alpha3.DestinationRuleTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertDestinationRule indicates an expected call of UpsertDestinationRule. +func (mr *MockDestinationRuleWriterMockRecorder) UpsertDestinationRule(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertDestinationRule", reflect.TypeOf((*MockDestinationRuleWriter)(nil).UpsertDestinationRule), varargs...) +} + +// MockDestinationRuleStatusWriter is a mock of DestinationRuleStatusWriter interface. +type MockDestinationRuleStatusWriter struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleStatusWriterMockRecorder +} + +// MockDestinationRuleStatusWriterMockRecorder is the mock recorder for MockDestinationRuleStatusWriter. +type MockDestinationRuleStatusWriterMockRecorder struct { + mock *MockDestinationRuleStatusWriter +} + +// NewMockDestinationRuleStatusWriter creates a new mock instance. +func NewMockDestinationRuleStatusWriter(ctrl *gomock.Controller) *MockDestinationRuleStatusWriter { + mock := &MockDestinationRuleStatusWriter{ctrl: ctrl} + mock.recorder = &MockDestinationRuleStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleStatusWriter) EXPECT() *MockDestinationRuleStatusWriterMockRecorder { + return m.recorder +} + +// PatchDestinationRuleStatus mocks base method. +func (m *MockDestinationRuleStatusWriter) PatchDestinationRuleStatus(ctx context.Context, obj *v1alpha30.DestinationRule, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchDestinationRuleStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchDestinationRuleStatus indicates an expected call of PatchDestinationRuleStatus. +func (mr *MockDestinationRuleStatusWriterMockRecorder) PatchDestinationRuleStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchDestinationRuleStatus", reflect.TypeOf((*MockDestinationRuleStatusWriter)(nil).PatchDestinationRuleStatus), varargs...) +} + +// UpdateDestinationRuleStatus mocks base method. +func (m *MockDestinationRuleStatusWriter) UpdateDestinationRuleStatus(ctx context.Context, obj *v1alpha30.DestinationRule, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateDestinationRuleStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDestinationRuleStatus indicates an expected call of UpdateDestinationRuleStatus. +func (mr *MockDestinationRuleStatusWriterMockRecorder) UpdateDestinationRuleStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDestinationRuleStatus", reflect.TypeOf((*MockDestinationRuleStatusWriter)(nil).UpdateDestinationRuleStatus), varargs...) +} + +// MockDestinationRuleClient is a mock of DestinationRuleClient interface. +type MockDestinationRuleClient struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleClientMockRecorder +} + +// MockDestinationRuleClientMockRecorder is the mock recorder for MockDestinationRuleClient. +type MockDestinationRuleClientMockRecorder struct { + mock *MockDestinationRuleClient +} + +// NewMockDestinationRuleClient creates a new mock instance. +func NewMockDestinationRuleClient(ctrl *gomock.Controller) *MockDestinationRuleClient { + mock := &MockDestinationRuleClient{ctrl: ctrl} + mock.recorder = &MockDestinationRuleClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleClient) EXPECT() *MockDestinationRuleClientMockRecorder { + return m.recorder +} + +// CreateDestinationRule mocks base method. +func (m *MockDestinationRuleClient) CreateDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateDestinationRule indicates an expected call of CreateDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) CreateDestinationRule(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).CreateDestinationRule), varargs...) +} + +// DeleteAllOfDestinationRule mocks base method. +func (m *MockDestinationRuleClient) DeleteAllOfDestinationRule(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfDestinationRule indicates an expected call of DeleteAllOfDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) DeleteAllOfDestinationRule(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).DeleteAllOfDestinationRule), varargs...) +} + +// DeleteDestinationRule mocks base method. +func (m *MockDestinationRuleClient) DeleteDestinationRule(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteDestinationRule indicates an expected call of DeleteDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) DeleteDestinationRule(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).DeleteDestinationRule), varargs...) +} + +// GetDestinationRule mocks base method. +func (m *MockDestinationRuleClient) GetDestinationRule(ctx context.Context, key client.ObjectKey) (*v1alpha30.DestinationRule, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDestinationRule", ctx, key) + ret0, _ := ret[0].(*v1alpha30.DestinationRule) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDestinationRule indicates an expected call of GetDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) GetDestinationRule(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).GetDestinationRule), ctx, key) +} + +// ListDestinationRule mocks base method. +func (m *MockDestinationRuleClient) ListDestinationRule(ctx context.Context, opts ...client.ListOption) (*v1alpha30.DestinationRuleList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListDestinationRule", varargs...) + ret0, _ := ret[0].(*v1alpha30.DestinationRuleList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListDestinationRule indicates an expected call of ListDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) ListDestinationRule(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).ListDestinationRule), varargs...) +} + +// PatchDestinationRule mocks base method. +func (m *MockDestinationRuleClient) PatchDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchDestinationRule indicates an expected call of PatchDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) PatchDestinationRule(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).PatchDestinationRule), varargs...) +} + +// PatchDestinationRuleStatus mocks base method. +func (m *MockDestinationRuleClient) PatchDestinationRuleStatus(ctx context.Context, obj *v1alpha30.DestinationRule, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchDestinationRuleStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchDestinationRuleStatus indicates an expected call of PatchDestinationRuleStatus. +func (mr *MockDestinationRuleClientMockRecorder) PatchDestinationRuleStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchDestinationRuleStatus", reflect.TypeOf((*MockDestinationRuleClient)(nil).PatchDestinationRuleStatus), varargs...) +} + +// UpdateDestinationRule mocks base method. +func (m *MockDestinationRuleClient) UpdateDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDestinationRule indicates an expected call of UpdateDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) UpdateDestinationRule(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).UpdateDestinationRule), varargs...) +} + +// UpdateDestinationRuleStatus mocks base method. +func (m *MockDestinationRuleClient) UpdateDestinationRuleStatus(ctx context.Context, obj *v1alpha30.DestinationRule, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateDestinationRuleStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateDestinationRuleStatus indicates an expected call of UpdateDestinationRuleStatus. +func (mr *MockDestinationRuleClientMockRecorder) UpdateDestinationRuleStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateDestinationRuleStatus", reflect.TypeOf((*MockDestinationRuleClient)(nil).UpdateDestinationRuleStatus), varargs...) +} + +// UpsertDestinationRule mocks base method. +func (m *MockDestinationRuleClient) UpsertDestinationRule(ctx context.Context, obj *v1alpha30.DestinationRule, transitionFuncs ...v1alpha3.DestinationRuleTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertDestinationRule", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertDestinationRule indicates an expected call of UpsertDestinationRule. +func (mr *MockDestinationRuleClientMockRecorder) UpsertDestinationRule(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertDestinationRule", reflect.TypeOf((*MockDestinationRuleClient)(nil).UpsertDestinationRule), varargs...) +} + +// MockMulticlusterDestinationRuleClient is a mock of MulticlusterDestinationRuleClient interface. +type MockMulticlusterDestinationRuleClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterDestinationRuleClientMockRecorder +} + +// MockMulticlusterDestinationRuleClientMockRecorder is the mock recorder for MockMulticlusterDestinationRuleClient. +type MockMulticlusterDestinationRuleClientMockRecorder struct { + mock *MockMulticlusterDestinationRuleClient +} + +// NewMockMulticlusterDestinationRuleClient creates a new mock instance. +func NewMockMulticlusterDestinationRuleClient(ctrl *gomock.Controller) *MockMulticlusterDestinationRuleClient { + mock := &MockMulticlusterDestinationRuleClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterDestinationRuleClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterDestinationRuleClient) EXPECT() *MockMulticlusterDestinationRuleClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterDestinationRuleClient) Cluster(cluster string) (v1alpha3.DestinationRuleClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.DestinationRuleClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterDestinationRuleClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterDestinationRuleClient)(nil).Cluster), cluster) +} + +// MockGatewayReader is a mock of GatewayReader interface. +type MockGatewayReader struct { + ctrl *gomock.Controller + recorder *MockGatewayReaderMockRecorder +} + +// MockGatewayReaderMockRecorder is the mock recorder for MockGatewayReader. +type MockGatewayReaderMockRecorder struct { + mock *MockGatewayReader +} + +// NewMockGatewayReader creates a new mock instance. +func NewMockGatewayReader(ctrl *gomock.Controller) *MockGatewayReader { + mock := &MockGatewayReader{ctrl: ctrl} + mock.recorder = &MockGatewayReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayReader) EXPECT() *MockGatewayReaderMockRecorder { + return m.recorder +} + +// GetGateway mocks base method. +func (m *MockGatewayReader) GetGateway(ctx context.Context, key client.ObjectKey) (*v1alpha30.Gateway, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetGateway", ctx, key) + ret0, _ := ret[0].(*v1alpha30.Gateway) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetGateway indicates an expected call of GetGateway. +func (mr *MockGatewayReaderMockRecorder) GetGateway(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGateway", reflect.TypeOf((*MockGatewayReader)(nil).GetGateway), ctx, key) +} + +// ListGateway mocks base method. +func (m *MockGatewayReader) ListGateway(ctx context.Context, opts ...client.ListOption) (*v1alpha30.GatewayList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListGateway", varargs...) + ret0, _ := ret[0].(*v1alpha30.GatewayList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListGateway indicates an expected call of ListGateway. +func (mr *MockGatewayReaderMockRecorder) ListGateway(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListGateway", reflect.TypeOf((*MockGatewayReader)(nil).ListGateway), varargs...) +} + +// MockGatewayWriter is a mock of GatewayWriter interface. +type MockGatewayWriter struct { + ctrl *gomock.Controller + recorder *MockGatewayWriterMockRecorder +} + +// MockGatewayWriterMockRecorder is the mock recorder for MockGatewayWriter. +type MockGatewayWriterMockRecorder struct { + mock *MockGatewayWriter +} + +// NewMockGatewayWriter creates a new mock instance. +func NewMockGatewayWriter(ctrl *gomock.Controller) *MockGatewayWriter { + mock := &MockGatewayWriter{ctrl: ctrl} + mock.recorder = &MockGatewayWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayWriter) EXPECT() *MockGatewayWriterMockRecorder { + return m.recorder +} + +// CreateGateway mocks base method. +func (m *MockGatewayWriter) CreateGateway(ctx context.Context, obj *v1alpha30.Gateway, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateGateway indicates an expected call of CreateGateway. +func (mr *MockGatewayWriterMockRecorder) CreateGateway(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateGateway", reflect.TypeOf((*MockGatewayWriter)(nil).CreateGateway), varargs...) +} + +// DeleteAllOfGateway mocks base method. +func (m *MockGatewayWriter) DeleteAllOfGateway(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfGateway indicates an expected call of DeleteAllOfGateway. +func (mr *MockGatewayWriterMockRecorder) DeleteAllOfGateway(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfGateway", reflect.TypeOf((*MockGatewayWriter)(nil).DeleteAllOfGateway), varargs...) +} + +// DeleteGateway mocks base method. +func (m *MockGatewayWriter) DeleteGateway(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteGateway indicates an expected call of DeleteGateway. +func (mr *MockGatewayWriterMockRecorder) DeleteGateway(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteGateway", reflect.TypeOf((*MockGatewayWriter)(nil).DeleteGateway), varargs...) +} + +// PatchGateway mocks base method. +func (m *MockGatewayWriter) PatchGateway(ctx context.Context, obj *v1alpha30.Gateway, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchGateway indicates an expected call of PatchGateway. +func (mr *MockGatewayWriterMockRecorder) PatchGateway(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchGateway", reflect.TypeOf((*MockGatewayWriter)(nil).PatchGateway), varargs...) +} + +// UpdateGateway mocks base method. +func (m *MockGatewayWriter) UpdateGateway(ctx context.Context, obj *v1alpha30.Gateway, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateGateway indicates an expected call of UpdateGateway. +func (mr *MockGatewayWriterMockRecorder) UpdateGateway(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGateway", reflect.TypeOf((*MockGatewayWriter)(nil).UpdateGateway), varargs...) +} + +// UpsertGateway mocks base method. +func (m *MockGatewayWriter) UpsertGateway(ctx context.Context, obj *v1alpha30.Gateway, transitionFuncs ...v1alpha3.GatewayTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertGateway indicates an expected call of UpsertGateway. +func (mr *MockGatewayWriterMockRecorder) UpsertGateway(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertGateway", reflect.TypeOf((*MockGatewayWriter)(nil).UpsertGateway), varargs...) +} + +// MockGatewayStatusWriter is a mock of GatewayStatusWriter interface. +type MockGatewayStatusWriter struct { + ctrl *gomock.Controller + recorder *MockGatewayStatusWriterMockRecorder +} + +// MockGatewayStatusWriterMockRecorder is the mock recorder for MockGatewayStatusWriter. +type MockGatewayStatusWriterMockRecorder struct { + mock *MockGatewayStatusWriter +} + +// NewMockGatewayStatusWriter creates a new mock instance. +func NewMockGatewayStatusWriter(ctrl *gomock.Controller) *MockGatewayStatusWriter { + mock := &MockGatewayStatusWriter{ctrl: ctrl} + mock.recorder = &MockGatewayStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayStatusWriter) EXPECT() *MockGatewayStatusWriterMockRecorder { + return m.recorder +} + +// PatchGatewayStatus mocks base method. +func (m *MockGatewayStatusWriter) PatchGatewayStatus(ctx context.Context, obj *v1alpha30.Gateway, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchGatewayStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchGatewayStatus indicates an expected call of PatchGatewayStatus. +func (mr *MockGatewayStatusWriterMockRecorder) PatchGatewayStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchGatewayStatus", reflect.TypeOf((*MockGatewayStatusWriter)(nil).PatchGatewayStatus), varargs...) +} + +// UpdateGatewayStatus mocks base method. +func (m *MockGatewayStatusWriter) UpdateGatewayStatus(ctx context.Context, obj *v1alpha30.Gateway, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateGatewayStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateGatewayStatus indicates an expected call of UpdateGatewayStatus. +func (mr *MockGatewayStatusWriterMockRecorder) UpdateGatewayStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGatewayStatus", reflect.TypeOf((*MockGatewayStatusWriter)(nil).UpdateGatewayStatus), varargs...) +} + +// MockGatewayClient is a mock of GatewayClient interface. +type MockGatewayClient struct { + ctrl *gomock.Controller + recorder *MockGatewayClientMockRecorder +} + +// MockGatewayClientMockRecorder is the mock recorder for MockGatewayClient. +type MockGatewayClientMockRecorder struct { + mock *MockGatewayClient +} + +// NewMockGatewayClient creates a new mock instance. +func NewMockGatewayClient(ctrl *gomock.Controller) *MockGatewayClient { + mock := &MockGatewayClient{ctrl: ctrl} + mock.recorder = &MockGatewayClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewayClient) EXPECT() *MockGatewayClientMockRecorder { + return m.recorder +} + +// CreateGateway mocks base method. +func (m *MockGatewayClient) CreateGateway(ctx context.Context, obj *v1alpha30.Gateway, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateGateway indicates an expected call of CreateGateway. +func (mr *MockGatewayClientMockRecorder) CreateGateway(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateGateway", reflect.TypeOf((*MockGatewayClient)(nil).CreateGateway), varargs...) +} + +// DeleteAllOfGateway mocks base method. +func (m *MockGatewayClient) DeleteAllOfGateway(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfGateway indicates an expected call of DeleteAllOfGateway. +func (mr *MockGatewayClientMockRecorder) DeleteAllOfGateway(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfGateway", reflect.TypeOf((*MockGatewayClient)(nil).DeleteAllOfGateway), varargs...) +} + +// DeleteGateway mocks base method. +func (m *MockGatewayClient) DeleteGateway(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteGateway indicates an expected call of DeleteGateway. +func (mr *MockGatewayClientMockRecorder) DeleteGateway(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteGateway", reflect.TypeOf((*MockGatewayClient)(nil).DeleteGateway), varargs...) +} + +// GetGateway mocks base method. +func (m *MockGatewayClient) GetGateway(ctx context.Context, key client.ObjectKey) (*v1alpha30.Gateway, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetGateway", ctx, key) + ret0, _ := ret[0].(*v1alpha30.Gateway) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetGateway indicates an expected call of GetGateway. +func (mr *MockGatewayClientMockRecorder) GetGateway(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGateway", reflect.TypeOf((*MockGatewayClient)(nil).GetGateway), ctx, key) +} + +// ListGateway mocks base method. +func (m *MockGatewayClient) ListGateway(ctx context.Context, opts ...client.ListOption) (*v1alpha30.GatewayList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListGateway", varargs...) + ret0, _ := ret[0].(*v1alpha30.GatewayList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListGateway indicates an expected call of ListGateway. +func (mr *MockGatewayClientMockRecorder) ListGateway(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListGateway", reflect.TypeOf((*MockGatewayClient)(nil).ListGateway), varargs...) +} + +// PatchGateway mocks base method. +func (m *MockGatewayClient) PatchGateway(ctx context.Context, obj *v1alpha30.Gateway, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchGateway indicates an expected call of PatchGateway. +func (mr *MockGatewayClientMockRecorder) PatchGateway(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchGateway", reflect.TypeOf((*MockGatewayClient)(nil).PatchGateway), varargs...) +} + +// PatchGatewayStatus mocks base method. +func (m *MockGatewayClient) PatchGatewayStatus(ctx context.Context, obj *v1alpha30.Gateway, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchGatewayStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchGatewayStatus indicates an expected call of PatchGatewayStatus. +func (mr *MockGatewayClientMockRecorder) PatchGatewayStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchGatewayStatus", reflect.TypeOf((*MockGatewayClient)(nil).PatchGatewayStatus), varargs...) +} + +// UpdateGateway mocks base method. +func (m *MockGatewayClient) UpdateGateway(ctx context.Context, obj *v1alpha30.Gateway, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateGateway indicates an expected call of UpdateGateway. +func (mr *MockGatewayClientMockRecorder) UpdateGateway(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGateway", reflect.TypeOf((*MockGatewayClient)(nil).UpdateGateway), varargs...) +} + +// UpdateGatewayStatus mocks base method. +func (m *MockGatewayClient) UpdateGatewayStatus(ctx context.Context, obj *v1alpha30.Gateway, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateGatewayStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateGatewayStatus indicates an expected call of UpdateGatewayStatus. +func (mr *MockGatewayClientMockRecorder) UpdateGatewayStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateGatewayStatus", reflect.TypeOf((*MockGatewayClient)(nil).UpdateGatewayStatus), varargs...) +} + +// UpsertGateway mocks base method. +func (m *MockGatewayClient) UpsertGateway(ctx context.Context, obj *v1alpha30.Gateway, transitionFuncs ...v1alpha3.GatewayTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertGateway", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertGateway indicates an expected call of UpsertGateway. +func (mr *MockGatewayClientMockRecorder) UpsertGateway(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertGateway", reflect.TypeOf((*MockGatewayClient)(nil).UpsertGateway), varargs...) +} + +// MockMulticlusterGatewayClient is a mock of MulticlusterGatewayClient interface. +type MockMulticlusterGatewayClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterGatewayClientMockRecorder +} + +// MockMulticlusterGatewayClientMockRecorder is the mock recorder for MockMulticlusterGatewayClient. +type MockMulticlusterGatewayClientMockRecorder struct { + mock *MockMulticlusterGatewayClient +} + +// NewMockMulticlusterGatewayClient creates a new mock instance. +func NewMockMulticlusterGatewayClient(ctrl *gomock.Controller) *MockMulticlusterGatewayClient { + mock := &MockMulticlusterGatewayClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterGatewayClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterGatewayClient) EXPECT() *MockMulticlusterGatewayClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterGatewayClient) Cluster(cluster string) (v1alpha3.GatewayClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.GatewayClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterGatewayClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterGatewayClient)(nil).Cluster), cluster) +} + +// MockServiceEntryReader is a mock of ServiceEntryReader interface. +type MockServiceEntryReader struct { + ctrl *gomock.Controller + recorder *MockServiceEntryReaderMockRecorder +} + +// MockServiceEntryReaderMockRecorder is the mock recorder for MockServiceEntryReader. +type MockServiceEntryReaderMockRecorder struct { + mock *MockServiceEntryReader +} + +// NewMockServiceEntryReader creates a new mock instance. +func NewMockServiceEntryReader(ctrl *gomock.Controller) *MockServiceEntryReader { + mock := &MockServiceEntryReader{ctrl: ctrl} + mock.recorder = &MockServiceEntryReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryReader) EXPECT() *MockServiceEntryReaderMockRecorder { + return m.recorder +} + +// GetServiceEntry mocks base method. +func (m *MockServiceEntryReader) GetServiceEntry(ctx context.Context, key client.ObjectKey) (*v1alpha30.ServiceEntry, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetServiceEntry", ctx, key) + ret0, _ := ret[0].(*v1alpha30.ServiceEntry) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetServiceEntry indicates an expected call of GetServiceEntry. +func (mr *MockServiceEntryReaderMockRecorder) GetServiceEntry(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServiceEntry", reflect.TypeOf((*MockServiceEntryReader)(nil).GetServiceEntry), ctx, key) +} + +// ListServiceEntry mocks base method. +func (m *MockServiceEntryReader) ListServiceEntry(ctx context.Context, opts ...client.ListOption) (*v1alpha30.ServiceEntryList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListServiceEntry", varargs...) + ret0, _ := ret[0].(*v1alpha30.ServiceEntryList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListServiceEntry indicates an expected call of ListServiceEntry. +func (mr *MockServiceEntryReaderMockRecorder) ListServiceEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListServiceEntry", reflect.TypeOf((*MockServiceEntryReader)(nil).ListServiceEntry), varargs...) +} + +// MockServiceEntryWriter is a mock of ServiceEntryWriter interface. +type MockServiceEntryWriter struct { + ctrl *gomock.Controller + recorder *MockServiceEntryWriterMockRecorder +} + +// MockServiceEntryWriterMockRecorder is the mock recorder for MockServiceEntryWriter. +type MockServiceEntryWriterMockRecorder struct { + mock *MockServiceEntryWriter +} + +// NewMockServiceEntryWriter creates a new mock instance. +func NewMockServiceEntryWriter(ctrl *gomock.Controller) *MockServiceEntryWriter { + mock := &MockServiceEntryWriter{ctrl: ctrl} + mock.recorder = &MockServiceEntryWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryWriter) EXPECT() *MockServiceEntryWriterMockRecorder { + return m.recorder +} + +// CreateServiceEntry mocks base method. +func (m *MockServiceEntryWriter) CreateServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateServiceEntry indicates an expected call of CreateServiceEntry. +func (mr *MockServiceEntryWriterMockRecorder) CreateServiceEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceEntry", reflect.TypeOf((*MockServiceEntryWriter)(nil).CreateServiceEntry), varargs...) +} + +// DeleteAllOfServiceEntry mocks base method. +func (m *MockServiceEntryWriter) DeleteAllOfServiceEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfServiceEntry indicates an expected call of DeleteAllOfServiceEntry. +func (mr *MockServiceEntryWriterMockRecorder) DeleteAllOfServiceEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfServiceEntry", reflect.TypeOf((*MockServiceEntryWriter)(nil).DeleteAllOfServiceEntry), varargs...) +} + +// DeleteServiceEntry mocks base method. +func (m *MockServiceEntryWriter) DeleteServiceEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteServiceEntry indicates an expected call of DeleteServiceEntry. +func (mr *MockServiceEntryWriterMockRecorder) DeleteServiceEntry(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceEntry", reflect.TypeOf((*MockServiceEntryWriter)(nil).DeleteServiceEntry), varargs...) +} + +// PatchServiceEntry mocks base method. +func (m *MockServiceEntryWriter) PatchServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchServiceEntry indicates an expected call of PatchServiceEntry. +func (mr *MockServiceEntryWriterMockRecorder) PatchServiceEntry(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchServiceEntry", reflect.TypeOf((*MockServiceEntryWriter)(nil).PatchServiceEntry), varargs...) +} + +// UpdateServiceEntry mocks base method. +func (m *MockServiceEntryWriter) UpdateServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateServiceEntry indicates an expected call of UpdateServiceEntry. +func (mr *MockServiceEntryWriterMockRecorder) UpdateServiceEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceEntry", reflect.TypeOf((*MockServiceEntryWriter)(nil).UpdateServiceEntry), varargs...) +} + +// UpsertServiceEntry mocks base method. +func (m *MockServiceEntryWriter) UpsertServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, transitionFuncs ...v1alpha3.ServiceEntryTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertServiceEntry indicates an expected call of UpsertServiceEntry. +func (mr *MockServiceEntryWriterMockRecorder) UpsertServiceEntry(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertServiceEntry", reflect.TypeOf((*MockServiceEntryWriter)(nil).UpsertServiceEntry), varargs...) +} + +// MockServiceEntryStatusWriter is a mock of ServiceEntryStatusWriter interface. +type MockServiceEntryStatusWriter struct { + ctrl *gomock.Controller + recorder *MockServiceEntryStatusWriterMockRecorder +} + +// MockServiceEntryStatusWriterMockRecorder is the mock recorder for MockServiceEntryStatusWriter. +type MockServiceEntryStatusWriterMockRecorder struct { + mock *MockServiceEntryStatusWriter +} + +// NewMockServiceEntryStatusWriter creates a new mock instance. +func NewMockServiceEntryStatusWriter(ctrl *gomock.Controller) *MockServiceEntryStatusWriter { + mock := &MockServiceEntryStatusWriter{ctrl: ctrl} + mock.recorder = &MockServiceEntryStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryStatusWriter) EXPECT() *MockServiceEntryStatusWriterMockRecorder { + return m.recorder +} + +// PatchServiceEntryStatus mocks base method. +func (m *MockServiceEntryStatusWriter) PatchServiceEntryStatus(ctx context.Context, obj *v1alpha30.ServiceEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchServiceEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchServiceEntryStatus indicates an expected call of PatchServiceEntryStatus. +func (mr *MockServiceEntryStatusWriterMockRecorder) PatchServiceEntryStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchServiceEntryStatus", reflect.TypeOf((*MockServiceEntryStatusWriter)(nil).PatchServiceEntryStatus), varargs...) +} + +// UpdateServiceEntryStatus mocks base method. +func (m *MockServiceEntryStatusWriter) UpdateServiceEntryStatus(ctx context.Context, obj *v1alpha30.ServiceEntry, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateServiceEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateServiceEntryStatus indicates an expected call of UpdateServiceEntryStatus. +func (mr *MockServiceEntryStatusWriterMockRecorder) UpdateServiceEntryStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceEntryStatus", reflect.TypeOf((*MockServiceEntryStatusWriter)(nil).UpdateServiceEntryStatus), varargs...) +} + +// MockServiceEntryClient is a mock of ServiceEntryClient interface. +type MockServiceEntryClient struct { + ctrl *gomock.Controller + recorder *MockServiceEntryClientMockRecorder +} + +// MockServiceEntryClientMockRecorder is the mock recorder for MockServiceEntryClient. +type MockServiceEntryClientMockRecorder struct { + mock *MockServiceEntryClient +} + +// NewMockServiceEntryClient creates a new mock instance. +func NewMockServiceEntryClient(ctrl *gomock.Controller) *MockServiceEntryClient { + mock := &MockServiceEntryClient{ctrl: ctrl} + mock.recorder = &MockServiceEntryClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntryClient) EXPECT() *MockServiceEntryClientMockRecorder { + return m.recorder +} + +// CreateServiceEntry mocks base method. +func (m *MockServiceEntryClient) CreateServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateServiceEntry indicates an expected call of CreateServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) CreateServiceEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).CreateServiceEntry), varargs...) +} + +// DeleteAllOfServiceEntry mocks base method. +func (m *MockServiceEntryClient) DeleteAllOfServiceEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfServiceEntry indicates an expected call of DeleteAllOfServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) DeleteAllOfServiceEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).DeleteAllOfServiceEntry), varargs...) +} + +// DeleteServiceEntry mocks base method. +func (m *MockServiceEntryClient) DeleteServiceEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteServiceEntry indicates an expected call of DeleteServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) DeleteServiceEntry(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).DeleteServiceEntry), varargs...) +} + +// GetServiceEntry mocks base method. +func (m *MockServiceEntryClient) GetServiceEntry(ctx context.Context, key client.ObjectKey) (*v1alpha30.ServiceEntry, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetServiceEntry", ctx, key) + ret0, _ := ret[0].(*v1alpha30.ServiceEntry) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetServiceEntry indicates an expected call of GetServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) GetServiceEntry(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).GetServiceEntry), ctx, key) +} + +// ListServiceEntry mocks base method. +func (m *MockServiceEntryClient) ListServiceEntry(ctx context.Context, opts ...client.ListOption) (*v1alpha30.ServiceEntryList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListServiceEntry", varargs...) + ret0, _ := ret[0].(*v1alpha30.ServiceEntryList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListServiceEntry indicates an expected call of ListServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) ListServiceEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).ListServiceEntry), varargs...) +} + +// PatchServiceEntry mocks base method. +func (m *MockServiceEntryClient) PatchServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchServiceEntry indicates an expected call of PatchServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) PatchServiceEntry(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).PatchServiceEntry), varargs...) +} + +// PatchServiceEntryStatus mocks base method. +func (m *MockServiceEntryClient) PatchServiceEntryStatus(ctx context.Context, obj *v1alpha30.ServiceEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchServiceEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchServiceEntryStatus indicates an expected call of PatchServiceEntryStatus. +func (mr *MockServiceEntryClientMockRecorder) PatchServiceEntryStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchServiceEntryStatus", reflect.TypeOf((*MockServiceEntryClient)(nil).PatchServiceEntryStatus), varargs...) +} + +// UpdateServiceEntry mocks base method. +func (m *MockServiceEntryClient) UpdateServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateServiceEntry indicates an expected call of UpdateServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) UpdateServiceEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).UpdateServiceEntry), varargs...) +} + +// UpdateServiceEntryStatus mocks base method. +func (m *MockServiceEntryClient) UpdateServiceEntryStatus(ctx context.Context, obj *v1alpha30.ServiceEntry, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateServiceEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateServiceEntryStatus indicates an expected call of UpdateServiceEntryStatus. +func (mr *MockServiceEntryClientMockRecorder) UpdateServiceEntryStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateServiceEntryStatus", reflect.TypeOf((*MockServiceEntryClient)(nil).UpdateServiceEntryStatus), varargs...) +} + +// UpsertServiceEntry mocks base method. +func (m *MockServiceEntryClient) UpsertServiceEntry(ctx context.Context, obj *v1alpha30.ServiceEntry, transitionFuncs ...v1alpha3.ServiceEntryTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertServiceEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertServiceEntry indicates an expected call of UpsertServiceEntry. +func (mr *MockServiceEntryClientMockRecorder) UpsertServiceEntry(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertServiceEntry", reflect.TypeOf((*MockServiceEntryClient)(nil).UpsertServiceEntry), varargs...) +} + +// MockMulticlusterServiceEntryClient is a mock of MulticlusterServiceEntryClient interface. +type MockMulticlusterServiceEntryClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterServiceEntryClientMockRecorder +} + +// MockMulticlusterServiceEntryClientMockRecorder is the mock recorder for MockMulticlusterServiceEntryClient. +type MockMulticlusterServiceEntryClientMockRecorder struct { + mock *MockMulticlusterServiceEntryClient +} + +// NewMockMulticlusterServiceEntryClient creates a new mock instance. +func NewMockMulticlusterServiceEntryClient(ctrl *gomock.Controller) *MockMulticlusterServiceEntryClient { + mock := &MockMulticlusterServiceEntryClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterServiceEntryClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterServiceEntryClient) EXPECT() *MockMulticlusterServiceEntryClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterServiceEntryClient) Cluster(cluster string) (v1alpha3.ServiceEntryClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.ServiceEntryClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterServiceEntryClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterServiceEntryClient)(nil).Cluster), cluster) +} + +// MockWorkloadEntryReader is a mock of WorkloadEntryReader interface. +type MockWorkloadEntryReader struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryReaderMockRecorder +} + +// MockWorkloadEntryReaderMockRecorder is the mock recorder for MockWorkloadEntryReader. +type MockWorkloadEntryReaderMockRecorder struct { + mock *MockWorkloadEntryReader +} + +// NewMockWorkloadEntryReader creates a new mock instance. +func NewMockWorkloadEntryReader(ctrl *gomock.Controller) *MockWorkloadEntryReader { + mock := &MockWorkloadEntryReader{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryReader) EXPECT() *MockWorkloadEntryReaderMockRecorder { + return m.recorder +} + +// GetWorkloadEntry mocks base method. +func (m *MockWorkloadEntryReader) GetWorkloadEntry(ctx context.Context, key client.ObjectKey) (*v1alpha30.WorkloadEntry, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWorkloadEntry", ctx, key) + ret0, _ := ret[0].(*v1alpha30.WorkloadEntry) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkloadEntry indicates an expected call of GetWorkloadEntry. +func (mr *MockWorkloadEntryReaderMockRecorder) GetWorkloadEntry(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryReader)(nil).GetWorkloadEntry), ctx, key) +} + +// ListWorkloadEntry mocks base method. +func (m *MockWorkloadEntryReader) ListWorkloadEntry(ctx context.Context, opts ...client.ListOption) (*v1alpha30.WorkloadEntryList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListWorkloadEntry", varargs...) + ret0, _ := ret[0].(*v1alpha30.WorkloadEntryList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListWorkloadEntry indicates an expected call of ListWorkloadEntry. +func (mr *MockWorkloadEntryReaderMockRecorder) ListWorkloadEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryReader)(nil).ListWorkloadEntry), varargs...) +} + +// MockWorkloadEntryWriter is a mock of WorkloadEntryWriter interface. +type MockWorkloadEntryWriter struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryWriterMockRecorder +} + +// MockWorkloadEntryWriterMockRecorder is the mock recorder for MockWorkloadEntryWriter. +type MockWorkloadEntryWriterMockRecorder struct { + mock *MockWorkloadEntryWriter +} + +// NewMockWorkloadEntryWriter creates a new mock instance. +func NewMockWorkloadEntryWriter(ctrl *gomock.Controller) *MockWorkloadEntryWriter { + mock := &MockWorkloadEntryWriter{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryWriter) EXPECT() *MockWorkloadEntryWriterMockRecorder { + return m.recorder +} + +// CreateWorkloadEntry mocks base method. +func (m *MockWorkloadEntryWriter) CreateWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateWorkloadEntry indicates an expected call of CreateWorkloadEntry. +func (mr *MockWorkloadEntryWriterMockRecorder) CreateWorkloadEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryWriter)(nil).CreateWorkloadEntry), varargs...) +} + +// DeleteAllOfWorkloadEntry mocks base method. +func (m *MockWorkloadEntryWriter) DeleteAllOfWorkloadEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfWorkloadEntry indicates an expected call of DeleteAllOfWorkloadEntry. +func (mr *MockWorkloadEntryWriterMockRecorder) DeleteAllOfWorkloadEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryWriter)(nil).DeleteAllOfWorkloadEntry), varargs...) +} + +// DeleteWorkloadEntry mocks base method. +func (m *MockWorkloadEntryWriter) DeleteWorkloadEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteWorkloadEntry indicates an expected call of DeleteWorkloadEntry. +func (mr *MockWorkloadEntryWriterMockRecorder) DeleteWorkloadEntry(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryWriter)(nil).DeleteWorkloadEntry), varargs...) +} + +// PatchWorkloadEntry mocks base method. +func (m *MockWorkloadEntryWriter) PatchWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadEntry indicates an expected call of PatchWorkloadEntry. +func (mr *MockWorkloadEntryWriterMockRecorder) PatchWorkloadEntry(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryWriter)(nil).PatchWorkloadEntry), varargs...) +} + +// UpdateWorkloadEntry mocks base method. +func (m *MockWorkloadEntryWriter) UpdateWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadEntry indicates an expected call of UpdateWorkloadEntry. +func (mr *MockWorkloadEntryWriterMockRecorder) UpdateWorkloadEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryWriter)(nil).UpdateWorkloadEntry), varargs...) +} + +// UpsertWorkloadEntry mocks base method. +func (m *MockWorkloadEntryWriter) UpsertWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, transitionFuncs ...v1alpha3.WorkloadEntryTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertWorkloadEntry indicates an expected call of UpsertWorkloadEntry. +func (mr *MockWorkloadEntryWriterMockRecorder) UpsertWorkloadEntry(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryWriter)(nil).UpsertWorkloadEntry), varargs...) +} + +// MockWorkloadEntryStatusWriter is a mock of WorkloadEntryStatusWriter interface. +type MockWorkloadEntryStatusWriter struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryStatusWriterMockRecorder +} + +// MockWorkloadEntryStatusWriterMockRecorder is the mock recorder for MockWorkloadEntryStatusWriter. +type MockWorkloadEntryStatusWriterMockRecorder struct { + mock *MockWorkloadEntryStatusWriter +} + +// NewMockWorkloadEntryStatusWriter creates a new mock instance. +func NewMockWorkloadEntryStatusWriter(ctrl *gomock.Controller) *MockWorkloadEntryStatusWriter { + mock := &MockWorkloadEntryStatusWriter{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryStatusWriter) EXPECT() *MockWorkloadEntryStatusWriterMockRecorder { + return m.recorder +} + +// PatchWorkloadEntryStatus mocks base method. +func (m *MockWorkloadEntryStatusWriter) PatchWorkloadEntryStatus(ctx context.Context, obj *v1alpha30.WorkloadEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadEntryStatus indicates an expected call of PatchWorkloadEntryStatus. +func (mr *MockWorkloadEntryStatusWriterMockRecorder) PatchWorkloadEntryStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadEntryStatus", reflect.TypeOf((*MockWorkloadEntryStatusWriter)(nil).PatchWorkloadEntryStatus), varargs...) +} + +// UpdateWorkloadEntryStatus mocks base method. +func (m *MockWorkloadEntryStatusWriter) UpdateWorkloadEntryStatus(ctx context.Context, obj *v1alpha30.WorkloadEntry, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadEntryStatus indicates an expected call of UpdateWorkloadEntryStatus. +func (mr *MockWorkloadEntryStatusWriterMockRecorder) UpdateWorkloadEntryStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadEntryStatus", reflect.TypeOf((*MockWorkloadEntryStatusWriter)(nil).UpdateWorkloadEntryStatus), varargs...) +} + +// MockWorkloadEntryClient is a mock of WorkloadEntryClient interface. +type MockWorkloadEntryClient struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntryClientMockRecorder +} + +// MockWorkloadEntryClientMockRecorder is the mock recorder for MockWorkloadEntryClient. +type MockWorkloadEntryClientMockRecorder struct { + mock *MockWorkloadEntryClient +} + +// NewMockWorkloadEntryClient creates a new mock instance. +func NewMockWorkloadEntryClient(ctrl *gomock.Controller) *MockWorkloadEntryClient { + mock := &MockWorkloadEntryClient{ctrl: ctrl} + mock.recorder = &MockWorkloadEntryClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntryClient) EXPECT() *MockWorkloadEntryClientMockRecorder { + return m.recorder +} + +// CreateWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) CreateWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateWorkloadEntry indicates an expected call of CreateWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) CreateWorkloadEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).CreateWorkloadEntry), varargs...) +} + +// DeleteAllOfWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) DeleteAllOfWorkloadEntry(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfWorkloadEntry indicates an expected call of DeleteAllOfWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) DeleteAllOfWorkloadEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).DeleteAllOfWorkloadEntry), varargs...) +} + +// DeleteWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) DeleteWorkloadEntry(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteWorkloadEntry indicates an expected call of DeleteWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) DeleteWorkloadEntry(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).DeleteWorkloadEntry), varargs...) +} + +// GetWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) GetWorkloadEntry(ctx context.Context, key client.ObjectKey) (*v1alpha30.WorkloadEntry, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWorkloadEntry", ctx, key) + ret0, _ := ret[0].(*v1alpha30.WorkloadEntry) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkloadEntry indicates an expected call of GetWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) GetWorkloadEntry(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).GetWorkloadEntry), ctx, key) +} + +// ListWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) ListWorkloadEntry(ctx context.Context, opts ...client.ListOption) (*v1alpha30.WorkloadEntryList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListWorkloadEntry", varargs...) + ret0, _ := ret[0].(*v1alpha30.WorkloadEntryList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListWorkloadEntry indicates an expected call of ListWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) ListWorkloadEntry(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).ListWorkloadEntry), varargs...) +} + +// PatchWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) PatchWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadEntry indicates an expected call of PatchWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) PatchWorkloadEntry(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).PatchWorkloadEntry), varargs...) +} + +// PatchWorkloadEntryStatus mocks base method. +func (m *MockWorkloadEntryClient) PatchWorkloadEntryStatus(ctx context.Context, obj *v1alpha30.WorkloadEntry, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadEntryStatus indicates an expected call of PatchWorkloadEntryStatus. +func (mr *MockWorkloadEntryClientMockRecorder) PatchWorkloadEntryStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadEntryStatus", reflect.TypeOf((*MockWorkloadEntryClient)(nil).PatchWorkloadEntryStatus), varargs...) +} + +// UpdateWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) UpdateWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadEntry indicates an expected call of UpdateWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) UpdateWorkloadEntry(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).UpdateWorkloadEntry), varargs...) +} + +// UpdateWorkloadEntryStatus mocks base method. +func (m *MockWorkloadEntryClient) UpdateWorkloadEntryStatus(ctx context.Context, obj *v1alpha30.WorkloadEntry, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadEntryStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadEntryStatus indicates an expected call of UpdateWorkloadEntryStatus. +func (mr *MockWorkloadEntryClientMockRecorder) UpdateWorkloadEntryStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadEntryStatus", reflect.TypeOf((*MockWorkloadEntryClient)(nil).UpdateWorkloadEntryStatus), varargs...) +} + +// UpsertWorkloadEntry mocks base method. +func (m *MockWorkloadEntryClient) UpsertWorkloadEntry(ctx context.Context, obj *v1alpha30.WorkloadEntry, transitionFuncs ...v1alpha3.WorkloadEntryTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertWorkloadEntry", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertWorkloadEntry indicates an expected call of UpsertWorkloadEntry. +func (mr *MockWorkloadEntryClientMockRecorder) UpsertWorkloadEntry(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkloadEntry", reflect.TypeOf((*MockWorkloadEntryClient)(nil).UpsertWorkloadEntry), varargs...) +} + +// MockMulticlusterWorkloadEntryClient is a mock of MulticlusterWorkloadEntryClient interface. +type MockMulticlusterWorkloadEntryClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadEntryClientMockRecorder +} + +// MockMulticlusterWorkloadEntryClientMockRecorder is the mock recorder for MockMulticlusterWorkloadEntryClient. +type MockMulticlusterWorkloadEntryClientMockRecorder struct { + mock *MockMulticlusterWorkloadEntryClient +} + +// NewMockMulticlusterWorkloadEntryClient creates a new mock instance. +func NewMockMulticlusterWorkloadEntryClient(ctrl *gomock.Controller) *MockMulticlusterWorkloadEntryClient { + mock := &MockMulticlusterWorkloadEntryClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadEntryClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadEntryClient) EXPECT() *MockMulticlusterWorkloadEntryClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterWorkloadEntryClient) Cluster(cluster string) (v1alpha3.WorkloadEntryClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.WorkloadEntryClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterWorkloadEntryClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterWorkloadEntryClient)(nil).Cluster), cluster) +} + +// MockWorkloadGroupReader is a mock of WorkloadGroupReader interface. +type MockWorkloadGroupReader struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupReaderMockRecorder +} + +// MockWorkloadGroupReaderMockRecorder is the mock recorder for MockWorkloadGroupReader. +type MockWorkloadGroupReaderMockRecorder struct { + mock *MockWorkloadGroupReader +} + +// NewMockWorkloadGroupReader creates a new mock instance. +func NewMockWorkloadGroupReader(ctrl *gomock.Controller) *MockWorkloadGroupReader { + mock := &MockWorkloadGroupReader{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupReader) EXPECT() *MockWorkloadGroupReaderMockRecorder { + return m.recorder +} + +// GetWorkloadGroup mocks base method. +func (m *MockWorkloadGroupReader) GetWorkloadGroup(ctx context.Context, key client.ObjectKey) (*v1alpha30.WorkloadGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWorkloadGroup", ctx, key) + ret0, _ := ret[0].(*v1alpha30.WorkloadGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkloadGroup indicates an expected call of GetWorkloadGroup. +func (mr *MockWorkloadGroupReaderMockRecorder) GetWorkloadGroup(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupReader)(nil).GetWorkloadGroup), ctx, key) +} + +// ListWorkloadGroup mocks base method. +func (m *MockWorkloadGroupReader) ListWorkloadGroup(ctx context.Context, opts ...client.ListOption) (*v1alpha30.WorkloadGroupList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListWorkloadGroup", varargs...) + ret0, _ := ret[0].(*v1alpha30.WorkloadGroupList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListWorkloadGroup indicates an expected call of ListWorkloadGroup. +func (mr *MockWorkloadGroupReaderMockRecorder) ListWorkloadGroup(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupReader)(nil).ListWorkloadGroup), varargs...) +} + +// MockWorkloadGroupWriter is a mock of WorkloadGroupWriter interface. +type MockWorkloadGroupWriter struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupWriterMockRecorder +} + +// MockWorkloadGroupWriterMockRecorder is the mock recorder for MockWorkloadGroupWriter. +type MockWorkloadGroupWriterMockRecorder struct { + mock *MockWorkloadGroupWriter +} + +// NewMockWorkloadGroupWriter creates a new mock instance. +func NewMockWorkloadGroupWriter(ctrl *gomock.Controller) *MockWorkloadGroupWriter { + mock := &MockWorkloadGroupWriter{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupWriter) EXPECT() *MockWorkloadGroupWriterMockRecorder { + return m.recorder +} + +// CreateWorkloadGroup mocks base method. +func (m *MockWorkloadGroupWriter) CreateWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateWorkloadGroup indicates an expected call of CreateWorkloadGroup. +func (mr *MockWorkloadGroupWriterMockRecorder) CreateWorkloadGroup(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupWriter)(nil).CreateWorkloadGroup), varargs...) +} + +// DeleteAllOfWorkloadGroup mocks base method. +func (m *MockWorkloadGroupWriter) DeleteAllOfWorkloadGroup(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfWorkloadGroup indicates an expected call of DeleteAllOfWorkloadGroup. +func (mr *MockWorkloadGroupWriterMockRecorder) DeleteAllOfWorkloadGroup(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupWriter)(nil).DeleteAllOfWorkloadGroup), varargs...) +} + +// DeleteWorkloadGroup mocks base method. +func (m *MockWorkloadGroupWriter) DeleteWorkloadGroup(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteWorkloadGroup indicates an expected call of DeleteWorkloadGroup. +func (mr *MockWorkloadGroupWriterMockRecorder) DeleteWorkloadGroup(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupWriter)(nil).DeleteWorkloadGroup), varargs...) +} + +// PatchWorkloadGroup mocks base method. +func (m *MockWorkloadGroupWriter) PatchWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadGroup indicates an expected call of PatchWorkloadGroup. +func (mr *MockWorkloadGroupWriterMockRecorder) PatchWorkloadGroup(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupWriter)(nil).PatchWorkloadGroup), varargs...) +} + +// UpdateWorkloadGroup mocks base method. +func (m *MockWorkloadGroupWriter) UpdateWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadGroup indicates an expected call of UpdateWorkloadGroup. +func (mr *MockWorkloadGroupWriterMockRecorder) UpdateWorkloadGroup(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupWriter)(nil).UpdateWorkloadGroup), varargs...) +} + +// UpsertWorkloadGroup mocks base method. +func (m *MockWorkloadGroupWriter) UpsertWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, transitionFuncs ...v1alpha3.WorkloadGroupTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertWorkloadGroup indicates an expected call of UpsertWorkloadGroup. +func (mr *MockWorkloadGroupWriterMockRecorder) UpsertWorkloadGroup(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupWriter)(nil).UpsertWorkloadGroup), varargs...) +} + +// MockWorkloadGroupStatusWriter is a mock of WorkloadGroupStatusWriter interface. +type MockWorkloadGroupStatusWriter struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupStatusWriterMockRecorder +} + +// MockWorkloadGroupStatusWriterMockRecorder is the mock recorder for MockWorkloadGroupStatusWriter. +type MockWorkloadGroupStatusWriterMockRecorder struct { + mock *MockWorkloadGroupStatusWriter +} + +// NewMockWorkloadGroupStatusWriter creates a new mock instance. +func NewMockWorkloadGroupStatusWriter(ctrl *gomock.Controller) *MockWorkloadGroupStatusWriter { + mock := &MockWorkloadGroupStatusWriter{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupStatusWriter) EXPECT() *MockWorkloadGroupStatusWriterMockRecorder { + return m.recorder +} + +// PatchWorkloadGroupStatus mocks base method. +func (m *MockWorkloadGroupStatusWriter) PatchWorkloadGroupStatus(ctx context.Context, obj *v1alpha30.WorkloadGroup, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadGroupStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadGroupStatus indicates an expected call of PatchWorkloadGroupStatus. +func (mr *MockWorkloadGroupStatusWriterMockRecorder) PatchWorkloadGroupStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadGroupStatus", reflect.TypeOf((*MockWorkloadGroupStatusWriter)(nil).PatchWorkloadGroupStatus), varargs...) +} + +// UpdateWorkloadGroupStatus mocks base method. +func (m *MockWorkloadGroupStatusWriter) UpdateWorkloadGroupStatus(ctx context.Context, obj *v1alpha30.WorkloadGroup, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadGroupStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadGroupStatus indicates an expected call of UpdateWorkloadGroupStatus. +func (mr *MockWorkloadGroupStatusWriterMockRecorder) UpdateWorkloadGroupStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadGroupStatus", reflect.TypeOf((*MockWorkloadGroupStatusWriter)(nil).UpdateWorkloadGroupStatus), varargs...) +} + +// MockWorkloadGroupClient is a mock of WorkloadGroupClient interface. +type MockWorkloadGroupClient struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupClientMockRecorder +} + +// MockWorkloadGroupClientMockRecorder is the mock recorder for MockWorkloadGroupClient. +type MockWorkloadGroupClientMockRecorder struct { + mock *MockWorkloadGroupClient +} + +// NewMockWorkloadGroupClient creates a new mock instance. +func NewMockWorkloadGroupClient(ctrl *gomock.Controller) *MockWorkloadGroupClient { + mock := &MockWorkloadGroupClient{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupClient) EXPECT() *MockWorkloadGroupClientMockRecorder { + return m.recorder +} + +// CreateWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) CreateWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateWorkloadGroup indicates an expected call of CreateWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) CreateWorkloadGroup(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).CreateWorkloadGroup), varargs...) +} + +// DeleteAllOfWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) DeleteAllOfWorkloadGroup(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfWorkloadGroup indicates an expected call of DeleteAllOfWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) DeleteAllOfWorkloadGroup(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).DeleteAllOfWorkloadGroup), varargs...) +} + +// DeleteWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) DeleteWorkloadGroup(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteWorkloadGroup indicates an expected call of DeleteWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) DeleteWorkloadGroup(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).DeleteWorkloadGroup), varargs...) +} + +// GetWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) GetWorkloadGroup(ctx context.Context, key client.ObjectKey) (*v1alpha30.WorkloadGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetWorkloadGroup", ctx, key) + ret0, _ := ret[0].(*v1alpha30.WorkloadGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetWorkloadGroup indicates an expected call of GetWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) GetWorkloadGroup(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).GetWorkloadGroup), ctx, key) +} + +// ListWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) ListWorkloadGroup(ctx context.Context, opts ...client.ListOption) (*v1alpha30.WorkloadGroupList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListWorkloadGroup", varargs...) + ret0, _ := ret[0].(*v1alpha30.WorkloadGroupList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListWorkloadGroup indicates an expected call of ListWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) ListWorkloadGroup(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).ListWorkloadGroup), varargs...) +} + +// PatchWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) PatchWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadGroup indicates an expected call of PatchWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) PatchWorkloadGroup(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).PatchWorkloadGroup), varargs...) +} + +// PatchWorkloadGroupStatus mocks base method. +func (m *MockWorkloadGroupClient) PatchWorkloadGroupStatus(ctx context.Context, obj *v1alpha30.WorkloadGroup, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchWorkloadGroupStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchWorkloadGroupStatus indicates an expected call of PatchWorkloadGroupStatus. +func (mr *MockWorkloadGroupClientMockRecorder) PatchWorkloadGroupStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchWorkloadGroupStatus", reflect.TypeOf((*MockWorkloadGroupClient)(nil).PatchWorkloadGroupStatus), varargs...) +} + +// UpdateWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) UpdateWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadGroup indicates an expected call of UpdateWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) UpdateWorkloadGroup(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).UpdateWorkloadGroup), varargs...) +} + +// UpdateWorkloadGroupStatus mocks base method. +func (m *MockWorkloadGroupClient) UpdateWorkloadGroupStatus(ctx context.Context, obj *v1alpha30.WorkloadGroup, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateWorkloadGroupStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateWorkloadGroupStatus indicates an expected call of UpdateWorkloadGroupStatus. +func (mr *MockWorkloadGroupClientMockRecorder) UpdateWorkloadGroupStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateWorkloadGroupStatus", reflect.TypeOf((*MockWorkloadGroupClient)(nil).UpdateWorkloadGroupStatus), varargs...) +} + +// UpsertWorkloadGroup mocks base method. +func (m *MockWorkloadGroupClient) UpsertWorkloadGroup(ctx context.Context, obj *v1alpha30.WorkloadGroup, transitionFuncs ...v1alpha3.WorkloadGroupTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertWorkloadGroup", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertWorkloadGroup indicates an expected call of UpsertWorkloadGroup. +func (mr *MockWorkloadGroupClientMockRecorder) UpsertWorkloadGroup(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertWorkloadGroup", reflect.TypeOf((*MockWorkloadGroupClient)(nil).UpsertWorkloadGroup), varargs...) +} + +// MockMulticlusterWorkloadGroupClient is a mock of MulticlusterWorkloadGroupClient interface. +type MockMulticlusterWorkloadGroupClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterWorkloadGroupClientMockRecorder +} + +// MockMulticlusterWorkloadGroupClientMockRecorder is the mock recorder for MockMulticlusterWorkloadGroupClient. +type MockMulticlusterWorkloadGroupClientMockRecorder struct { + mock *MockMulticlusterWorkloadGroupClient +} + +// NewMockMulticlusterWorkloadGroupClient creates a new mock instance. +func NewMockMulticlusterWorkloadGroupClient(ctrl *gomock.Controller) *MockMulticlusterWorkloadGroupClient { + mock := &MockMulticlusterWorkloadGroupClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterWorkloadGroupClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterWorkloadGroupClient) EXPECT() *MockMulticlusterWorkloadGroupClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterWorkloadGroupClient) Cluster(cluster string) (v1alpha3.WorkloadGroupClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.WorkloadGroupClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterWorkloadGroupClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterWorkloadGroupClient)(nil).Cluster), cluster) +} + +// MockVirtualServiceReader is a mock of VirtualServiceReader interface. +type MockVirtualServiceReader struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceReaderMockRecorder +} + +// MockVirtualServiceReaderMockRecorder is the mock recorder for MockVirtualServiceReader. +type MockVirtualServiceReaderMockRecorder struct { + mock *MockVirtualServiceReader +} + +// NewMockVirtualServiceReader creates a new mock instance. +func NewMockVirtualServiceReader(ctrl *gomock.Controller) *MockVirtualServiceReader { + mock := &MockVirtualServiceReader{ctrl: ctrl} + mock.recorder = &MockVirtualServiceReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceReader) EXPECT() *MockVirtualServiceReaderMockRecorder { + return m.recorder +} + +// GetVirtualService mocks base method. +func (m *MockVirtualServiceReader) GetVirtualService(ctx context.Context, key client.ObjectKey) (*v1alpha30.VirtualService, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVirtualService", ctx, key) + ret0, _ := ret[0].(*v1alpha30.VirtualService) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVirtualService indicates an expected call of GetVirtualService. +func (mr *MockVirtualServiceReaderMockRecorder) GetVirtualService(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVirtualService", reflect.TypeOf((*MockVirtualServiceReader)(nil).GetVirtualService), ctx, key) +} + +// ListVirtualService mocks base method. +func (m *MockVirtualServiceReader) ListVirtualService(ctx context.Context, opts ...client.ListOption) (*v1alpha30.VirtualServiceList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListVirtualService", varargs...) + ret0, _ := ret[0].(*v1alpha30.VirtualServiceList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListVirtualService indicates an expected call of ListVirtualService. +func (mr *MockVirtualServiceReaderMockRecorder) ListVirtualService(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVirtualService", reflect.TypeOf((*MockVirtualServiceReader)(nil).ListVirtualService), varargs...) +} + +// MockVirtualServiceWriter is a mock of VirtualServiceWriter interface. +type MockVirtualServiceWriter struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceWriterMockRecorder +} + +// MockVirtualServiceWriterMockRecorder is the mock recorder for MockVirtualServiceWriter. +type MockVirtualServiceWriterMockRecorder struct { + mock *MockVirtualServiceWriter +} + +// NewMockVirtualServiceWriter creates a new mock instance. +func NewMockVirtualServiceWriter(ctrl *gomock.Controller) *MockVirtualServiceWriter { + mock := &MockVirtualServiceWriter{ctrl: ctrl} + mock.recorder = &MockVirtualServiceWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceWriter) EXPECT() *MockVirtualServiceWriterMockRecorder { + return m.recorder +} + +// CreateVirtualService mocks base method. +func (m *MockVirtualServiceWriter) CreateVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateVirtualService indicates an expected call of CreateVirtualService. +func (mr *MockVirtualServiceWriterMockRecorder) CreateVirtualService(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVirtualService", reflect.TypeOf((*MockVirtualServiceWriter)(nil).CreateVirtualService), varargs...) +} + +// DeleteAllOfVirtualService mocks base method. +func (m *MockVirtualServiceWriter) DeleteAllOfVirtualService(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfVirtualService indicates an expected call of DeleteAllOfVirtualService. +func (mr *MockVirtualServiceWriterMockRecorder) DeleteAllOfVirtualService(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfVirtualService", reflect.TypeOf((*MockVirtualServiceWriter)(nil).DeleteAllOfVirtualService), varargs...) +} + +// DeleteVirtualService mocks base method. +func (m *MockVirtualServiceWriter) DeleteVirtualService(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteVirtualService indicates an expected call of DeleteVirtualService. +func (mr *MockVirtualServiceWriterMockRecorder) DeleteVirtualService(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVirtualService", reflect.TypeOf((*MockVirtualServiceWriter)(nil).DeleteVirtualService), varargs...) +} + +// PatchVirtualService mocks base method. +func (m *MockVirtualServiceWriter) PatchVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchVirtualService indicates an expected call of PatchVirtualService. +func (mr *MockVirtualServiceWriterMockRecorder) PatchVirtualService(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchVirtualService", reflect.TypeOf((*MockVirtualServiceWriter)(nil).PatchVirtualService), varargs...) +} + +// UpdateVirtualService mocks base method. +func (m *MockVirtualServiceWriter) UpdateVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateVirtualService indicates an expected call of UpdateVirtualService. +func (mr *MockVirtualServiceWriterMockRecorder) UpdateVirtualService(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVirtualService", reflect.TypeOf((*MockVirtualServiceWriter)(nil).UpdateVirtualService), varargs...) +} + +// UpsertVirtualService mocks base method. +func (m *MockVirtualServiceWriter) UpsertVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, transitionFuncs ...v1alpha3.VirtualServiceTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertVirtualService indicates an expected call of UpsertVirtualService. +func (mr *MockVirtualServiceWriterMockRecorder) UpsertVirtualService(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertVirtualService", reflect.TypeOf((*MockVirtualServiceWriter)(nil).UpsertVirtualService), varargs...) +} + +// MockVirtualServiceStatusWriter is a mock of VirtualServiceStatusWriter interface. +type MockVirtualServiceStatusWriter struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceStatusWriterMockRecorder +} + +// MockVirtualServiceStatusWriterMockRecorder is the mock recorder for MockVirtualServiceStatusWriter. +type MockVirtualServiceStatusWriterMockRecorder struct { + mock *MockVirtualServiceStatusWriter +} + +// NewMockVirtualServiceStatusWriter creates a new mock instance. +func NewMockVirtualServiceStatusWriter(ctrl *gomock.Controller) *MockVirtualServiceStatusWriter { + mock := &MockVirtualServiceStatusWriter{ctrl: ctrl} + mock.recorder = &MockVirtualServiceStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceStatusWriter) EXPECT() *MockVirtualServiceStatusWriterMockRecorder { + return m.recorder +} + +// PatchVirtualServiceStatus mocks base method. +func (m *MockVirtualServiceStatusWriter) PatchVirtualServiceStatus(ctx context.Context, obj *v1alpha30.VirtualService, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchVirtualServiceStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchVirtualServiceStatus indicates an expected call of PatchVirtualServiceStatus. +func (mr *MockVirtualServiceStatusWriterMockRecorder) PatchVirtualServiceStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchVirtualServiceStatus", reflect.TypeOf((*MockVirtualServiceStatusWriter)(nil).PatchVirtualServiceStatus), varargs...) +} + +// UpdateVirtualServiceStatus mocks base method. +func (m *MockVirtualServiceStatusWriter) UpdateVirtualServiceStatus(ctx context.Context, obj *v1alpha30.VirtualService, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateVirtualServiceStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateVirtualServiceStatus indicates an expected call of UpdateVirtualServiceStatus. +func (mr *MockVirtualServiceStatusWriterMockRecorder) UpdateVirtualServiceStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVirtualServiceStatus", reflect.TypeOf((*MockVirtualServiceStatusWriter)(nil).UpdateVirtualServiceStatus), varargs...) +} + +// MockVirtualServiceClient is a mock of VirtualServiceClient interface. +type MockVirtualServiceClient struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceClientMockRecorder +} + +// MockVirtualServiceClientMockRecorder is the mock recorder for MockVirtualServiceClient. +type MockVirtualServiceClientMockRecorder struct { + mock *MockVirtualServiceClient +} + +// NewMockVirtualServiceClient creates a new mock instance. +func NewMockVirtualServiceClient(ctrl *gomock.Controller) *MockVirtualServiceClient { + mock := &MockVirtualServiceClient{ctrl: ctrl} + mock.recorder = &MockVirtualServiceClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceClient) EXPECT() *MockVirtualServiceClientMockRecorder { + return m.recorder +} + +// CreateVirtualService mocks base method. +func (m *MockVirtualServiceClient) CreateVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateVirtualService indicates an expected call of CreateVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) CreateVirtualService(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).CreateVirtualService), varargs...) +} + +// DeleteAllOfVirtualService mocks base method. +func (m *MockVirtualServiceClient) DeleteAllOfVirtualService(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfVirtualService indicates an expected call of DeleteAllOfVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) DeleteAllOfVirtualService(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).DeleteAllOfVirtualService), varargs...) +} + +// DeleteVirtualService mocks base method. +func (m *MockVirtualServiceClient) DeleteVirtualService(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteVirtualService indicates an expected call of DeleteVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) DeleteVirtualService(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).DeleteVirtualService), varargs...) +} + +// GetVirtualService mocks base method. +func (m *MockVirtualServiceClient) GetVirtualService(ctx context.Context, key client.ObjectKey) (*v1alpha30.VirtualService, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVirtualService", ctx, key) + ret0, _ := ret[0].(*v1alpha30.VirtualService) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVirtualService indicates an expected call of GetVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) GetVirtualService(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).GetVirtualService), ctx, key) +} + +// ListVirtualService mocks base method. +func (m *MockVirtualServiceClient) ListVirtualService(ctx context.Context, opts ...client.ListOption) (*v1alpha30.VirtualServiceList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListVirtualService", varargs...) + ret0, _ := ret[0].(*v1alpha30.VirtualServiceList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListVirtualService indicates an expected call of ListVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) ListVirtualService(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).ListVirtualService), varargs...) +} + +// PatchVirtualService mocks base method. +func (m *MockVirtualServiceClient) PatchVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchVirtualService indicates an expected call of PatchVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) PatchVirtualService(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).PatchVirtualService), varargs...) +} + +// PatchVirtualServiceStatus mocks base method. +func (m *MockVirtualServiceClient) PatchVirtualServiceStatus(ctx context.Context, obj *v1alpha30.VirtualService, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchVirtualServiceStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchVirtualServiceStatus indicates an expected call of PatchVirtualServiceStatus. +func (mr *MockVirtualServiceClientMockRecorder) PatchVirtualServiceStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchVirtualServiceStatus", reflect.TypeOf((*MockVirtualServiceClient)(nil).PatchVirtualServiceStatus), varargs...) +} + +// UpdateVirtualService mocks base method. +func (m *MockVirtualServiceClient) UpdateVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateVirtualService indicates an expected call of UpdateVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) UpdateVirtualService(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).UpdateVirtualService), varargs...) +} + +// UpdateVirtualServiceStatus mocks base method. +func (m *MockVirtualServiceClient) UpdateVirtualServiceStatus(ctx context.Context, obj *v1alpha30.VirtualService, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateVirtualServiceStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateVirtualServiceStatus indicates an expected call of UpdateVirtualServiceStatus. +func (mr *MockVirtualServiceClientMockRecorder) UpdateVirtualServiceStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVirtualServiceStatus", reflect.TypeOf((*MockVirtualServiceClient)(nil).UpdateVirtualServiceStatus), varargs...) +} + +// UpsertVirtualService mocks base method. +func (m *MockVirtualServiceClient) UpsertVirtualService(ctx context.Context, obj *v1alpha30.VirtualService, transitionFuncs ...v1alpha3.VirtualServiceTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertVirtualService", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertVirtualService indicates an expected call of UpsertVirtualService. +func (mr *MockVirtualServiceClientMockRecorder) UpsertVirtualService(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertVirtualService", reflect.TypeOf((*MockVirtualServiceClient)(nil).UpsertVirtualService), varargs...) +} + +// MockMulticlusterVirtualServiceClient is a mock of MulticlusterVirtualServiceClient interface. +type MockMulticlusterVirtualServiceClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterVirtualServiceClientMockRecorder +} + +// MockMulticlusterVirtualServiceClientMockRecorder is the mock recorder for MockMulticlusterVirtualServiceClient. +type MockMulticlusterVirtualServiceClientMockRecorder struct { + mock *MockMulticlusterVirtualServiceClient +} + +// NewMockMulticlusterVirtualServiceClient creates a new mock instance. +func NewMockMulticlusterVirtualServiceClient(ctrl *gomock.Controller) *MockMulticlusterVirtualServiceClient { + mock := &MockMulticlusterVirtualServiceClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterVirtualServiceClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterVirtualServiceClient) EXPECT() *MockMulticlusterVirtualServiceClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterVirtualServiceClient) Cluster(cluster string) (v1alpha3.VirtualServiceClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.VirtualServiceClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterVirtualServiceClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterVirtualServiceClient)(nil).Cluster), cluster) +} + +// MockSidecarReader is a mock of SidecarReader interface. +type MockSidecarReader struct { + ctrl *gomock.Controller + recorder *MockSidecarReaderMockRecorder +} + +// MockSidecarReaderMockRecorder is the mock recorder for MockSidecarReader. +type MockSidecarReaderMockRecorder struct { + mock *MockSidecarReader +} + +// NewMockSidecarReader creates a new mock instance. +func NewMockSidecarReader(ctrl *gomock.Controller) *MockSidecarReader { + mock := &MockSidecarReader{ctrl: ctrl} + mock.recorder = &MockSidecarReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarReader) EXPECT() *MockSidecarReaderMockRecorder { + return m.recorder +} + +// GetSidecar mocks base method. +func (m *MockSidecarReader) GetSidecar(ctx context.Context, key client.ObjectKey) (*v1alpha30.Sidecar, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSidecar", ctx, key) + ret0, _ := ret[0].(*v1alpha30.Sidecar) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSidecar indicates an expected call of GetSidecar. +func (mr *MockSidecarReaderMockRecorder) GetSidecar(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSidecar", reflect.TypeOf((*MockSidecarReader)(nil).GetSidecar), ctx, key) +} + +// ListSidecar mocks base method. +func (m *MockSidecarReader) ListSidecar(ctx context.Context, opts ...client.ListOption) (*v1alpha30.SidecarList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListSidecar", varargs...) + ret0, _ := ret[0].(*v1alpha30.SidecarList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListSidecar indicates an expected call of ListSidecar. +func (mr *MockSidecarReaderMockRecorder) ListSidecar(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSidecar", reflect.TypeOf((*MockSidecarReader)(nil).ListSidecar), varargs...) +} + +// MockSidecarWriter is a mock of SidecarWriter interface. +type MockSidecarWriter struct { + ctrl *gomock.Controller + recorder *MockSidecarWriterMockRecorder +} + +// MockSidecarWriterMockRecorder is the mock recorder for MockSidecarWriter. +type MockSidecarWriterMockRecorder struct { + mock *MockSidecarWriter +} + +// NewMockSidecarWriter creates a new mock instance. +func NewMockSidecarWriter(ctrl *gomock.Controller) *MockSidecarWriter { + mock := &MockSidecarWriter{ctrl: ctrl} + mock.recorder = &MockSidecarWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarWriter) EXPECT() *MockSidecarWriterMockRecorder { + return m.recorder +} + +// CreateSidecar mocks base method. +func (m *MockSidecarWriter) CreateSidecar(ctx context.Context, obj *v1alpha30.Sidecar, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateSidecar indicates an expected call of CreateSidecar. +func (mr *MockSidecarWriterMockRecorder) CreateSidecar(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSidecar", reflect.TypeOf((*MockSidecarWriter)(nil).CreateSidecar), varargs...) +} + +// DeleteAllOfSidecar mocks base method. +func (m *MockSidecarWriter) DeleteAllOfSidecar(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfSidecar indicates an expected call of DeleteAllOfSidecar. +func (mr *MockSidecarWriterMockRecorder) DeleteAllOfSidecar(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfSidecar", reflect.TypeOf((*MockSidecarWriter)(nil).DeleteAllOfSidecar), varargs...) +} + +// DeleteSidecar mocks base method. +func (m *MockSidecarWriter) DeleteSidecar(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteSidecar indicates an expected call of DeleteSidecar. +func (mr *MockSidecarWriterMockRecorder) DeleteSidecar(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSidecar", reflect.TypeOf((*MockSidecarWriter)(nil).DeleteSidecar), varargs...) +} + +// PatchSidecar mocks base method. +func (m *MockSidecarWriter) PatchSidecar(ctx context.Context, obj *v1alpha30.Sidecar, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchSidecar indicates an expected call of PatchSidecar. +func (mr *MockSidecarWriterMockRecorder) PatchSidecar(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchSidecar", reflect.TypeOf((*MockSidecarWriter)(nil).PatchSidecar), varargs...) +} + +// UpdateSidecar mocks base method. +func (m *MockSidecarWriter) UpdateSidecar(ctx context.Context, obj *v1alpha30.Sidecar, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateSidecar indicates an expected call of UpdateSidecar. +func (mr *MockSidecarWriterMockRecorder) UpdateSidecar(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSidecar", reflect.TypeOf((*MockSidecarWriter)(nil).UpdateSidecar), varargs...) +} + +// UpsertSidecar mocks base method. +func (m *MockSidecarWriter) UpsertSidecar(ctx context.Context, obj *v1alpha30.Sidecar, transitionFuncs ...v1alpha3.SidecarTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertSidecar indicates an expected call of UpsertSidecar. +func (mr *MockSidecarWriterMockRecorder) UpsertSidecar(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertSidecar", reflect.TypeOf((*MockSidecarWriter)(nil).UpsertSidecar), varargs...) +} + +// MockSidecarStatusWriter is a mock of SidecarStatusWriter interface. +type MockSidecarStatusWriter struct { + ctrl *gomock.Controller + recorder *MockSidecarStatusWriterMockRecorder +} + +// MockSidecarStatusWriterMockRecorder is the mock recorder for MockSidecarStatusWriter. +type MockSidecarStatusWriterMockRecorder struct { + mock *MockSidecarStatusWriter +} + +// NewMockSidecarStatusWriter creates a new mock instance. +func NewMockSidecarStatusWriter(ctrl *gomock.Controller) *MockSidecarStatusWriter { + mock := &MockSidecarStatusWriter{ctrl: ctrl} + mock.recorder = &MockSidecarStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarStatusWriter) EXPECT() *MockSidecarStatusWriterMockRecorder { + return m.recorder +} + +// PatchSidecarStatus mocks base method. +func (m *MockSidecarStatusWriter) PatchSidecarStatus(ctx context.Context, obj *v1alpha30.Sidecar, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchSidecarStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchSidecarStatus indicates an expected call of PatchSidecarStatus. +func (mr *MockSidecarStatusWriterMockRecorder) PatchSidecarStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchSidecarStatus", reflect.TypeOf((*MockSidecarStatusWriter)(nil).PatchSidecarStatus), varargs...) +} + +// UpdateSidecarStatus mocks base method. +func (m *MockSidecarStatusWriter) UpdateSidecarStatus(ctx context.Context, obj *v1alpha30.Sidecar, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSidecarStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateSidecarStatus indicates an expected call of UpdateSidecarStatus. +func (mr *MockSidecarStatusWriterMockRecorder) UpdateSidecarStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSidecarStatus", reflect.TypeOf((*MockSidecarStatusWriter)(nil).UpdateSidecarStatus), varargs...) +} + +// MockSidecarClient is a mock of SidecarClient interface. +type MockSidecarClient struct { + ctrl *gomock.Controller + recorder *MockSidecarClientMockRecorder +} + +// MockSidecarClientMockRecorder is the mock recorder for MockSidecarClient. +type MockSidecarClientMockRecorder struct { + mock *MockSidecarClient +} + +// NewMockSidecarClient creates a new mock instance. +func NewMockSidecarClient(ctrl *gomock.Controller) *MockSidecarClient { + mock := &MockSidecarClient{ctrl: ctrl} + mock.recorder = &MockSidecarClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarClient) EXPECT() *MockSidecarClientMockRecorder { + return m.recorder +} + +// CreateSidecar mocks base method. +func (m *MockSidecarClient) CreateSidecar(ctx context.Context, obj *v1alpha30.Sidecar, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateSidecar indicates an expected call of CreateSidecar. +func (mr *MockSidecarClientMockRecorder) CreateSidecar(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateSidecar", reflect.TypeOf((*MockSidecarClient)(nil).CreateSidecar), varargs...) +} + +// DeleteAllOfSidecar mocks base method. +func (m *MockSidecarClient) DeleteAllOfSidecar(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfSidecar indicates an expected call of DeleteAllOfSidecar. +func (mr *MockSidecarClientMockRecorder) DeleteAllOfSidecar(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfSidecar", reflect.TypeOf((*MockSidecarClient)(nil).DeleteAllOfSidecar), varargs...) +} + +// DeleteSidecar mocks base method. +func (m *MockSidecarClient) DeleteSidecar(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteSidecar indicates an expected call of DeleteSidecar. +func (mr *MockSidecarClientMockRecorder) DeleteSidecar(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSidecar", reflect.TypeOf((*MockSidecarClient)(nil).DeleteSidecar), varargs...) +} + +// GetSidecar mocks base method. +func (m *MockSidecarClient) GetSidecar(ctx context.Context, key client.ObjectKey) (*v1alpha30.Sidecar, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSidecar", ctx, key) + ret0, _ := ret[0].(*v1alpha30.Sidecar) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSidecar indicates an expected call of GetSidecar. +func (mr *MockSidecarClientMockRecorder) GetSidecar(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSidecar", reflect.TypeOf((*MockSidecarClient)(nil).GetSidecar), ctx, key) +} + +// ListSidecar mocks base method. +func (m *MockSidecarClient) ListSidecar(ctx context.Context, opts ...client.ListOption) (*v1alpha30.SidecarList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListSidecar", varargs...) + ret0, _ := ret[0].(*v1alpha30.SidecarList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListSidecar indicates an expected call of ListSidecar. +func (mr *MockSidecarClientMockRecorder) ListSidecar(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListSidecar", reflect.TypeOf((*MockSidecarClient)(nil).ListSidecar), varargs...) +} + +// PatchSidecar mocks base method. +func (m *MockSidecarClient) PatchSidecar(ctx context.Context, obj *v1alpha30.Sidecar, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchSidecar indicates an expected call of PatchSidecar. +func (mr *MockSidecarClientMockRecorder) PatchSidecar(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchSidecar", reflect.TypeOf((*MockSidecarClient)(nil).PatchSidecar), varargs...) +} + +// PatchSidecarStatus mocks base method. +func (m *MockSidecarClient) PatchSidecarStatus(ctx context.Context, obj *v1alpha30.Sidecar, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchSidecarStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchSidecarStatus indicates an expected call of PatchSidecarStatus. +func (mr *MockSidecarClientMockRecorder) PatchSidecarStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchSidecarStatus", reflect.TypeOf((*MockSidecarClient)(nil).PatchSidecarStatus), varargs...) +} + +// UpdateSidecar mocks base method. +func (m *MockSidecarClient) UpdateSidecar(ctx context.Context, obj *v1alpha30.Sidecar, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateSidecar indicates an expected call of UpdateSidecar. +func (mr *MockSidecarClientMockRecorder) UpdateSidecar(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSidecar", reflect.TypeOf((*MockSidecarClient)(nil).UpdateSidecar), varargs...) +} + +// UpdateSidecarStatus mocks base method. +func (m *MockSidecarClient) UpdateSidecarStatus(ctx context.Context, obj *v1alpha30.Sidecar, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSidecarStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateSidecarStatus indicates an expected call of UpdateSidecarStatus. +func (mr *MockSidecarClientMockRecorder) UpdateSidecarStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSidecarStatus", reflect.TypeOf((*MockSidecarClient)(nil).UpdateSidecarStatus), varargs...) +} + +// UpsertSidecar mocks base method. +func (m *MockSidecarClient) UpsertSidecar(ctx context.Context, obj *v1alpha30.Sidecar, transitionFuncs ...v1alpha3.SidecarTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertSidecar", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertSidecar indicates an expected call of UpsertSidecar. +func (mr *MockSidecarClientMockRecorder) UpsertSidecar(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertSidecar", reflect.TypeOf((*MockSidecarClient)(nil).UpsertSidecar), varargs...) +} + +// MockMulticlusterSidecarClient is a mock of MulticlusterSidecarClient interface. +type MockMulticlusterSidecarClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterSidecarClientMockRecorder +} + +// MockMulticlusterSidecarClientMockRecorder is the mock recorder for MockMulticlusterSidecarClient. +type MockMulticlusterSidecarClientMockRecorder struct { + mock *MockMulticlusterSidecarClient +} + +// NewMockMulticlusterSidecarClient creates a new mock instance. +func NewMockMulticlusterSidecarClient(ctrl *gomock.Controller) *MockMulticlusterSidecarClient { + mock := &MockMulticlusterSidecarClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterSidecarClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterSidecarClient) EXPECT() *MockMulticlusterSidecarClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterSidecarClient) Cluster(cluster string) (v1alpha3.SidecarClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1alpha3.SidecarClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterSidecarClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterSidecarClient)(nil).Cluster), cluster) +} + // MockEnvoyFilterReader is a mock of EnvoyFilterReader interface. type MockEnvoyFilterReader struct { ctrl *gomock.Controller diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/providers/client_providers.go b/pkg/api/istio/networking.istio.io/v1alpha3/providers/client_providers.go index f0d9ee7..088b162 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/providers/client_providers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/providers/client_providers.go @@ -17,6 +17,202 @@ import ( See package `github.com/solo-io/skv2/pkg/multicluster/register` for example */ +// Provider for DestinationRuleClient from Clientset +func DestinationRuleClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.DestinationRuleClient { + return clients.DestinationRules() +} + +// Provider for DestinationRule Client from Client +func DestinationRuleClientProvider(client client.Client) networking_istio_io_v1alpha3.DestinationRuleClient { + return networking_istio_io_v1alpha3.NewDestinationRuleClient(client) +} + +type DestinationRuleClientFactory func(client client.Client) networking_istio_io_v1alpha3.DestinationRuleClient + +func DestinationRuleClientFactoryProvider() DestinationRuleClientFactory { + return DestinationRuleClientProvider +} + +type DestinationRuleClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.DestinationRuleClient, error) + +func DestinationRuleClientFromConfigFactoryProvider() DestinationRuleClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.DestinationRuleClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.DestinationRules(), nil + } +} + +// Provider for GatewayClient from Clientset +func GatewayClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.GatewayClient { + return clients.Gateways() +} + +// Provider for Gateway Client from Client +func GatewayClientProvider(client client.Client) networking_istio_io_v1alpha3.GatewayClient { + return networking_istio_io_v1alpha3.NewGatewayClient(client) +} + +type GatewayClientFactory func(client client.Client) networking_istio_io_v1alpha3.GatewayClient + +func GatewayClientFactoryProvider() GatewayClientFactory { + return GatewayClientProvider +} + +type GatewayClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.GatewayClient, error) + +func GatewayClientFromConfigFactoryProvider() GatewayClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.GatewayClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.Gateways(), nil + } +} + +// Provider for ServiceEntryClient from Clientset +func ServiceEntryClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.ServiceEntryClient { + return clients.ServiceEntries() +} + +// Provider for ServiceEntry Client from Client +func ServiceEntryClientProvider(client client.Client) networking_istio_io_v1alpha3.ServiceEntryClient { + return networking_istio_io_v1alpha3.NewServiceEntryClient(client) +} + +type ServiceEntryClientFactory func(client client.Client) networking_istio_io_v1alpha3.ServiceEntryClient + +func ServiceEntryClientFactoryProvider() ServiceEntryClientFactory { + return ServiceEntryClientProvider +} + +type ServiceEntryClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.ServiceEntryClient, error) + +func ServiceEntryClientFromConfigFactoryProvider() ServiceEntryClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.ServiceEntryClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.ServiceEntries(), nil + } +} + +// Provider for WorkloadEntryClient from Clientset +func WorkloadEntryClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.WorkloadEntryClient { + return clients.WorkloadEntries() +} + +// Provider for WorkloadEntry Client from Client +func WorkloadEntryClientProvider(client client.Client) networking_istio_io_v1alpha3.WorkloadEntryClient { + return networking_istio_io_v1alpha3.NewWorkloadEntryClient(client) +} + +type WorkloadEntryClientFactory func(client client.Client) networking_istio_io_v1alpha3.WorkloadEntryClient + +func WorkloadEntryClientFactoryProvider() WorkloadEntryClientFactory { + return WorkloadEntryClientProvider +} + +type WorkloadEntryClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.WorkloadEntryClient, error) + +func WorkloadEntryClientFromConfigFactoryProvider() WorkloadEntryClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.WorkloadEntryClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.WorkloadEntries(), nil + } +} + +// Provider for WorkloadGroupClient from Clientset +func WorkloadGroupClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.WorkloadGroupClient { + return clients.WorkloadGroups() +} + +// Provider for WorkloadGroup Client from Client +func WorkloadGroupClientProvider(client client.Client) networking_istio_io_v1alpha3.WorkloadGroupClient { + return networking_istio_io_v1alpha3.NewWorkloadGroupClient(client) +} + +type WorkloadGroupClientFactory func(client client.Client) networking_istio_io_v1alpha3.WorkloadGroupClient + +func WorkloadGroupClientFactoryProvider() WorkloadGroupClientFactory { + return WorkloadGroupClientProvider +} + +type WorkloadGroupClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.WorkloadGroupClient, error) + +func WorkloadGroupClientFromConfigFactoryProvider() WorkloadGroupClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.WorkloadGroupClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.WorkloadGroups(), nil + } +} + +// Provider for VirtualServiceClient from Clientset +func VirtualServiceClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.VirtualServiceClient { + return clients.VirtualServices() +} + +// Provider for VirtualService Client from Client +func VirtualServiceClientProvider(client client.Client) networking_istio_io_v1alpha3.VirtualServiceClient { + return networking_istio_io_v1alpha3.NewVirtualServiceClient(client) +} + +type VirtualServiceClientFactory func(client client.Client) networking_istio_io_v1alpha3.VirtualServiceClient + +func VirtualServiceClientFactoryProvider() VirtualServiceClientFactory { + return VirtualServiceClientProvider +} + +type VirtualServiceClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.VirtualServiceClient, error) + +func VirtualServiceClientFromConfigFactoryProvider() VirtualServiceClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.VirtualServiceClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.VirtualServices(), nil + } +} + +// Provider for SidecarClient from Clientset +func SidecarClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.SidecarClient { + return clients.Sidecars() +} + +// Provider for Sidecar Client from Client +func SidecarClientProvider(client client.Client) networking_istio_io_v1alpha3.SidecarClient { + return networking_istio_io_v1alpha3.NewSidecarClient(client) +} + +type SidecarClientFactory func(client client.Client) networking_istio_io_v1alpha3.SidecarClient + +func SidecarClientFactoryProvider() SidecarClientFactory { + return SidecarClientProvider +} + +type SidecarClientFromConfigFactory func(cfg *rest.Config) (networking_istio_io_v1alpha3.SidecarClient, error) + +func SidecarClientFromConfigFactoryProvider() SidecarClientFromConfigFactory { + return func(cfg *rest.Config) (networking_istio_io_v1alpha3.SidecarClient, error) { + clients, err := networking_istio_io_v1alpha3.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.Sidecars(), nil + } +} + // Provider for EnvoyFilterClient from Clientset func EnvoyFilterClientFromClientsetProvider(clients networking_istio_io_v1alpha3.Clientset) networking_istio_io_v1alpha3.EnvoyFilterClient { return clients.EnvoyFilters() diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/sets/mocks/sets.go b/pkg/api/istio/networking.istio.io/v1alpha3/sets/mocks/sets.go index b7ef7a1..9505b76 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/sets/mocks/sets.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/sets/mocks/sets.go @@ -15,6 +15,1798 @@ import ( sets0 "k8s.io/apimachinery/pkg/util/sets" ) +// MockDestinationRuleSet is a mock of DestinationRuleSet interface. +type MockDestinationRuleSet struct { + ctrl *gomock.Controller + recorder *MockDestinationRuleSetMockRecorder +} + +// MockDestinationRuleSetMockRecorder is the mock recorder for MockDestinationRuleSet. +type MockDestinationRuleSetMockRecorder struct { + mock *MockDestinationRuleSet +} + +// NewMockDestinationRuleSet creates a new mock instance. +func NewMockDestinationRuleSet(ctrl *gomock.Controller) *MockDestinationRuleSet { + mock := &MockDestinationRuleSet{ctrl: ctrl} + mock.recorder = &MockDestinationRuleSetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockDestinationRuleSet) EXPECT() *MockDestinationRuleSetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockDestinationRuleSet) Clone() v1alpha3sets.DestinationRuleSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.DestinationRuleSet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockDestinationRuleSetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockDestinationRuleSet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockDestinationRuleSet) Delete(destinationRule ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", destinationRule) +} + +// Delete indicates an expected call of Delete. +func (mr *MockDestinationRuleSetMockRecorder) Delete(destinationRule interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDestinationRuleSet)(nil).Delete), destinationRule) +} + +// Delta mocks base method. +func (m *MockDestinationRuleSet) Delta(newSet v1alpha3sets.DestinationRuleSet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockDestinationRuleSetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockDestinationRuleSet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockDestinationRuleSet) Difference(set v1alpha3sets.DestinationRuleSet) v1alpha3sets.DestinationRuleSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.DestinationRuleSet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockDestinationRuleSetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockDestinationRuleSet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockDestinationRuleSet) Equal(destinationRuleSet v1alpha3sets.DestinationRuleSet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", destinationRuleSet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockDestinationRuleSetMockRecorder) Equal(destinationRuleSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockDestinationRuleSet)(nil).Equal), destinationRuleSet) +} + +// Find mocks base method. +func (m *MockDestinationRuleSet) Find(id ezkube.ResourceId) (*v1alpha3.DestinationRule, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.DestinationRule) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockDestinationRuleSetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockDestinationRuleSet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockDestinationRuleSet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockDestinationRuleSetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockDestinationRuleSet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockDestinationRuleSet) Has(destinationRule ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", destinationRule) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockDestinationRuleSetMockRecorder) Has(destinationRule interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockDestinationRuleSet)(nil).Has), destinationRule) +} + +// Insert mocks base method. +func (m *MockDestinationRuleSet) Insert(destinationRule ...*v1alpha3.DestinationRule) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range destinationRule { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockDestinationRuleSetMockRecorder) Insert(destinationRule ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockDestinationRuleSet)(nil).Insert), destinationRule...) +} + +// Intersection mocks base method. +func (m *MockDestinationRuleSet) Intersection(set v1alpha3sets.DestinationRuleSet) v1alpha3sets.DestinationRuleSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.DestinationRuleSet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockDestinationRuleSetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockDestinationRuleSet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockDestinationRuleSet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockDestinationRuleSetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockDestinationRuleSet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockDestinationRuleSet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockDestinationRuleSetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockDestinationRuleSet)(nil).Length)) +} + +// List mocks base method. +func (m *MockDestinationRuleSet) List(filterResource ...func(*v1alpha3.DestinationRule) bool) []*v1alpha3.DestinationRule { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.DestinationRule) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockDestinationRuleSetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockDestinationRuleSet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockDestinationRuleSet) Map() map[string]*v1alpha3.DestinationRule { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.DestinationRule) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockDestinationRuleSetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockDestinationRuleSet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockDestinationRuleSet) Union(set v1alpha3sets.DestinationRuleSet) v1alpha3sets.DestinationRuleSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.DestinationRuleSet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockDestinationRuleSetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockDestinationRuleSet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockDestinationRuleSet) UnsortedList(filterResource ...func(*v1alpha3.DestinationRule) bool) []*v1alpha3.DestinationRule { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.DestinationRule) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockDestinationRuleSetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockDestinationRuleSet)(nil).UnsortedList), filterResource...) +} + +// MockGatewaySet is a mock of GatewaySet interface. +type MockGatewaySet struct { + ctrl *gomock.Controller + recorder *MockGatewaySetMockRecorder +} + +// MockGatewaySetMockRecorder is the mock recorder for MockGatewaySet. +type MockGatewaySetMockRecorder struct { + mock *MockGatewaySet +} + +// NewMockGatewaySet creates a new mock instance. +func NewMockGatewaySet(ctrl *gomock.Controller) *MockGatewaySet { + mock := &MockGatewaySet{ctrl: ctrl} + mock.recorder = &MockGatewaySetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockGatewaySet) EXPECT() *MockGatewaySetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockGatewaySet) Clone() v1alpha3sets.GatewaySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.GatewaySet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockGatewaySetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockGatewaySet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockGatewaySet) Delete(gateway ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", gateway) +} + +// Delete indicates an expected call of Delete. +func (mr *MockGatewaySetMockRecorder) Delete(gateway interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockGatewaySet)(nil).Delete), gateway) +} + +// Delta mocks base method. +func (m *MockGatewaySet) Delta(newSet v1alpha3sets.GatewaySet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockGatewaySetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockGatewaySet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockGatewaySet) Difference(set v1alpha3sets.GatewaySet) v1alpha3sets.GatewaySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.GatewaySet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockGatewaySetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockGatewaySet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockGatewaySet) Equal(gatewaySet v1alpha3sets.GatewaySet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", gatewaySet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockGatewaySetMockRecorder) Equal(gatewaySet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockGatewaySet)(nil).Equal), gatewaySet) +} + +// Find mocks base method. +func (m *MockGatewaySet) Find(id ezkube.ResourceId) (*v1alpha3.Gateway, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.Gateway) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockGatewaySetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockGatewaySet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockGatewaySet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockGatewaySetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockGatewaySet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockGatewaySet) Has(gateway ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", gateway) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockGatewaySetMockRecorder) Has(gateway interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockGatewaySet)(nil).Has), gateway) +} + +// Insert mocks base method. +func (m *MockGatewaySet) Insert(gateway ...*v1alpha3.Gateway) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range gateway { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockGatewaySetMockRecorder) Insert(gateway ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockGatewaySet)(nil).Insert), gateway...) +} + +// Intersection mocks base method. +func (m *MockGatewaySet) Intersection(set v1alpha3sets.GatewaySet) v1alpha3sets.GatewaySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.GatewaySet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockGatewaySetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockGatewaySet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockGatewaySet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockGatewaySetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockGatewaySet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockGatewaySet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockGatewaySetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockGatewaySet)(nil).Length)) +} + +// List mocks base method. +func (m *MockGatewaySet) List(filterResource ...func(*v1alpha3.Gateway) bool) []*v1alpha3.Gateway { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.Gateway) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockGatewaySetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockGatewaySet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockGatewaySet) Map() map[string]*v1alpha3.Gateway { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.Gateway) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockGatewaySetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockGatewaySet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockGatewaySet) Union(set v1alpha3sets.GatewaySet) v1alpha3sets.GatewaySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.GatewaySet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockGatewaySetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockGatewaySet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockGatewaySet) UnsortedList(filterResource ...func(*v1alpha3.Gateway) bool) []*v1alpha3.Gateway { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.Gateway) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockGatewaySetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockGatewaySet)(nil).UnsortedList), filterResource...) +} + +// MockServiceEntrySet is a mock of ServiceEntrySet interface. +type MockServiceEntrySet struct { + ctrl *gomock.Controller + recorder *MockServiceEntrySetMockRecorder +} + +// MockServiceEntrySetMockRecorder is the mock recorder for MockServiceEntrySet. +type MockServiceEntrySetMockRecorder struct { + mock *MockServiceEntrySet +} + +// NewMockServiceEntrySet creates a new mock instance. +func NewMockServiceEntrySet(ctrl *gomock.Controller) *MockServiceEntrySet { + mock := &MockServiceEntrySet{ctrl: ctrl} + mock.recorder = &MockServiceEntrySetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockServiceEntrySet) EXPECT() *MockServiceEntrySetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockServiceEntrySet) Clone() v1alpha3sets.ServiceEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.ServiceEntrySet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockServiceEntrySetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockServiceEntrySet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockServiceEntrySet) Delete(serviceEntry ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", serviceEntry) +} + +// Delete indicates an expected call of Delete. +func (mr *MockServiceEntrySetMockRecorder) Delete(serviceEntry interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockServiceEntrySet)(nil).Delete), serviceEntry) +} + +// Delta mocks base method. +func (m *MockServiceEntrySet) Delta(newSet v1alpha3sets.ServiceEntrySet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockServiceEntrySetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockServiceEntrySet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockServiceEntrySet) Difference(set v1alpha3sets.ServiceEntrySet) v1alpha3sets.ServiceEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.ServiceEntrySet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockServiceEntrySetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockServiceEntrySet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockServiceEntrySet) Equal(serviceEntrySet v1alpha3sets.ServiceEntrySet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", serviceEntrySet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockServiceEntrySetMockRecorder) Equal(serviceEntrySet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockServiceEntrySet)(nil).Equal), serviceEntrySet) +} + +// Find mocks base method. +func (m *MockServiceEntrySet) Find(id ezkube.ResourceId) (*v1alpha3.ServiceEntry, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.ServiceEntry) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockServiceEntrySetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockServiceEntrySet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockServiceEntrySet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockServiceEntrySetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockServiceEntrySet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockServiceEntrySet) Has(serviceEntry ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", serviceEntry) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockServiceEntrySetMockRecorder) Has(serviceEntry interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockServiceEntrySet)(nil).Has), serviceEntry) +} + +// Insert mocks base method. +func (m *MockServiceEntrySet) Insert(serviceEntry ...*v1alpha3.ServiceEntry) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range serviceEntry { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockServiceEntrySetMockRecorder) Insert(serviceEntry ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockServiceEntrySet)(nil).Insert), serviceEntry...) +} + +// Intersection mocks base method. +func (m *MockServiceEntrySet) Intersection(set v1alpha3sets.ServiceEntrySet) v1alpha3sets.ServiceEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.ServiceEntrySet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockServiceEntrySetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockServiceEntrySet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockServiceEntrySet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockServiceEntrySetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockServiceEntrySet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockServiceEntrySet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockServiceEntrySetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockServiceEntrySet)(nil).Length)) +} + +// List mocks base method. +func (m *MockServiceEntrySet) List(filterResource ...func(*v1alpha3.ServiceEntry) bool) []*v1alpha3.ServiceEntry { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.ServiceEntry) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockServiceEntrySetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockServiceEntrySet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockServiceEntrySet) Map() map[string]*v1alpha3.ServiceEntry { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.ServiceEntry) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockServiceEntrySetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockServiceEntrySet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockServiceEntrySet) Union(set v1alpha3sets.ServiceEntrySet) v1alpha3sets.ServiceEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.ServiceEntrySet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockServiceEntrySetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockServiceEntrySet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockServiceEntrySet) UnsortedList(filterResource ...func(*v1alpha3.ServiceEntry) bool) []*v1alpha3.ServiceEntry { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.ServiceEntry) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockServiceEntrySetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockServiceEntrySet)(nil).UnsortedList), filterResource...) +} + +// MockWorkloadEntrySet is a mock of WorkloadEntrySet interface. +type MockWorkloadEntrySet struct { + ctrl *gomock.Controller + recorder *MockWorkloadEntrySetMockRecorder +} + +// MockWorkloadEntrySetMockRecorder is the mock recorder for MockWorkloadEntrySet. +type MockWorkloadEntrySetMockRecorder struct { + mock *MockWorkloadEntrySet +} + +// NewMockWorkloadEntrySet creates a new mock instance. +func NewMockWorkloadEntrySet(ctrl *gomock.Controller) *MockWorkloadEntrySet { + mock := &MockWorkloadEntrySet{ctrl: ctrl} + mock.recorder = &MockWorkloadEntrySetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadEntrySet) EXPECT() *MockWorkloadEntrySetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockWorkloadEntrySet) Clone() v1alpha3sets.WorkloadEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.WorkloadEntrySet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockWorkloadEntrySetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockWorkloadEntrySet) Delete(workloadEntry ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", workloadEntry) +} + +// Delete indicates an expected call of Delete. +func (mr *MockWorkloadEntrySetMockRecorder) Delete(workloadEntry interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Delete), workloadEntry) +} + +// Delta mocks base method. +func (m *MockWorkloadEntrySet) Delta(newSet v1alpha3sets.WorkloadEntrySet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockWorkloadEntrySetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockWorkloadEntrySet) Difference(set v1alpha3sets.WorkloadEntrySet) v1alpha3sets.WorkloadEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.WorkloadEntrySet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockWorkloadEntrySetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockWorkloadEntrySet) Equal(workloadEntrySet v1alpha3sets.WorkloadEntrySet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", workloadEntrySet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockWorkloadEntrySetMockRecorder) Equal(workloadEntrySet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Equal), workloadEntrySet) +} + +// Find mocks base method. +func (m *MockWorkloadEntrySet) Find(id ezkube.ResourceId) (*v1alpha3.WorkloadEntry, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.WorkloadEntry) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockWorkloadEntrySetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockWorkloadEntrySet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockWorkloadEntrySetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockWorkloadEntrySet) Has(workloadEntry ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", workloadEntry) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockWorkloadEntrySetMockRecorder) Has(workloadEntry interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Has), workloadEntry) +} + +// Insert mocks base method. +func (m *MockWorkloadEntrySet) Insert(workloadEntry ...*v1alpha3.WorkloadEntry) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range workloadEntry { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockWorkloadEntrySetMockRecorder) Insert(workloadEntry ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Insert), workloadEntry...) +} + +// Intersection mocks base method. +func (m *MockWorkloadEntrySet) Intersection(set v1alpha3sets.WorkloadEntrySet) v1alpha3sets.WorkloadEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.WorkloadEntrySet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockWorkloadEntrySetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockWorkloadEntrySet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockWorkloadEntrySetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockWorkloadEntrySet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockWorkloadEntrySetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Length)) +} + +// List mocks base method. +func (m *MockWorkloadEntrySet) List(filterResource ...func(*v1alpha3.WorkloadEntry) bool) []*v1alpha3.WorkloadEntry { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.WorkloadEntry) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockWorkloadEntrySetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockWorkloadEntrySet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockWorkloadEntrySet) Map() map[string]*v1alpha3.WorkloadEntry { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.WorkloadEntry) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockWorkloadEntrySetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockWorkloadEntrySet) Union(set v1alpha3sets.WorkloadEntrySet) v1alpha3sets.WorkloadEntrySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.WorkloadEntrySet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockWorkloadEntrySetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockWorkloadEntrySet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockWorkloadEntrySet) UnsortedList(filterResource ...func(*v1alpha3.WorkloadEntry) bool) []*v1alpha3.WorkloadEntry { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.WorkloadEntry) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockWorkloadEntrySetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockWorkloadEntrySet)(nil).UnsortedList), filterResource...) +} + +// MockWorkloadGroupSet is a mock of WorkloadGroupSet interface. +type MockWorkloadGroupSet struct { + ctrl *gomock.Controller + recorder *MockWorkloadGroupSetMockRecorder +} + +// MockWorkloadGroupSetMockRecorder is the mock recorder for MockWorkloadGroupSet. +type MockWorkloadGroupSetMockRecorder struct { + mock *MockWorkloadGroupSet +} + +// NewMockWorkloadGroupSet creates a new mock instance. +func NewMockWorkloadGroupSet(ctrl *gomock.Controller) *MockWorkloadGroupSet { + mock := &MockWorkloadGroupSet{ctrl: ctrl} + mock.recorder = &MockWorkloadGroupSetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockWorkloadGroupSet) EXPECT() *MockWorkloadGroupSetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockWorkloadGroupSet) Clone() v1alpha3sets.WorkloadGroupSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.WorkloadGroupSet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockWorkloadGroupSetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockWorkloadGroupSet) Delete(workloadGroup ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", workloadGroup) +} + +// Delete indicates an expected call of Delete. +func (mr *MockWorkloadGroupSetMockRecorder) Delete(workloadGroup interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Delete), workloadGroup) +} + +// Delta mocks base method. +func (m *MockWorkloadGroupSet) Delta(newSet v1alpha3sets.WorkloadGroupSet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockWorkloadGroupSetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockWorkloadGroupSet) Difference(set v1alpha3sets.WorkloadGroupSet) v1alpha3sets.WorkloadGroupSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.WorkloadGroupSet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockWorkloadGroupSetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockWorkloadGroupSet) Equal(workloadGroupSet v1alpha3sets.WorkloadGroupSet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", workloadGroupSet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockWorkloadGroupSetMockRecorder) Equal(workloadGroupSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Equal), workloadGroupSet) +} + +// Find mocks base method. +func (m *MockWorkloadGroupSet) Find(id ezkube.ResourceId) (*v1alpha3.WorkloadGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.WorkloadGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockWorkloadGroupSetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockWorkloadGroupSet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockWorkloadGroupSetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockWorkloadGroupSet) Has(workloadGroup ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", workloadGroup) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockWorkloadGroupSetMockRecorder) Has(workloadGroup interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Has), workloadGroup) +} + +// Insert mocks base method. +func (m *MockWorkloadGroupSet) Insert(workloadGroup ...*v1alpha3.WorkloadGroup) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range workloadGroup { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockWorkloadGroupSetMockRecorder) Insert(workloadGroup ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Insert), workloadGroup...) +} + +// Intersection mocks base method. +func (m *MockWorkloadGroupSet) Intersection(set v1alpha3sets.WorkloadGroupSet) v1alpha3sets.WorkloadGroupSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.WorkloadGroupSet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockWorkloadGroupSetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockWorkloadGroupSet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockWorkloadGroupSetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockWorkloadGroupSet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockWorkloadGroupSetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Length)) +} + +// List mocks base method. +func (m *MockWorkloadGroupSet) List(filterResource ...func(*v1alpha3.WorkloadGroup) bool) []*v1alpha3.WorkloadGroup { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.WorkloadGroup) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockWorkloadGroupSetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockWorkloadGroupSet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockWorkloadGroupSet) Map() map[string]*v1alpha3.WorkloadGroup { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.WorkloadGroup) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockWorkloadGroupSetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockWorkloadGroupSet) Union(set v1alpha3sets.WorkloadGroupSet) v1alpha3sets.WorkloadGroupSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.WorkloadGroupSet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockWorkloadGroupSetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockWorkloadGroupSet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockWorkloadGroupSet) UnsortedList(filterResource ...func(*v1alpha3.WorkloadGroup) bool) []*v1alpha3.WorkloadGroup { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.WorkloadGroup) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockWorkloadGroupSetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockWorkloadGroupSet)(nil).UnsortedList), filterResource...) +} + +// MockVirtualServiceSet is a mock of VirtualServiceSet interface. +type MockVirtualServiceSet struct { + ctrl *gomock.Controller + recorder *MockVirtualServiceSetMockRecorder +} + +// MockVirtualServiceSetMockRecorder is the mock recorder for MockVirtualServiceSet. +type MockVirtualServiceSetMockRecorder struct { + mock *MockVirtualServiceSet +} + +// NewMockVirtualServiceSet creates a new mock instance. +func NewMockVirtualServiceSet(ctrl *gomock.Controller) *MockVirtualServiceSet { + mock := &MockVirtualServiceSet{ctrl: ctrl} + mock.recorder = &MockVirtualServiceSetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockVirtualServiceSet) EXPECT() *MockVirtualServiceSetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockVirtualServiceSet) Clone() v1alpha3sets.VirtualServiceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.VirtualServiceSet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockVirtualServiceSetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockVirtualServiceSet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockVirtualServiceSet) Delete(virtualService ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", virtualService) +} + +// Delete indicates an expected call of Delete. +func (mr *MockVirtualServiceSetMockRecorder) Delete(virtualService interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockVirtualServiceSet)(nil).Delete), virtualService) +} + +// Delta mocks base method. +func (m *MockVirtualServiceSet) Delta(newSet v1alpha3sets.VirtualServiceSet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockVirtualServiceSetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockVirtualServiceSet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockVirtualServiceSet) Difference(set v1alpha3sets.VirtualServiceSet) v1alpha3sets.VirtualServiceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.VirtualServiceSet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockVirtualServiceSetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockVirtualServiceSet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockVirtualServiceSet) Equal(virtualServiceSet v1alpha3sets.VirtualServiceSet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", virtualServiceSet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockVirtualServiceSetMockRecorder) Equal(virtualServiceSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockVirtualServiceSet)(nil).Equal), virtualServiceSet) +} + +// Find mocks base method. +func (m *MockVirtualServiceSet) Find(id ezkube.ResourceId) (*v1alpha3.VirtualService, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.VirtualService) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockVirtualServiceSetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockVirtualServiceSet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockVirtualServiceSet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockVirtualServiceSetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockVirtualServiceSet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockVirtualServiceSet) Has(virtualService ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", virtualService) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockVirtualServiceSetMockRecorder) Has(virtualService interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockVirtualServiceSet)(nil).Has), virtualService) +} + +// Insert mocks base method. +func (m *MockVirtualServiceSet) Insert(virtualService ...*v1alpha3.VirtualService) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range virtualService { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockVirtualServiceSetMockRecorder) Insert(virtualService ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockVirtualServiceSet)(nil).Insert), virtualService...) +} + +// Intersection mocks base method. +func (m *MockVirtualServiceSet) Intersection(set v1alpha3sets.VirtualServiceSet) v1alpha3sets.VirtualServiceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.VirtualServiceSet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockVirtualServiceSetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockVirtualServiceSet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockVirtualServiceSet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockVirtualServiceSetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockVirtualServiceSet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockVirtualServiceSet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockVirtualServiceSetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockVirtualServiceSet)(nil).Length)) +} + +// List mocks base method. +func (m *MockVirtualServiceSet) List(filterResource ...func(*v1alpha3.VirtualService) bool) []*v1alpha3.VirtualService { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.VirtualService) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockVirtualServiceSetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockVirtualServiceSet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockVirtualServiceSet) Map() map[string]*v1alpha3.VirtualService { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.VirtualService) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockVirtualServiceSetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockVirtualServiceSet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockVirtualServiceSet) Union(set v1alpha3sets.VirtualServiceSet) v1alpha3sets.VirtualServiceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.VirtualServiceSet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockVirtualServiceSetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockVirtualServiceSet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockVirtualServiceSet) UnsortedList(filterResource ...func(*v1alpha3.VirtualService) bool) []*v1alpha3.VirtualService { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.VirtualService) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockVirtualServiceSetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockVirtualServiceSet)(nil).UnsortedList), filterResource...) +} + +// MockSidecarSet is a mock of SidecarSet interface. +type MockSidecarSet struct { + ctrl *gomock.Controller + recorder *MockSidecarSetMockRecorder +} + +// MockSidecarSetMockRecorder is the mock recorder for MockSidecarSet. +type MockSidecarSetMockRecorder struct { + mock *MockSidecarSet +} + +// NewMockSidecarSet creates a new mock instance. +func NewMockSidecarSet(ctrl *gomock.Controller) *MockSidecarSet { + mock := &MockSidecarSet{ctrl: ctrl} + mock.recorder = &MockSidecarSetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockSidecarSet) EXPECT() *MockSidecarSetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockSidecarSet) Clone() v1alpha3sets.SidecarSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1alpha3sets.SidecarSet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockSidecarSetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockSidecarSet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockSidecarSet) Delete(sidecar ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", sidecar) +} + +// Delete indicates an expected call of Delete. +func (mr *MockSidecarSetMockRecorder) Delete(sidecar interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockSidecarSet)(nil).Delete), sidecar) +} + +// Delta mocks base method. +func (m *MockSidecarSet) Delta(newSet v1alpha3sets.SidecarSet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockSidecarSetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockSidecarSet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockSidecarSet) Difference(set v1alpha3sets.SidecarSet) v1alpha3sets.SidecarSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1alpha3sets.SidecarSet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockSidecarSetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockSidecarSet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockSidecarSet) Equal(sidecarSet v1alpha3sets.SidecarSet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", sidecarSet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockSidecarSetMockRecorder) Equal(sidecarSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockSidecarSet)(nil).Equal), sidecarSet) +} + +// Find mocks base method. +func (m *MockSidecarSet) Find(id ezkube.ResourceId) (*v1alpha3.Sidecar, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1alpha3.Sidecar) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockSidecarSetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockSidecarSet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockSidecarSet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockSidecarSetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockSidecarSet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockSidecarSet) Has(sidecar ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", sidecar) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockSidecarSetMockRecorder) Has(sidecar interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockSidecarSet)(nil).Has), sidecar) +} + +// Insert mocks base method. +func (m *MockSidecarSet) Insert(sidecar ...*v1alpha3.Sidecar) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range sidecar { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockSidecarSetMockRecorder) Insert(sidecar ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockSidecarSet)(nil).Insert), sidecar...) +} + +// Intersection mocks base method. +func (m *MockSidecarSet) Intersection(set v1alpha3sets.SidecarSet) v1alpha3sets.SidecarSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1alpha3sets.SidecarSet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockSidecarSetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockSidecarSet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockSidecarSet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockSidecarSetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockSidecarSet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockSidecarSet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockSidecarSetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockSidecarSet)(nil).Length)) +} + +// List mocks base method. +func (m *MockSidecarSet) List(filterResource ...func(*v1alpha3.Sidecar) bool) []*v1alpha3.Sidecar { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1alpha3.Sidecar) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockSidecarSetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockSidecarSet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockSidecarSet) Map() map[string]*v1alpha3.Sidecar { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1alpha3.Sidecar) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockSidecarSetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockSidecarSet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockSidecarSet) Union(set v1alpha3sets.SidecarSet) v1alpha3sets.SidecarSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1alpha3sets.SidecarSet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockSidecarSetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockSidecarSet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockSidecarSet) UnsortedList(filterResource ...func(*v1alpha3.Sidecar) bool) []*v1alpha3.Sidecar { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1alpha3.Sidecar) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockSidecarSetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockSidecarSet)(nil).UnsortedList), filterResource...) +} + // MockEnvoyFilterSet is a mock of EnvoyFilterSet interface. type MockEnvoyFilterSet struct { ctrl *gomock.Controller diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/sets/sets.go b/pkg/api/istio/networking.istio.io/v1alpha3/sets/sets.go index ca75601..58393e7 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/sets/sets.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/sets/sets.go @@ -13,6 +13,1567 @@ import ( "k8s.io/apimachinery/pkg/util/sets" ) +type DestinationRuleSet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.DestinationRule) bool) []*networking_istio_io_v1alpha3.DestinationRule + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.DestinationRule) bool) []*networking_istio_io_v1alpha3.DestinationRule + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.DestinationRule + // Insert a resource into the set. + Insert(destinationRule ...*networking_istio_io_v1alpha3.DestinationRule) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(destinationRuleSet DestinationRuleSet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(destinationRule ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(destinationRule ezkube.ResourceId) + // Return the union with the provided set + Union(set DestinationRuleSet) DestinationRuleSet + // Return the difference with the provided set + Difference(set DestinationRuleSet) DestinationRuleSet + // Return the intersection with the provided set + Intersection(set DestinationRuleSet) DestinationRuleSet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.DestinationRule, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another DestinationRuleSet + Delta(newSet DestinationRuleSet) sksets.ResourceDelta + // Create a deep copy of the current DestinationRuleSet + Clone() DestinationRuleSet +} + +func makeGenericDestinationRuleSet(destinationRuleList []*networking_istio_io_v1alpha3.DestinationRule) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range destinationRuleList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type destinationRuleSet struct { + set sksets.ResourceSet +} + +func NewDestinationRuleSet(destinationRuleList ...*networking_istio_io_v1alpha3.DestinationRule) DestinationRuleSet { + return &destinationRuleSet{set: makeGenericDestinationRuleSet(destinationRuleList)} +} + +func NewDestinationRuleSetFromList(destinationRuleList *networking_istio_io_v1alpha3.DestinationRuleList) DestinationRuleSet { + list := make([]*networking_istio_io_v1alpha3.DestinationRule, 0, len(destinationRuleList.Items)) + for idx := range destinationRuleList.Items { + list = append(list, destinationRuleList.Items[idx]) + } + return &destinationRuleSet{set: makeGenericDestinationRuleSet(list)} +} + +func (s *destinationRuleSet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *destinationRuleSet) List(filterResource ...func(*networking_istio_io_v1alpha3.DestinationRule) bool) []*networking_istio_io_v1alpha3.DestinationRule { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.DestinationRule)) + }) + } + + objs := s.Generic().List(genericFilters...) + destinationRuleList := make([]*networking_istio_io_v1alpha3.DestinationRule, 0, len(objs)) + for _, obj := range objs { + destinationRuleList = append(destinationRuleList, obj.(*networking_istio_io_v1alpha3.DestinationRule)) + } + return destinationRuleList +} + +func (s *destinationRuleSet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.DestinationRule) bool) []*networking_istio_io_v1alpha3.DestinationRule { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.DestinationRule)) + }) + } + + var destinationRuleList []*networking_istio_io_v1alpha3.DestinationRule + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + destinationRuleList = append(destinationRuleList, obj.(*networking_istio_io_v1alpha3.DestinationRule)) + } + return destinationRuleList +} + +func (s *destinationRuleSet) Map() map[string]*networking_istio_io_v1alpha3.DestinationRule { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.DestinationRule{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.DestinationRule) + } + return newMap +} + +func (s *destinationRuleSet) Insert( + destinationRuleList ...*networking_istio_io_v1alpha3.DestinationRule, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range destinationRuleList { + s.Generic().Insert(obj) + } +} + +func (s *destinationRuleSet) Has(destinationRule ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(destinationRule) +} + +func (s *destinationRuleSet) Equal( + destinationRuleSet DestinationRuleSet, +) bool { + if s == nil { + return destinationRuleSet == nil + } + return s.Generic().Equal(destinationRuleSet.Generic()) +} + +func (s *destinationRuleSet) Delete(DestinationRule ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(DestinationRule) +} + +func (s *destinationRuleSet) Union(set DestinationRuleSet) DestinationRuleSet { + if s == nil { + return set + } + return NewDestinationRuleSet(append(s.List(), set.List()...)...) +} + +func (s *destinationRuleSet) Difference(set DestinationRuleSet) DestinationRuleSet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &destinationRuleSet{set: newSet} +} + +func (s *destinationRuleSet) Intersection(set DestinationRuleSet) DestinationRuleSet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var destinationRuleList []*networking_istio_io_v1alpha3.DestinationRule + for _, obj := range newSet.List() { + destinationRuleList = append(destinationRuleList, obj.(*networking_istio_io_v1alpha3.DestinationRule)) + } + return NewDestinationRuleSet(destinationRuleList...) +} + +func (s *destinationRuleSet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.DestinationRule, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find DestinationRule %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.DestinationRule{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.DestinationRule), nil +} + +func (s *destinationRuleSet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *destinationRuleSet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *destinationRuleSet) Delta(newSet DestinationRuleSet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *destinationRuleSet) Clone() DestinationRuleSet { + if s == nil { + return nil + } + return &destinationRuleSet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type GatewaySet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.Gateway) bool) []*networking_istio_io_v1alpha3.Gateway + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.Gateway) bool) []*networking_istio_io_v1alpha3.Gateway + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.Gateway + // Insert a resource into the set. + Insert(gateway ...*networking_istio_io_v1alpha3.Gateway) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(gatewaySet GatewaySet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(gateway ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(gateway ezkube.ResourceId) + // Return the union with the provided set + Union(set GatewaySet) GatewaySet + // Return the difference with the provided set + Difference(set GatewaySet) GatewaySet + // Return the intersection with the provided set + Intersection(set GatewaySet) GatewaySet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.Gateway, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another GatewaySet + Delta(newSet GatewaySet) sksets.ResourceDelta + // Create a deep copy of the current GatewaySet + Clone() GatewaySet +} + +func makeGenericGatewaySet(gatewayList []*networking_istio_io_v1alpha3.Gateway) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range gatewayList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type gatewaySet struct { + set sksets.ResourceSet +} + +func NewGatewaySet(gatewayList ...*networking_istio_io_v1alpha3.Gateway) GatewaySet { + return &gatewaySet{set: makeGenericGatewaySet(gatewayList)} +} + +func NewGatewaySetFromList(gatewayList *networking_istio_io_v1alpha3.GatewayList) GatewaySet { + list := make([]*networking_istio_io_v1alpha3.Gateway, 0, len(gatewayList.Items)) + for idx := range gatewayList.Items { + list = append(list, gatewayList.Items[idx]) + } + return &gatewaySet{set: makeGenericGatewaySet(list)} +} + +func (s *gatewaySet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *gatewaySet) List(filterResource ...func(*networking_istio_io_v1alpha3.Gateway) bool) []*networking_istio_io_v1alpha3.Gateway { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.Gateway)) + }) + } + + objs := s.Generic().List(genericFilters...) + gatewayList := make([]*networking_istio_io_v1alpha3.Gateway, 0, len(objs)) + for _, obj := range objs { + gatewayList = append(gatewayList, obj.(*networking_istio_io_v1alpha3.Gateway)) + } + return gatewayList +} + +func (s *gatewaySet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.Gateway) bool) []*networking_istio_io_v1alpha3.Gateway { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.Gateway)) + }) + } + + var gatewayList []*networking_istio_io_v1alpha3.Gateway + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + gatewayList = append(gatewayList, obj.(*networking_istio_io_v1alpha3.Gateway)) + } + return gatewayList +} + +func (s *gatewaySet) Map() map[string]*networking_istio_io_v1alpha3.Gateway { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.Gateway{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.Gateway) + } + return newMap +} + +func (s *gatewaySet) Insert( + gatewayList ...*networking_istio_io_v1alpha3.Gateway, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range gatewayList { + s.Generic().Insert(obj) + } +} + +func (s *gatewaySet) Has(gateway ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(gateway) +} + +func (s *gatewaySet) Equal( + gatewaySet GatewaySet, +) bool { + if s == nil { + return gatewaySet == nil + } + return s.Generic().Equal(gatewaySet.Generic()) +} + +func (s *gatewaySet) Delete(Gateway ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(Gateway) +} + +func (s *gatewaySet) Union(set GatewaySet) GatewaySet { + if s == nil { + return set + } + return NewGatewaySet(append(s.List(), set.List()...)...) +} + +func (s *gatewaySet) Difference(set GatewaySet) GatewaySet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &gatewaySet{set: newSet} +} + +func (s *gatewaySet) Intersection(set GatewaySet) GatewaySet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var gatewayList []*networking_istio_io_v1alpha3.Gateway + for _, obj := range newSet.List() { + gatewayList = append(gatewayList, obj.(*networking_istio_io_v1alpha3.Gateway)) + } + return NewGatewaySet(gatewayList...) +} + +func (s *gatewaySet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.Gateway, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find Gateway %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.Gateway{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.Gateway), nil +} + +func (s *gatewaySet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *gatewaySet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *gatewaySet) Delta(newSet GatewaySet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *gatewaySet) Clone() GatewaySet { + if s == nil { + return nil + } + return &gatewaySet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type ServiceEntrySet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.ServiceEntry) bool) []*networking_istio_io_v1alpha3.ServiceEntry + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.ServiceEntry) bool) []*networking_istio_io_v1alpha3.ServiceEntry + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.ServiceEntry + // Insert a resource into the set. + Insert(serviceEntry ...*networking_istio_io_v1alpha3.ServiceEntry) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(serviceEntrySet ServiceEntrySet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(serviceEntry ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(serviceEntry ezkube.ResourceId) + // Return the union with the provided set + Union(set ServiceEntrySet) ServiceEntrySet + // Return the difference with the provided set + Difference(set ServiceEntrySet) ServiceEntrySet + // Return the intersection with the provided set + Intersection(set ServiceEntrySet) ServiceEntrySet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.ServiceEntry, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another ServiceEntrySet + Delta(newSet ServiceEntrySet) sksets.ResourceDelta + // Create a deep copy of the current ServiceEntrySet + Clone() ServiceEntrySet +} + +func makeGenericServiceEntrySet(serviceEntryList []*networking_istio_io_v1alpha3.ServiceEntry) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range serviceEntryList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type serviceEntrySet struct { + set sksets.ResourceSet +} + +func NewServiceEntrySet(serviceEntryList ...*networking_istio_io_v1alpha3.ServiceEntry) ServiceEntrySet { + return &serviceEntrySet{set: makeGenericServiceEntrySet(serviceEntryList)} +} + +func NewServiceEntrySetFromList(serviceEntryList *networking_istio_io_v1alpha3.ServiceEntryList) ServiceEntrySet { + list := make([]*networking_istio_io_v1alpha3.ServiceEntry, 0, len(serviceEntryList.Items)) + for idx := range serviceEntryList.Items { + list = append(list, serviceEntryList.Items[idx]) + } + return &serviceEntrySet{set: makeGenericServiceEntrySet(list)} +} + +func (s *serviceEntrySet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *serviceEntrySet) List(filterResource ...func(*networking_istio_io_v1alpha3.ServiceEntry) bool) []*networking_istio_io_v1alpha3.ServiceEntry { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.ServiceEntry)) + }) + } + + objs := s.Generic().List(genericFilters...) + serviceEntryList := make([]*networking_istio_io_v1alpha3.ServiceEntry, 0, len(objs)) + for _, obj := range objs { + serviceEntryList = append(serviceEntryList, obj.(*networking_istio_io_v1alpha3.ServiceEntry)) + } + return serviceEntryList +} + +func (s *serviceEntrySet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.ServiceEntry) bool) []*networking_istio_io_v1alpha3.ServiceEntry { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.ServiceEntry)) + }) + } + + var serviceEntryList []*networking_istio_io_v1alpha3.ServiceEntry + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + serviceEntryList = append(serviceEntryList, obj.(*networking_istio_io_v1alpha3.ServiceEntry)) + } + return serviceEntryList +} + +func (s *serviceEntrySet) Map() map[string]*networking_istio_io_v1alpha3.ServiceEntry { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.ServiceEntry{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.ServiceEntry) + } + return newMap +} + +func (s *serviceEntrySet) Insert( + serviceEntryList ...*networking_istio_io_v1alpha3.ServiceEntry, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range serviceEntryList { + s.Generic().Insert(obj) + } +} + +func (s *serviceEntrySet) Has(serviceEntry ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(serviceEntry) +} + +func (s *serviceEntrySet) Equal( + serviceEntrySet ServiceEntrySet, +) bool { + if s == nil { + return serviceEntrySet == nil + } + return s.Generic().Equal(serviceEntrySet.Generic()) +} + +func (s *serviceEntrySet) Delete(ServiceEntry ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(ServiceEntry) +} + +func (s *serviceEntrySet) Union(set ServiceEntrySet) ServiceEntrySet { + if s == nil { + return set + } + return NewServiceEntrySet(append(s.List(), set.List()...)...) +} + +func (s *serviceEntrySet) Difference(set ServiceEntrySet) ServiceEntrySet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &serviceEntrySet{set: newSet} +} + +func (s *serviceEntrySet) Intersection(set ServiceEntrySet) ServiceEntrySet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var serviceEntryList []*networking_istio_io_v1alpha3.ServiceEntry + for _, obj := range newSet.List() { + serviceEntryList = append(serviceEntryList, obj.(*networking_istio_io_v1alpha3.ServiceEntry)) + } + return NewServiceEntrySet(serviceEntryList...) +} + +func (s *serviceEntrySet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.ServiceEntry, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find ServiceEntry %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.ServiceEntry{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.ServiceEntry), nil +} + +func (s *serviceEntrySet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *serviceEntrySet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *serviceEntrySet) Delta(newSet ServiceEntrySet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *serviceEntrySet) Clone() ServiceEntrySet { + if s == nil { + return nil + } + return &serviceEntrySet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type WorkloadEntrySet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadEntry) bool) []*networking_istio_io_v1alpha3.WorkloadEntry + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadEntry) bool) []*networking_istio_io_v1alpha3.WorkloadEntry + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.WorkloadEntry + // Insert a resource into the set. + Insert(workloadEntry ...*networking_istio_io_v1alpha3.WorkloadEntry) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(workloadEntrySet WorkloadEntrySet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(workloadEntry ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(workloadEntry ezkube.ResourceId) + // Return the union with the provided set + Union(set WorkloadEntrySet) WorkloadEntrySet + // Return the difference with the provided set + Difference(set WorkloadEntrySet) WorkloadEntrySet + // Return the intersection with the provided set + Intersection(set WorkloadEntrySet) WorkloadEntrySet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.WorkloadEntry, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another WorkloadEntrySet + Delta(newSet WorkloadEntrySet) sksets.ResourceDelta + // Create a deep copy of the current WorkloadEntrySet + Clone() WorkloadEntrySet +} + +func makeGenericWorkloadEntrySet(workloadEntryList []*networking_istio_io_v1alpha3.WorkloadEntry) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range workloadEntryList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type workloadEntrySet struct { + set sksets.ResourceSet +} + +func NewWorkloadEntrySet(workloadEntryList ...*networking_istio_io_v1alpha3.WorkloadEntry) WorkloadEntrySet { + return &workloadEntrySet{set: makeGenericWorkloadEntrySet(workloadEntryList)} +} + +func NewWorkloadEntrySetFromList(workloadEntryList *networking_istio_io_v1alpha3.WorkloadEntryList) WorkloadEntrySet { + list := make([]*networking_istio_io_v1alpha3.WorkloadEntry, 0, len(workloadEntryList.Items)) + for idx := range workloadEntryList.Items { + list = append(list, workloadEntryList.Items[idx]) + } + return &workloadEntrySet{set: makeGenericWorkloadEntrySet(list)} +} + +func (s *workloadEntrySet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *workloadEntrySet) List(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadEntry) bool) []*networking_istio_io_v1alpha3.WorkloadEntry { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.WorkloadEntry)) + }) + } + + objs := s.Generic().List(genericFilters...) + workloadEntryList := make([]*networking_istio_io_v1alpha3.WorkloadEntry, 0, len(objs)) + for _, obj := range objs { + workloadEntryList = append(workloadEntryList, obj.(*networking_istio_io_v1alpha3.WorkloadEntry)) + } + return workloadEntryList +} + +func (s *workloadEntrySet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadEntry) bool) []*networking_istio_io_v1alpha3.WorkloadEntry { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.WorkloadEntry)) + }) + } + + var workloadEntryList []*networking_istio_io_v1alpha3.WorkloadEntry + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + workloadEntryList = append(workloadEntryList, obj.(*networking_istio_io_v1alpha3.WorkloadEntry)) + } + return workloadEntryList +} + +func (s *workloadEntrySet) Map() map[string]*networking_istio_io_v1alpha3.WorkloadEntry { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.WorkloadEntry{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.WorkloadEntry) + } + return newMap +} + +func (s *workloadEntrySet) Insert( + workloadEntryList ...*networking_istio_io_v1alpha3.WorkloadEntry, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range workloadEntryList { + s.Generic().Insert(obj) + } +} + +func (s *workloadEntrySet) Has(workloadEntry ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(workloadEntry) +} + +func (s *workloadEntrySet) Equal( + workloadEntrySet WorkloadEntrySet, +) bool { + if s == nil { + return workloadEntrySet == nil + } + return s.Generic().Equal(workloadEntrySet.Generic()) +} + +func (s *workloadEntrySet) Delete(WorkloadEntry ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(WorkloadEntry) +} + +func (s *workloadEntrySet) Union(set WorkloadEntrySet) WorkloadEntrySet { + if s == nil { + return set + } + return NewWorkloadEntrySet(append(s.List(), set.List()...)...) +} + +func (s *workloadEntrySet) Difference(set WorkloadEntrySet) WorkloadEntrySet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &workloadEntrySet{set: newSet} +} + +func (s *workloadEntrySet) Intersection(set WorkloadEntrySet) WorkloadEntrySet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var workloadEntryList []*networking_istio_io_v1alpha3.WorkloadEntry + for _, obj := range newSet.List() { + workloadEntryList = append(workloadEntryList, obj.(*networking_istio_io_v1alpha3.WorkloadEntry)) + } + return NewWorkloadEntrySet(workloadEntryList...) +} + +func (s *workloadEntrySet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.WorkloadEntry, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find WorkloadEntry %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.WorkloadEntry{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.WorkloadEntry), nil +} + +func (s *workloadEntrySet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *workloadEntrySet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *workloadEntrySet) Delta(newSet WorkloadEntrySet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *workloadEntrySet) Clone() WorkloadEntrySet { + if s == nil { + return nil + } + return &workloadEntrySet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type WorkloadGroupSet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadGroup) bool) []*networking_istio_io_v1alpha3.WorkloadGroup + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadGroup) bool) []*networking_istio_io_v1alpha3.WorkloadGroup + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.WorkloadGroup + // Insert a resource into the set. + Insert(workloadGroup ...*networking_istio_io_v1alpha3.WorkloadGroup) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(workloadGroupSet WorkloadGroupSet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(workloadGroup ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(workloadGroup ezkube.ResourceId) + // Return the union with the provided set + Union(set WorkloadGroupSet) WorkloadGroupSet + // Return the difference with the provided set + Difference(set WorkloadGroupSet) WorkloadGroupSet + // Return the intersection with the provided set + Intersection(set WorkloadGroupSet) WorkloadGroupSet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.WorkloadGroup, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another WorkloadGroupSet + Delta(newSet WorkloadGroupSet) sksets.ResourceDelta + // Create a deep copy of the current WorkloadGroupSet + Clone() WorkloadGroupSet +} + +func makeGenericWorkloadGroupSet(workloadGroupList []*networking_istio_io_v1alpha3.WorkloadGroup) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range workloadGroupList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type workloadGroupSet struct { + set sksets.ResourceSet +} + +func NewWorkloadGroupSet(workloadGroupList ...*networking_istio_io_v1alpha3.WorkloadGroup) WorkloadGroupSet { + return &workloadGroupSet{set: makeGenericWorkloadGroupSet(workloadGroupList)} +} + +func NewWorkloadGroupSetFromList(workloadGroupList *networking_istio_io_v1alpha3.WorkloadGroupList) WorkloadGroupSet { + list := make([]*networking_istio_io_v1alpha3.WorkloadGroup, 0, len(workloadGroupList.Items)) + for idx := range workloadGroupList.Items { + list = append(list, workloadGroupList.Items[idx]) + } + return &workloadGroupSet{set: makeGenericWorkloadGroupSet(list)} +} + +func (s *workloadGroupSet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *workloadGroupSet) List(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadGroup) bool) []*networking_istio_io_v1alpha3.WorkloadGroup { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.WorkloadGroup)) + }) + } + + objs := s.Generic().List(genericFilters...) + workloadGroupList := make([]*networking_istio_io_v1alpha3.WorkloadGroup, 0, len(objs)) + for _, obj := range objs { + workloadGroupList = append(workloadGroupList, obj.(*networking_istio_io_v1alpha3.WorkloadGroup)) + } + return workloadGroupList +} + +func (s *workloadGroupSet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.WorkloadGroup) bool) []*networking_istio_io_v1alpha3.WorkloadGroup { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.WorkloadGroup)) + }) + } + + var workloadGroupList []*networking_istio_io_v1alpha3.WorkloadGroup + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + workloadGroupList = append(workloadGroupList, obj.(*networking_istio_io_v1alpha3.WorkloadGroup)) + } + return workloadGroupList +} + +func (s *workloadGroupSet) Map() map[string]*networking_istio_io_v1alpha3.WorkloadGroup { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.WorkloadGroup{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.WorkloadGroup) + } + return newMap +} + +func (s *workloadGroupSet) Insert( + workloadGroupList ...*networking_istio_io_v1alpha3.WorkloadGroup, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range workloadGroupList { + s.Generic().Insert(obj) + } +} + +func (s *workloadGroupSet) Has(workloadGroup ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(workloadGroup) +} + +func (s *workloadGroupSet) Equal( + workloadGroupSet WorkloadGroupSet, +) bool { + if s == nil { + return workloadGroupSet == nil + } + return s.Generic().Equal(workloadGroupSet.Generic()) +} + +func (s *workloadGroupSet) Delete(WorkloadGroup ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(WorkloadGroup) +} + +func (s *workloadGroupSet) Union(set WorkloadGroupSet) WorkloadGroupSet { + if s == nil { + return set + } + return NewWorkloadGroupSet(append(s.List(), set.List()...)...) +} + +func (s *workloadGroupSet) Difference(set WorkloadGroupSet) WorkloadGroupSet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &workloadGroupSet{set: newSet} +} + +func (s *workloadGroupSet) Intersection(set WorkloadGroupSet) WorkloadGroupSet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var workloadGroupList []*networking_istio_io_v1alpha3.WorkloadGroup + for _, obj := range newSet.List() { + workloadGroupList = append(workloadGroupList, obj.(*networking_istio_io_v1alpha3.WorkloadGroup)) + } + return NewWorkloadGroupSet(workloadGroupList...) +} + +func (s *workloadGroupSet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.WorkloadGroup, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find WorkloadGroup %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.WorkloadGroup{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.WorkloadGroup), nil +} + +func (s *workloadGroupSet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *workloadGroupSet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *workloadGroupSet) Delta(newSet WorkloadGroupSet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *workloadGroupSet) Clone() WorkloadGroupSet { + if s == nil { + return nil + } + return &workloadGroupSet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type VirtualServiceSet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.VirtualService) bool) []*networking_istio_io_v1alpha3.VirtualService + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.VirtualService) bool) []*networking_istio_io_v1alpha3.VirtualService + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.VirtualService + // Insert a resource into the set. + Insert(virtualService ...*networking_istio_io_v1alpha3.VirtualService) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(virtualServiceSet VirtualServiceSet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(virtualService ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(virtualService ezkube.ResourceId) + // Return the union with the provided set + Union(set VirtualServiceSet) VirtualServiceSet + // Return the difference with the provided set + Difference(set VirtualServiceSet) VirtualServiceSet + // Return the intersection with the provided set + Intersection(set VirtualServiceSet) VirtualServiceSet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.VirtualService, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another VirtualServiceSet + Delta(newSet VirtualServiceSet) sksets.ResourceDelta + // Create a deep copy of the current VirtualServiceSet + Clone() VirtualServiceSet +} + +func makeGenericVirtualServiceSet(virtualServiceList []*networking_istio_io_v1alpha3.VirtualService) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range virtualServiceList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type virtualServiceSet struct { + set sksets.ResourceSet +} + +func NewVirtualServiceSet(virtualServiceList ...*networking_istio_io_v1alpha3.VirtualService) VirtualServiceSet { + return &virtualServiceSet{set: makeGenericVirtualServiceSet(virtualServiceList)} +} + +func NewVirtualServiceSetFromList(virtualServiceList *networking_istio_io_v1alpha3.VirtualServiceList) VirtualServiceSet { + list := make([]*networking_istio_io_v1alpha3.VirtualService, 0, len(virtualServiceList.Items)) + for idx := range virtualServiceList.Items { + list = append(list, virtualServiceList.Items[idx]) + } + return &virtualServiceSet{set: makeGenericVirtualServiceSet(list)} +} + +func (s *virtualServiceSet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *virtualServiceSet) List(filterResource ...func(*networking_istio_io_v1alpha3.VirtualService) bool) []*networking_istio_io_v1alpha3.VirtualService { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.VirtualService)) + }) + } + + objs := s.Generic().List(genericFilters...) + virtualServiceList := make([]*networking_istio_io_v1alpha3.VirtualService, 0, len(objs)) + for _, obj := range objs { + virtualServiceList = append(virtualServiceList, obj.(*networking_istio_io_v1alpha3.VirtualService)) + } + return virtualServiceList +} + +func (s *virtualServiceSet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.VirtualService) bool) []*networking_istio_io_v1alpha3.VirtualService { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.VirtualService)) + }) + } + + var virtualServiceList []*networking_istio_io_v1alpha3.VirtualService + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + virtualServiceList = append(virtualServiceList, obj.(*networking_istio_io_v1alpha3.VirtualService)) + } + return virtualServiceList +} + +func (s *virtualServiceSet) Map() map[string]*networking_istio_io_v1alpha3.VirtualService { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.VirtualService{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.VirtualService) + } + return newMap +} + +func (s *virtualServiceSet) Insert( + virtualServiceList ...*networking_istio_io_v1alpha3.VirtualService, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range virtualServiceList { + s.Generic().Insert(obj) + } +} + +func (s *virtualServiceSet) Has(virtualService ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(virtualService) +} + +func (s *virtualServiceSet) Equal( + virtualServiceSet VirtualServiceSet, +) bool { + if s == nil { + return virtualServiceSet == nil + } + return s.Generic().Equal(virtualServiceSet.Generic()) +} + +func (s *virtualServiceSet) Delete(VirtualService ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(VirtualService) +} + +func (s *virtualServiceSet) Union(set VirtualServiceSet) VirtualServiceSet { + if s == nil { + return set + } + return NewVirtualServiceSet(append(s.List(), set.List()...)...) +} + +func (s *virtualServiceSet) Difference(set VirtualServiceSet) VirtualServiceSet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &virtualServiceSet{set: newSet} +} + +func (s *virtualServiceSet) Intersection(set VirtualServiceSet) VirtualServiceSet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var virtualServiceList []*networking_istio_io_v1alpha3.VirtualService + for _, obj := range newSet.List() { + virtualServiceList = append(virtualServiceList, obj.(*networking_istio_io_v1alpha3.VirtualService)) + } + return NewVirtualServiceSet(virtualServiceList...) +} + +func (s *virtualServiceSet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.VirtualService, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find VirtualService %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.VirtualService{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.VirtualService), nil +} + +func (s *virtualServiceSet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *virtualServiceSet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *virtualServiceSet) Delta(newSet VirtualServiceSet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *virtualServiceSet) Clone() VirtualServiceSet { + if s == nil { + return nil + } + return &virtualServiceSet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type SidecarSet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*networking_istio_io_v1alpha3.Sidecar) bool) []*networking_istio_io_v1alpha3.Sidecar + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.Sidecar) bool) []*networking_istio_io_v1alpha3.Sidecar + // Return the Set as a map of key to resource. + Map() map[string]*networking_istio_io_v1alpha3.Sidecar + // Insert a resource into the set. + Insert(sidecar ...*networking_istio_io_v1alpha3.Sidecar) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(sidecarSet SidecarSet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(sidecar ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(sidecar ezkube.ResourceId) + // Return the union with the provided set + Union(set SidecarSet) SidecarSet + // Return the difference with the provided set + Difference(set SidecarSet) SidecarSet + // Return the intersection with the provided set + Intersection(set SidecarSet) SidecarSet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.Sidecar, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another SidecarSet + Delta(newSet SidecarSet) sksets.ResourceDelta + // Create a deep copy of the current SidecarSet + Clone() SidecarSet +} + +func makeGenericSidecarSet(sidecarList []*networking_istio_io_v1alpha3.Sidecar) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range sidecarList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type sidecarSet struct { + set sksets.ResourceSet +} + +func NewSidecarSet(sidecarList ...*networking_istio_io_v1alpha3.Sidecar) SidecarSet { + return &sidecarSet{set: makeGenericSidecarSet(sidecarList)} +} + +func NewSidecarSetFromList(sidecarList *networking_istio_io_v1alpha3.SidecarList) SidecarSet { + list := make([]*networking_istio_io_v1alpha3.Sidecar, 0, len(sidecarList.Items)) + for idx := range sidecarList.Items { + list = append(list, sidecarList.Items[idx]) + } + return &sidecarSet{set: makeGenericSidecarSet(list)} +} + +func (s *sidecarSet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *sidecarSet) List(filterResource ...func(*networking_istio_io_v1alpha3.Sidecar) bool) []*networking_istio_io_v1alpha3.Sidecar { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.Sidecar)) + }) + } + + objs := s.Generic().List(genericFilters...) + sidecarList := make([]*networking_istio_io_v1alpha3.Sidecar, 0, len(objs)) + for _, obj := range objs { + sidecarList = append(sidecarList, obj.(*networking_istio_io_v1alpha3.Sidecar)) + } + return sidecarList +} + +func (s *sidecarSet) UnsortedList(filterResource ...func(*networking_istio_io_v1alpha3.Sidecar) bool) []*networking_istio_io_v1alpha3.Sidecar { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*networking_istio_io_v1alpha3.Sidecar)) + }) + } + + var sidecarList []*networking_istio_io_v1alpha3.Sidecar + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + sidecarList = append(sidecarList, obj.(*networking_istio_io_v1alpha3.Sidecar)) + } + return sidecarList +} + +func (s *sidecarSet) Map() map[string]*networking_istio_io_v1alpha3.Sidecar { + if s == nil { + return nil + } + + newMap := map[string]*networking_istio_io_v1alpha3.Sidecar{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*networking_istio_io_v1alpha3.Sidecar) + } + return newMap +} + +func (s *sidecarSet) Insert( + sidecarList ...*networking_istio_io_v1alpha3.Sidecar, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range sidecarList { + s.Generic().Insert(obj) + } +} + +func (s *sidecarSet) Has(sidecar ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(sidecar) +} + +func (s *sidecarSet) Equal( + sidecarSet SidecarSet, +) bool { + if s == nil { + return sidecarSet == nil + } + return s.Generic().Equal(sidecarSet.Generic()) +} + +func (s *sidecarSet) Delete(Sidecar ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(Sidecar) +} + +func (s *sidecarSet) Union(set SidecarSet) SidecarSet { + if s == nil { + return set + } + return NewSidecarSet(append(s.List(), set.List()...)...) +} + +func (s *sidecarSet) Difference(set SidecarSet) SidecarSet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &sidecarSet{set: newSet} +} + +func (s *sidecarSet) Intersection(set SidecarSet) SidecarSet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var sidecarList []*networking_istio_io_v1alpha3.Sidecar + for _, obj := range newSet.List() { + sidecarList = append(sidecarList, obj.(*networking_istio_io_v1alpha3.Sidecar)) + } + return NewSidecarSet(sidecarList...) +} + +func (s *sidecarSet) Find(id ezkube.ResourceId) (*networking_istio_io_v1alpha3.Sidecar, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find Sidecar %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&networking_istio_io_v1alpha3.Sidecar{}, id) + if err != nil { + return nil, err + } + + return obj.(*networking_istio_io_v1alpha3.Sidecar), nil +} + +func (s *sidecarSet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *sidecarSet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *sidecarSet) Delta(newSet SidecarSet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *sidecarSet) Clone() SidecarSet { + if s == nil { + return nil + } + return &sidecarSet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + type EnvoyFilterSet interface { // Get the set stored keys Keys() sets.String diff --git a/pkg/api/istio/networking.istio.io/v1alpha3/type_helpers.go b/pkg/api/istio/networking.istio.io/v1alpha3/type_helpers.go index 5744187..16352fc 100644 --- a/pkg/api/istio/networking.istio.io/v1alpha3/type_helpers.go +++ b/pkg/api/istio/networking.istio.io/v1alpha3/type_helpers.go @@ -7,5 +7,26 @@ import ( . "istio.io/client-go/pkg/apis/networking/v1alpha3" ) +// DestinationRuleSlice represents a slice of *DestinationRule +type DestinationRuleSlice []*DestinationRule + +// GatewaySlice represents a slice of *Gateway +type GatewaySlice []*Gateway + +// ServiceEntrySlice represents a slice of *ServiceEntry +type ServiceEntrySlice []*ServiceEntry + +// WorkloadEntrySlice represents a slice of *WorkloadEntry +type WorkloadEntrySlice []*WorkloadEntry + +// WorkloadGroupSlice represents a slice of *WorkloadGroup +type WorkloadGroupSlice []*WorkloadGroup + +// VirtualServiceSlice represents a slice of *VirtualService +type VirtualServiceSlice []*VirtualService + +// SidecarSlice represents a slice of *Sidecar +type SidecarSlice []*Sidecar + // EnvoyFilterSlice represents a slice of *EnvoyFilter type EnvoyFilterSlice []*EnvoyFilter diff --git a/pkg/api/istio/security.istio.io/v1/clients.go b/pkg/api/istio/security.istio.io/v1/clients.go new file mode 100644 index 0000000..663845f --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/clients.go @@ -0,0 +1,512 @@ +// Code generated by skv2. DO NOT EDIT. + +//go:generate mockgen -source ./clients.go -destination mocks/clients.go + +package v1 + +import ( + "context" + + "github.com/solo-io/skv2/pkg/controllerutils" + "github.com/solo-io/skv2/pkg/multicluster" + security_istio_io_v1 "istio.io/client-go/pkg/apis/security/v1beta1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// MulticlusterClientset for the security.istio.io/v1 APIs +type MulticlusterClientset interface { + // Cluster returns a Clientset for the given cluster + Cluster(cluster string) (Clientset, error) +} + +type multiclusterClientset struct { + client multicluster.Client +} + +func NewMulticlusterClientset(client multicluster.Client) MulticlusterClientset { + return &multiclusterClientset{client: client} +} + +func (m *multiclusterClientset) Cluster(cluster string) (Clientset, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewClientset(client), nil +} + +// clienset for the security.istio.io/v1 APIs +type Clientset interface { + // clienset for the security.istio.io/v1/v1 APIs + AuthorizationPolicies() AuthorizationPolicyClient + // clienset for the security.istio.io/v1/v1 APIs + PeerAuthentications() PeerAuthenticationClient + // clienset for the security.istio.io/v1/v1 APIs + RequestAuthentications() RequestAuthenticationClient +} + +type clientSet struct { + client client.Client +} + +func NewClientsetFromConfig(cfg *rest.Config) (Clientset, error) { + scheme := scheme.Scheme + if err := security_istio_io_v1.SchemeBuilder.AddToScheme(scheme); err != nil { + return nil, err + } + client, err := client.New(cfg, client.Options{ + Scheme: scheme, + }) + if err != nil { + return nil, err + } + return NewClientset(client), nil +} + +func NewClientset(client client.Client) Clientset { + return &clientSet{client: client} +} + +// clienset for the security.istio.io/v1/v1 APIs +func (c *clientSet) AuthorizationPolicies() AuthorizationPolicyClient { + return NewAuthorizationPolicyClient(c.client) +} + +// clienset for the security.istio.io/v1/v1 APIs +func (c *clientSet) PeerAuthentications() PeerAuthenticationClient { + return NewPeerAuthenticationClient(c.client) +} + +// clienset for the security.istio.io/v1/v1 APIs +func (c *clientSet) RequestAuthentications() RequestAuthenticationClient { + return NewRequestAuthenticationClient(c.client) +} + +// Reader knows how to read and list AuthorizationPolicys. +type AuthorizationPolicyReader interface { + // Get retrieves a AuthorizationPolicy for the given object key + GetAuthorizationPolicy(ctx context.Context, key client.ObjectKey) (*security_istio_io_v1.AuthorizationPolicy, error) + + // List retrieves list of AuthorizationPolicys for a given namespace and list options. + ListAuthorizationPolicy(ctx context.Context, opts ...client.ListOption) (*security_istio_io_v1.AuthorizationPolicyList, error) +} + +// AuthorizationPolicyTransitionFunction instructs the AuthorizationPolicyWriter how to transition between an existing +// AuthorizationPolicy object and a desired on an Upsert +type AuthorizationPolicyTransitionFunction func(existing, desired *security_istio_io_v1.AuthorizationPolicy) error + +// Writer knows how to create, delete, and update AuthorizationPolicys. +type AuthorizationPolicyWriter interface { + // Create saves the AuthorizationPolicy object. + CreateAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, opts ...client.CreateOption) error + + // Delete deletes the AuthorizationPolicy object. + DeleteAuthorizationPolicy(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given AuthorizationPolicy object. + UpdateAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, opts ...client.UpdateOption) error + + // Patch patches the given AuthorizationPolicy object. + PatchAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all AuthorizationPolicy objects matching the given options. + DeleteAllOfAuthorizationPolicy(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the AuthorizationPolicy object. + UpsertAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, transitionFuncs ...AuthorizationPolicyTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a AuthorizationPolicy object. +type AuthorizationPolicyStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given AuthorizationPolicy object. + UpdateAuthorizationPolicyStatus(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given AuthorizationPolicy object's subresource. + PatchAuthorizationPolicyStatus(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on AuthorizationPolicys. +type AuthorizationPolicyClient interface { + AuthorizationPolicyReader + AuthorizationPolicyWriter + AuthorizationPolicyStatusWriter +} + +type authorizationPolicyClient struct { + client client.Client +} + +func NewAuthorizationPolicyClient(client client.Client) *authorizationPolicyClient { + return &authorizationPolicyClient{client: client} +} + +func (c *authorizationPolicyClient) GetAuthorizationPolicy(ctx context.Context, key client.ObjectKey) (*security_istio_io_v1.AuthorizationPolicy, error) { + obj := &security_istio_io_v1.AuthorizationPolicy{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *authorizationPolicyClient) ListAuthorizationPolicy(ctx context.Context, opts ...client.ListOption) (*security_istio_io_v1.AuthorizationPolicyList, error) { + list := &security_istio_io_v1.AuthorizationPolicyList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *authorizationPolicyClient) CreateAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *authorizationPolicyClient) DeleteAuthorizationPolicy(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &security_istio_io_v1.AuthorizationPolicy{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *authorizationPolicyClient) UpdateAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *authorizationPolicyClient) PatchAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *authorizationPolicyClient) DeleteAllOfAuthorizationPolicy(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &security_istio_io_v1.AuthorizationPolicy{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *authorizationPolicyClient) UpsertAuthorizationPolicy(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, transitionFuncs ...AuthorizationPolicyTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*security_istio_io_v1.AuthorizationPolicy), desired.(*security_istio_io_v1.AuthorizationPolicy)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *authorizationPolicyClient) UpdateAuthorizationPolicyStatus(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *authorizationPolicyClient) PatchAuthorizationPolicyStatus(ctx context.Context, obj *security_istio_io_v1.AuthorizationPolicy, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides AuthorizationPolicyClients for multiple clusters. +type MulticlusterAuthorizationPolicyClient interface { + // Cluster returns a AuthorizationPolicyClient for the given cluster + Cluster(cluster string) (AuthorizationPolicyClient, error) +} + +type multiclusterAuthorizationPolicyClient struct { + client multicluster.Client +} + +func NewMulticlusterAuthorizationPolicyClient(client multicluster.Client) MulticlusterAuthorizationPolicyClient { + return &multiclusterAuthorizationPolicyClient{client: client} +} + +func (m *multiclusterAuthorizationPolicyClient) Cluster(cluster string) (AuthorizationPolicyClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewAuthorizationPolicyClient(client), nil +} + +// Reader knows how to read and list PeerAuthentications. +type PeerAuthenticationReader interface { + // Get retrieves a PeerAuthentication for the given object key + GetPeerAuthentication(ctx context.Context, key client.ObjectKey) (*security_istio_io_v1.PeerAuthentication, error) + + // List retrieves list of PeerAuthentications for a given namespace and list options. + ListPeerAuthentication(ctx context.Context, opts ...client.ListOption) (*security_istio_io_v1.PeerAuthenticationList, error) +} + +// PeerAuthenticationTransitionFunction instructs the PeerAuthenticationWriter how to transition between an existing +// PeerAuthentication object and a desired on an Upsert +type PeerAuthenticationTransitionFunction func(existing, desired *security_istio_io_v1.PeerAuthentication) error + +// Writer knows how to create, delete, and update PeerAuthentications. +type PeerAuthenticationWriter interface { + // Create saves the PeerAuthentication object. + CreatePeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, opts ...client.CreateOption) error + + // Delete deletes the PeerAuthentication object. + DeletePeerAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given PeerAuthentication object. + UpdatePeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, opts ...client.UpdateOption) error + + // Patch patches the given PeerAuthentication object. + PatchPeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all PeerAuthentication objects matching the given options. + DeleteAllOfPeerAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the PeerAuthentication object. + UpsertPeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, transitionFuncs ...PeerAuthenticationTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a PeerAuthentication object. +type PeerAuthenticationStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given PeerAuthentication object. + UpdatePeerAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given PeerAuthentication object's subresource. + PatchPeerAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on PeerAuthentications. +type PeerAuthenticationClient interface { + PeerAuthenticationReader + PeerAuthenticationWriter + PeerAuthenticationStatusWriter +} + +type peerAuthenticationClient struct { + client client.Client +} + +func NewPeerAuthenticationClient(client client.Client) *peerAuthenticationClient { + return &peerAuthenticationClient{client: client} +} + +func (c *peerAuthenticationClient) GetPeerAuthentication(ctx context.Context, key client.ObjectKey) (*security_istio_io_v1.PeerAuthentication, error) { + obj := &security_istio_io_v1.PeerAuthentication{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *peerAuthenticationClient) ListPeerAuthentication(ctx context.Context, opts ...client.ListOption) (*security_istio_io_v1.PeerAuthenticationList, error) { + list := &security_istio_io_v1.PeerAuthenticationList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *peerAuthenticationClient) CreatePeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *peerAuthenticationClient) DeletePeerAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &security_istio_io_v1.PeerAuthentication{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *peerAuthenticationClient) UpdatePeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *peerAuthenticationClient) PatchPeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *peerAuthenticationClient) DeleteAllOfPeerAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &security_istio_io_v1.PeerAuthentication{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *peerAuthenticationClient) UpsertPeerAuthentication(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, transitionFuncs ...PeerAuthenticationTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*security_istio_io_v1.PeerAuthentication), desired.(*security_istio_io_v1.PeerAuthentication)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *peerAuthenticationClient) UpdatePeerAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *peerAuthenticationClient) PatchPeerAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.PeerAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides PeerAuthenticationClients for multiple clusters. +type MulticlusterPeerAuthenticationClient interface { + // Cluster returns a PeerAuthenticationClient for the given cluster + Cluster(cluster string) (PeerAuthenticationClient, error) +} + +type multiclusterPeerAuthenticationClient struct { + client multicluster.Client +} + +func NewMulticlusterPeerAuthenticationClient(client multicluster.Client) MulticlusterPeerAuthenticationClient { + return &multiclusterPeerAuthenticationClient{client: client} +} + +func (m *multiclusterPeerAuthenticationClient) Cluster(cluster string) (PeerAuthenticationClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewPeerAuthenticationClient(client), nil +} + +// Reader knows how to read and list RequestAuthentications. +type RequestAuthenticationReader interface { + // Get retrieves a RequestAuthentication for the given object key + GetRequestAuthentication(ctx context.Context, key client.ObjectKey) (*security_istio_io_v1.RequestAuthentication, error) + + // List retrieves list of RequestAuthentications for a given namespace and list options. + ListRequestAuthentication(ctx context.Context, opts ...client.ListOption) (*security_istio_io_v1.RequestAuthenticationList, error) +} + +// RequestAuthenticationTransitionFunction instructs the RequestAuthenticationWriter how to transition between an existing +// RequestAuthentication object and a desired on an Upsert +type RequestAuthenticationTransitionFunction func(existing, desired *security_istio_io_v1.RequestAuthentication) error + +// Writer knows how to create, delete, and update RequestAuthentications. +type RequestAuthenticationWriter interface { + // Create saves the RequestAuthentication object. + CreateRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, opts ...client.CreateOption) error + + // Delete deletes the RequestAuthentication object. + DeleteRequestAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error + + // Update updates the given RequestAuthentication object. + UpdateRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, opts ...client.UpdateOption) error + + // Patch patches the given RequestAuthentication object. + PatchRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, patch client.Patch, opts ...client.PatchOption) error + + // DeleteAllOf deletes all RequestAuthentication objects matching the given options. + DeleteAllOfRequestAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error + + // Create or Update the RequestAuthentication object. + UpsertRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, transitionFuncs ...RequestAuthenticationTransitionFunction) error +} + +// StatusWriter knows how to update status subresource of a RequestAuthentication object. +type RequestAuthenticationStatusWriter interface { + // Update updates the fields corresponding to the status subresource for the + // given RequestAuthentication object. + UpdateRequestAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, opts ...client.SubResourceUpdateOption) error + + // Patch patches the given RequestAuthentication object's subresource. + PatchRequestAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error +} + +// Client knows how to perform CRUD operations on RequestAuthentications. +type RequestAuthenticationClient interface { + RequestAuthenticationReader + RequestAuthenticationWriter + RequestAuthenticationStatusWriter +} + +type requestAuthenticationClient struct { + client client.Client +} + +func NewRequestAuthenticationClient(client client.Client) *requestAuthenticationClient { + return &requestAuthenticationClient{client: client} +} + +func (c *requestAuthenticationClient) GetRequestAuthentication(ctx context.Context, key client.ObjectKey) (*security_istio_io_v1.RequestAuthentication, error) { + obj := &security_istio_io_v1.RequestAuthentication{} + if err := c.client.Get(ctx, key, obj); err != nil { + return nil, err + } + return obj, nil +} + +func (c *requestAuthenticationClient) ListRequestAuthentication(ctx context.Context, opts ...client.ListOption) (*security_istio_io_v1.RequestAuthenticationList, error) { + list := &security_istio_io_v1.RequestAuthenticationList{} + if err := c.client.List(ctx, list, opts...); err != nil { + return nil, err + } + return list, nil +} + +func (c *requestAuthenticationClient) CreateRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, opts ...client.CreateOption) error { + return c.client.Create(ctx, obj, opts...) +} + +func (c *requestAuthenticationClient) DeleteRequestAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + obj := &security_istio_io_v1.RequestAuthentication{} + obj.SetName(key.Name) + obj.SetNamespace(key.Namespace) + return c.client.Delete(ctx, obj, opts...) +} + +func (c *requestAuthenticationClient) UpdateRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, opts ...client.UpdateOption) error { + return c.client.Update(ctx, obj, opts...) +} + +func (c *requestAuthenticationClient) PatchRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, patch client.Patch, opts ...client.PatchOption) error { + return c.client.Patch(ctx, obj, patch, opts...) +} + +func (c *requestAuthenticationClient) DeleteAllOfRequestAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error { + obj := &security_istio_io_v1.RequestAuthentication{} + return c.client.DeleteAllOf(ctx, obj, opts...) +} + +func (c *requestAuthenticationClient) UpsertRequestAuthentication(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, transitionFuncs ...RequestAuthenticationTransitionFunction) error { + genericTxFunc := func(existing, desired runtime.Object) error { + for _, txFunc := range transitionFuncs { + if err := txFunc(existing.(*security_istio_io_v1.RequestAuthentication), desired.(*security_istio_io_v1.RequestAuthentication)); err != nil { + return err + } + } + return nil + } + _, err := controllerutils.Upsert(ctx, c.client, obj, genericTxFunc) + return err +} + +func (c *requestAuthenticationClient) UpdateRequestAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, opts ...client.SubResourceUpdateOption) error { + return c.client.Status().Update(ctx, obj, opts...) +} + +func (c *requestAuthenticationClient) PatchRequestAuthenticationStatus(ctx context.Context, obj *security_istio_io_v1.RequestAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error { + return c.client.Status().Patch(ctx, obj, patch, opts...) +} + +// Provides RequestAuthenticationClients for multiple clusters. +type MulticlusterRequestAuthenticationClient interface { + // Cluster returns a RequestAuthenticationClient for the given cluster + Cluster(cluster string) (RequestAuthenticationClient, error) +} + +type multiclusterRequestAuthenticationClient struct { + client multicluster.Client +} + +func NewMulticlusterRequestAuthenticationClient(client multicluster.Client) MulticlusterRequestAuthenticationClient { + return &multiclusterRequestAuthenticationClient{client: client} +} + +func (m *multiclusterRequestAuthenticationClient) Cluster(cluster string) (RequestAuthenticationClient, error) { + client, err := m.client.Cluster(cluster) + if err != nil { + return nil, err + } + return NewRequestAuthenticationClient(client), nil +} diff --git a/pkg/api/istio/security.istio.io/v1/controller/event_handlers.go b/pkg/api/istio/security.istio.io/v1/controller/event_handlers.go new file mode 100644 index 0000000..455a604 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/controller/event_handlers.go @@ -0,0 +1,339 @@ +// Code generated by skv2. DO NOT EDIT. + +//go:generate mockgen -source ./event_handlers.go -destination mocks/event_handlers.go + +// Definitions for the Kubernetes Controllers +package controller + +import ( + "context" + + security_istio_io_v1 "istio.io/client-go/pkg/apis/security/v1beta1" + + "github.com/pkg/errors" + "github.com/solo-io/skv2/pkg/events" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// Handle events for the AuthorizationPolicy Resource +// DEPRECATED: Prefer reconciler pattern. +type AuthorizationPolicyEventHandler interface { + CreateAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error + UpdateAuthorizationPolicy(old, new *security_istio_io_v1.AuthorizationPolicy) error + DeleteAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error + GenericAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error +} + +type AuthorizationPolicyEventHandlerFuncs struct { + OnCreate func(obj *security_istio_io_v1.AuthorizationPolicy) error + OnUpdate func(old, new *security_istio_io_v1.AuthorizationPolicy) error + OnDelete func(obj *security_istio_io_v1.AuthorizationPolicy) error + OnGeneric func(obj *security_istio_io_v1.AuthorizationPolicy) error +} + +func (f *AuthorizationPolicyEventHandlerFuncs) CreateAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *AuthorizationPolicyEventHandlerFuncs) DeleteAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *AuthorizationPolicyEventHandlerFuncs) UpdateAuthorizationPolicy(objOld, objNew *security_istio_io_v1.AuthorizationPolicy) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *AuthorizationPolicyEventHandlerFuncs) GenericAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type AuthorizationPolicyEventWatcher interface { + AddEventHandler(ctx context.Context, h AuthorizationPolicyEventHandler, predicates ...predicate.Predicate) error +} + +type authorizationPolicyEventWatcher struct { + watcher events.EventWatcher +} + +func NewAuthorizationPolicyEventWatcher(name string, mgr manager.Manager) AuthorizationPolicyEventWatcher { + return &authorizationPolicyEventWatcher{ + watcher: events.NewWatcher(name, mgr, &security_istio_io_v1.AuthorizationPolicy{}), + } +} + +func (c *authorizationPolicyEventWatcher) AddEventHandler(ctx context.Context, h AuthorizationPolicyEventHandler, predicates ...predicate.Predicate) error { + handler := genericAuthorizationPolicyHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericAuthorizationPolicyHandler implements a generic events.EventHandler +type genericAuthorizationPolicyHandler struct { + handler AuthorizationPolicyEventHandler +} + +func (h genericAuthorizationPolicyHandler) Create(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", object) + } + return h.handler.CreateAuthorizationPolicy(obj) +} + +func (h genericAuthorizationPolicyHandler) Delete(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", object) + } + return h.handler.DeleteAuthorizationPolicy(obj) +} + +func (h genericAuthorizationPolicyHandler) Update(old, new client.Object) error { + objOld, ok := old.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", old) + } + objNew, ok := new.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", new) + } + return h.handler.UpdateAuthorizationPolicy(objOld, objNew) +} + +func (h genericAuthorizationPolicyHandler) Generic(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", object) + } + return h.handler.GenericAuthorizationPolicy(obj) +} + +// Handle events for the PeerAuthentication Resource +// DEPRECATED: Prefer reconciler pattern. +type PeerAuthenticationEventHandler interface { + CreatePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error + UpdatePeerAuthentication(old, new *security_istio_io_v1.PeerAuthentication) error + DeletePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error + GenericPeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error +} + +type PeerAuthenticationEventHandlerFuncs struct { + OnCreate func(obj *security_istio_io_v1.PeerAuthentication) error + OnUpdate func(old, new *security_istio_io_v1.PeerAuthentication) error + OnDelete func(obj *security_istio_io_v1.PeerAuthentication) error + OnGeneric func(obj *security_istio_io_v1.PeerAuthentication) error +} + +func (f *PeerAuthenticationEventHandlerFuncs) CreatePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *PeerAuthenticationEventHandlerFuncs) DeletePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *PeerAuthenticationEventHandlerFuncs) UpdatePeerAuthentication(objOld, objNew *security_istio_io_v1.PeerAuthentication) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *PeerAuthenticationEventHandlerFuncs) GenericPeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type PeerAuthenticationEventWatcher interface { + AddEventHandler(ctx context.Context, h PeerAuthenticationEventHandler, predicates ...predicate.Predicate) error +} + +type peerAuthenticationEventWatcher struct { + watcher events.EventWatcher +} + +func NewPeerAuthenticationEventWatcher(name string, mgr manager.Manager) PeerAuthenticationEventWatcher { + return &peerAuthenticationEventWatcher{ + watcher: events.NewWatcher(name, mgr, &security_istio_io_v1.PeerAuthentication{}), + } +} + +func (c *peerAuthenticationEventWatcher) AddEventHandler(ctx context.Context, h PeerAuthenticationEventHandler, predicates ...predicate.Predicate) error { + handler := genericPeerAuthenticationHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericPeerAuthenticationHandler implements a generic events.EventHandler +type genericPeerAuthenticationHandler struct { + handler PeerAuthenticationEventHandler +} + +func (h genericPeerAuthenticationHandler) Create(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return errors.Errorf("internal error: PeerAuthentication handler received event for %T", object) + } + return h.handler.CreatePeerAuthentication(obj) +} + +func (h genericPeerAuthenticationHandler) Delete(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return errors.Errorf("internal error: PeerAuthentication handler received event for %T", object) + } + return h.handler.DeletePeerAuthentication(obj) +} + +func (h genericPeerAuthenticationHandler) Update(old, new client.Object) error { + objOld, ok := old.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return errors.Errorf("internal error: PeerAuthentication handler received event for %T", old) + } + objNew, ok := new.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return errors.Errorf("internal error: PeerAuthentication handler received event for %T", new) + } + return h.handler.UpdatePeerAuthentication(objOld, objNew) +} + +func (h genericPeerAuthenticationHandler) Generic(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return errors.Errorf("internal error: PeerAuthentication handler received event for %T", object) + } + return h.handler.GenericPeerAuthentication(obj) +} + +// Handle events for the RequestAuthentication Resource +// DEPRECATED: Prefer reconciler pattern. +type RequestAuthenticationEventHandler interface { + CreateRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error + UpdateRequestAuthentication(old, new *security_istio_io_v1.RequestAuthentication) error + DeleteRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error + GenericRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error +} + +type RequestAuthenticationEventHandlerFuncs struct { + OnCreate func(obj *security_istio_io_v1.RequestAuthentication) error + OnUpdate func(old, new *security_istio_io_v1.RequestAuthentication) error + OnDelete func(obj *security_istio_io_v1.RequestAuthentication) error + OnGeneric func(obj *security_istio_io_v1.RequestAuthentication) error +} + +func (f *RequestAuthenticationEventHandlerFuncs) CreateRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error { + if f.OnCreate == nil { + return nil + } + return f.OnCreate(obj) +} + +func (f *RequestAuthenticationEventHandlerFuncs) DeleteRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error { + if f.OnDelete == nil { + return nil + } + return f.OnDelete(obj) +} + +func (f *RequestAuthenticationEventHandlerFuncs) UpdateRequestAuthentication(objOld, objNew *security_istio_io_v1.RequestAuthentication) error { + if f.OnUpdate == nil { + return nil + } + return f.OnUpdate(objOld, objNew) +} + +func (f *RequestAuthenticationEventHandlerFuncs) GenericRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error { + if f.OnGeneric == nil { + return nil + } + return f.OnGeneric(obj) +} + +type RequestAuthenticationEventWatcher interface { + AddEventHandler(ctx context.Context, h RequestAuthenticationEventHandler, predicates ...predicate.Predicate) error +} + +type requestAuthenticationEventWatcher struct { + watcher events.EventWatcher +} + +func NewRequestAuthenticationEventWatcher(name string, mgr manager.Manager) RequestAuthenticationEventWatcher { + return &requestAuthenticationEventWatcher{ + watcher: events.NewWatcher(name, mgr, &security_istio_io_v1.RequestAuthentication{}), + } +} + +func (c *requestAuthenticationEventWatcher) AddEventHandler(ctx context.Context, h RequestAuthenticationEventHandler, predicates ...predicate.Predicate) error { + handler := genericRequestAuthenticationHandler{handler: h} + if err := c.watcher.Watch(ctx, handler, predicates...); err != nil { + return err + } + return nil +} + +// genericRequestAuthenticationHandler implements a generic events.EventHandler +type genericRequestAuthenticationHandler struct { + handler RequestAuthenticationEventHandler +} + +func (h genericRequestAuthenticationHandler) Create(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return errors.Errorf("internal error: RequestAuthentication handler received event for %T", object) + } + return h.handler.CreateRequestAuthentication(obj) +} + +func (h genericRequestAuthenticationHandler) Delete(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return errors.Errorf("internal error: RequestAuthentication handler received event for %T", object) + } + return h.handler.DeleteRequestAuthentication(obj) +} + +func (h genericRequestAuthenticationHandler) Update(old, new client.Object) error { + objOld, ok := old.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return errors.Errorf("internal error: RequestAuthentication handler received event for %T", old) + } + objNew, ok := new.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return errors.Errorf("internal error: RequestAuthentication handler received event for %T", new) + } + return h.handler.UpdateRequestAuthentication(objOld, objNew) +} + +func (h genericRequestAuthenticationHandler) Generic(object client.Object) error { + obj, ok := object.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return errors.Errorf("internal error: RequestAuthentication handler received event for %T", object) + } + return h.handler.GenericRequestAuthentication(obj) +} diff --git a/pkg/api/istio/security.istio.io/v1/controller/mocks/event_handlers.go b/pkg/api/istio/security.istio.io/v1/controller/mocks/event_handlers.go new file mode 100644 index 0000000..2ef5829 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/controller/mocks/event_handlers.go @@ -0,0 +1,378 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./event_handlers.go + +// Package mock_controller is a generated GoMock package. +package mock_controller + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + controller "github.com/solo-io/external-apis/pkg/api/istio/security.istio.io/v1/controller" + v1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + predicate "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// MockAuthorizationPolicyEventHandler is a mock of AuthorizationPolicyEventHandler interface. +type MockAuthorizationPolicyEventHandler struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyEventHandlerMockRecorder +} + +// MockAuthorizationPolicyEventHandlerMockRecorder is the mock recorder for MockAuthorizationPolicyEventHandler. +type MockAuthorizationPolicyEventHandlerMockRecorder struct { + mock *MockAuthorizationPolicyEventHandler +} + +// NewMockAuthorizationPolicyEventHandler creates a new mock instance. +func NewMockAuthorizationPolicyEventHandler(ctrl *gomock.Controller) *MockAuthorizationPolicyEventHandler { + mock := &MockAuthorizationPolicyEventHandler{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyEventHandler) EXPECT() *MockAuthorizationPolicyEventHandlerMockRecorder { + return m.recorder +} + +// CreateAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyEventHandler) CreateAuthorizationPolicy(obj *v1beta1.AuthorizationPolicy) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateAuthorizationPolicy", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateAuthorizationPolicy indicates an expected call of CreateAuthorizationPolicy. +func (mr *MockAuthorizationPolicyEventHandlerMockRecorder) CreateAuthorizationPolicy(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyEventHandler)(nil).CreateAuthorizationPolicy), obj) +} + +// DeleteAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyEventHandler) DeleteAuthorizationPolicy(obj *v1beta1.AuthorizationPolicy) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAuthorizationPolicy", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAuthorizationPolicy indicates an expected call of DeleteAuthorizationPolicy. +func (mr *MockAuthorizationPolicyEventHandlerMockRecorder) DeleteAuthorizationPolicy(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyEventHandler)(nil).DeleteAuthorizationPolicy), obj) +} + +// GenericAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyEventHandler) GenericAuthorizationPolicy(obj *v1beta1.AuthorizationPolicy) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericAuthorizationPolicy", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericAuthorizationPolicy indicates an expected call of GenericAuthorizationPolicy. +func (mr *MockAuthorizationPolicyEventHandlerMockRecorder) GenericAuthorizationPolicy(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyEventHandler)(nil).GenericAuthorizationPolicy), obj) +} + +// UpdateAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyEventHandler) UpdateAuthorizationPolicy(old, new *v1beta1.AuthorizationPolicy) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateAuthorizationPolicy", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAuthorizationPolicy indicates an expected call of UpdateAuthorizationPolicy. +func (mr *MockAuthorizationPolicyEventHandlerMockRecorder) UpdateAuthorizationPolicy(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyEventHandler)(nil).UpdateAuthorizationPolicy), old, new) +} + +// MockAuthorizationPolicyEventWatcher is a mock of AuthorizationPolicyEventWatcher interface. +type MockAuthorizationPolicyEventWatcher struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyEventWatcherMockRecorder +} + +// MockAuthorizationPolicyEventWatcherMockRecorder is the mock recorder for MockAuthorizationPolicyEventWatcher. +type MockAuthorizationPolicyEventWatcherMockRecorder struct { + mock *MockAuthorizationPolicyEventWatcher +} + +// NewMockAuthorizationPolicyEventWatcher creates a new mock instance. +func NewMockAuthorizationPolicyEventWatcher(ctrl *gomock.Controller) *MockAuthorizationPolicyEventWatcher { + mock := &MockAuthorizationPolicyEventWatcher{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyEventWatcher) EXPECT() *MockAuthorizationPolicyEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockAuthorizationPolicyEventWatcher) AddEventHandler(ctx context.Context, h controller.AuthorizationPolicyEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockAuthorizationPolicyEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockAuthorizationPolicyEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockPeerAuthenticationEventHandler is a mock of PeerAuthenticationEventHandler interface. +type MockPeerAuthenticationEventHandler struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationEventHandlerMockRecorder +} + +// MockPeerAuthenticationEventHandlerMockRecorder is the mock recorder for MockPeerAuthenticationEventHandler. +type MockPeerAuthenticationEventHandlerMockRecorder struct { + mock *MockPeerAuthenticationEventHandler +} + +// NewMockPeerAuthenticationEventHandler creates a new mock instance. +func NewMockPeerAuthenticationEventHandler(ctrl *gomock.Controller) *MockPeerAuthenticationEventHandler { + mock := &MockPeerAuthenticationEventHandler{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationEventHandler) EXPECT() *MockPeerAuthenticationEventHandlerMockRecorder { + return m.recorder +} + +// CreatePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationEventHandler) CreatePeerAuthentication(obj *v1beta1.PeerAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreatePeerAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreatePeerAuthentication indicates an expected call of CreatePeerAuthentication. +func (mr *MockPeerAuthenticationEventHandlerMockRecorder) CreatePeerAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationEventHandler)(nil).CreatePeerAuthentication), obj) +} + +// DeletePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationEventHandler) DeletePeerAuthentication(obj *v1beta1.PeerAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeletePeerAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeletePeerAuthentication indicates an expected call of DeletePeerAuthentication. +func (mr *MockPeerAuthenticationEventHandlerMockRecorder) DeletePeerAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationEventHandler)(nil).DeletePeerAuthentication), obj) +} + +// GenericPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationEventHandler) GenericPeerAuthentication(obj *v1beta1.PeerAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericPeerAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericPeerAuthentication indicates an expected call of GenericPeerAuthentication. +func (mr *MockPeerAuthenticationEventHandlerMockRecorder) GenericPeerAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationEventHandler)(nil).GenericPeerAuthentication), obj) +} + +// UpdatePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationEventHandler) UpdatePeerAuthentication(old, new *v1beta1.PeerAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdatePeerAuthentication", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdatePeerAuthentication indicates an expected call of UpdatePeerAuthentication. +func (mr *MockPeerAuthenticationEventHandlerMockRecorder) UpdatePeerAuthentication(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationEventHandler)(nil).UpdatePeerAuthentication), old, new) +} + +// MockPeerAuthenticationEventWatcher is a mock of PeerAuthenticationEventWatcher interface. +type MockPeerAuthenticationEventWatcher struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationEventWatcherMockRecorder +} + +// MockPeerAuthenticationEventWatcherMockRecorder is the mock recorder for MockPeerAuthenticationEventWatcher. +type MockPeerAuthenticationEventWatcherMockRecorder struct { + mock *MockPeerAuthenticationEventWatcher +} + +// NewMockPeerAuthenticationEventWatcher creates a new mock instance. +func NewMockPeerAuthenticationEventWatcher(ctrl *gomock.Controller) *MockPeerAuthenticationEventWatcher { + mock := &MockPeerAuthenticationEventWatcher{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationEventWatcher) EXPECT() *MockPeerAuthenticationEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockPeerAuthenticationEventWatcher) AddEventHandler(ctx context.Context, h controller.PeerAuthenticationEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockPeerAuthenticationEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockPeerAuthenticationEventWatcher)(nil).AddEventHandler), varargs...) +} + +// MockRequestAuthenticationEventHandler is a mock of RequestAuthenticationEventHandler interface. +type MockRequestAuthenticationEventHandler struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationEventHandlerMockRecorder +} + +// MockRequestAuthenticationEventHandlerMockRecorder is the mock recorder for MockRequestAuthenticationEventHandler. +type MockRequestAuthenticationEventHandlerMockRecorder struct { + mock *MockRequestAuthenticationEventHandler +} + +// NewMockRequestAuthenticationEventHandler creates a new mock instance. +func NewMockRequestAuthenticationEventHandler(ctrl *gomock.Controller) *MockRequestAuthenticationEventHandler { + mock := &MockRequestAuthenticationEventHandler{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationEventHandlerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationEventHandler) EXPECT() *MockRequestAuthenticationEventHandlerMockRecorder { + return m.recorder +} + +// CreateRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationEventHandler) CreateRequestAuthentication(obj *v1beta1.RequestAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRequestAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateRequestAuthentication indicates an expected call of CreateRequestAuthentication. +func (mr *MockRequestAuthenticationEventHandlerMockRecorder) CreateRequestAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationEventHandler)(nil).CreateRequestAuthentication), obj) +} + +// DeleteRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationEventHandler) DeleteRequestAuthentication(obj *v1beta1.RequestAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRequestAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRequestAuthentication indicates an expected call of DeleteRequestAuthentication. +func (mr *MockRequestAuthenticationEventHandlerMockRecorder) DeleteRequestAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationEventHandler)(nil).DeleteRequestAuthentication), obj) +} + +// GenericRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationEventHandler) GenericRequestAuthentication(obj *v1beta1.RequestAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GenericRequestAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// GenericRequestAuthentication indicates an expected call of GenericRequestAuthentication. +func (mr *MockRequestAuthenticationEventHandlerMockRecorder) GenericRequestAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenericRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationEventHandler)(nil).GenericRequestAuthentication), obj) +} + +// UpdateRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationEventHandler) UpdateRequestAuthentication(old, new *v1beta1.RequestAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRequestAuthentication", old, new) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateRequestAuthentication indicates an expected call of UpdateRequestAuthentication. +func (mr *MockRequestAuthenticationEventHandlerMockRecorder) UpdateRequestAuthentication(old, new interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationEventHandler)(nil).UpdateRequestAuthentication), old, new) +} + +// MockRequestAuthenticationEventWatcher is a mock of RequestAuthenticationEventWatcher interface. +type MockRequestAuthenticationEventWatcher struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationEventWatcherMockRecorder +} + +// MockRequestAuthenticationEventWatcherMockRecorder is the mock recorder for MockRequestAuthenticationEventWatcher. +type MockRequestAuthenticationEventWatcherMockRecorder struct { + mock *MockRequestAuthenticationEventWatcher +} + +// NewMockRequestAuthenticationEventWatcher creates a new mock instance. +func NewMockRequestAuthenticationEventWatcher(ctrl *gomock.Controller) *MockRequestAuthenticationEventWatcher { + mock := &MockRequestAuthenticationEventWatcher{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationEventWatcherMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationEventWatcher) EXPECT() *MockRequestAuthenticationEventWatcherMockRecorder { + return m.recorder +} + +// AddEventHandler mocks base method. +func (m *MockRequestAuthenticationEventWatcher) AddEventHandler(ctx context.Context, h controller.RequestAuthenticationEventHandler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, h} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AddEventHandler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// AddEventHandler indicates an expected call of AddEventHandler. +func (mr *MockRequestAuthenticationEventWatcherMockRecorder) AddEventHandler(ctx, h interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, h}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddEventHandler", reflect.TypeOf((*MockRequestAuthenticationEventWatcher)(nil).AddEventHandler), varargs...) +} diff --git a/pkg/api/istio/security.istio.io/v1/controller/mocks/multicluster_reconcilers.go b/pkg/api/istio/security.istio.io/v1/controller/mocks/multicluster_reconcilers.go new file mode 100644 index 0000000..9b943c1 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/controller/mocks/multicluster_reconcilers.go @@ -0,0 +1,361 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./multicluster_reconcilers.go + +// Package mock_controller is a generated GoMock package. +package mock_controller + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + controller "github.com/solo-io/external-apis/pkg/api/istio/security.istio.io/v1/controller" + reconcile "github.com/solo-io/skv2/pkg/reconcile" + v1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + predicate "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// MockMulticlusterAuthorizationPolicyReconciler is a mock of MulticlusterAuthorizationPolicyReconciler interface. +type MockMulticlusterAuthorizationPolicyReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterAuthorizationPolicyReconcilerMockRecorder +} + +// MockMulticlusterAuthorizationPolicyReconcilerMockRecorder is the mock recorder for MockMulticlusterAuthorizationPolicyReconciler. +type MockMulticlusterAuthorizationPolicyReconcilerMockRecorder struct { + mock *MockMulticlusterAuthorizationPolicyReconciler +} + +// NewMockMulticlusterAuthorizationPolicyReconciler creates a new mock instance. +func NewMockMulticlusterAuthorizationPolicyReconciler(ctrl *gomock.Controller) *MockMulticlusterAuthorizationPolicyReconciler { + mock := &MockMulticlusterAuthorizationPolicyReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterAuthorizationPolicyReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterAuthorizationPolicyReconciler) EXPECT() *MockMulticlusterAuthorizationPolicyReconcilerMockRecorder { + return m.recorder +} + +// ReconcileAuthorizationPolicy mocks base method. +func (m *MockMulticlusterAuthorizationPolicyReconciler) ReconcileAuthorizationPolicy(clusterName string, obj *v1beta1.AuthorizationPolicy) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileAuthorizationPolicy", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileAuthorizationPolicy indicates an expected call of ReconcileAuthorizationPolicy. +func (mr *MockMulticlusterAuthorizationPolicyReconcilerMockRecorder) ReconcileAuthorizationPolicy(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileAuthorizationPolicy", reflect.TypeOf((*MockMulticlusterAuthorizationPolicyReconciler)(nil).ReconcileAuthorizationPolicy), clusterName, obj) +} + +// MockMulticlusterAuthorizationPolicyDeletionReconciler is a mock of MulticlusterAuthorizationPolicyDeletionReconciler interface. +type MockMulticlusterAuthorizationPolicyDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterAuthorizationPolicyDeletionReconcilerMockRecorder +} + +// MockMulticlusterAuthorizationPolicyDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterAuthorizationPolicyDeletionReconciler. +type MockMulticlusterAuthorizationPolicyDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterAuthorizationPolicyDeletionReconciler +} + +// NewMockMulticlusterAuthorizationPolicyDeletionReconciler creates a new mock instance. +func NewMockMulticlusterAuthorizationPolicyDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterAuthorizationPolicyDeletionReconciler { + mock := &MockMulticlusterAuthorizationPolicyDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterAuthorizationPolicyDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterAuthorizationPolicyDeletionReconciler) EXPECT() *MockMulticlusterAuthorizationPolicyDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileAuthorizationPolicyDeletion mocks base method. +func (m *MockMulticlusterAuthorizationPolicyDeletionReconciler) ReconcileAuthorizationPolicyDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileAuthorizationPolicyDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileAuthorizationPolicyDeletion indicates an expected call of ReconcileAuthorizationPolicyDeletion. +func (mr *MockMulticlusterAuthorizationPolicyDeletionReconcilerMockRecorder) ReconcileAuthorizationPolicyDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileAuthorizationPolicyDeletion", reflect.TypeOf((*MockMulticlusterAuthorizationPolicyDeletionReconciler)(nil).ReconcileAuthorizationPolicyDeletion), clusterName, req) +} + +// MockMulticlusterAuthorizationPolicyReconcileLoop is a mock of MulticlusterAuthorizationPolicyReconcileLoop interface. +type MockMulticlusterAuthorizationPolicyReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterAuthorizationPolicyReconcileLoopMockRecorder +} + +// MockMulticlusterAuthorizationPolicyReconcileLoopMockRecorder is the mock recorder for MockMulticlusterAuthorizationPolicyReconcileLoop. +type MockMulticlusterAuthorizationPolicyReconcileLoopMockRecorder struct { + mock *MockMulticlusterAuthorizationPolicyReconcileLoop +} + +// NewMockMulticlusterAuthorizationPolicyReconcileLoop creates a new mock instance. +func NewMockMulticlusterAuthorizationPolicyReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterAuthorizationPolicyReconcileLoop { + mock := &MockMulticlusterAuthorizationPolicyReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterAuthorizationPolicyReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterAuthorizationPolicyReconcileLoop) EXPECT() *MockMulticlusterAuthorizationPolicyReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterAuthorizationPolicyReconciler mocks base method. +func (m *MockMulticlusterAuthorizationPolicyReconcileLoop) AddMulticlusterAuthorizationPolicyReconciler(ctx context.Context, rec controller.MulticlusterAuthorizationPolicyReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterAuthorizationPolicyReconciler", varargs...) +} + +// AddMulticlusterAuthorizationPolicyReconciler indicates an expected call of AddMulticlusterAuthorizationPolicyReconciler. +func (mr *MockMulticlusterAuthorizationPolicyReconcileLoopMockRecorder) AddMulticlusterAuthorizationPolicyReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterAuthorizationPolicyReconciler", reflect.TypeOf((*MockMulticlusterAuthorizationPolicyReconcileLoop)(nil).AddMulticlusterAuthorizationPolicyReconciler), varargs...) +} + +// MockMulticlusterPeerAuthenticationReconciler is a mock of MulticlusterPeerAuthenticationReconciler interface. +type MockMulticlusterPeerAuthenticationReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterPeerAuthenticationReconcilerMockRecorder +} + +// MockMulticlusterPeerAuthenticationReconcilerMockRecorder is the mock recorder for MockMulticlusterPeerAuthenticationReconciler. +type MockMulticlusterPeerAuthenticationReconcilerMockRecorder struct { + mock *MockMulticlusterPeerAuthenticationReconciler +} + +// NewMockMulticlusterPeerAuthenticationReconciler creates a new mock instance. +func NewMockMulticlusterPeerAuthenticationReconciler(ctrl *gomock.Controller) *MockMulticlusterPeerAuthenticationReconciler { + mock := &MockMulticlusterPeerAuthenticationReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterPeerAuthenticationReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterPeerAuthenticationReconciler) EXPECT() *MockMulticlusterPeerAuthenticationReconcilerMockRecorder { + return m.recorder +} + +// ReconcilePeerAuthentication mocks base method. +func (m *MockMulticlusterPeerAuthenticationReconciler) ReconcilePeerAuthentication(clusterName string, obj *v1beta1.PeerAuthentication) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcilePeerAuthentication", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcilePeerAuthentication indicates an expected call of ReconcilePeerAuthentication. +func (mr *MockMulticlusterPeerAuthenticationReconcilerMockRecorder) ReconcilePeerAuthentication(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcilePeerAuthentication", reflect.TypeOf((*MockMulticlusterPeerAuthenticationReconciler)(nil).ReconcilePeerAuthentication), clusterName, obj) +} + +// MockMulticlusterPeerAuthenticationDeletionReconciler is a mock of MulticlusterPeerAuthenticationDeletionReconciler interface. +type MockMulticlusterPeerAuthenticationDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterPeerAuthenticationDeletionReconcilerMockRecorder +} + +// MockMulticlusterPeerAuthenticationDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterPeerAuthenticationDeletionReconciler. +type MockMulticlusterPeerAuthenticationDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterPeerAuthenticationDeletionReconciler +} + +// NewMockMulticlusterPeerAuthenticationDeletionReconciler creates a new mock instance. +func NewMockMulticlusterPeerAuthenticationDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterPeerAuthenticationDeletionReconciler { + mock := &MockMulticlusterPeerAuthenticationDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterPeerAuthenticationDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterPeerAuthenticationDeletionReconciler) EXPECT() *MockMulticlusterPeerAuthenticationDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcilePeerAuthenticationDeletion mocks base method. +func (m *MockMulticlusterPeerAuthenticationDeletionReconciler) ReconcilePeerAuthenticationDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcilePeerAuthenticationDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcilePeerAuthenticationDeletion indicates an expected call of ReconcilePeerAuthenticationDeletion. +func (mr *MockMulticlusterPeerAuthenticationDeletionReconcilerMockRecorder) ReconcilePeerAuthenticationDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcilePeerAuthenticationDeletion", reflect.TypeOf((*MockMulticlusterPeerAuthenticationDeletionReconciler)(nil).ReconcilePeerAuthenticationDeletion), clusterName, req) +} + +// MockMulticlusterPeerAuthenticationReconcileLoop is a mock of MulticlusterPeerAuthenticationReconcileLoop interface. +type MockMulticlusterPeerAuthenticationReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterPeerAuthenticationReconcileLoopMockRecorder +} + +// MockMulticlusterPeerAuthenticationReconcileLoopMockRecorder is the mock recorder for MockMulticlusterPeerAuthenticationReconcileLoop. +type MockMulticlusterPeerAuthenticationReconcileLoopMockRecorder struct { + mock *MockMulticlusterPeerAuthenticationReconcileLoop +} + +// NewMockMulticlusterPeerAuthenticationReconcileLoop creates a new mock instance. +func NewMockMulticlusterPeerAuthenticationReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterPeerAuthenticationReconcileLoop { + mock := &MockMulticlusterPeerAuthenticationReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterPeerAuthenticationReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterPeerAuthenticationReconcileLoop) EXPECT() *MockMulticlusterPeerAuthenticationReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterPeerAuthenticationReconciler mocks base method. +func (m *MockMulticlusterPeerAuthenticationReconcileLoop) AddMulticlusterPeerAuthenticationReconciler(ctx context.Context, rec controller.MulticlusterPeerAuthenticationReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterPeerAuthenticationReconciler", varargs...) +} + +// AddMulticlusterPeerAuthenticationReconciler indicates an expected call of AddMulticlusterPeerAuthenticationReconciler. +func (mr *MockMulticlusterPeerAuthenticationReconcileLoopMockRecorder) AddMulticlusterPeerAuthenticationReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterPeerAuthenticationReconciler", reflect.TypeOf((*MockMulticlusterPeerAuthenticationReconcileLoop)(nil).AddMulticlusterPeerAuthenticationReconciler), varargs...) +} + +// MockMulticlusterRequestAuthenticationReconciler is a mock of MulticlusterRequestAuthenticationReconciler interface. +type MockMulticlusterRequestAuthenticationReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterRequestAuthenticationReconcilerMockRecorder +} + +// MockMulticlusterRequestAuthenticationReconcilerMockRecorder is the mock recorder for MockMulticlusterRequestAuthenticationReconciler. +type MockMulticlusterRequestAuthenticationReconcilerMockRecorder struct { + mock *MockMulticlusterRequestAuthenticationReconciler +} + +// NewMockMulticlusterRequestAuthenticationReconciler creates a new mock instance. +func NewMockMulticlusterRequestAuthenticationReconciler(ctrl *gomock.Controller) *MockMulticlusterRequestAuthenticationReconciler { + mock := &MockMulticlusterRequestAuthenticationReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterRequestAuthenticationReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterRequestAuthenticationReconciler) EXPECT() *MockMulticlusterRequestAuthenticationReconcilerMockRecorder { + return m.recorder +} + +// ReconcileRequestAuthentication mocks base method. +func (m *MockMulticlusterRequestAuthenticationReconciler) ReconcileRequestAuthentication(clusterName string, obj *v1beta1.RequestAuthentication) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileRequestAuthentication", clusterName, obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileRequestAuthentication indicates an expected call of ReconcileRequestAuthentication. +func (mr *MockMulticlusterRequestAuthenticationReconcilerMockRecorder) ReconcileRequestAuthentication(clusterName, obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileRequestAuthentication", reflect.TypeOf((*MockMulticlusterRequestAuthenticationReconciler)(nil).ReconcileRequestAuthentication), clusterName, obj) +} + +// MockMulticlusterRequestAuthenticationDeletionReconciler is a mock of MulticlusterRequestAuthenticationDeletionReconciler interface. +type MockMulticlusterRequestAuthenticationDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockMulticlusterRequestAuthenticationDeletionReconcilerMockRecorder +} + +// MockMulticlusterRequestAuthenticationDeletionReconcilerMockRecorder is the mock recorder for MockMulticlusterRequestAuthenticationDeletionReconciler. +type MockMulticlusterRequestAuthenticationDeletionReconcilerMockRecorder struct { + mock *MockMulticlusterRequestAuthenticationDeletionReconciler +} + +// NewMockMulticlusterRequestAuthenticationDeletionReconciler creates a new mock instance. +func NewMockMulticlusterRequestAuthenticationDeletionReconciler(ctrl *gomock.Controller) *MockMulticlusterRequestAuthenticationDeletionReconciler { + mock := &MockMulticlusterRequestAuthenticationDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockMulticlusterRequestAuthenticationDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterRequestAuthenticationDeletionReconciler) EXPECT() *MockMulticlusterRequestAuthenticationDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileRequestAuthenticationDeletion mocks base method. +func (m *MockMulticlusterRequestAuthenticationDeletionReconciler) ReconcileRequestAuthenticationDeletion(clusterName string, req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileRequestAuthenticationDeletion", clusterName, req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileRequestAuthenticationDeletion indicates an expected call of ReconcileRequestAuthenticationDeletion. +func (mr *MockMulticlusterRequestAuthenticationDeletionReconcilerMockRecorder) ReconcileRequestAuthenticationDeletion(clusterName, req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileRequestAuthenticationDeletion", reflect.TypeOf((*MockMulticlusterRequestAuthenticationDeletionReconciler)(nil).ReconcileRequestAuthenticationDeletion), clusterName, req) +} + +// MockMulticlusterRequestAuthenticationReconcileLoop is a mock of MulticlusterRequestAuthenticationReconcileLoop interface. +type MockMulticlusterRequestAuthenticationReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockMulticlusterRequestAuthenticationReconcileLoopMockRecorder +} + +// MockMulticlusterRequestAuthenticationReconcileLoopMockRecorder is the mock recorder for MockMulticlusterRequestAuthenticationReconcileLoop. +type MockMulticlusterRequestAuthenticationReconcileLoopMockRecorder struct { + mock *MockMulticlusterRequestAuthenticationReconcileLoop +} + +// NewMockMulticlusterRequestAuthenticationReconcileLoop creates a new mock instance. +func NewMockMulticlusterRequestAuthenticationReconcileLoop(ctrl *gomock.Controller) *MockMulticlusterRequestAuthenticationReconcileLoop { + mock := &MockMulticlusterRequestAuthenticationReconcileLoop{ctrl: ctrl} + mock.recorder = &MockMulticlusterRequestAuthenticationReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterRequestAuthenticationReconcileLoop) EXPECT() *MockMulticlusterRequestAuthenticationReconcileLoopMockRecorder { + return m.recorder +} + +// AddMulticlusterRequestAuthenticationReconciler mocks base method. +func (m *MockMulticlusterRequestAuthenticationReconcileLoop) AddMulticlusterRequestAuthenticationReconciler(ctx context.Context, rec controller.MulticlusterRequestAuthenticationReconciler, predicates ...predicate.Predicate) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "AddMulticlusterRequestAuthenticationReconciler", varargs...) +} + +// AddMulticlusterRequestAuthenticationReconciler indicates an expected call of AddMulticlusterRequestAuthenticationReconciler. +func (mr *MockMulticlusterRequestAuthenticationReconcileLoopMockRecorder) AddMulticlusterRequestAuthenticationReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddMulticlusterRequestAuthenticationReconciler", reflect.TypeOf((*MockMulticlusterRequestAuthenticationReconcileLoop)(nil).AddMulticlusterRequestAuthenticationReconciler), varargs...) +} diff --git a/pkg/api/istio/security.istio.io/v1/controller/mocks/reconcilers.go b/pkg/api/istio/security.istio.io/v1/controller/mocks/reconcilers.go new file mode 100644 index 0000000..3556ae6 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/controller/mocks/reconcilers.go @@ -0,0 +1,565 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./reconcilers.go + +// Package mock_controller is a generated GoMock package. +package mock_controller + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + controller "github.com/solo-io/external-apis/pkg/api/istio/security.istio.io/v1/controller" + reconcile "github.com/solo-io/skv2/pkg/reconcile" + v1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + predicate "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// MockAuthorizationPolicyReconciler is a mock of AuthorizationPolicyReconciler interface. +type MockAuthorizationPolicyReconciler struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyReconcilerMockRecorder +} + +// MockAuthorizationPolicyReconcilerMockRecorder is the mock recorder for MockAuthorizationPolicyReconciler. +type MockAuthorizationPolicyReconcilerMockRecorder struct { + mock *MockAuthorizationPolicyReconciler +} + +// NewMockAuthorizationPolicyReconciler creates a new mock instance. +func NewMockAuthorizationPolicyReconciler(ctrl *gomock.Controller) *MockAuthorizationPolicyReconciler { + mock := &MockAuthorizationPolicyReconciler{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyReconciler) EXPECT() *MockAuthorizationPolicyReconcilerMockRecorder { + return m.recorder +} + +// ReconcileAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyReconciler) ReconcileAuthorizationPolicy(obj *v1beta1.AuthorizationPolicy) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileAuthorizationPolicy", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileAuthorizationPolicy indicates an expected call of ReconcileAuthorizationPolicy. +func (mr *MockAuthorizationPolicyReconcilerMockRecorder) ReconcileAuthorizationPolicy(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyReconciler)(nil).ReconcileAuthorizationPolicy), obj) +} + +// MockAuthorizationPolicyDeletionReconciler is a mock of AuthorizationPolicyDeletionReconciler interface. +type MockAuthorizationPolicyDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyDeletionReconcilerMockRecorder +} + +// MockAuthorizationPolicyDeletionReconcilerMockRecorder is the mock recorder for MockAuthorizationPolicyDeletionReconciler. +type MockAuthorizationPolicyDeletionReconcilerMockRecorder struct { + mock *MockAuthorizationPolicyDeletionReconciler +} + +// NewMockAuthorizationPolicyDeletionReconciler creates a new mock instance. +func NewMockAuthorizationPolicyDeletionReconciler(ctrl *gomock.Controller) *MockAuthorizationPolicyDeletionReconciler { + mock := &MockAuthorizationPolicyDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyDeletionReconciler) EXPECT() *MockAuthorizationPolicyDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileAuthorizationPolicyDeletion mocks base method. +func (m *MockAuthorizationPolicyDeletionReconciler) ReconcileAuthorizationPolicyDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileAuthorizationPolicyDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileAuthorizationPolicyDeletion indicates an expected call of ReconcileAuthorizationPolicyDeletion. +func (mr *MockAuthorizationPolicyDeletionReconcilerMockRecorder) ReconcileAuthorizationPolicyDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileAuthorizationPolicyDeletion", reflect.TypeOf((*MockAuthorizationPolicyDeletionReconciler)(nil).ReconcileAuthorizationPolicyDeletion), req) +} + +// MockAuthorizationPolicyFinalizer is a mock of AuthorizationPolicyFinalizer interface. +type MockAuthorizationPolicyFinalizer struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyFinalizerMockRecorder +} + +// MockAuthorizationPolicyFinalizerMockRecorder is the mock recorder for MockAuthorizationPolicyFinalizer. +type MockAuthorizationPolicyFinalizerMockRecorder struct { + mock *MockAuthorizationPolicyFinalizer +} + +// NewMockAuthorizationPolicyFinalizer creates a new mock instance. +func NewMockAuthorizationPolicyFinalizer(ctrl *gomock.Controller) *MockAuthorizationPolicyFinalizer { + mock := &MockAuthorizationPolicyFinalizer{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyFinalizer) EXPECT() *MockAuthorizationPolicyFinalizerMockRecorder { + return m.recorder +} + +// AuthorizationPolicyFinalizerName mocks base method. +func (m *MockAuthorizationPolicyFinalizer) AuthorizationPolicyFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AuthorizationPolicyFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// AuthorizationPolicyFinalizerName indicates an expected call of AuthorizationPolicyFinalizerName. +func (mr *MockAuthorizationPolicyFinalizerMockRecorder) AuthorizationPolicyFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthorizationPolicyFinalizerName", reflect.TypeOf((*MockAuthorizationPolicyFinalizer)(nil).AuthorizationPolicyFinalizerName)) +} + +// FinalizeAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyFinalizer) FinalizeAuthorizationPolicy(obj *v1beta1.AuthorizationPolicy) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeAuthorizationPolicy", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeAuthorizationPolicy indicates an expected call of FinalizeAuthorizationPolicy. +func (mr *MockAuthorizationPolicyFinalizerMockRecorder) FinalizeAuthorizationPolicy(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyFinalizer)(nil).FinalizeAuthorizationPolicy), obj) +} + +// ReconcileAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyFinalizer) ReconcileAuthorizationPolicy(obj *v1beta1.AuthorizationPolicy) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileAuthorizationPolicy", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileAuthorizationPolicy indicates an expected call of ReconcileAuthorizationPolicy. +func (mr *MockAuthorizationPolicyFinalizerMockRecorder) ReconcileAuthorizationPolicy(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyFinalizer)(nil).ReconcileAuthorizationPolicy), obj) +} + +// MockAuthorizationPolicyReconcileLoop is a mock of AuthorizationPolicyReconcileLoop interface. +type MockAuthorizationPolicyReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyReconcileLoopMockRecorder +} + +// MockAuthorizationPolicyReconcileLoopMockRecorder is the mock recorder for MockAuthorizationPolicyReconcileLoop. +type MockAuthorizationPolicyReconcileLoopMockRecorder struct { + mock *MockAuthorizationPolicyReconcileLoop +} + +// NewMockAuthorizationPolicyReconcileLoop creates a new mock instance. +func NewMockAuthorizationPolicyReconcileLoop(ctrl *gomock.Controller) *MockAuthorizationPolicyReconcileLoop { + mock := &MockAuthorizationPolicyReconcileLoop{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyReconcileLoop) EXPECT() *MockAuthorizationPolicyReconcileLoopMockRecorder { + return m.recorder +} + +// RunAuthorizationPolicyReconciler mocks base method. +func (m *MockAuthorizationPolicyReconcileLoop) RunAuthorizationPolicyReconciler(ctx context.Context, rec controller.AuthorizationPolicyReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunAuthorizationPolicyReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunAuthorizationPolicyReconciler indicates an expected call of RunAuthorizationPolicyReconciler. +func (mr *MockAuthorizationPolicyReconcileLoopMockRecorder) RunAuthorizationPolicyReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunAuthorizationPolicyReconciler", reflect.TypeOf((*MockAuthorizationPolicyReconcileLoop)(nil).RunAuthorizationPolicyReconciler), varargs...) +} + +// MockPeerAuthenticationReconciler is a mock of PeerAuthenticationReconciler interface. +type MockPeerAuthenticationReconciler struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationReconcilerMockRecorder +} + +// MockPeerAuthenticationReconcilerMockRecorder is the mock recorder for MockPeerAuthenticationReconciler. +type MockPeerAuthenticationReconcilerMockRecorder struct { + mock *MockPeerAuthenticationReconciler +} + +// NewMockPeerAuthenticationReconciler creates a new mock instance. +func NewMockPeerAuthenticationReconciler(ctrl *gomock.Controller) *MockPeerAuthenticationReconciler { + mock := &MockPeerAuthenticationReconciler{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationReconciler) EXPECT() *MockPeerAuthenticationReconcilerMockRecorder { + return m.recorder +} + +// ReconcilePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationReconciler) ReconcilePeerAuthentication(obj *v1beta1.PeerAuthentication) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcilePeerAuthentication", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcilePeerAuthentication indicates an expected call of ReconcilePeerAuthentication. +func (mr *MockPeerAuthenticationReconcilerMockRecorder) ReconcilePeerAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcilePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationReconciler)(nil).ReconcilePeerAuthentication), obj) +} + +// MockPeerAuthenticationDeletionReconciler is a mock of PeerAuthenticationDeletionReconciler interface. +type MockPeerAuthenticationDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationDeletionReconcilerMockRecorder +} + +// MockPeerAuthenticationDeletionReconcilerMockRecorder is the mock recorder for MockPeerAuthenticationDeletionReconciler. +type MockPeerAuthenticationDeletionReconcilerMockRecorder struct { + mock *MockPeerAuthenticationDeletionReconciler +} + +// NewMockPeerAuthenticationDeletionReconciler creates a new mock instance. +func NewMockPeerAuthenticationDeletionReconciler(ctrl *gomock.Controller) *MockPeerAuthenticationDeletionReconciler { + mock := &MockPeerAuthenticationDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationDeletionReconciler) EXPECT() *MockPeerAuthenticationDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcilePeerAuthenticationDeletion mocks base method. +func (m *MockPeerAuthenticationDeletionReconciler) ReconcilePeerAuthenticationDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcilePeerAuthenticationDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcilePeerAuthenticationDeletion indicates an expected call of ReconcilePeerAuthenticationDeletion. +func (mr *MockPeerAuthenticationDeletionReconcilerMockRecorder) ReconcilePeerAuthenticationDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcilePeerAuthenticationDeletion", reflect.TypeOf((*MockPeerAuthenticationDeletionReconciler)(nil).ReconcilePeerAuthenticationDeletion), req) +} + +// MockPeerAuthenticationFinalizer is a mock of PeerAuthenticationFinalizer interface. +type MockPeerAuthenticationFinalizer struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationFinalizerMockRecorder +} + +// MockPeerAuthenticationFinalizerMockRecorder is the mock recorder for MockPeerAuthenticationFinalizer. +type MockPeerAuthenticationFinalizerMockRecorder struct { + mock *MockPeerAuthenticationFinalizer +} + +// NewMockPeerAuthenticationFinalizer creates a new mock instance. +func NewMockPeerAuthenticationFinalizer(ctrl *gomock.Controller) *MockPeerAuthenticationFinalizer { + mock := &MockPeerAuthenticationFinalizer{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationFinalizer) EXPECT() *MockPeerAuthenticationFinalizerMockRecorder { + return m.recorder +} + +// FinalizePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationFinalizer) FinalizePeerAuthentication(obj *v1beta1.PeerAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizePeerAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizePeerAuthentication indicates an expected call of FinalizePeerAuthentication. +func (mr *MockPeerAuthenticationFinalizerMockRecorder) FinalizePeerAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationFinalizer)(nil).FinalizePeerAuthentication), obj) +} + +// PeerAuthenticationFinalizerName mocks base method. +func (m *MockPeerAuthenticationFinalizer) PeerAuthenticationFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PeerAuthenticationFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// PeerAuthenticationFinalizerName indicates an expected call of PeerAuthenticationFinalizerName. +func (mr *MockPeerAuthenticationFinalizerMockRecorder) PeerAuthenticationFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerAuthenticationFinalizerName", reflect.TypeOf((*MockPeerAuthenticationFinalizer)(nil).PeerAuthenticationFinalizerName)) +} + +// ReconcilePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationFinalizer) ReconcilePeerAuthentication(obj *v1beta1.PeerAuthentication) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcilePeerAuthentication", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcilePeerAuthentication indicates an expected call of ReconcilePeerAuthentication. +func (mr *MockPeerAuthenticationFinalizerMockRecorder) ReconcilePeerAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcilePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationFinalizer)(nil).ReconcilePeerAuthentication), obj) +} + +// MockPeerAuthenticationReconcileLoop is a mock of PeerAuthenticationReconcileLoop interface. +type MockPeerAuthenticationReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationReconcileLoopMockRecorder +} + +// MockPeerAuthenticationReconcileLoopMockRecorder is the mock recorder for MockPeerAuthenticationReconcileLoop. +type MockPeerAuthenticationReconcileLoopMockRecorder struct { + mock *MockPeerAuthenticationReconcileLoop +} + +// NewMockPeerAuthenticationReconcileLoop creates a new mock instance. +func NewMockPeerAuthenticationReconcileLoop(ctrl *gomock.Controller) *MockPeerAuthenticationReconcileLoop { + mock := &MockPeerAuthenticationReconcileLoop{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationReconcileLoop) EXPECT() *MockPeerAuthenticationReconcileLoopMockRecorder { + return m.recorder +} + +// RunPeerAuthenticationReconciler mocks base method. +func (m *MockPeerAuthenticationReconcileLoop) RunPeerAuthenticationReconciler(ctx context.Context, rec controller.PeerAuthenticationReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunPeerAuthenticationReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunPeerAuthenticationReconciler indicates an expected call of RunPeerAuthenticationReconciler. +func (mr *MockPeerAuthenticationReconcileLoopMockRecorder) RunPeerAuthenticationReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunPeerAuthenticationReconciler", reflect.TypeOf((*MockPeerAuthenticationReconcileLoop)(nil).RunPeerAuthenticationReconciler), varargs...) +} + +// MockRequestAuthenticationReconciler is a mock of RequestAuthenticationReconciler interface. +type MockRequestAuthenticationReconciler struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationReconcilerMockRecorder +} + +// MockRequestAuthenticationReconcilerMockRecorder is the mock recorder for MockRequestAuthenticationReconciler. +type MockRequestAuthenticationReconcilerMockRecorder struct { + mock *MockRequestAuthenticationReconciler +} + +// NewMockRequestAuthenticationReconciler creates a new mock instance. +func NewMockRequestAuthenticationReconciler(ctrl *gomock.Controller) *MockRequestAuthenticationReconciler { + mock := &MockRequestAuthenticationReconciler{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationReconciler) EXPECT() *MockRequestAuthenticationReconcilerMockRecorder { + return m.recorder +} + +// ReconcileRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationReconciler) ReconcileRequestAuthentication(obj *v1beta1.RequestAuthentication) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileRequestAuthentication", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileRequestAuthentication indicates an expected call of ReconcileRequestAuthentication. +func (mr *MockRequestAuthenticationReconcilerMockRecorder) ReconcileRequestAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationReconciler)(nil).ReconcileRequestAuthentication), obj) +} + +// MockRequestAuthenticationDeletionReconciler is a mock of RequestAuthenticationDeletionReconciler interface. +type MockRequestAuthenticationDeletionReconciler struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationDeletionReconcilerMockRecorder +} + +// MockRequestAuthenticationDeletionReconcilerMockRecorder is the mock recorder for MockRequestAuthenticationDeletionReconciler. +type MockRequestAuthenticationDeletionReconcilerMockRecorder struct { + mock *MockRequestAuthenticationDeletionReconciler +} + +// NewMockRequestAuthenticationDeletionReconciler creates a new mock instance. +func NewMockRequestAuthenticationDeletionReconciler(ctrl *gomock.Controller) *MockRequestAuthenticationDeletionReconciler { + mock := &MockRequestAuthenticationDeletionReconciler{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationDeletionReconcilerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationDeletionReconciler) EXPECT() *MockRequestAuthenticationDeletionReconcilerMockRecorder { + return m.recorder +} + +// ReconcileRequestAuthenticationDeletion mocks base method. +func (m *MockRequestAuthenticationDeletionReconciler) ReconcileRequestAuthenticationDeletion(req reconcile.Request) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileRequestAuthenticationDeletion", req) + ret0, _ := ret[0].(error) + return ret0 +} + +// ReconcileRequestAuthenticationDeletion indicates an expected call of ReconcileRequestAuthenticationDeletion. +func (mr *MockRequestAuthenticationDeletionReconcilerMockRecorder) ReconcileRequestAuthenticationDeletion(req interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileRequestAuthenticationDeletion", reflect.TypeOf((*MockRequestAuthenticationDeletionReconciler)(nil).ReconcileRequestAuthenticationDeletion), req) +} + +// MockRequestAuthenticationFinalizer is a mock of RequestAuthenticationFinalizer interface. +type MockRequestAuthenticationFinalizer struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationFinalizerMockRecorder +} + +// MockRequestAuthenticationFinalizerMockRecorder is the mock recorder for MockRequestAuthenticationFinalizer. +type MockRequestAuthenticationFinalizerMockRecorder struct { + mock *MockRequestAuthenticationFinalizer +} + +// NewMockRequestAuthenticationFinalizer creates a new mock instance. +func NewMockRequestAuthenticationFinalizer(ctrl *gomock.Controller) *MockRequestAuthenticationFinalizer { + mock := &MockRequestAuthenticationFinalizer{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationFinalizerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationFinalizer) EXPECT() *MockRequestAuthenticationFinalizerMockRecorder { + return m.recorder +} + +// FinalizeRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationFinalizer) FinalizeRequestAuthentication(obj *v1beta1.RequestAuthentication) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FinalizeRequestAuthentication", obj) + ret0, _ := ret[0].(error) + return ret0 +} + +// FinalizeRequestAuthentication indicates an expected call of FinalizeRequestAuthentication. +func (mr *MockRequestAuthenticationFinalizerMockRecorder) FinalizeRequestAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FinalizeRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationFinalizer)(nil).FinalizeRequestAuthentication), obj) +} + +// ReconcileRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationFinalizer) ReconcileRequestAuthentication(obj *v1beta1.RequestAuthentication) (reconcile.Result, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileRequestAuthentication", obj) + ret0, _ := ret[0].(reconcile.Result) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ReconcileRequestAuthentication indicates an expected call of ReconcileRequestAuthentication. +func (mr *MockRequestAuthenticationFinalizerMockRecorder) ReconcileRequestAuthentication(obj interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationFinalizer)(nil).ReconcileRequestAuthentication), obj) +} + +// RequestAuthenticationFinalizerName mocks base method. +func (m *MockRequestAuthenticationFinalizer) RequestAuthenticationFinalizerName() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RequestAuthenticationFinalizerName") + ret0, _ := ret[0].(string) + return ret0 +} + +// RequestAuthenticationFinalizerName indicates an expected call of RequestAuthenticationFinalizerName. +func (mr *MockRequestAuthenticationFinalizerMockRecorder) RequestAuthenticationFinalizerName() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestAuthenticationFinalizerName", reflect.TypeOf((*MockRequestAuthenticationFinalizer)(nil).RequestAuthenticationFinalizerName)) +} + +// MockRequestAuthenticationReconcileLoop is a mock of RequestAuthenticationReconcileLoop interface. +type MockRequestAuthenticationReconcileLoop struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationReconcileLoopMockRecorder +} + +// MockRequestAuthenticationReconcileLoopMockRecorder is the mock recorder for MockRequestAuthenticationReconcileLoop. +type MockRequestAuthenticationReconcileLoopMockRecorder struct { + mock *MockRequestAuthenticationReconcileLoop +} + +// NewMockRequestAuthenticationReconcileLoop creates a new mock instance. +func NewMockRequestAuthenticationReconcileLoop(ctrl *gomock.Controller) *MockRequestAuthenticationReconcileLoop { + mock := &MockRequestAuthenticationReconcileLoop{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationReconcileLoopMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationReconcileLoop) EXPECT() *MockRequestAuthenticationReconcileLoopMockRecorder { + return m.recorder +} + +// RunRequestAuthenticationReconciler mocks base method. +func (m *MockRequestAuthenticationReconcileLoop) RunRequestAuthenticationReconciler(ctx context.Context, rec controller.RequestAuthenticationReconciler, predicates ...predicate.Predicate) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, rec} + for _, a := range predicates { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RunRequestAuthenticationReconciler", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// RunRequestAuthenticationReconciler indicates an expected call of RunRequestAuthenticationReconciler. +func (mr *MockRequestAuthenticationReconcileLoopMockRecorder) RunRequestAuthenticationReconciler(ctx, rec interface{}, predicates ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, rec}, predicates...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunRequestAuthenticationReconciler", reflect.TypeOf((*MockRequestAuthenticationReconcileLoop)(nil).RunRequestAuthenticationReconciler), varargs...) +} diff --git a/pkg/api/istio/security.istio.io/v1/controller/multicluster_reconcilers.go b/pkg/api/istio/security.istio.io/v1/controller/multicluster_reconcilers.go new file mode 100644 index 0000000..bf0fe6a --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/controller/multicluster_reconcilers.go @@ -0,0 +1,232 @@ +// Code generated by skv2. DO NOT EDIT. + +//go:generate mockgen -source ./multicluster_reconcilers.go -destination mocks/multicluster_reconcilers.go + +// Definitions for the multicluster Kubernetes Controllers +package controller + +import ( + "context" + + security_istio_io_v1 "istio.io/client-go/pkg/apis/security/v1beta1" + + "github.com/pkg/errors" + "github.com/solo-io/skv2/pkg/ezkube" + "github.com/solo-io/skv2/pkg/multicluster" + mc_reconcile "github.com/solo-io/skv2/pkg/multicluster/reconcile" + "github.com/solo-io/skv2/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// Reconcile Upsert events for the AuthorizationPolicy Resource across clusters. +// implemented by the user +type MulticlusterAuthorizationPolicyReconciler interface { + ReconcileAuthorizationPolicy(clusterName string, obj *security_istio_io_v1.AuthorizationPolicy) (reconcile.Result, error) +} + +// Reconcile deletion events for the AuthorizationPolicy Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterAuthorizationPolicyDeletionReconciler interface { + ReconcileAuthorizationPolicyDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterAuthorizationPolicyReconcilerFuncs struct { + OnReconcileAuthorizationPolicy func(clusterName string, obj *security_istio_io_v1.AuthorizationPolicy) (reconcile.Result, error) + OnReconcileAuthorizationPolicyDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterAuthorizationPolicyReconcilerFuncs) ReconcileAuthorizationPolicy(clusterName string, obj *security_istio_io_v1.AuthorizationPolicy) (reconcile.Result, error) { + if f.OnReconcileAuthorizationPolicy == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileAuthorizationPolicy(clusterName, obj) +} + +func (f *MulticlusterAuthorizationPolicyReconcilerFuncs) ReconcileAuthorizationPolicyDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileAuthorizationPolicyDeletion == nil { + return nil + } + return f.OnReconcileAuthorizationPolicyDeletion(clusterName, req) +} + +type MulticlusterAuthorizationPolicyReconcileLoop interface { + // AddMulticlusterAuthorizationPolicyReconciler adds a MulticlusterAuthorizationPolicyReconciler to the MulticlusterAuthorizationPolicyReconcileLoop. + AddMulticlusterAuthorizationPolicyReconciler(ctx context.Context, rec MulticlusterAuthorizationPolicyReconciler, predicates ...predicate.Predicate) +} + +type multiclusterAuthorizationPolicyReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterAuthorizationPolicyReconcileLoop) AddMulticlusterAuthorizationPolicyReconciler(ctx context.Context, rec MulticlusterAuthorizationPolicyReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericAuthorizationPolicyMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterAuthorizationPolicyReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterAuthorizationPolicyReconcileLoop { + return &multiclusterAuthorizationPolicyReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &security_istio_io_v1.AuthorizationPolicy{}, options)} +} + +type genericAuthorizationPolicyMulticlusterReconciler struct { + reconciler MulticlusterAuthorizationPolicyReconciler +} + +func (g genericAuthorizationPolicyMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterAuthorizationPolicyDeletionReconciler); ok { + return deletionReconciler.ReconcileAuthorizationPolicyDeletion(cluster, req) + } + return nil +} + +func (g genericAuthorizationPolicyMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", object) + } + return g.reconciler.ReconcileAuthorizationPolicy(cluster, obj) +} + +// Reconcile Upsert events for the PeerAuthentication Resource across clusters. +// implemented by the user +type MulticlusterPeerAuthenticationReconciler interface { + ReconcilePeerAuthentication(clusterName string, obj *security_istio_io_v1.PeerAuthentication) (reconcile.Result, error) +} + +// Reconcile deletion events for the PeerAuthentication Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterPeerAuthenticationDeletionReconciler interface { + ReconcilePeerAuthenticationDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterPeerAuthenticationReconcilerFuncs struct { + OnReconcilePeerAuthentication func(clusterName string, obj *security_istio_io_v1.PeerAuthentication) (reconcile.Result, error) + OnReconcilePeerAuthenticationDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterPeerAuthenticationReconcilerFuncs) ReconcilePeerAuthentication(clusterName string, obj *security_istio_io_v1.PeerAuthentication) (reconcile.Result, error) { + if f.OnReconcilePeerAuthentication == nil { + return reconcile.Result{}, nil + } + return f.OnReconcilePeerAuthentication(clusterName, obj) +} + +func (f *MulticlusterPeerAuthenticationReconcilerFuncs) ReconcilePeerAuthenticationDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcilePeerAuthenticationDeletion == nil { + return nil + } + return f.OnReconcilePeerAuthenticationDeletion(clusterName, req) +} + +type MulticlusterPeerAuthenticationReconcileLoop interface { + // AddMulticlusterPeerAuthenticationReconciler adds a MulticlusterPeerAuthenticationReconciler to the MulticlusterPeerAuthenticationReconcileLoop. + AddMulticlusterPeerAuthenticationReconciler(ctx context.Context, rec MulticlusterPeerAuthenticationReconciler, predicates ...predicate.Predicate) +} + +type multiclusterPeerAuthenticationReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterPeerAuthenticationReconcileLoop) AddMulticlusterPeerAuthenticationReconciler(ctx context.Context, rec MulticlusterPeerAuthenticationReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericPeerAuthenticationMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterPeerAuthenticationReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterPeerAuthenticationReconcileLoop { + return &multiclusterPeerAuthenticationReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &security_istio_io_v1.PeerAuthentication{}, options)} +} + +type genericPeerAuthenticationMulticlusterReconciler struct { + reconciler MulticlusterPeerAuthenticationReconciler +} + +func (g genericPeerAuthenticationMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterPeerAuthenticationDeletionReconciler); ok { + return deletionReconciler.ReconcilePeerAuthenticationDeletion(cluster, req) + } + return nil +} + +func (g genericPeerAuthenticationMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: PeerAuthentication handler received event for %T", object) + } + return g.reconciler.ReconcilePeerAuthentication(cluster, obj) +} + +// Reconcile Upsert events for the RequestAuthentication Resource across clusters. +// implemented by the user +type MulticlusterRequestAuthenticationReconciler interface { + ReconcileRequestAuthentication(clusterName string, obj *security_istio_io_v1.RequestAuthentication) (reconcile.Result, error) +} + +// Reconcile deletion events for the RequestAuthentication Resource across clusters. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type MulticlusterRequestAuthenticationDeletionReconciler interface { + ReconcileRequestAuthenticationDeletion(clusterName string, req reconcile.Request) error +} + +type MulticlusterRequestAuthenticationReconcilerFuncs struct { + OnReconcileRequestAuthentication func(clusterName string, obj *security_istio_io_v1.RequestAuthentication) (reconcile.Result, error) + OnReconcileRequestAuthenticationDeletion func(clusterName string, req reconcile.Request) error +} + +func (f *MulticlusterRequestAuthenticationReconcilerFuncs) ReconcileRequestAuthentication(clusterName string, obj *security_istio_io_v1.RequestAuthentication) (reconcile.Result, error) { + if f.OnReconcileRequestAuthentication == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileRequestAuthentication(clusterName, obj) +} + +func (f *MulticlusterRequestAuthenticationReconcilerFuncs) ReconcileRequestAuthenticationDeletion(clusterName string, req reconcile.Request) error { + if f.OnReconcileRequestAuthenticationDeletion == nil { + return nil + } + return f.OnReconcileRequestAuthenticationDeletion(clusterName, req) +} + +type MulticlusterRequestAuthenticationReconcileLoop interface { + // AddMulticlusterRequestAuthenticationReconciler adds a MulticlusterRequestAuthenticationReconciler to the MulticlusterRequestAuthenticationReconcileLoop. + AddMulticlusterRequestAuthenticationReconciler(ctx context.Context, rec MulticlusterRequestAuthenticationReconciler, predicates ...predicate.Predicate) +} + +type multiclusterRequestAuthenticationReconcileLoop struct { + loop multicluster.Loop +} + +func (m *multiclusterRequestAuthenticationReconcileLoop) AddMulticlusterRequestAuthenticationReconciler(ctx context.Context, rec MulticlusterRequestAuthenticationReconciler, predicates ...predicate.Predicate) { + genericReconciler := genericRequestAuthenticationMulticlusterReconciler{reconciler: rec} + + m.loop.AddReconciler(ctx, genericReconciler, predicates...) +} + +func NewMulticlusterRequestAuthenticationReconcileLoop(name string, cw multicluster.ClusterWatcher, options reconcile.Options) MulticlusterRequestAuthenticationReconcileLoop { + return &multiclusterRequestAuthenticationReconcileLoop{loop: mc_reconcile.NewLoop(name, cw, &security_istio_io_v1.RequestAuthentication{}, options)} +} + +type genericRequestAuthenticationMulticlusterReconciler struct { + reconciler MulticlusterRequestAuthenticationReconciler +} + +func (g genericRequestAuthenticationMulticlusterReconciler) ReconcileDeletion(cluster string, req reconcile.Request) error { + if deletionReconciler, ok := g.reconciler.(MulticlusterRequestAuthenticationDeletionReconciler); ok { + return deletionReconciler.ReconcileRequestAuthenticationDeletion(cluster, req) + } + return nil +} + +func (g genericRequestAuthenticationMulticlusterReconciler) Reconcile(cluster string, object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: RequestAuthentication handler received event for %T", object) + } + return g.reconciler.ReconcileRequestAuthentication(cluster, obj) +} diff --git a/pkg/api/istio/security.istio.io/v1/controller/reconcilers.go b/pkg/api/istio/security.istio.io/v1/controller/reconcilers.go new file mode 100644 index 0000000..08d76e5 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/controller/reconcilers.go @@ -0,0 +1,369 @@ +// Code generated by skv2. DO NOT EDIT. + +//go:generate mockgen -source ./reconcilers.go -destination mocks/reconcilers.go + +// Definitions for the Kubernetes Controllers +package controller + +import ( + "context" + + security_istio_io_v1 "istio.io/client-go/pkg/apis/security/v1beta1" + + "github.com/pkg/errors" + "github.com/solo-io/skv2/pkg/ezkube" + "github.com/solo-io/skv2/pkg/reconcile" + "sigs.k8s.io/controller-runtime/pkg/manager" + "sigs.k8s.io/controller-runtime/pkg/predicate" +) + +// Reconcile Upsert events for the AuthorizationPolicy Resource. +// implemented by the user +type AuthorizationPolicyReconciler interface { + ReconcileAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) (reconcile.Result, error) +} + +// Reconcile deletion events for the AuthorizationPolicy Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type AuthorizationPolicyDeletionReconciler interface { + ReconcileAuthorizationPolicyDeletion(req reconcile.Request) error +} + +type AuthorizationPolicyReconcilerFuncs struct { + OnReconcileAuthorizationPolicy func(obj *security_istio_io_v1.AuthorizationPolicy) (reconcile.Result, error) + OnReconcileAuthorizationPolicyDeletion func(req reconcile.Request) error +} + +func (f *AuthorizationPolicyReconcilerFuncs) ReconcileAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) (reconcile.Result, error) { + if f.OnReconcileAuthorizationPolicy == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileAuthorizationPolicy(obj) +} + +func (f *AuthorizationPolicyReconcilerFuncs) ReconcileAuthorizationPolicyDeletion(req reconcile.Request) error { + if f.OnReconcileAuthorizationPolicyDeletion == nil { + return nil + } + return f.OnReconcileAuthorizationPolicyDeletion(req) +} + +// Reconcile and finalize the AuthorizationPolicy Resource +// implemented by the user +type AuthorizationPolicyFinalizer interface { + AuthorizationPolicyReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + AuthorizationPolicyFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeAuthorizationPolicy(obj *security_istio_io_v1.AuthorizationPolicy) error +} + +type AuthorizationPolicyReconcileLoop interface { + RunAuthorizationPolicyReconciler(ctx context.Context, rec AuthorizationPolicyReconciler, predicates ...predicate.Predicate) error +} + +type authorizationPolicyReconcileLoop struct { + loop reconcile.Loop +} + +func NewAuthorizationPolicyReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) AuthorizationPolicyReconcileLoop { + return &authorizationPolicyReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &security_istio_io_v1.AuthorizationPolicy{}, options), + } +} + +func (c *authorizationPolicyReconcileLoop) RunAuthorizationPolicyReconciler(ctx context.Context, reconciler AuthorizationPolicyReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericAuthorizationPolicyReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(AuthorizationPolicyFinalizer); ok { + reconcilerWrapper = genericAuthorizationPolicyFinalizer{ + genericAuthorizationPolicyReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericAuthorizationPolicyHandler implements a generic reconcile.Reconciler +type genericAuthorizationPolicyReconciler struct { + reconciler AuthorizationPolicyReconciler +} + +func (r genericAuthorizationPolicyReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", object) + } + return r.reconciler.ReconcileAuthorizationPolicy(obj) +} + +func (r genericAuthorizationPolicyReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(AuthorizationPolicyDeletionReconciler); ok { + return deletionReconciler.ReconcileAuthorizationPolicyDeletion(request) + } + return nil +} + +// genericAuthorizationPolicyFinalizer implements a generic reconcile.FinalizingReconciler +type genericAuthorizationPolicyFinalizer struct { + genericAuthorizationPolicyReconciler + finalizingReconciler AuthorizationPolicyFinalizer +} + +func (r genericAuthorizationPolicyFinalizer) FinalizerName() string { + return r.finalizingReconciler.AuthorizationPolicyFinalizerName() +} + +func (r genericAuthorizationPolicyFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*security_istio_io_v1.AuthorizationPolicy) + if !ok { + return errors.Errorf("internal error: AuthorizationPolicy handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeAuthorizationPolicy(obj) +} + +// Reconcile Upsert events for the PeerAuthentication Resource. +// implemented by the user +type PeerAuthenticationReconciler interface { + ReconcilePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) (reconcile.Result, error) +} + +// Reconcile deletion events for the PeerAuthentication Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type PeerAuthenticationDeletionReconciler interface { + ReconcilePeerAuthenticationDeletion(req reconcile.Request) error +} + +type PeerAuthenticationReconcilerFuncs struct { + OnReconcilePeerAuthentication func(obj *security_istio_io_v1.PeerAuthentication) (reconcile.Result, error) + OnReconcilePeerAuthenticationDeletion func(req reconcile.Request) error +} + +func (f *PeerAuthenticationReconcilerFuncs) ReconcilePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) (reconcile.Result, error) { + if f.OnReconcilePeerAuthentication == nil { + return reconcile.Result{}, nil + } + return f.OnReconcilePeerAuthentication(obj) +} + +func (f *PeerAuthenticationReconcilerFuncs) ReconcilePeerAuthenticationDeletion(req reconcile.Request) error { + if f.OnReconcilePeerAuthenticationDeletion == nil { + return nil + } + return f.OnReconcilePeerAuthenticationDeletion(req) +} + +// Reconcile and finalize the PeerAuthentication Resource +// implemented by the user +type PeerAuthenticationFinalizer interface { + PeerAuthenticationReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + PeerAuthenticationFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizePeerAuthentication(obj *security_istio_io_v1.PeerAuthentication) error +} + +type PeerAuthenticationReconcileLoop interface { + RunPeerAuthenticationReconciler(ctx context.Context, rec PeerAuthenticationReconciler, predicates ...predicate.Predicate) error +} + +type peerAuthenticationReconcileLoop struct { + loop reconcile.Loop +} + +func NewPeerAuthenticationReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) PeerAuthenticationReconcileLoop { + return &peerAuthenticationReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &security_istio_io_v1.PeerAuthentication{}, options), + } +} + +func (c *peerAuthenticationReconcileLoop) RunPeerAuthenticationReconciler(ctx context.Context, reconciler PeerAuthenticationReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericPeerAuthenticationReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(PeerAuthenticationFinalizer); ok { + reconcilerWrapper = genericPeerAuthenticationFinalizer{ + genericPeerAuthenticationReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericPeerAuthenticationHandler implements a generic reconcile.Reconciler +type genericPeerAuthenticationReconciler struct { + reconciler PeerAuthenticationReconciler +} + +func (r genericPeerAuthenticationReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: PeerAuthentication handler received event for %T", object) + } + return r.reconciler.ReconcilePeerAuthentication(obj) +} + +func (r genericPeerAuthenticationReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(PeerAuthenticationDeletionReconciler); ok { + return deletionReconciler.ReconcilePeerAuthenticationDeletion(request) + } + return nil +} + +// genericPeerAuthenticationFinalizer implements a generic reconcile.FinalizingReconciler +type genericPeerAuthenticationFinalizer struct { + genericPeerAuthenticationReconciler + finalizingReconciler PeerAuthenticationFinalizer +} + +func (r genericPeerAuthenticationFinalizer) FinalizerName() string { + return r.finalizingReconciler.PeerAuthenticationFinalizerName() +} + +func (r genericPeerAuthenticationFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*security_istio_io_v1.PeerAuthentication) + if !ok { + return errors.Errorf("internal error: PeerAuthentication handler received event for %T", object) + } + return r.finalizingReconciler.FinalizePeerAuthentication(obj) +} + +// Reconcile Upsert events for the RequestAuthentication Resource. +// implemented by the user +type RequestAuthenticationReconciler interface { + ReconcileRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) (reconcile.Result, error) +} + +// Reconcile deletion events for the RequestAuthentication Resource. +// Deletion receives a reconcile.Request as we cannot guarantee the last state of the object +// before being deleted. +// implemented by the user +type RequestAuthenticationDeletionReconciler interface { + ReconcileRequestAuthenticationDeletion(req reconcile.Request) error +} + +type RequestAuthenticationReconcilerFuncs struct { + OnReconcileRequestAuthentication func(obj *security_istio_io_v1.RequestAuthentication) (reconcile.Result, error) + OnReconcileRequestAuthenticationDeletion func(req reconcile.Request) error +} + +func (f *RequestAuthenticationReconcilerFuncs) ReconcileRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) (reconcile.Result, error) { + if f.OnReconcileRequestAuthentication == nil { + return reconcile.Result{}, nil + } + return f.OnReconcileRequestAuthentication(obj) +} + +func (f *RequestAuthenticationReconcilerFuncs) ReconcileRequestAuthenticationDeletion(req reconcile.Request) error { + if f.OnReconcileRequestAuthenticationDeletion == nil { + return nil + } + return f.OnReconcileRequestAuthenticationDeletion(req) +} + +// Reconcile and finalize the RequestAuthentication Resource +// implemented by the user +type RequestAuthenticationFinalizer interface { + RequestAuthenticationReconciler + + // name of the finalizer used by this handler. + // finalizer names should be unique for a single task + RequestAuthenticationFinalizerName() string + + // finalize the object before it is deleted. + // Watchers created with a finalizing handler will a + FinalizeRequestAuthentication(obj *security_istio_io_v1.RequestAuthentication) error +} + +type RequestAuthenticationReconcileLoop interface { + RunRequestAuthenticationReconciler(ctx context.Context, rec RequestAuthenticationReconciler, predicates ...predicate.Predicate) error +} + +type requestAuthenticationReconcileLoop struct { + loop reconcile.Loop +} + +func NewRequestAuthenticationReconcileLoop(name string, mgr manager.Manager, options reconcile.Options) RequestAuthenticationReconcileLoop { + return &requestAuthenticationReconcileLoop{ + // empty cluster indicates this reconciler is built for the local cluster + loop: reconcile.NewLoop(name, "", mgr, &security_istio_io_v1.RequestAuthentication{}, options), + } +} + +func (c *requestAuthenticationReconcileLoop) RunRequestAuthenticationReconciler(ctx context.Context, reconciler RequestAuthenticationReconciler, predicates ...predicate.Predicate) error { + genericReconciler := genericRequestAuthenticationReconciler{ + reconciler: reconciler, + } + + var reconcilerWrapper reconcile.Reconciler + if finalizingReconciler, ok := reconciler.(RequestAuthenticationFinalizer); ok { + reconcilerWrapper = genericRequestAuthenticationFinalizer{ + genericRequestAuthenticationReconciler: genericReconciler, + finalizingReconciler: finalizingReconciler, + } + } else { + reconcilerWrapper = genericReconciler + } + return c.loop.RunReconciler(ctx, reconcilerWrapper, predicates...) +} + +// genericRequestAuthenticationHandler implements a generic reconcile.Reconciler +type genericRequestAuthenticationReconciler struct { + reconciler RequestAuthenticationReconciler +} + +func (r genericRequestAuthenticationReconciler) Reconcile(object ezkube.Object) (reconcile.Result, error) { + obj, ok := object.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return reconcile.Result{}, errors.Errorf("internal error: RequestAuthentication handler received event for %T", object) + } + return r.reconciler.ReconcileRequestAuthentication(obj) +} + +func (r genericRequestAuthenticationReconciler) ReconcileDeletion(request reconcile.Request) error { + if deletionReconciler, ok := r.reconciler.(RequestAuthenticationDeletionReconciler); ok { + return deletionReconciler.ReconcileRequestAuthenticationDeletion(request) + } + return nil +} + +// genericRequestAuthenticationFinalizer implements a generic reconcile.FinalizingReconciler +type genericRequestAuthenticationFinalizer struct { + genericRequestAuthenticationReconciler + finalizingReconciler RequestAuthenticationFinalizer +} + +func (r genericRequestAuthenticationFinalizer) FinalizerName() string { + return r.finalizingReconciler.RequestAuthenticationFinalizerName() +} + +func (r genericRequestAuthenticationFinalizer) Finalize(object ezkube.Object) error { + obj, ok := object.(*security_istio_io_v1.RequestAuthentication) + if !ok { + return errors.Errorf("internal error: RequestAuthentication handler received event for %T", object) + } + return r.finalizingReconciler.FinalizeRequestAuthentication(obj) +} diff --git a/pkg/api/istio/security.istio.io/v1/mocks/clients.go b/pkg/api/istio/security.istio.io/v1/mocks/clients.go new file mode 100644 index 0000000..0a9df9e --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/mocks/clients.go @@ -0,0 +1,1630 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./clients.go + +// Package mock_v1 is a generated GoMock package. +package mock_v1 + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + v1 "github.com/solo-io/external-apis/pkg/api/istio/security.istio.io/v1" + v1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// MockMulticlusterClientset is a mock of MulticlusterClientset interface. +type MockMulticlusterClientset struct { + ctrl *gomock.Controller + recorder *MockMulticlusterClientsetMockRecorder +} + +// MockMulticlusterClientsetMockRecorder is the mock recorder for MockMulticlusterClientset. +type MockMulticlusterClientsetMockRecorder struct { + mock *MockMulticlusterClientset +} + +// NewMockMulticlusterClientset creates a new mock instance. +func NewMockMulticlusterClientset(ctrl *gomock.Controller) *MockMulticlusterClientset { + mock := &MockMulticlusterClientset{ctrl: ctrl} + mock.recorder = &MockMulticlusterClientsetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterClientset) EXPECT() *MockMulticlusterClientsetMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterClientset) Cluster(cluster string) (v1.Clientset, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1.Clientset) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterClientsetMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterClientset)(nil).Cluster), cluster) +} + +// MockClientset is a mock of Clientset interface. +type MockClientset struct { + ctrl *gomock.Controller + recorder *MockClientsetMockRecorder +} + +// MockClientsetMockRecorder is the mock recorder for MockClientset. +type MockClientsetMockRecorder struct { + mock *MockClientset +} + +// NewMockClientset creates a new mock instance. +func NewMockClientset(ctrl *gomock.Controller) *MockClientset { + mock := &MockClientset{ctrl: ctrl} + mock.recorder = &MockClientsetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClientset) EXPECT() *MockClientsetMockRecorder { + return m.recorder +} + +// AuthorizationPolicies mocks base method. +func (m *MockClientset) AuthorizationPolicies() v1.AuthorizationPolicyClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AuthorizationPolicies") + ret0, _ := ret[0].(v1.AuthorizationPolicyClient) + return ret0 +} + +// AuthorizationPolicies indicates an expected call of AuthorizationPolicies. +func (mr *MockClientsetMockRecorder) AuthorizationPolicies() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AuthorizationPolicies", reflect.TypeOf((*MockClientset)(nil).AuthorizationPolicies)) +} + +// PeerAuthentications mocks base method. +func (m *MockClientset) PeerAuthentications() v1.PeerAuthenticationClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PeerAuthentications") + ret0, _ := ret[0].(v1.PeerAuthenticationClient) + return ret0 +} + +// PeerAuthentications indicates an expected call of PeerAuthentications. +func (mr *MockClientsetMockRecorder) PeerAuthentications() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerAuthentications", reflect.TypeOf((*MockClientset)(nil).PeerAuthentications)) +} + +// RequestAuthentications mocks base method. +func (m *MockClientset) RequestAuthentications() v1.RequestAuthenticationClient { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RequestAuthentications") + ret0, _ := ret[0].(v1.RequestAuthenticationClient) + return ret0 +} + +// RequestAuthentications indicates an expected call of RequestAuthentications. +func (mr *MockClientsetMockRecorder) RequestAuthentications() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RequestAuthentications", reflect.TypeOf((*MockClientset)(nil).RequestAuthentications)) +} + +// MockAuthorizationPolicyReader is a mock of AuthorizationPolicyReader interface. +type MockAuthorizationPolicyReader struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyReaderMockRecorder +} + +// MockAuthorizationPolicyReaderMockRecorder is the mock recorder for MockAuthorizationPolicyReader. +type MockAuthorizationPolicyReaderMockRecorder struct { + mock *MockAuthorizationPolicyReader +} + +// NewMockAuthorizationPolicyReader creates a new mock instance. +func NewMockAuthorizationPolicyReader(ctrl *gomock.Controller) *MockAuthorizationPolicyReader { + mock := &MockAuthorizationPolicyReader{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyReader) EXPECT() *MockAuthorizationPolicyReaderMockRecorder { + return m.recorder +} + +// GetAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyReader) GetAuthorizationPolicy(ctx context.Context, key client.ObjectKey) (*v1beta1.AuthorizationPolicy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationPolicy", ctx, key) + ret0, _ := ret[0].(*v1beta1.AuthorizationPolicy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAuthorizationPolicy indicates an expected call of GetAuthorizationPolicy. +func (mr *MockAuthorizationPolicyReaderMockRecorder) GetAuthorizationPolicy(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyReader)(nil).GetAuthorizationPolicy), ctx, key) +} + +// ListAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyReader) ListAuthorizationPolicy(ctx context.Context, opts ...client.ListOption) (*v1beta1.AuthorizationPolicyList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(*v1beta1.AuthorizationPolicyList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAuthorizationPolicy indicates an expected call of ListAuthorizationPolicy. +func (mr *MockAuthorizationPolicyReaderMockRecorder) ListAuthorizationPolicy(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyReader)(nil).ListAuthorizationPolicy), varargs...) +} + +// MockAuthorizationPolicyWriter is a mock of AuthorizationPolicyWriter interface. +type MockAuthorizationPolicyWriter struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyWriterMockRecorder +} + +// MockAuthorizationPolicyWriterMockRecorder is the mock recorder for MockAuthorizationPolicyWriter. +type MockAuthorizationPolicyWriterMockRecorder struct { + mock *MockAuthorizationPolicyWriter +} + +// NewMockAuthorizationPolicyWriter creates a new mock instance. +func NewMockAuthorizationPolicyWriter(ctrl *gomock.Controller) *MockAuthorizationPolicyWriter { + mock := &MockAuthorizationPolicyWriter{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyWriter) EXPECT() *MockAuthorizationPolicyWriterMockRecorder { + return m.recorder +} + +// CreateAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyWriter) CreateAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateAuthorizationPolicy indicates an expected call of CreateAuthorizationPolicy. +func (mr *MockAuthorizationPolicyWriterMockRecorder) CreateAuthorizationPolicy(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyWriter)(nil).CreateAuthorizationPolicy), varargs...) +} + +// DeleteAllOfAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyWriter) DeleteAllOfAuthorizationPolicy(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfAuthorizationPolicy indicates an expected call of DeleteAllOfAuthorizationPolicy. +func (mr *MockAuthorizationPolicyWriterMockRecorder) DeleteAllOfAuthorizationPolicy(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyWriter)(nil).DeleteAllOfAuthorizationPolicy), varargs...) +} + +// DeleteAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyWriter) DeleteAuthorizationPolicy(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAuthorizationPolicy indicates an expected call of DeleteAuthorizationPolicy. +func (mr *MockAuthorizationPolicyWriterMockRecorder) DeleteAuthorizationPolicy(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyWriter)(nil).DeleteAuthorizationPolicy), varargs...) +} + +// PatchAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyWriter) PatchAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchAuthorizationPolicy indicates an expected call of PatchAuthorizationPolicy. +func (mr *MockAuthorizationPolicyWriterMockRecorder) PatchAuthorizationPolicy(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyWriter)(nil).PatchAuthorizationPolicy), varargs...) +} + +// UpdateAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyWriter) UpdateAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAuthorizationPolicy indicates an expected call of UpdateAuthorizationPolicy. +func (mr *MockAuthorizationPolicyWriterMockRecorder) UpdateAuthorizationPolicy(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyWriter)(nil).UpdateAuthorizationPolicy), varargs...) +} + +// UpsertAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyWriter) UpsertAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, transitionFuncs ...v1.AuthorizationPolicyTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertAuthorizationPolicy indicates an expected call of UpsertAuthorizationPolicy. +func (mr *MockAuthorizationPolicyWriterMockRecorder) UpsertAuthorizationPolicy(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyWriter)(nil).UpsertAuthorizationPolicy), varargs...) +} + +// MockAuthorizationPolicyStatusWriter is a mock of AuthorizationPolicyStatusWriter interface. +type MockAuthorizationPolicyStatusWriter struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyStatusWriterMockRecorder +} + +// MockAuthorizationPolicyStatusWriterMockRecorder is the mock recorder for MockAuthorizationPolicyStatusWriter. +type MockAuthorizationPolicyStatusWriterMockRecorder struct { + mock *MockAuthorizationPolicyStatusWriter +} + +// NewMockAuthorizationPolicyStatusWriter creates a new mock instance. +func NewMockAuthorizationPolicyStatusWriter(ctrl *gomock.Controller) *MockAuthorizationPolicyStatusWriter { + mock := &MockAuthorizationPolicyStatusWriter{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyStatusWriter) EXPECT() *MockAuthorizationPolicyStatusWriterMockRecorder { + return m.recorder +} + +// PatchAuthorizationPolicyStatus mocks base method. +func (m *MockAuthorizationPolicyStatusWriter) PatchAuthorizationPolicyStatus(ctx context.Context, obj *v1beta1.AuthorizationPolicy, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchAuthorizationPolicyStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchAuthorizationPolicyStatus indicates an expected call of PatchAuthorizationPolicyStatus. +func (mr *MockAuthorizationPolicyStatusWriterMockRecorder) PatchAuthorizationPolicyStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchAuthorizationPolicyStatus", reflect.TypeOf((*MockAuthorizationPolicyStatusWriter)(nil).PatchAuthorizationPolicyStatus), varargs...) +} + +// UpdateAuthorizationPolicyStatus mocks base method. +func (m *MockAuthorizationPolicyStatusWriter) UpdateAuthorizationPolicyStatus(ctx context.Context, obj *v1beta1.AuthorizationPolicy, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateAuthorizationPolicyStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAuthorizationPolicyStatus indicates an expected call of UpdateAuthorizationPolicyStatus. +func (mr *MockAuthorizationPolicyStatusWriterMockRecorder) UpdateAuthorizationPolicyStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAuthorizationPolicyStatus", reflect.TypeOf((*MockAuthorizationPolicyStatusWriter)(nil).UpdateAuthorizationPolicyStatus), varargs...) +} + +// MockAuthorizationPolicyClient is a mock of AuthorizationPolicyClient interface. +type MockAuthorizationPolicyClient struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicyClientMockRecorder +} + +// MockAuthorizationPolicyClientMockRecorder is the mock recorder for MockAuthorizationPolicyClient. +type MockAuthorizationPolicyClientMockRecorder struct { + mock *MockAuthorizationPolicyClient +} + +// NewMockAuthorizationPolicyClient creates a new mock instance. +func NewMockAuthorizationPolicyClient(ctrl *gomock.Controller) *MockAuthorizationPolicyClient { + mock := &MockAuthorizationPolicyClient{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicyClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicyClient) EXPECT() *MockAuthorizationPolicyClientMockRecorder { + return m.recorder +} + +// CreateAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) CreateAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateAuthorizationPolicy indicates an expected call of CreateAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) CreateAuthorizationPolicy(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).CreateAuthorizationPolicy), varargs...) +} + +// DeleteAllOfAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) DeleteAllOfAuthorizationPolicy(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfAuthorizationPolicy indicates an expected call of DeleteAllOfAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) DeleteAllOfAuthorizationPolicy(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).DeleteAllOfAuthorizationPolicy), varargs...) +} + +// DeleteAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) DeleteAuthorizationPolicy(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAuthorizationPolicy indicates an expected call of DeleteAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) DeleteAuthorizationPolicy(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).DeleteAuthorizationPolicy), varargs...) +} + +// GetAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) GetAuthorizationPolicy(ctx context.Context, key client.ObjectKey) (*v1beta1.AuthorizationPolicy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAuthorizationPolicy", ctx, key) + ret0, _ := ret[0].(*v1beta1.AuthorizationPolicy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAuthorizationPolicy indicates an expected call of GetAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) GetAuthorizationPolicy(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).GetAuthorizationPolicy), ctx, key) +} + +// ListAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) ListAuthorizationPolicy(ctx context.Context, opts ...client.ListOption) (*v1beta1.AuthorizationPolicyList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(*v1beta1.AuthorizationPolicyList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAuthorizationPolicy indicates an expected call of ListAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) ListAuthorizationPolicy(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).ListAuthorizationPolicy), varargs...) +} + +// PatchAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) PatchAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchAuthorizationPolicy indicates an expected call of PatchAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) PatchAuthorizationPolicy(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).PatchAuthorizationPolicy), varargs...) +} + +// PatchAuthorizationPolicyStatus mocks base method. +func (m *MockAuthorizationPolicyClient) PatchAuthorizationPolicyStatus(ctx context.Context, obj *v1beta1.AuthorizationPolicy, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchAuthorizationPolicyStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchAuthorizationPolicyStatus indicates an expected call of PatchAuthorizationPolicyStatus. +func (mr *MockAuthorizationPolicyClientMockRecorder) PatchAuthorizationPolicyStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchAuthorizationPolicyStatus", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).PatchAuthorizationPolicyStatus), varargs...) +} + +// UpdateAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) UpdateAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAuthorizationPolicy indicates an expected call of UpdateAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) UpdateAuthorizationPolicy(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).UpdateAuthorizationPolicy), varargs...) +} + +// UpdateAuthorizationPolicyStatus mocks base method. +func (m *MockAuthorizationPolicyClient) UpdateAuthorizationPolicyStatus(ctx context.Context, obj *v1beta1.AuthorizationPolicy, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateAuthorizationPolicyStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateAuthorizationPolicyStatus indicates an expected call of UpdateAuthorizationPolicyStatus. +func (mr *MockAuthorizationPolicyClientMockRecorder) UpdateAuthorizationPolicyStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAuthorizationPolicyStatus", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).UpdateAuthorizationPolicyStatus), varargs...) +} + +// UpsertAuthorizationPolicy mocks base method. +func (m *MockAuthorizationPolicyClient) UpsertAuthorizationPolicy(ctx context.Context, obj *v1beta1.AuthorizationPolicy, transitionFuncs ...v1.AuthorizationPolicyTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertAuthorizationPolicy", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertAuthorizationPolicy indicates an expected call of UpsertAuthorizationPolicy. +func (mr *MockAuthorizationPolicyClientMockRecorder) UpsertAuthorizationPolicy(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertAuthorizationPolicy", reflect.TypeOf((*MockAuthorizationPolicyClient)(nil).UpsertAuthorizationPolicy), varargs...) +} + +// MockMulticlusterAuthorizationPolicyClient is a mock of MulticlusterAuthorizationPolicyClient interface. +type MockMulticlusterAuthorizationPolicyClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterAuthorizationPolicyClientMockRecorder +} + +// MockMulticlusterAuthorizationPolicyClientMockRecorder is the mock recorder for MockMulticlusterAuthorizationPolicyClient. +type MockMulticlusterAuthorizationPolicyClientMockRecorder struct { + mock *MockMulticlusterAuthorizationPolicyClient +} + +// NewMockMulticlusterAuthorizationPolicyClient creates a new mock instance. +func NewMockMulticlusterAuthorizationPolicyClient(ctrl *gomock.Controller) *MockMulticlusterAuthorizationPolicyClient { + mock := &MockMulticlusterAuthorizationPolicyClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterAuthorizationPolicyClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterAuthorizationPolicyClient) EXPECT() *MockMulticlusterAuthorizationPolicyClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterAuthorizationPolicyClient) Cluster(cluster string) (v1.AuthorizationPolicyClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1.AuthorizationPolicyClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterAuthorizationPolicyClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterAuthorizationPolicyClient)(nil).Cluster), cluster) +} + +// MockPeerAuthenticationReader is a mock of PeerAuthenticationReader interface. +type MockPeerAuthenticationReader struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationReaderMockRecorder +} + +// MockPeerAuthenticationReaderMockRecorder is the mock recorder for MockPeerAuthenticationReader. +type MockPeerAuthenticationReaderMockRecorder struct { + mock *MockPeerAuthenticationReader +} + +// NewMockPeerAuthenticationReader creates a new mock instance. +func NewMockPeerAuthenticationReader(ctrl *gomock.Controller) *MockPeerAuthenticationReader { + mock := &MockPeerAuthenticationReader{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationReader) EXPECT() *MockPeerAuthenticationReaderMockRecorder { + return m.recorder +} + +// GetPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationReader) GetPeerAuthentication(ctx context.Context, key client.ObjectKey) (*v1beta1.PeerAuthentication, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPeerAuthentication", ctx, key) + ret0, _ := ret[0].(*v1beta1.PeerAuthentication) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPeerAuthentication indicates an expected call of GetPeerAuthentication. +func (mr *MockPeerAuthenticationReaderMockRecorder) GetPeerAuthentication(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationReader)(nil).GetPeerAuthentication), ctx, key) +} + +// ListPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationReader) ListPeerAuthentication(ctx context.Context, opts ...client.ListOption) (*v1beta1.PeerAuthenticationList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListPeerAuthentication", varargs...) + ret0, _ := ret[0].(*v1beta1.PeerAuthenticationList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListPeerAuthentication indicates an expected call of ListPeerAuthentication. +func (mr *MockPeerAuthenticationReaderMockRecorder) ListPeerAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationReader)(nil).ListPeerAuthentication), varargs...) +} + +// MockPeerAuthenticationWriter is a mock of PeerAuthenticationWriter interface. +type MockPeerAuthenticationWriter struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationWriterMockRecorder +} + +// MockPeerAuthenticationWriterMockRecorder is the mock recorder for MockPeerAuthenticationWriter. +type MockPeerAuthenticationWriterMockRecorder struct { + mock *MockPeerAuthenticationWriter +} + +// NewMockPeerAuthenticationWriter creates a new mock instance. +func NewMockPeerAuthenticationWriter(ctrl *gomock.Controller) *MockPeerAuthenticationWriter { + mock := &MockPeerAuthenticationWriter{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationWriter) EXPECT() *MockPeerAuthenticationWriterMockRecorder { + return m.recorder +} + +// CreatePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationWriter) CreatePeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreatePeerAuthentication indicates an expected call of CreatePeerAuthentication. +func (mr *MockPeerAuthenticationWriterMockRecorder) CreatePeerAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationWriter)(nil).CreatePeerAuthentication), varargs...) +} + +// DeleteAllOfPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationWriter) DeleteAllOfPeerAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfPeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfPeerAuthentication indicates an expected call of DeleteAllOfPeerAuthentication. +func (mr *MockPeerAuthenticationWriterMockRecorder) DeleteAllOfPeerAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationWriter)(nil).DeleteAllOfPeerAuthentication), varargs...) +} + +// DeletePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationWriter) DeletePeerAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeletePeerAuthentication indicates an expected call of DeletePeerAuthentication. +func (mr *MockPeerAuthenticationWriterMockRecorder) DeletePeerAuthentication(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationWriter)(nil).DeletePeerAuthentication), varargs...) +} + +// PatchPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationWriter) PatchPeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchPeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchPeerAuthentication indicates an expected call of PatchPeerAuthentication. +func (mr *MockPeerAuthenticationWriterMockRecorder) PatchPeerAuthentication(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationWriter)(nil).PatchPeerAuthentication), varargs...) +} + +// UpdatePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationWriter) UpdatePeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdatePeerAuthentication indicates an expected call of UpdatePeerAuthentication. +func (mr *MockPeerAuthenticationWriterMockRecorder) UpdatePeerAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationWriter)(nil).UpdatePeerAuthentication), varargs...) +} + +// UpsertPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationWriter) UpsertPeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, transitionFuncs ...v1.PeerAuthenticationTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertPeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertPeerAuthentication indicates an expected call of UpsertPeerAuthentication. +func (mr *MockPeerAuthenticationWriterMockRecorder) UpsertPeerAuthentication(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationWriter)(nil).UpsertPeerAuthentication), varargs...) +} + +// MockPeerAuthenticationStatusWriter is a mock of PeerAuthenticationStatusWriter interface. +type MockPeerAuthenticationStatusWriter struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationStatusWriterMockRecorder +} + +// MockPeerAuthenticationStatusWriterMockRecorder is the mock recorder for MockPeerAuthenticationStatusWriter. +type MockPeerAuthenticationStatusWriterMockRecorder struct { + mock *MockPeerAuthenticationStatusWriter +} + +// NewMockPeerAuthenticationStatusWriter creates a new mock instance. +func NewMockPeerAuthenticationStatusWriter(ctrl *gomock.Controller) *MockPeerAuthenticationStatusWriter { + mock := &MockPeerAuthenticationStatusWriter{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationStatusWriter) EXPECT() *MockPeerAuthenticationStatusWriterMockRecorder { + return m.recorder +} + +// PatchPeerAuthenticationStatus mocks base method. +func (m *MockPeerAuthenticationStatusWriter) PatchPeerAuthenticationStatus(ctx context.Context, obj *v1beta1.PeerAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchPeerAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchPeerAuthenticationStatus indicates an expected call of PatchPeerAuthenticationStatus. +func (mr *MockPeerAuthenticationStatusWriterMockRecorder) PatchPeerAuthenticationStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchPeerAuthenticationStatus", reflect.TypeOf((*MockPeerAuthenticationStatusWriter)(nil).PatchPeerAuthenticationStatus), varargs...) +} + +// UpdatePeerAuthenticationStatus mocks base method. +func (m *MockPeerAuthenticationStatusWriter) UpdatePeerAuthenticationStatus(ctx context.Context, obj *v1beta1.PeerAuthentication, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePeerAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdatePeerAuthenticationStatus indicates an expected call of UpdatePeerAuthenticationStatus. +func (mr *MockPeerAuthenticationStatusWriterMockRecorder) UpdatePeerAuthenticationStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePeerAuthenticationStatus", reflect.TypeOf((*MockPeerAuthenticationStatusWriter)(nil).UpdatePeerAuthenticationStatus), varargs...) +} + +// MockPeerAuthenticationClient is a mock of PeerAuthenticationClient interface. +type MockPeerAuthenticationClient struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationClientMockRecorder +} + +// MockPeerAuthenticationClientMockRecorder is the mock recorder for MockPeerAuthenticationClient. +type MockPeerAuthenticationClientMockRecorder struct { + mock *MockPeerAuthenticationClient +} + +// NewMockPeerAuthenticationClient creates a new mock instance. +func NewMockPeerAuthenticationClient(ctrl *gomock.Controller) *MockPeerAuthenticationClient { + mock := &MockPeerAuthenticationClient{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationClient) EXPECT() *MockPeerAuthenticationClientMockRecorder { + return m.recorder +} + +// CreatePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) CreatePeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreatePeerAuthentication indicates an expected call of CreatePeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) CreatePeerAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).CreatePeerAuthentication), varargs...) +} + +// DeleteAllOfPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) DeleteAllOfPeerAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfPeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfPeerAuthentication indicates an expected call of DeleteAllOfPeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) DeleteAllOfPeerAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).DeleteAllOfPeerAuthentication), varargs...) +} + +// DeletePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) DeletePeerAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeletePeerAuthentication indicates an expected call of DeletePeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) DeletePeerAuthentication(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).DeletePeerAuthentication), varargs...) +} + +// GetPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) GetPeerAuthentication(ctx context.Context, key client.ObjectKey) (*v1beta1.PeerAuthentication, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPeerAuthentication", ctx, key) + ret0, _ := ret[0].(*v1beta1.PeerAuthentication) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetPeerAuthentication indicates an expected call of GetPeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) GetPeerAuthentication(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).GetPeerAuthentication), ctx, key) +} + +// ListPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) ListPeerAuthentication(ctx context.Context, opts ...client.ListOption) (*v1beta1.PeerAuthenticationList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListPeerAuthentication", varargs...) + ret0, _ := ret[0].(*v1beta1.PeerAuthenticationList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListPeerAuthentication indicates an expected call of ListPeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) ListPeerAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).ListPeerAuthentication), varargs...) +} + +// PatchPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) PatchPeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchPeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchPeerAuthentication indicates an expected call of PatchPeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) PatchPeerAuthentication(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).PatchPeerAuthentication), varargs...) +} + +// PatchPeerAuthenticationStatus mocks base method. +func (m *MockPeerAuthenticationClient) PatchPeerAuthenticationStatus(ctx context.Context, obj *v1beta1.PeerAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchPeerAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchPeerAuthenticationStatus indicates an expected call of PatchPeerAuthenticationStatus. +func (mr *MockPeerAuthenticationClientMockRecorder) PatchPeerAuthenticationStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchPeerAuthenticationStatus", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).PatchPeerAuthenticationStatus), varargs...) +} + +// UpdatePeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) UpdatePeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdatePeerAuthentication indicates an expected call of UpdatePeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) UpdatePeerAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).UpdatePeerAuthentication), varargs...) +} + +// UpdatePeerAuthenticationStatus mocks base method. +func (m *MockPeerAuthenticationClient) UpdatePeerAuthenticationStatus(ctx context.Context, obj *v1beta1.PeerAuthentication, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePeerAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdatePeerAuthenticationStatus indicates an expected call of UpdatePeerAuthenticationStatus. +func (mr *MockPeerAuthenticationClientMockRecorder) UpdatePeerAuthenticationStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePeerAuthenticationStatus", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).UpdatePeerAuthenticationStatus), varargs...) +} + +// UpsertPeerAuthentication mocks base method. +func (m *MockPeerAuthenticationClient) UpsertPeerAuthentication(ctx context.Context, obj *v1beta1.PeerAuthentication, transitionFuncs ...v1.PeerAuthenticationTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertPeerAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertPeerAuthentication indicates an expected call of UpsertPeerAuthentication. +func (mr *MockPeerAuthenticationClientMockRecorder) UpsertPeerAuthentication(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertPeerAuthentication", reflect.TypeOf((*MockPeerAuthenticationClient)(nil).UpsertPeerAuthentication), varargs...) +} + +// MockMulticlusterPeerAuthenticationClient is a mock of MulticlusterPeerAuthenticationClient interface. +type MockMulticlusterPeerAuthenticationClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterPeerAuthenticationClientMockRecorder +} + +// MockMulticlusterPeerAuthenticationClientMockRecorder is the mock recorder for MockMulticlusterPeerAuthenticationClient. +type MockMulticlusterPeerAuthenticationClientMockRecorder struct { + mock *MockMulticlusterPeerAuthenticationClient +} + +// NewMockMulticlusterPeerAuthenticationClient creates a new mock instance. +func NewMockMulticlusterPeerAuthenticationClient(ctrl *gomock.Controller) *MockMulticlusterPeerAuthenticationClient { + mock := &MockMulticlusterPeerAuthenticationClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterPeerAuthenticationClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterPeerAuthenticationClient) EXPECT() *MockMulticlusterPeerAuthenticationClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterPeerAuthenticationClient) Cluster(cluster string) (v1.PeerAuthenticationClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1.PeerAuthenticationClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterPeerAuthenticationClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterPeerAuthenticationClient)(nil).Cluster), cluster) +} + +// MockRequestAuthenticationReader is a mock of RequestAuthenticationReader interface. +type MockRequestAuthenticationReader struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationReaderMockRecorder +} + +// MockRequestAuthenticationReaderMockRecorder is the mock recorder for MockRequestAuthenticationReader. +type MockRequestAuthenticationReaderMockRecorder struct { + mock *MockRequestAuthenticationReader +} + +// NewMockRequestAuthenticationReader creates a new mock instance. +func NewMockRequestAuthenticationReader(ctrl *gomock.Controller) *MockRequestAuthenticationReader { + mock := &MockRequestAuthenticationReader{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationReaderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationReader) EXPECT() *MockRequestAuthenticationReaderMockRecorder { + return m.recorder +} + +// GetRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationReader) GetRequestAuthentication(ctx context.Context, key client.ObjectKey) (*v1beta1.RequestAuthentication, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRequestAuthentication", ctx, key) + ret0, _ := ret[0].(*v1beta1.RequestAuthentication) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRequestAuthentication indicates an expected call of GetRequestAuthentication. +func (mr *MockRequestAuthenticationReaderMockRecorder) GetRequestAuthentication(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationReader)(nil).GetRequestAuthentication), ctx, key) +} + +// ListRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationReader) ListRequestAuthentication(ctx context.Context, opts ...client.ListOption) (*v1beta1.RequestAuthenticationList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListRequestAuthentication", varargs...) + ret0, _ := ret[0].(*v1beta1.RequestAuthenticationList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRequestAuthentication indicates an expected call of ListRequestAuthentication. +func (mr *MockRequestAuthenticationReaderMockRecorder) ListRequestAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationReader)(nil).ListRequestAuthentication), varargs...) +} + +// MockRequestAuthenticationWriter is a mock of RequestAuthenticationWriter interface. +type MockRequestAuthenticationWriter struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationWriterMockRecorder +} + +// MockRequestAuthenticationWriterMockRecorder is the mock recorder for MockRequestAuthenticationWriter. +type MockRequestAuthenticationWriterMockRecorder struct { + mock *MockRequestAuthenticationWriter +} + +// NewMockRequestAuthenticationWriter creates a new mock instance. +func NewMockRequestAuthenticationWriter(ctrl *gomock.Controller) *MockRequestAuthenticationWriter { + mock := &MockRequestAuthenticationWriter{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationWriter) EXPECT() *MockRequestAuthenticationWriterMockRecorder { + return m.recorder +} + +// CreateRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationWriter) CreateRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateRequestAuthentication indicates an expected call of CreateRequestAuthentication. +func (mr *MockRequestAuthenticationWriterMockRecorder) CreateRequestAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationWriter)(nil).CreateRequestAuthentication), varargs...) +} + +// DeleteAllOfRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationWriter) DeleteAllOfRequestAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfRequestAuthentication indicates an expected call of DeleteAllOfRequestAuthentication. +func (mr *MockRequestAuthenticationWriterMockRecorder) DeleteAllOfRequestAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationWriter)(nil).DeleteAllOfRequestAuthentication), varargs...) +} + +// DeleteRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationWriter) DeleteRequestAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRequestAuthentication indicates an expected call of DeleteRequestAuthentication. +func (mr *MockRequestAuthenticationWriterMockRecorder) DeleteRequestAuthentication(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationWriter)(nil).DeleteRequestAuthentication), varargs...) +} + +// PatchRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationWriter) PatchRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchRequestAuthentication indicates an expected call of PatchRequestAuthentication. +func (mr *MockRequestAuthenticationWriterMockRecorder) PatchRequestAuthentication(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationWriter)(nil).PatchRequestAuthentication), varargs...) +} + +// UpdateRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationWriter) UpdateRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateRequestAuthentication indicates an expected call of UpdateRequestAuthentication. +func (mr *MockRequestAuthenticationWriterMockRecorder) UpdateRequestAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationWriter)(nil).UpdateRequestAuthentication), varargs...) +} + +// UpsertRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationWriter) UpsertRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, transitionFuncs ...v1.RequestAuthenticationTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertRequestAuthentication indicates an expected call of UpsertRequestAuthentication. +func (mr *MockRequestAuthenticationWriterMockRecorder) UpsertRequestAuthentication(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationWriter)(nil).UpsertRequestAuthentication), varargs...) +} + +// MockRequestAuthenticationStatusWriter is a mock of RequestAuthenticationStatusWriter interface. +type MockRequestAuthenticationStatusWriter struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationStatusWriterMockRecorder +} + +// MockRequestAuthenticationStatusWriterMockRecorder is the mock recorder for MockRequestAuthenticationStatusWriter. +type MockRequestAuthenticationStatusWriterMockRecorder struct { + mock *MockRequestAuthenticationStatusWriter +} + +// NewMockRequestAuthenticationStatusWriter creates a new mock instance. +func NewMockRequestAuthenticationStatusWriter(ctrl *gomock.Controller) *MockRequestAuthenticationStatusWriter { + mock := &MockRequestAuthenticationStatusWriter{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationStatusWriterMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationStatusWriter) EXPECT() *MockRequestAuthenticationStatusWriterMockRecorder { + return m.recorder +} + +// PatchRequestAuthenticationStatus mocks base method. +func (m *MockRequestAuthenticationStatusWriter) PatchRequestAuthenticationStatus(ctx context.Context, obj *v1beta1.RequestAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchRequestAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchRequestAuthenticationStatus indicates an expected call of PatchRequestAuthenticationStatus. +func (mr *MockRequestAuthenticationStatusWriterMockRecorder) PatchRequestAuthenticationStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchRequestAuthenticationStatus", reflect.TypeOf((*MockRequestAuthenticationStatusWriter)(nil).PatchRequestAuthenticationStatus), varargs...) +} + +// UpdateRequestAuthenticationStatus mocks base method. +func (m *MockRequestAuthenticationStatusWriter) UpdateRequestAuthenticationStatus(ctx context.Context, obj *v1beta1.RequestAuthentication, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateRequestAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateRequestAuthenticationStatus indicates an expected call of UpdateRequestAuthenticationStatus. +func (mr *MockRequestAuthenticationStatusWriterMockRecorder) UpdateRequestAuthenticationStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRequestAuthenticationStatus", reflect.TypeOf((*MockRequestAuthenticationStatusWriter)(nil).UpdateRequestAuthenticationStatus), varargs...) +} + +// MockRequestAuthenticationClient is a mock of RequestAuthenticationClient interface. +type MockRequestAuthenticationClient struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationClientMockRecorder +} + +// MockRequestAuthenticationClientMockRecorder is the mock recorder for MockRequestAuthenticationClient. +type MockRequestAuthenticationClientMockRecorder struct { + mock *MockRequestAuthenticationClient +} + +// NewMockRequestAuthenticationClient creates a new mock instance. +func NewMockRequestAuthenticationClient(ctrl *gomock.Controller) *MockRequestAuthenticationClient { + mock := &MockRequestAuthenticationClient{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationClient) EXPECT() *MockRequestAuthenticationClientMockRecorder { + return m.recorder +} + +// CreateRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) CreateRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, opts ...client.CreateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreateRequestAuthentication indicates an expected call of CreateRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) CreateRequestAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).CreateRequestAuthentication), varargs...) +} + +// DeleteAllOfRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) DeleteAllOfRequestAuthentication(ctx context.Context, opts ...client.DeleteAllOfOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteAllOfRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllOfRequestAuthentication indicates an expected call of DeleteAllOfRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) DeleteAllOfRequestAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllOfRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).DeleteAllOfRequestAuthentication), varargs...) +} + +// DeleteRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) DeleteRequestAuthentication(ctx context.Context, key client.ObjectKey, opts ...client.DeleteOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, key} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRequestAuthentication indicates an expected call of DeleteRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) DeleteRequestAuthentication(ctx, key interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, key}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).DeleteRequestAuthentication), varargs...) +} + +// GetRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) GetRequestAuthentication(ctx context.Context, key client.ObjectKey) (*v1beta1.RequestAuthentication, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRequestAuthentication", ctx, key) + ret0, _ := ret[0].(*v1beta1.RequestAuthentication) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRequestAuthentication indicates an expected call of GetRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) GetRequestAuthentication(ctx, key interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).GetRequestAuthentication), ctx, key) +} + +// ListRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) ListRequestAuthentication(ctx context.Context, opts ...client.ListOption) (*v1beta1.RequestAuthenticationList, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListRequestAuthentication", varargs...) + ret0, _ := ret[0].(*v1beta1.RequestAuthenticationList) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListRequestAuthentication indicates an expected call of ListRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) ListRequestAuthentication(ctx interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).ListRequestAuthentication), varargs...) +} + +// PatchRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) PatchRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, patch client.Patch, opts ...client.PatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchRequestAuthentication indicates an expected call of PatchRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) PatchRequestAuthentication(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).PatchRequestAuthentication), varargs...) +} + +// PatchRequestAuthenticationStatus mocks base method. +func (m *MockRequestAuthenticationClient) PatchRequestAuthenticationStatus(ctx context.Context, obj *v1beta1.RequestAuthentication, patch client.Patch, opts ...client.SubResourcePatchOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj, patch} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "PatchRequestAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// PatchRequestAuthenticationStatus indicates an expected call of PatchRequestAuthenticationStatus. +func (mr *MockRequestAuthenticationClientMockRecorder) PatchRequestAuthenticationStatus(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj, patch}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PatchRequestAuthenticationStatus", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).PatchRequestAuthenticationStatus), varargs...) +} + +// UpdateRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) UpdateRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, opts ...client.UpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateRequestAuthentication indicates an expected call of UpdateRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) UpdateRequestAuthentication(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).UpdateRequestAuthentication), varargs...) +} + +// UpdateRequestAuthenticationStatus mocks base method. +func (m *MockRequestAuthenticationClient) UpdateRequestAuthenticationStatus(ctx context.Context, obj *v1beta1.RequestAuthentication, opts ...client.SubResourceUpdateOption) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateRequestAuthenticationStatus", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateRequestAuthenticationStatus indicates an expected call of UpdateRequestAuthenticationStatus. +func (mr *MockRequestAuthenticationClientMockRecorder) UpdateRequestAuthenticationStatus(ctx, obj interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRequestAuthenticationStatus", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).UpdateRequestAuthenticationStatus), varargs...) +} + +// UpsertRequestAuthentication mocks base method. +func (m *MockRequestAuthenticationClient) UpsertRequestAuthentication(ctx context.Context, obj *v1beta1.RequestAuthentication, transitionFuncs ...v1.RequestAuthenticationTransitionFunction) error { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, obj} + for _, a := range transitionFuncs { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpsertRequestAuthentication", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpsertRequestAuthentication indicates an expected call of UpsertRequestAuthentication. +func (mr *MockRequestAuthenticationClientMockRecorder) UpsertRequestAuthentication(ctx, obj interface{}, transitionFuncs ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, obj}, transitionFuncs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpsertRequestAuthentication", reflect.TypeOf((*MockRequestAuthenticationClient)(nil).UpsertRequestAuthentication), varargs...) +} + +// MockMulticlusterRequestAuthenticationClient is a mock of MulticlusterRequestAuthenticationClient interface. +type MockMulticlusterRequestAuthenticationClient struct { + ctrl *gomock.Controller + recorder *MockMulticlusterRequestAuthenticationClientMockRecorder +} + +// MockMulticlusterRequestAuthenticationClientMockRecorder is the mock recorder for MockMulticlusterRequestAuthenticationClient. +type MockMulticlusterRequestAuthenticationClientMockRecorder struct { + mock *MockMulticlusterRequestAuthenticationClient +} + +// NewMockMulticlusterRequestAuthenticationClient creates a new mock instance. +func NewMockMulticlusterRequestAuthenticationClient(ctrl *gomock.Controller) *MockMulticlusterRequestAuthenticationClient { + mock := &MockMulticlusterRequestAuthenticationClient{ctrl: ctrl} + mock.recorder = &MockMulticlusterRequestAuthenticationClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockMulticlusterRequestAuthenticationClient) EXPECT() *MockMulticlusterRequestAuthenticationClientMockRecorder { + return m.recorder +} + +// Cluster mocks base method. +func (m *MockMulticlusterRequestAuthenticationClient) Cluster(cluster string) (v1.RequestAuthenticationClient, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Cluster", cluster) + ret0, _ := ret[0].(v1.RequestAuthenticationClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Cluster indicates an expected call of Cluster. +func (mr *MockMulticlusterRequestAuthenticationClientMockRecorder) Cluster(cluster interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Cluster", reflect.TypeOf((*MockMulticlusterRequestAuthenticationClient)(nil).Cluster), cluster) +} diff --git a/pkg/api/istio/security.istio.io/v1/providers/client_providers.go b/pkg/api/istio/security.istio.io/v1/providers/client_providers.go new file mode 100644 index 0000000..ed743b6 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/providers/client_providers.go @@ -0,0 +1,102 @@ +// Code generated by skv2. DO NOT EDIT. + +package v1 + +import ( + security_istio_io_v1 "github.com/solo-io/external-apis/pkg/api/istio/security.istio.io/v1" + + "k8s.io/client-go/rest" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +/* + The intention of these providers are to be used for Mocking. + They expose the Clients as interfaces, as well as factories to provide mocked versions + of the clients when they require building within a component. + + See package `github.com/solo-io/skv2/pkg/multicluster/register` for example +*/ + +// Provider for AuthorizationPolicyClient from Clientset +func AuthorizationPolicyClientFromClientsetProvider(clients security_istio_io_v1.Clientset) security_istio_io_v1.AuthorizationPolicyClient { + return clients.AuthorizationPolicies() +} + +// Provider for AuthorizationPolicy Client from Client +func AuthorizationPolicyClientProvider(client client.Client) security_istio_io_v1.AuthorizationPolicyClient { + return security_istio_io_v1.NewAuthorizationPolicyClient(client) +} + +type AuthorizationPolicyClientFactory func(client client.Client) security_istio_io_v1.AuthorizationPolicyClient + +func AuthorizationPolicyClientFactoryProvider() AuthorizationPolicyClientFactory { + return AuthorizationPolicyClientProvider +} + +type AuthorizationPolicyClientFromConfigFactory func(cfg *rest.Config) (security_istio_io_v1.AuthorizationPolicyClient, error) + +func AuthorizationPolicyClientFromConfigFactoryProvider() AuthorizationPolicyClientFromConfigFactory { + return func(cfg *rest.Config) (security_istio_io_v1.AuthorizationPolicyClient, error) { + clients, err := security_istio_io_v1.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.AuthorizationPolicies(), nil + } +} + +// Provider for PeerAuthenticationClient from Clientset +func PeerAuthenticationClientFromClientsetProvider(clients security_istio_io_v1.Clientset) security_istio_io_v1.PeerAuthenticationClient { + return clients.PeerAuthentications() +} + +// Provider for PeerAuthentication Client from Client +func PeerAuthenticationClientProvider(client client.Client) security_istio_io_v1.PeerAuthenticationClient { + return security_istio_io_v1.NewPeerAuthenticationClient(client) +} + +type PeerAuthenticationClientFactory func(client client.Client) security_istio_io_v1.PeerAuthenticationClient + +func PeerAuthenticationClientFactoryProvider() PeerAuthenticationClientFactory { + return PeerAuthenticationClientProvider +} + +type PeerAuthenticationClientFromConfigFactory func(cfg *rest.Config) (security_istio_io_v1.PeerAuthenticationClient, error) + +func PeerAuthenticationClientFromConfigFactoryProvider() PeerAuthenticationClientFromConfigFactory { + return func(cfg *rest.Config) (security_istio_io_v1.PeerAuthenticationClient, error) { + clients, err := security_istio_io_v1.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.PeerAuthentications(), nil + } +} + +// Provider for RequestAuthenticationClient from Clientset +func RequestAuthenticationClientFromClientsetProvider(clients security_istio_io_v1.Clientset) security_istio_io_v1.RequestAuthenticationClient { + return clients.RequestAuthentications() +} + +// Provider for RequestAuthentication Client from Client +func RequestAuthenticationClientProvider(client client.Client) security_istio_io_v1.RequestAuthenticationClient { + return security_istio_io_v1.NewRequestAuthenticationClient(client) +} + +type RequestAuthenticationClientFactory func(client client.Client) security_istio_io_v1.RequestAuthenticationClient + +func RequestAuthenticationClientFactoryProvider() RequestAuthenticationClientFactory { + return RequestAuthenticationClientProvider +} + +type RequestAuthenticationClientFromConfigFactory func(cfg *rest.Config) (security_istio_io_v1.RequestAuthenticationClient, error) + +func RequestAuthenticationClientFromConfigFactoryProvider() RequestAuthenticationClientFromConfigFactory { + return func(cfg *rest.Config) (security_istio_io_v1.RequestAuthenticationClient, error) { + clients, err := security_istio_io_v1.NewClientsetFromConfig(cfg) + if err != nil { + return nil, err + } + return clients.RequestAuthentications(), nil + } +} diff --git a/pkg/api/istio/security.istio.io/v1/sets/mocks/sets.go b/pkg/api/istio/security.istio.io/v1/sets/mocks/sets.go new file mode 100644 index 0000000..9f1f113 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/sets/mocks/sets.go @@ -0,0 +1,784 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./sets.go + +// Package mock_v1sets is a generated GoMock package. +package mock_v1sets + +import ( + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + v1sets "github.com/solo-io/external-apis/pkg/api/istio/security.istio.io/v1/sets" + sets "github.com/solo-io/skv2/contrib/pkg/sets" + ezkube "github.com/solo-io/skv2/pkg/ezkube" + v1beta1 "istio.io/client-go/pkg/apis/security/v1beta1" + sets0 "k8s.io/apimachinery/pkg/util/sets" +) + +// MockAuthorizationPolicySet is a mock of AuthorizationPolicySet interface. +type MockAuthorizationPolicySet struct { + ctrl *gomock.Controller + recorder *MockAuthorizationPolicySetMockRecorder +} + +// MockAuthorizationPolicySetMockRecorder is the mock recorder for MockAuthorizationPolicySet. +type MockAuthorizationPolicySetMockRecorder struct { + mock *MockAuthorizationPolicySet +} + +// NewMockAuthorizationPolicySet creates a new mock instance. +func NewMockAuthorizationPolicySet(ctrl *gomock.Controller) *MockAuthorizationPolicySet { + mock := &MockAuthorizationPolicySet{ctrl: ctrl} + mock.recorder = &MockAuthorizationPolicySetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAuthorizationPolicySet) EXPECT() *MockAuthorizationPolicySetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockAuthorizationPolicySet) Clone() v1sets.AuthorizationPolicySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1sets.AuthorizationPolicySet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockAuthorizationPolicySetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockAuthorizationPolicySet) Delete(authorizationPolicy ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", authorizationPolicy) +} + +// Delete indicates an expected call of Delete. +func (mr *MockAuthorizationPolicySetMockRecorder) Delete(authorizationPolicy interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Delete), authorizationPolicy) +} + +// Delta mocks base method. +func (m *MockAuthorizationPolicySet) Delta(newSet v1sets.AuthorizationPolicySet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockAuthorizationPolicySetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockAuthorizationPolicySet) Difference(set v1sets.AuthorizationPolicySet) v1sets.AuthorizationPolicySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1sets.AuthorizationPolicySet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockAuthorizationPolicySetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockAuthorizationPolicySet) Equal(authorizationPolicySet v1sets.AuthorizationPolicySet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", authorizationPolicySet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockAuthorizationPolicySetMockRecorder) Equal(authorizationPolicySet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Equal), authorizationPolicySet) +} + +// Find mocks base method. +func (m *MockAuthorizationPolicySet) Find(id ezkube.ResourceId) (*v1beta1.AuthorizationPolicy, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1beta1.AuthorizationPolicy) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockAuthorizationPolicySetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockAuthorizationPolicySet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockAuthorizationPolicySetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockAuthorizationPolicySet) Has(authorizationPolicy ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", authorizationPolicy) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockAuthorizationPolicySetMockRecorder) Has(authorizationPolicy interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Has), authorizationPolicy) +} + +// Insert mocks base method. +func (m *MockAuthorizationPolicySet) Insert(authorizationPolicy ...*v1beta1.AuthorizationPolicy) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range authorizationPolicy { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockAuthorizationPolicySetMockRecorder) Insert(authorizationPolicy ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Insert), authorizationPolicy...) +} + +// Intersection mocks base method. +func (m *MockAuthorizationPolicySet) Intersection(set v1sets.AuthorizationPolicySet) v1sets.AuthorizationPolicySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1sets.AuthorizationPolicySet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockAuthorizationPolicySetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockAuthorizationPolicySet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockAuthorizationPolicySetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockAuthorizationPolicySet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockAuthorizationPolicySetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Length)) +} + +// List mocks base method. +func (m *MockAuthorizationPolicySet) List(filterResource ...func(*v1beta1.AuthorizationPolicy) bool) []*v1beta1.AuthorizationPolicy { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1beta1.AuthorizationPolicy) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockAuthorizationPolicySetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockAuthorizationPolicySet) Map() map[string]*v1beta1.AuthorizationPolicy { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1beta1.AuthorizationPolicy) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockAuthorizationPolicySetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockAuthorizationPolicySet) Union(set v1sets.AuthorizationPolicySet) v1sets.AuthorizationPolicySet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1sets.AuthorizationPolicySet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockAuthorizationPolicySetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockAuthorizationPolicySet) UnsortedList(filterResource ...func(*v1beta1.AuthorizationPolicy) bool) []*v1beta1.AuthorizationPolicy { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1beta1.AuthorizationPolicy) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockAuthorizationPolicySetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockAuthorizationPolicySet)(nil).UnsortedList), filterResource...) +} + +// MockPeerAuthenticationSet is a mock of PeerAuthenticationSet interface. +type MockPeerAuthenticationSet struct { + ctrl *gomock.Controller + recorder *MockPeerAuthenticationSetMockRecorder +} + +// MockPeerAuthenticationSetMockRecorder is the mock recorder for MockPeerAuthenticationSet. +type MockPeerAuthenticationSetMockRecorder struct { + mock *MockPeerAuthenticationSet +} + +// NewMockPeerAuthenticationSet creates a new mock instance. +func NewMockPeerAuthenticationSet(ctrl *gomock.Controller) *MockPeerAuthenticationSet { + mock := &MockPeerAuthenticationSet{ctrl: ctrl} + mock.recorder = &MockPeerAuthenticationSetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockPeerAuthenticationSet) EXPECT() *MockPeerAuthenticationSetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockPeerAuthenticationSet) Clone() v1sets.PeerAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1sets.PeerAuthenticationSet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockPeerAuthenticationSetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockPeerAuthenticationSet) Delete(peerAuthentication ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", peerAuthentication) +} + +// Delete indicates an expected call of Delete. +func (mr *MockPeerAuthenticationSetMockRecorder) Delete(peerAuthentication interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Delete), peerAuthentication) +} + +// Delta mocks base method. +func (m *MockPeerAuthenticationSet) Delta(newSet v1sets.PeerAuthenticationSet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockPeerAuthenticationSetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockPeerAuthenticationSet) Difference(set v1sets.PeerAuthenticationSet) v1sets.PeerAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1sets.PeerAuthenticationSet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockPeerAuthenticationSetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockPeerAuthenticationSet) Equal(peerAuthenticationSet v1sets.PeerAuthenticationSet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", peerAuthenticationSet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockPeerAuthenticationSetMockRecorder) Equal(peerAuthenticationSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Equal), peerAuthenticationSet) +} + +// Find mocks base method. +func (m *MockPeerAuthenticationSet) Find(id ezkube.ResourceId) (*v1beta1.PeerAuthentication, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1beta1.PeerAuthentication) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockPeerAuthenticationSetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockPeerAuthenticationSet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockPeerAuthenticationSetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockPeerAuthenticationSet) Has(peerAuthentication ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", peerAuthentication) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockPeerAuthenticationSetMockRecorder) Has(peerAuthentication interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Has), peerAuthentication) +} + +// Insert mocks base method. +func (m *MockPeerAuthenticationSet) Insert(peerAuthentication ...*v1beta1.PeerAuthentication) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range peerAuthentication { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockPeerAuthenticationSetMockRecorder) Insert(peerAuthentication ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Insert), peerAuthentication...) +} + +// Intersection mocks base method. +func (m *MockPeerAuthenticationSet) Intersection(set v1sets.PeerAuthenticationSet) v1sets.PeerAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1sets.PeerAuthenticationSet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockPeerAuthenticationSetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockPeerAuthenticationSet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockPeerAuthenticationSetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockPeerAuthenticationSet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockPeerAuthenticationSetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Length)) +} + +// List mocks base method. +func (m *MockPeerAuthenticationSet) List(filterResource ...func(*v1beta1.PeerAuthentication) bool) []*v1beta1.PeerAuthentication { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1beta1.PeerAuthentication) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockPeerAuthenticationSetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockPeerAuthenticationSet) Map() map[string]*v1beta1.PeerAuthentication { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1beta1.PeerAuthentication) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockPeerAuthenticationSetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockPeerAuthenticationSet) Union(set v1sets.PeerAuthenticationSet) v1sets.PeerAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1sets.PeerAuthenticationSet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockPeerAuthenticationSetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockPeerAuthenticationSet) UnsortedList(filterResource ...func(*v1beta1.PeerAuthentication) bool) []*v1beta1.PeerAuthentication { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1beta1.PeerAuthentication) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockPeerAuthenticationSetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockPeerAuthenticationSet)(nil).UnsortedList), filterResource...) +} + +// MockRequestAuthenticationSet is a mock of RequestAuthenticationSet interface. +type MockRequestAuthenticationSet struct { + ctrl *gomock.Controller + recorder *MockRequestAuthenticationSetMockRecorder +} + +// MockRequestAuthenticationSetMockRecorder is the mock recorder for MockRequestAuthenticationSet. +type MockRequestAuthenticationSetMockRecorder struct { + mock *MockRequestAuthenticationSet +} + +// NewMockRequestAuthenticationSet creates a new mock instance. +func NewMockRequestAuthenticationSet(ctrl *gomock.Controller) *MockRequestAuthenticationSet { + mock := &MockRequestAuthenticationSet{ctrl: ctrl} + mock.recorder = &MockRequestAuthenticationSetMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockRequestAuthenticationSet) EXPECT() *MockRequestAuthenticationSetMockRecorder { + return m.recorder +} + +// Clone mocks base method. +func (m *MockRequestAuthenticationSet) Clone() v1sets.RequestAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Clone") + ret0, _ := ret[0].(v1sets.RequestAuthenticationSet) + return ret0 +} + +// Clone indicates an expected call of Clone. +func (mr *MockRequestAuthenticationSetMockRecorder) Clone() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Clone", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Clone)) +} + +// Delete mocks base method. +func (m *MockRequestAuthenticationSet) Delete(requestAuthentication ezkube.ResourceId) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "Delete", requestAuthentication) +} + +// Delete indicates an expected call of Delete. +func (mr *MockRequestAuthenticationSetMockRecorder) Delete(requestAuthentication interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Delete), requestAuthentication) +} + +// Delta mocks base method. +func (m *MockRequestAuthenticationSet) Delta(newSet v1sets.RequestAuthenticationSet) sets.ResourceDelta { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Delta", newSet) + ret0, _ := ret[0].(sets.ResourceDelta) + return ret0 +} + +// Delta indicates an expected call of Delta. +func (mr *MockRequestAuthenticationSetMockRecorder) Delta(newSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delta", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Delta), newSet) +} + +// Difference mocks base method. +func (m *MockRequestAuthenticationSet) Difference(set v1sets.RequestAuthenticationSet) v1sets.RequestAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Difference", set) + ret0, _ := ret[0].(v1sets.RequestAuthenticationSet) + return ret0 +} + +// Difference indicates an expected call of Difference. +func (mr *MockRequestAuthenticationSetMockRecorder) Difference(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Difference", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Difference), set) +} + +// Equal mocks base method. +func (m *MockRequestAuthenticationSet) Equal(requestAuthenticationSet v1sets.RequestAuthenticationSet) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Equal", requestAuthenticationSet) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Equal indicates an expected call of Equal. +func (mr *MockRequestAuthenticationSetMockRecorder) Equal(requestAuthenticationSet interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Equal", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Equal), requestAuthenticationSet) +} + +// Find mocks base method. +func (m *MockRequestAuthenticationSet) Find(id ezkube.ResourceId) (*v1beta1.RequestAuthentication, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Find", id) + ret0, _ := ret[0].(*v1beta1.RequestAuthentication) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Find indicates an expected call of Find. +func (mr *MockRequestAuthenticationSetMockRecorder) Find(id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Find", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Find), id) +} + +// Generic mocks base method. +func (m *MockRequestAuthenticationSet) Generic() sets.ResourceSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Generic") + ret0, _ := ret[0].(sets.ResourceSet) + return ret0 +} + +// Generic indicates an expected call of Generic. +func (mr *MockRequestAuthenticationSetMockRecorder) Generic() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Generic", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Generic)) +} + +// Has mocks base method. +func (m *MockRequestAuthenticationSet) Has(requestAuthentication ezkube.ResourceId) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Has", requestAuthentication) + ret0, _ := ret[0].(bool) + return ret0 +} + +// Has indicates an expected call of Has. +func (mr *MockRequestAuthenticationSetMockRecorder) Has(requestAuthentication interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Has), requestAuthentication) +} + +// Insert mocks base method. +func (m *MockRequestAuthenticationSet) Insert(requestAuthentication ...*v1beta1.RequestAuthentication) { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range requestAuthentication { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Insert", varargs...) +} + +// Insert indicates an expected call of Insert. +func (mr *MockRequestAuthenticationSetMockRecorder) Insert(requestAuthentication ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Insert", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Insert), requestAuthentication...) +} + +// Intersection mocks base method. +func (m *MockRequestAuthenticationSet) Intersection(set v1sets.RequestAuthenticationSet) v1sets.RequestAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Intersection", set) + ret0, _ := ret[0].(v1sets.RequestAuthenticationSet) + return ret0 +} + +// Intersection indicates an expected call of Intersection. +func (mr *MockRequestAuthenticationSetMockRecorder) Intersection(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Intersection", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Intersection), set) +} + +// Keys mocks base method. +func (m *MockRequestAuthenticationSet) Keys() sets0.String { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Keys") + ret0, _ := ret[0].(sets0.String) + return ret0 +} + +// Keys indicates an expected call of Keys. +func (mr *MockRequestAuthenticationSetMockRecorder) Keys() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Keys", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Keys)) +} + +// Length mocks base method. +func (m *MockRequestAuthenticationSet) Length() int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Length") + ret0, _ := ret[0].(int) + return ret0 +} + +// Length indicates an expected call of Length. +func (mr *MockRequestAuthenticationSetMockRecorder) Length() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Length", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Length)) +} + +// List mocks base method. +func (m *MockRequestAuthenticationSet) List(filterResource ...func(*v1beta1.RequestAuthentication) bool) []*v1beta1.RequestAuthentication { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "List", varargs...) + ret0, _ := ret[0].([]*v1beta1.RequestAuthentication) + return ret0 +} + +// List indicates an expected call of List. +func (mr *MockRequestAuthenticationSetMockRecorder) List(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).List), filterResource...) +} + +// Map mocks base method. +func (m *MockRequestAuthenticationSet) Map() map[string]*v1beta1.RequestAuthentication { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Map") + ret0, _ := ret[0].(map[string]*v1beta1.RequestAuthentication) + return ret0 +} + +// Map indicates an expected call of Map. +func (mr *MockRequestAuthenticationSetMockRecorder) Map() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Map", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Map)) +} + +// Union mocks base method. +func (m *MockRequestAuthenticationSet) Union(set v1sets.RequestAuthenticationSet) v1sets.RequestAuthenticationSet { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Union", set) + ret0, _ := ret[0].(v1sets.RequestAuthenticationSet) + return ret0 +} + +// Union indicates an expected call of Union. +func (mr *MockRequestAuthenticationSetMockRecorder) Union(set interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Union", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).Union), set) +} + +// UnsortedList mocks base method. +func (m *MockRequestAuthenticationSet) UnsortedList(filterResource ...func(*v1beta1.RequestAuthentication) bool) []*v1beta1.RequestAuthentication { + m.ctrl.T.Helper() + varargs := []interface{}{} + for _, a := range filterResource { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UnsortedList", varargs...) + ret0, _ := ret[0].([]*v1beta1.RequestAuthentication) + return ret0 +} + +// UnsortedList indicates an expected call of UnsortedList. +func (mr *MockRequestAuthenticationSetMockRecorder) UnsortedList(filterResource ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnsortedList", reflect.TypeOf((*MockRequestAuthenticationSet)(nil).UnsortedList), filterResource...) +} diff --git a/pkg/api/istio/security.istio.io/v1/sets/sets.go b/pkg/api/istio/security.istio.io/v1/sets/sets.go new file mode 100644 index 0000000..44a656b --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/sets/sets.go @@ -0,0 +1,683 @@ +// Code generated by skv2. DO NOT EDIT. + +//go:generate mockgen -source ./sets.go -destination mocks/sets.go + +package v1sets + +import ( + security_istio_io_v1 "istio.io/client-go/pkg/apis/security/v1beta1" + + "github.com/rotisserie/eris" + sksets "github.com/solo-io/skv2/contrib/pkg/sets" + "github.com/solo-io/skv2/pkg/ezkube" + "k8s.io/apimachinery/pkg/util/sets" +) + +type AuthorizationPolicySet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*security_istio_io_v1.AuthorizationPolicy) bool) []*security_istio_io_v1.AuthorizationPolicy + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*security_istio_io_v1.AuthorizationPolicy) bool) []*security_istio_io_v1.AuthorizationPolicy + // Return the Set as a map of key to resource. + Map() map[string]*security_istio_io_v1.AuthorizationPolicy + // Insert a resource into the set. + Insert(authorizationPolicy ...*security_istio_io_v1.AuthorizationPolicy) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(authorizationPolicySet AuthorizationPolicySet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(authorizationPolicy ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(authorizationPolicy ezkube.ResourceId) + // Return the union with the provided set + Union(set AuthorizationPolicySet) AuthorizationPolicySet + // Return the difference with the provided set + Difference(set AuthorizationPolicySet) AuthorizationPolicySet + // Return the intersection with the provided set + Intersection(set AuthorizationPolicySet) AuthorizationPolicySet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*security_istio_io_v1.AuthorizationPolicy, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another AuthorizationPolicySet + Delta(newSet AuthorizationPolicySet) sksets.ResourceDelta + // Create a deep copy of the current AuthorizationPolicySet + Clone() AuthorizationPolicySet +} + +func makeGenericAuthorizationPolicySet(authorizationPolicyList []*security_istio_io_v1.AuthorizationPolicy) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range authorizationPolicyList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type authorizationPolicySet struct { + set sksets.ResourceSet +} + +func NewAuthorizationPolicySet(authorizationPolicyList ...*security_istio_io_v1.AuthorizationPolicy) AuthorizationPolicySet { + return &authorizationPolicySet{set: makeGenericAuthorizationPolicySet(authorizationPolicyList)} +} + +func NewAuthorizationPolicySetFromList(authorizationPolicyList *security_istio_io_v1.AuthorizationPolicyList) AuthorizationPolicySet { + list := make([]*security_istio_io_v1.AuthorizationPolicy, 0, len(authorizationPolicyList.Items)) + for idx := range authorizationPolicyList.Items { + list = append(list, authorizationPolicyList.Items[idx]) + } + return &authorizationPolicySet{set: makeGenericAuthorizationPolicySet(list)} +} + +func (s *authorizationPolicySet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *authorizationPolicySet) List(filterResource ...func(*security_istio_io_v1.AuthorizationPolicy) bool) []*security_istio_io_v1.AuthorizationPolicy { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*security_istio_io_v1.AuthorizationPolicy)) + }) + } + + objs := s.Generic().List(genericFilters...) + authorizationPolicyList := make([]*security_istio_io_v1.AuthorizationPolicy, 0, len(objs)) + for _, obj := range objs { + authorizationPolicyList = append(authorizationPolicyList, obj.(*security_istio_io_v1.AuthorizationPolicy)) + } + return authorizationPolicyList +} + +func (s *authorizationPolicySet) UnsortedList(filterResource ...func(*security_istio_io_v1.AuthorizationPolicy) bool) []*security_istio_io_v1.AuthorizationPolicy { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*security_istio_io_v1.AuthorizationPolicy)) + }) + } + + var authorizationPolicyList []*security_istio_io_v1.AuthorizationPolicy + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + authorizationPolicyList = append(authorizationPolicyList, obj.(*security_istio_io_v1.AuthorizationPolicy)) + } + return authorizationPolicyList +} + +func (s *authorizationPolicySet) Map() map[string]*security_istio_io_v1.AuthorizationPolicy { + if s == nil { + return nil + } + + newMap := map[string]*security_istio_io_v1.AuthorizationPolicy{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*security_istio_io_v1.AuthorizationPolicy) + } + return newMap +} + +func (s *authorizationPolicySet) Insert( + authorizationPolicyList ...*security_istio_io_v1.AuthorizationPolicy, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range authorizationPolicyList { + s.Generic().Insert(obj) + } +} + +func (s *authorizationPolicySet) Has(authorizationPolicy ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(authorizationPolicy) +} + +func (s *authorizationPolicySet) Equal( + authorizationPolicySet AuthorizationPolicySet, +) bool { + if s == nil { + return authorizationPolicySet == nil + } + return s.Generic().Equal(authorizationPolicySet.Generic()) +} + +func (s *authorizationPolicySet) Delete(AuthorizationPolicy ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(AuthorizationPolicy) +} + +func (s *authorizationPolicySet) Union(set AuthorizationPolicySet) AuthorizationPolicySet { + if s == nil { + return set + } + return NewAuthorizationPolicySet(append(s.List(), set.List()...)...) +} + +func (s *authorizationPolicySet) Difference(set AuthorizationPolicySet) AuthorizationPolicySet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &authorizationPolicySet{set: newSet} +} + +func (s *authorizationPolicySet) Intersection(set AuthorizationPolicySet) AuthorizationPolicySet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var authorizationPolicyList []*security_istio_io_v1.AuthorizationPolicy + for _, obj := range newSet.List() { + authorizationPolicyList = append(authorizationPolicyList, obj.(*security_istio_io_v1.AuthorizationPolicy)) + } + return NewAuthorizationPolicySet(authorizationPolicyList...) +} + +func (s *authorizationPolicySet) Find(id ezkube.ResourceId) (*security_istio_io_v1.AuthorizationPolicy, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find AuthorizationPolicy %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&security_istio_io_v1.AuthorizationPolicy{}, id) + if err != nil { + return nil, err + } + + return obj.(*security_istio_io_v1.AuthorizationPolicy), nil +} + +func (s *authorizationPolicySet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *authorizationPolicySet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *authorizationPolicySet) Delta(newSet AuthorizationPolicySet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *authorizationPolicySet) Clone() AuthorizationPolicySet { + if s == nil { + return nil + } + return &authorizationPolicySet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type PeerAuthenticationSet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*security_istio_io_v1.PeerAuthentication) bool) []*security_istio_io_v1.PeerAuthentication + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*security_istio_io_v1.PeerAuthentication) bool) []*security_istio_io_v1.PeerAuthentication + // Return the Set as a map of key to resource. + Map() map[string]*security_istio_io_v1.PeerAuthentication + // Insert a resource into the set. + Insert(peerAuthentication ...*security_istio_io_v1.PeerAuthentication) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(peerAuthenticationSet PeerAuthenticationSet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(peerAuthentication ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(peerAuthentication ezkube.ResourceId) + // Return the union with the provided set + Union(set PeerAuthenticationSet) PeerAuthenticationSet + // Return the difference with the provided set + Difference(set PeerAuthenticationSet) PeerAuthenticationSet + // Return the intersection with the provided set + Intersection(set PeerAuthenticationSet) PeerAuthenticationSet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*security_istio_io_v1.PeerAuthentication, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another PeerAuthenticationSet + Delta(newSet PeerAuthenticationSet) sksets.ResourceDelta + // Create a deep copy of the current PeerAuthenticationSet + Clone() PeerAuthenticationSet +} + +func makeGenericPeerAuthenticationSet(peerAuthenticationList []*security_istio_io_v1.PeerAuthentication) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range peerAuthenticationList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type peerAuthenticationSet struct { + set sksets.ResourceSet +} + +func NewPeerAuthenticationSet(peerAuthenticationList ...*security_istio_io_v1.PeerAuthentication) PeerAuthenticationSet { + return &peerAuthenticationSet{set: makeGenericPeerAuthenticationSet(peerAuthenticationList)} +} + +func NewPeerAuthenticationSetFromList(peerAuthenticationList *security_istio_io_v1.PeerAuthenticationList) PeerAuthenticationSet { + list := make([]*security_istio_io_v1.PeerAuthentication, 0, len(peerAuthenticationList.Items)) + for idx := range peerAuthenticationList.Items { + list = append(list, peerAuthenticationList.Items[idx]) + } + return &peerAuthenticationSet{set: makeGenericPeerAuthenticationSet(list)} +} + +func (s *peerAuthenticationSet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *peerAuthenticationSet) List(filterResource ...func(*security_istio_io_v1.PeerAuthentication) bool) []*security_istio_io_v1.PeerAuthentication { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*security_istio_io_v1.PeerAuthentication)) + }) + } + + objs := s.Generic().List(genericFilters...) + peerAuthenticationList := make([]*security_istio_io_v1.PeerAuthentication, 0, len(objs)) + for _, obj := range objs { + peerAuthenticationList = append(peerAuthenticationList, obj.(*security_istio_io_v1.PeerAuthentication)) + } + return peerAuthenticationList +} + +func (s *peerAuthenticationSet) UnsortedList(filterResource ...func(*security_istio_io_v1.PeerAuthentication) bool) []*security_istio_io_v1.PeerAuthentication { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*security_istio_io_v1.PeerAuthentication)) + }) + } + + var peerAuthenticationList []*security_istio_io_v1.PeerAuthentication + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + peerAuthenticationList = append(peerAuthenticationList, obj.(*security_istio_io_v1.PeerAuthentication)) + } + return peerAuthenticationList +} + +func (s *peerAuthenticationSet) Map() map[string]*security_istio_io_v1.PeerAuthentication { + if s == nil { + return nil + } + + newMap := map[string]*security_istio_io_v1.PeerAuthentication{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*security_istio_io_v1.PeerAuthentication) + } + return newMap +} + +func (s *peerAuthenticationSet) Insert( + peerAuthenticationList ...*security_istio_io_v1.PeerAuthentication, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range peerAuthenticationList { + s.Generic().Insert(obj) + } +} + +func (s *peerAuthenticationSet) Has(peerAuthentication ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(peerAuthentication) +} + +func (s *peerAuthenticationSet) Equal( + peerAuthenticationSet PeerAuthenticationSet, +) bool { + if s == nil { + return peerAuthenticationSet == nil + } + return s.Generic().Equal(peerAuthenticationSet.Generic()) +} + +func (s *peerAuthenticationSet) Delete(PeerAuthentication ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(PeerAuthentication) +} + +func (s *peerAuthenticationSet) Union(set PeerAuthenticationSet) PeerAuthenticationSet { + if s == nil { + return set + } + return NewPeerAuthenticationSet(append(s.List(), set.List()...)...) +} + +func (s *peerAuthenticationSet) Difference(set PeerAuthenticationSet) PeerAuthenticationSet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &peerAuthenticationSet{set: newSet} +} + +func (s *peerAuthenticationSet) Intersection(set PeerAuthenticationSet) PeerAuthenticationSet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var peerAuthenticationList []*security_istio_io_v1.PeerAuthentication + for _, obj := range newSet.List() { + peerAuthenticationList = append(peerAuthenticationList, obj.(*security_istio_io_v1.PeerAuthentication)) + } + return NewPeerAuthenticationSet(peerAuthenticationList...) +} + +func (s *peerAuthenticationSet) Find(id ezkube.ResourceId) (*security_istio_io_v1.PeerAuthentication, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find PeerAuthentication %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&security_istio_io_v1.PeerAuthentication{}, id) + if err != nil { + return nil, err + } + + return obj.(*security_istio_io_v1.PeerAuthentication), nil +} + +func (s *peerAuthenticationSet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *peerAuthenticationSet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *peerAuthenticationSet) Delta(newSet PeerAuthenticationSet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *peerAuthenticationSet) Clone() PeerAuthenticationSet { + if s == nil { + return nil + } + return &peerAuthenticationSet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} + +type RequestAuthenticationSet interface { + // Get the set stored keys + Keys() sets.String + // List of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + List(filterResource ...func(*security_istio_io_v1.RequestAuthentication) bool) []*security_istio_io_v1.RequestAuthentication + // Unsorted list of resources stored in the set. Pass an optional filter function to filter on the list. + // The filter function should return false to keep the resource, true to drop it. + UnsortedList(filterResource ...func(*security_istio_io_v1.RequestAuthentication) bool) []*security_istio_io_v1.RequestAuthentication + // Return the Set as a map of key to resource. + Map() map[string]*security_istio_io_v1.RequestAuthentication + // Insert a resource into the set. + Insert(requestAuthentication ...*security_istio_io_v1.RequestAuthentication) + // Compare the equality of the keys in two sets (not the resources themselves) + Equal(requestAuthenticationSet RequestAuthenticationSet) bool + // Check if the set contains a key matching the resource (not the resource itself) + Has(requestAuthentication ezkube.ResourceId) bool + // Delete the key matching the resource + Delete(requestAuthentication ezkube.ResourceId) + // Return the union with the provided set + Union(set RequestAuthenticationSet) RequestAuthenticationSet + // Return the difference with the provided set + Difference(set RequestAuthenticationSet) RequestAuthenticationSet + // Return the intersection with the provided set + Intersection(set RequestAuthenticationSet) RequestAuthenticationSet + // Find the resource with the given ID + Find(id ezkube.ResourceId) (*security_istio_io_v1.RequestAuthentication, error) + // Get the length of the set + Length() int + // returns the generic implementation of the set + Generic() sksets.ResourceSet + // returns the delta between this and and another RequestAuthenticationSet + Delta(newSet RequestAuthenticationSet) sksets.ResourceDelta + // Create a deep copy of the current RequestAuthenticationSet + Clone() RequestAuthenticationSet +} + +func makeGenericRequestAuthenticationSet(requestAuthenticationList []*security_istio_io_v1.RequestAuthentication) sksets.ResourceSet { + var genericResources []ezkube.ResourceId + for _, obj := range requestAuthenticationList { + genericResources = append(genericResources, obj) + } + return sksets.NewResourceSet(genericResources...) +} + +type requestAuthenticationSet struct { + set sksets.ResourceSet +} + +func NewRequestAuthenticationSet(requestAuthenticationList ...*security_istio_io_v1.RequestAuthentication) RequestAuthenticationSet { + return &requestAuthenticationSet{set: makeGenericRequestAuthenticationSet(requestAuthenticationList)} +} + +func NewRequestAuthenticationSetFromList(requestAuthenticationList *security_istio_io_v1.RequestAuthenticationList) RequestAuthenticationSet { + list := make([]*security_istio_io_v1.RequestAuthentication, 0, len(requestAuthenticationList.Items)) + for idx := range requestAuthenticationList.Items { + list = append(list, requestAuthenticationList.Items[idx]) + } + return &requestAuthenticationSet{set: makeGenericRequestAuthenticationSet(list)} +} + +func (s *requestAuthenticationSet) Keys() sets.String { + if s == nil { + return sets.String{} + } + return s.Generic().Keys() +} + +func (s *requestAuthenticationSet) List(filterResource ...func(*security_istio_io_v1.RequestAuthentication) bool) []*security_istio_io_v1.RequestAuthentication { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*security_istio_io_v1.RequestAuthentication)) + }) + } + + objs := s.Generic().List(genericFilters...) + requestAuthenticationList := make([]*security_istio_io_v1.RequestAuthentication, 0, len(objs)) + for _, obj := range objs { + requestAuthenticationList = append(requestAuthenticationList, obj.(*security_istio_io_v1.RequestAuthentication)) + } + return requestAuthenticationList +} + +func (s *requestAuthenticationSet) UnsortedList(filterResource ...func(*security_istio_io_v1.RequestAuthentication) bool) []*security_istio_io_v1.RequestAuthentication { + if s == nil { + return nil + } + var genericFilters []func(ezkube.ResourceId) bool + for _, filter := range filterResource { + filter := filter + genericFilters = append(genericFilters, func(obj ezkube.ResourceId) bool { + return filter(obj.(*security_istio_io_v1.RequestAuthentication)) + }) + } + + var requestAuthenticationList []*security_istio_io_v1.RequestAuthentication + for _, obj := range s.Generic().UnsortedList(genericFilters...) { + requestAuthenticationList = append(requestAuthenticationList, obj.(*security_istio_io_v1.RequestAuthentication)) + } + return requestAuthenticationList +} + +func (s *requestAuthenticationSet) Map() map[string]*security_istio_io_v1.RequestAuthentication { + if s == nil { + return nil + } + + newMap := map[string]*security_istio_io_v1.RequestAuthentication{} + for k, v := range s.Generic().Map() { + newMap[k] = v.(*security_istio_io_v1.RequestAuthentication) + } + return newMap +} + +func (s *requestAuthenticationSet) Insert( + requestAuthenticationList ...*security_istio_io_v1.RequestAuthentication, +) { + if s == nil { + panic("cannot insert into nil set") + } + + for _, obj := range requestAuthenticationList { + s.Generic().Insert(obj) + } +} + +func (s *requestAuthenticationSet) Has(requestAuthentication ezkube.ResourceId) bool { + if s == nil { + return false + } + return s.Generic().Has(requestAuthentication) +} + +func (s *requestAuthenticationSet) Equal( + requestAuthenticationSet RequestAuthenticationSet, +) bool { + if s == nil { + return requestAuthenticationSet == nil + } + return s.Generic().Equal(requestAuthenticationSet.Generic()) +} + +func (s *requestAuthenticationSet) Delete(RequestAuthentication ezkube.ResourceId) { + if s == nil { + return + } + s.Generic().Delete(RequestAuthentication) +} + +func (s *requestAuthenticationSet) Union(set RequestAuthenticationSet) RequestAuthenticationSet { + if s == nil { + return set + } + return NewRequestAuthenticationSet(append(s.List(), set.List()...)...) +} + +func (s *requestAuthenticationSet) Difference(set RequestAuthenticationSet) RequestAuthenticationSet { + if s == nil { + return set + } + newSet := s.Generic().Difference(set.Generic()) + return &requestAuthenticationSet{set: newSet} +} + +func (s *requestAuthenticationSet) Intersection(set RequestAuthenticationSet) RequestAuthenticationSet { + if s == nil { + return nil + } + newSet := s.Generic().Intersection(set.Generic()) + var requestAuthenticationList []*security_istio_io_v1.RequestAuthentication + for _, obj := range newSet.List() { + requestAuthenticationList = append(requestAuthenticationList, obj.(*security_istio_io_v1.RequestAuthentication)) + } + return NewRequestAuthenticationSet(requestAuthenticationList...) +} + +func (s *requestAuthenticationSet) Find(id ezkube.ResourceId) (*security_istio_io_v1.RequestAuthentication, error) { + if s == nil { + return nil, eris.Errorf("empty set, cannot find RequestAuthentication %v", sksets.Key(id)) + } + obj, err := s.Generic().Find(&security_istio_io_v1.RequestAuthentication{}, id) + if err != nil { + return nil, err + } + + return obj.(*security_istio_io_v1.RequestAuthentication), nil +} + +func (s *requestAuthenticationSet) Length() int { + if s == nil { + return 0 + } + return s.Generic().Length() +} + +func (s *requestAuthenticationSet) Generic() sksets.ResourceSet { + if s == nil { + return nil + } + return s.set +} + +func (s *requestAuthenticationSet) Delta(newSet RequestAuthenticationSet) sksets.ResourceDelta { + if s == nil { + return sksets.ResourceDelta{ + Inserted: newSet.Generic(), + } + } + return s.Generic().Delta(newSet.Generic()) +} + +func (s *requestAuthenticationSet) Clone() RequestAuthenticationSet { + if s == nil { + return nil + } + return &requestAuthenticationSet{set: sksets.NewResourceSet(s.Generic().Clone().List()...)} +} diff --git a/pkg/api/istio/security.istio.io/v1/type_helpers.go b/pkg/api/istio/security.istio.io/v1/type_helpers.go new file mode 100644 index 0000000..dad12f5 --- /dev/null +++ b/pkg/api/istio/security.istio.io/v1/type_helpers.go @@ -0,0 +1,17 @@ +// Code generated by skv2. DO NOT EDIT. + +// Definitions for the Kubernetes types +package v1 + +import ( + . "istio.io/client-go/pkg/apis/security/v1beta1" +) + +// AuthorizationPolicySlice represents a slice of *AuthorizationPolicy +type AuthorizationPolicySlice []*AuthorizationPolicy + +// PeerAuthenticationSlice represents a slice of *PeerAuthentication +type PeerAuthenticationSlice []*PeerAuthentication + +// RequestAuthenticationSlice represents a slice of *RequestAuthentication +type RequestAuthenticationSlice []*RequestAuthentication