Documentation ¶
Index ¶
- Constants
- Variables
- type ErrNotFound
- type JSONPatch
- type MockCiliumV2Client
- func (m *MockCiliumV2Client) CiliumClusterwideEnvoyConfigs() ciliumv2.CiliumClusterwideEnvoyConfigInterface
- func (m *MockCiliumV2Client) CiliumClusterwideNetworkPolicies() ciliumv2.CiliumClusterwideNetworkPolicyInterface
- func (m *MockCiliumV2Client) CiliumEgressGatewayPolicies() ciliumv2.CiliumEgressGatewayPolicyInterface
- func (m *MockCiliumV2Client) CiliumEndpoints(namespace string) ciliumv2.CiliumEndpointInterface
- func (m *MockCiliumV2Client) CiliumEnvoyConfigs(_ string) ciliumv2.CiliumEnvoyConfigInterface
- func (m *MockCiliumV2Client) CiliumExternalWorkloads() ciliumv2.CiliumExternalWorkloadInterface
- func (m *MockCiliumV2Client) CiliumIdentities() ciliumv2.CiliumIdentityInterface
- func (m *MockCiliumV2Client) CiliumLocalRedirectPolicies(_ string) ciliumv2.CiliumLocalRedirectPolicyInterface
- func (m *MockCiliumV2Client) CiliumNetworkPolicies(_ string) ciliumv2.CiliumNetworkPolicyInterface
- func (m *MockCiliumV2Client) CiliumNodes() ciliumv2.CiliumNodeInterface
- func (m *MockCiliumV2Client) RESTClient() rest.Interface
- type MockEndpointClient
- func (m *MockEndpointClient) Create(_ context.Context, ciliumEndpoint *v2.CiliumEndpoint, _ v1.CreateOptions) (*v2.CiliumEndpoint, error)
- func (m *MockEndpointClient) Delete(_ context.Context, name string, _ v1.DeleteOptions) error
- func (m *MockEndpointClient) DeleteCollection(_ context.Context, _ v1.DeleteOptions, _ v1.ListOptions) error
- func (m *MockEndpointClient) Get(_ context.Context, name string, _ v1.GetOptions) (*v2.CiliumEndpoint, error)
- func (m *MockEndpointClient) List(_ context.Context, _ v1.ListOptions) (*v2.CiliumEndpointList, error)
- func (m *MockEndpointClient) Patch(_ context.Context, name string, _ types.PatchType, data []byte, ...) (result *v2.CiliumEndpoint, err error)
- func (m *MockEndpointClient) Update(_ context.Context, ciliumEndpoint *v2.CiliumEndpoint, _ v1.UpdateOptions) (*v2.CiliumEndpoint, error)
- func (m *MockEndpointClient) UpdateStatus(_ context.Context, _ *v2.CiliumEndpoint, _ v1.UpdateOptions) (*v2.CiliumEndpoint, error)
- func (m *MockEndpointClient) Watch(_ context.Context, _ v1.ListOptions) (watch.Interface, error)
- type MockIdentityClient
- func (m *MockIdentityClient) Create(_ context.Context, ciliumIdentity *v2.CiliumIdentity, _ v1.CreateOptions) (*v2.CiliumIdentity, error)
- func (m *MockIdentityClient) Delete(_ context.Context, name string, _ v1.DeleteOptions) error
- func (m *MockIdentityClient) DeleteCollection(_ context.Context, _ v1.DeleteOptions, _ v1.ListOptions) error
- func (m *MockIdentityClient) Get(_ context.Context, name string, _ v1.GetOptions) (*v2.CiliumIdentity, error)
- func (m *MockIdentityClient) GetIdentities() map[string]*v2.CiliumIdentity
- func (m *MockIdentityClient) List(_ context.Context, _ v1.ListOptions) (*v2.CiliumIdentityList, error)
- func (m *MockIdentityClient) Patch(_ context.Context, _ string, _ types.PatchType, _ []byte, _ v1.PatchOptions, ...) (result *v2.CiliumIdentity, err error)
- func (m *MockIdentityClient) Update(_ context.Context, ciliumIdentity *v2.CiliumIdentity, _ v1.UpdateOptions) (*v2.CiliumIdentity, error)
- func (m *MockIdentityClient) Watch(_ context.Context, _ v1.ListOptions) (watch.Interface, error)
- type MockResource
- func (r *MockResource[T]) ByIndex(_, _ string) ([]T, error)
- func (r *MockResource[T]) CacheStore() cache.Store
- func (r *MockResource[T]) Delete(k resource.Key)
- func (r *MockResource[T]) Events(_ context.Context, _ ...resource.EventsOpt) <-chan resource.Event[T]
- func (r *MockResource[T]) FailOnNextStoreCall()
- func (r *MockResource[T]) Get(obj T) (item T, exists bool, err error)
- func (r *MockResource[T]) GetByKey(key resource.Key) (item T, exists bool, err error)
- func (r *MockResource[T]) IndexKeys(_, _ string) ([]string, error)
- func (r *MockResource[T]) IterKeys() resource.KeyIter
- func (r *MockResource[T]) List() []T
- func (r *MockResource[T]) Observe(_ context.Context, _ func(resource.Event[T]), _ func(error))
- func (r *MockResource[T]) Release()
- func (r *MockResource[T]) Store(context.Context) (resource.Store[T], error)
- func (r *MockResource[T]) Upsert(obj T)
- type MockVersionedClient
Constants ¶
const ErrCodeNotFound = 404
Variables ¶
var ( ErrAlreadyExists = errors.New("already exists") ErrNotImplemented = errors.New("not implemented") )
var ErrMockStoreFailure = errors.New("mock store failure")
Functions ¶
This section is empty.
Types ¶
type ErrNotFound ¶
type ErrNotFound struct{}
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
func (ErrNotFound) Status ¶
func (e ErrNotFound) Status() v1.Status
type JSONPatch ¶
type JSONPatch struct { OP string `json:"op,omitempty"` Path string `json:"path,omitempty"` Value v2.EndpointStatus `json:"value"` }
type MockCiliumV2Client ¶
type MockCiliumV2Client struct {
// contains filtered or unexported fields
}
MockCiliumV2Client is a mock implementation of ciliumv2.CiliumV2Interface. Currently it only returns a real value for CiliumIdentities()
func NewMockCiliumV2Client ¶
func NewMockCiliumV2Client(l logrus.FieldLogger, ciliumEndpoints *MockResource[*v2.CiliumEndpoint]) *MockCiliumV2Client
func (*MockCiliumV2Client) CiliumClusterwideEnvoyConfigs ¶
func (m *MockCiliumV2Client) CiliumClusterwideEnvoyConfigs() ciliumv2.CiliumClusterwideEnvoyConfigInterface
func (*MockCiliumV2Client) CiliumClusterwideNetworkPolicies ¶
func (m *MockCiliumV2Client) CiliumClusterwideNetworkPolicies() ciliumv2.CiliumClusterwideNetworkPolicyInterface
func (*MockCiliumV2Client) CiliumEgressGatewayPolicies ¶
func (m *MockCiliumV2Client) CiliumEgressGatewayPolicies() ciliumv2.CiliumEgressGatewayPolicyInterface
func (*MockCiliumV2Client) CiliumEndpoints ¶
func (m *MockCiliumV2Client) CiliumEndpoints(namespace string) ciliumv2.CiliumEndpointInterface
func (*MockCiliumV2Client) CiliumEnvoyConfigs ¶
func (m *MockCiliumV2Client) CiliumEnvoyConfigs(_ string) ciliumv2.CiliumEnvoyConfigInterface
func (*MockCiliumV2Client) CiliumExternalWorkloads ¶
func (m *MockCiliumV2Client) CiliumExternalWorkloads() ciliumv2.CiliumExternalWorkloadInterface
func (*MockCiliumV2Client) CiliumIdentities ¶
func (m *MockCiliumV2Client) CiliumIdentities() ciliumv2.CiliumIdentityInterface
func (*MockCiliumV2Client) CiliumLocalRedirectPolicies ¶
func (m *MockCiliumV2Client) CiliumLocalRedirectPolicies(_ string) ciliumv2.CiliumLocalRedirectPolicyInterface
func (*MockCiliumV2Client) CiliumNetworkPolicies ¶
func (m *MockCiliumV2Client) CiliumNetworkPolicies(_ string) ciliumv2.CiliumNetworkPolicyInterface
func (*MockCiliumV2Client) CiliumNodes ¶
func (m *MockCiliumV2Client) CiliumNodes() ciliumv2.CiliumNodeInterface
func (*MockCiliumV2Client) RESTClient ¶
func (m *MockCiliumV2Client) RESTClient() rest.Interface
type MockEndpointClient ¶
type MockEndpointClient struct {
// contains filtered or unexported fields
}
func NewMockEndpointClient ¶
func NewMockEndpointClient(l logrus.FieldLogger, namespace string, ciliumEndpoints *MockResource[*v2.CiliumEndpoint]) *MockEndpointClient
func (*MockEndpointClient) Create ¶
func (m *MockEndpointClient) Create(_ context.Context, ciliumEndpoint *v2.CiliumEndpoint, _ v1.CreateOptions) (*v2.CiliumEndpoint, error)
func (*MockEndpointClient) Delete ¶
func (m *MockEndpointClient) Delete(_ context.Context, name string, _ v1.DeleteOptions) error
func (*MockEndpointClient) DeleteCollection ¶
func (m *MockEndpointClient) DeleteCollection(_ context.Context, _ v1.DeleteOptions, _ v1.ListOptions) error
func (*MockEndpointClient) Get ¶
func (m *MockEndpointClient) Get(_ context.Context, name string, _ v1.GetOptions) (*v2.CiliumEndpoint, error)
func (*MockEndpointClient) List ¶
func (m *MockEndpointClient) List(_ context.Context, _ v1.ListOptions) (*v2.CiliumEndpointList, error)
func (*MockEndpointClient) Patch ¶
func (m *MockEndpointClient) Patch(_ context.Context, name string, _ types.PatchType, data []byte, _ v1.PatchOptions, _ ...string) (result *v2.CiliumEndpoint, err error)
func (*MockEndpointClient) Update ¶
func (m *MockEndpointClient) Update(_ context.Context, ciliumEndpoint *v2.CiliumEndpoint, _ v1.UpdateOptions) (*v2.CiliumEndpoint, error)
func (*MockEndpointClient) UpdateStatus ¶
func (m *MockEndpointClient) UpdateStatus(_ context.Context, _ *v2.CiliumEndpoint, _ v1.UpdateOptions) (*v2.CiliumEndpoint, error)
func (*MockEndpointClient) Watch ¶
func (m *MockEndpointClient) Watch(_ context.Context, _ v1.ListOptions) (watch.Interface, error)
type MockIdentityClient ¶
type MockIdentityClient struct {
// contains filtered or unexported fields
}
MockIdentityClient is a mock implementation of ciliumv2.CiliumIdentityInterface. We only implement what's needed. These methods are used by: - CRDBackend within the Allocator within the IdentityManager - identitygc cell
func NewMockIdentityClient ¶
func NewMockIdentityClient(l logrus.FieldLogger) *MockIdentityClient
func (*MockIdentityClient) Create ¶
func (m *MockIdentityClient) Create(_ context.Context, ciliumIdentity *v2.CiliumIdentity, _ v1.CreateOptions) (*v2.CiliumIdentity, error)
func (*MockIdentityClient) Delete ¶
func (m *MockIdentityClient) Delete(_ context.Context, name string, _ v1.DeleteOptions) error
func (*MockIdentityClient) DeleteCollection ¶
func (m *MockIdentityClient) DeleteCollection(_ context.Context, _ v1.DeleteOptions, _ v1.ListOptions) error
func (*MockIdentityClient) Get ¶
func (m *MockIdentityClient) Get(_ context.Context, name string, _ v1.GetOptions) (*v2.CiliumIdentity, error)
func (*MockIdentityClient) GetIdentities ¶
func (m *MockIdentityClient) GetIdentities() map[string]*v2.CiliumIdentity
func (*MockIdentityClient) List ¶
func (m *MockIdentityClient) List(_ context.Context, _ v1.ListOptions) (*v2.CiliumIdentityList, error)
func (*MockIdentityClient) Patch ¶
func (m *MockIdentityClient) Patch(_ context.Context, _ string, _ types.PatchType, _ []byte, _ v1.PatchOptions, _ ...string) (result *v2.CiliumIdentity, err error)
func (*MockIdentityClient) Update ¶
func (m *MockIdentityClient) Update(_ context.Context, ciliumIdentity *v2.CiliumIdentity, _ v1.UpdateOptions) (*v2.CiliumIdentity, error)
func (*MockIdentityClient) Watch ¶
func (m *MockIdentityClient) Watch(_ context.Context, _ v1.ListOptions) (watch.Interface, error)
type MockResource ¶
type MockResource[T k8sRuntime.Object] struct { // contains filtered or unexported fields }
MockResource is a mock implementation of resource.Resource AND resource.Store It currently only implements the methods used in the endpoint controller i.e. Store() and GetByKey() plus some helpers to add/remove items from the cache and error on the next call to Store()
func NewMockResource ¶
func NewMockResource[T k8sRuntime.Object](l logrus.FieldLogger) *MockResource[T]
func (*MockResource[T]) ByIndex ¶
func (r *MockResource[T]) ByIndex(_, _ string) ([]T, error)
func (*MockResource[T]) CacheStore ¶
func (r *MockResource[T]) CacheStore() cache.Store
func (*MockResource[T]) Delete ¶
func (r *MockResource[T]) Delete(k resource.Key)
func (*MockResource[T]) FailOnNextStoreCall ¶
func (r *MockResource[T]) FailOnNextStoreCall()
FailOnNextStoreCall will cause the next call to Store() to return an error
func (*MockResource[T]) Get ¶
func (r *MockResource[T]) Get(obj T) (item T, exists bool, err error)
func (*MockResource[T]) GetByKey ¶
func (r *MockResource[T]) GetByKey(key resource.Key) (item T, exists bool, err error)
func (*MockResource[T]) IndexKeys ¶
func (r *MockResource[T]) IndexKeys(_, _ string) ([]string, error)
func (*MockResource[T]) IterKeys ¶
func (r *MockResource[T]) IterKeys() resource.KeyIter
func (*MockResource[T]) List ¶
func (r *MockResource[T]) List() []T
func (*MockResource[T]) Release ¶
func (r *MockResource[T]) Release()
func (*MockResource[T]) Upsert ¶
func (r *MockResource[T]) Upsert(obj T)
type MockVersionedClient ¶
type MockVersionedClient struct {
// contains filtered or unexported fields
}
MockVersionedClient is a mock implementation of versioned.Interface Currently it only returns a real value for CiliumV2()
func NewMockVersionedClient ¶
func NewMockVersionedClient(l logrus.FieldLogger, ciliumEndpoints *MockResource[*v2.CiliumEndpoint]) *MockVersionedClient
func (*MockVersionedClient) CiliumV2 ¶
func (m *MockVersionedClient) CiliumV2() ciliumv2.CiliumV2Interface
func (*MockVersionedClient) CiliumV2alpha1 ¶
func (m *MockVersionedClient) CiliumV2alpha1() ciliumv2alpha1.CiliumV2alpha1Interface
func (*MockVersionedClient) Discovery ¶
func (m *MockVersionedClient) Discovery() discovery.DiscoveryInterface