/
types.go
47 lines (37 loc) · 1.3 KB
/
types.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package types
import (
"context"
"github.com/loft-sh/vcluster/pkg/options"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/rest"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"sigs.k8s.io/controller-runtime/pkg/client"
)
type Manager interface {
// Start starts the plugins with the given information
Start(
ctx context.Context,
currentNamespace, targetNamespace string,
virtualKubeConfig *rest.Config,
physicalKubeConfig *rest.Config,
syncerConfig *clientcmdapi.Config,
options *options.VirtualClusterOptions,
) error
// SetLeader sets the leader for the plugins
SetLeader(ctx context.Context) error
// MutateObject mutates the objects of the given version kind type
MutateObject(ctx context.Context, obj client.Object, hookType string, scheme *runtime.Scheme) error
// HasClientHooks returns if there are any plugin client hooks
HasClientHooks() bool
// HasClientHooksForType returns if there are any plugin client hooks for the given type
HasClientHooksForType(VersionKindType) bool
// HasPlugins returns if there are any plugins to start
HasPlugins() bool
// SetProFeatures is used by vCluster.Pro to signal what pro features are enabled
SetProFeatures(proFeatures map[string]bool)
}
type VersionKindType struct {
APIVersion string
Kind string
Type string
}