/
embeddedClient.go
25 lines (22 loc) · 1.4 KB
/
embeddedClient.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package generic
import (
"context"
"github.com/rancher/lasso/pkg/client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/rest"
)
// embeddedClient is the interface for the lasso Client used by the controller.
type embeddedClient interface {
Create(ctx context.Context, namespace string, obj runtime.Object, result runtime.Object, opts metav1.CreateOptions) (err error)
Delete(ctx context.Context, namespace string, name string, opts metav1.DeleteOptions) error
Get(ctx context.Context, namespace string, name string, result runtime.Object, options metav1.GetOptions) (err error)
List(ctx context.Context, namespace string, result runtime.Object, opts metav1.ListOptions) (err error)
Patch(ctx context.Context, namespace string, name string, pt types.PatchType, data []byte, result runtime.Object, opts metav1.PatchOptions, subresources ...string) (err error)
Update(ctx context.Context, namespace string, obj runtime.Object, result runtime.Object, opts metav1.UpdateOptions) (err error)
UpdateStatus(ctx context.Context, namespace string, obj runtime.Object, result runtime.Object, opts metav1.UpdateOptions) (err error)
Watch(ctx context.Context, namespace string, opts metav1.ListOptions) (watch.Interface, error)
WithImpersonation(impersonate rest.ImpersonationConfig) (*client.Client, error)
}