Documentation ¶
Index ¶
- Constants
- Variables
- func DownloadCertManagerCRDs(scheme *runtime.Scheme) []*apiextensionsv1.CustomResourceDefinition
- func EnableIfCI[T any](decorator T) any
- func LoadPlugins(loader *plugins.PluginLoader) int
- func LoadUnaryPlugins(loader *plugins.PluginLoader) int
- func NewApiExtensionTestPlugin(srv apiextensions.ManagementAPIExtensionServer, svcDesc *grpc.ServiceDesc, ...) *plugin.ClientConfig
- func NewApiExtensionUnaryTestPlugin(srv apiextensions.UnaryAPIExtensionServer, svcDesc *grpc.ServiceDesc, ...) *plugin.ClientConfig
- func NewTestCapabilityBackend(ctrl *gomock.Controller, capBackend *CapabilityInfo) capability.Backend
- func NewTestCapabilityBackendClient(ctrl *gomock.Controller, capBackend *CapabilityInfo) capability.BackendClient
- func NewTestClusterStore(ctrl *gomock.Controller) storage.ClusterStore
- func NewTestIdentProvider(ctrl *gomock.Controller, id string) ident.Provider
- func NewTestKeyValueStore(ctrl *gomock.Controller) storage.KeyValueStore
- func NewTestKeyValueStoreBroker(ctrl *gomock.Controller) storage.KeyValueStoreBroker
- func NewTestKeyringStore(ctrl *gomock.Controller, prefix string, ref *corev1.Reference) storage.KeyringStore
- func NewTestKeyringStoreBroker(ctrl *gomock.Controller, handler ...KeyringStoreHandler) storage.KeyringStoreBroker
- func NewTestRBACStore(ctrl *gomock.Controller) storage.RBACStore
- func NewTestRuleFinder(ctrl *gomock.Controller, groups func() []rulefmt.RuleGroup) rules.RuleFinder
- func NewTestStorageBackend(ctx context.Context, ctrl *gomock.Controller) storage.Backend
- func NewTestTokenStore(ctx context.Context, ctrl *gomock.Controller) storage.TokenStore
- func RunTestEnvironment(testEnv *envtest.Environment, runControllerManager bool, externalEnv bool, ...) (stop context.CancelFunc, k8sManager ctrl.Manager, k8sClient client.Client)
- func StartControllerManager(ctx context.Context, testEnv *envtest.Environment)
- func StartStandaloneTestEnvironment(opts ...EnvironmentOption)
- func TestData(filename string) []byte
- type CapabilityInfo
- type Environment
- func (e *Environment) EtcdClient() (*clientv3.Client, error)
- func (e *Environment) EtcdConfig() *v1beta1.EtcdStorageSpec
- func (e *Environment) GatewayConfig() *v1beta1.GatewayConfig
- func (e *Environment) GatewayTLSConfig() *tls.Config
- func (e *Environment) GetAgent(id string) RunningAgent
- func (e *Environment) NewManagementClient() managementv1.ManagementClient
- func (e *Environment) PrometheusAPIEndpoint() string
- func (e *Environment) Start(opts ...EnvironmentOption) error
- func (e *Environment) StartAgent(id string, token *corev1.BootstrapToken, pins []string, ...) (int, <-chan error)
- func (e *Environment) StartK8s() (*rest.Config, error)
- func (e *Environment) StartManager(restConfig *rest.Config, reconcilers ...Reconciler) ctrl.Manager
- func (e *Environment) StartPrometheus(opniAgentPort int) int
- func (e *Environment) Stop() error
- type EnvironmentOption
- type EnvironmentOptions
- type KeyringStoreHandler
- type Lease
- type LeaseStore
- type Reconciler
- type RunningAgent
- type StartAgentOption
- type StartAgentOptions
Constants ¶
View Source
const ( Unit = "unit" Integration = "integration" Controller = "controller" E2E = "e2e" Slow = "slow" TimeSensitive = "time-sensitive" )
Variables ¶
View Source
var ExternalResources sync.WaitGroup
View Source
var Log = logger.New(logger.WithLogLevel(zap.DebugLevel)).Named("test")
View Source
var TestDataFS embed.FS
Functions ¶
func DownloadCertManagerCRDs ¶ added in v0.4.1
func DownloadCertManagerCRDs(scheme *runtime.Scheme) []*apiextensionsv1.CustomResourceDefinition
func EnableIfCI ¶ added in v0.4.1
func LoadPlugins ¶ added in v0.4.1
func LoadPlugins(loader *plugins.PluginLoader) int
func LoadUnaryPlugins ¶ added in v0.5.4
func LoadUnaryPlugins(loader *plugins.PluginLoader) int
func NewApiExtensionTestPlugin ¶ added in v0.4.1
func NewApiExtensionTestPlugin( srv apiextensions.ManagementAPIExtensionServer, svcDesc *grpc.ServiceDesc, impl interface{}, ) *plugin.ClientConfig
func NewApiExtensionUnaryTestPlugin ¶ added in v0.5.4
func NewApiExtensionUnaryTestPlugin( srv apiextensions.UnaryAPIExtensionServer, svcDesc *grpc.ServiceDesc, impl interface{}, ) *plugin.ClientConfig
func NewTestCapabilityBackend ¶ added in v0.4.1
func NewTestCapabilityBackend( ctrl *gomock.Controller, capBackend *CapabilityInfo, ) capability.Backend
func NewTestCapabilityBackendClient ¶ added in v0.4.1
func NewTestCapabilityBackendClient( ctrl *gomock.Controller, capBackend *CapabilityInfo, ) capability.BackendClient
func NewTestClusterStore ¶ added in v0.4.1
func NewTestClusterStore(ctrl *gomock.Controller) storage.ClusterStore
func NewTestIdentProvider ¶ added in v0.4.1
func NewTestIdentProvider(ctrl *gomock.Controller, id string) ident.Provider
func NewTestKeyValueStore ¶ added in v0.4.1
func NewTestKeyValueStore(ctrl *gomock.Controller) storage.KeyValueStore
func NewTestKeyValueStoreBroker ¶ added in v0.4.1
func NewTestKeyValueStoreBroker(ctrl *gomock.Controller) storage.KeyValueStoreBroker
func NewTestKeyringStore ¶ added in v0.4.1
func NewTestKeyringStore(ctrl *gomock.Controller, prefix string, ref *corev1.Reference) storage.KeyringStore
func NewTestKeyringStoreBroker ¶ added in v0.4.1
func NewTestKeyringStoreBroker(ctrl *gomock.Controller, handler ...KeyringStoreHandler) storage.KeyringStoreBroker
func NewTestRBACStore ¶ added in v0.4.1
func NewTestRBACStore(ctrl *gomock.Controller) storage.RBACStore
func NewTestRuleFinder ¶ added in v0.4.1
func NewTestRuleFinder(ctrl *gomock.Controller, groups func() []rulefmt.RuleGroup) rules.RuleFinder
func NewTestStorageBackend ¶ added in v0.4.1
func NewTestTokenStore ¶ added in v0.4.1
func NewTestTokenStore(ctx context.Context, ctrl *gomock.Controller) storage.TokenStore
func RunTestEnvironment ¶
func RunTestEnvironment( testEnv *envtest.Environment, runControllerManager bool, externalEnv bool, reconcilers ...Reconciler, ) (stop context.CancelFunc, k8sManager ctrl.Manager, k8sClient client.Client)
func StartControllerManager ¶ added in v0.2.0
func StartControllerManager(ctx context.Context, testEnv *envtest.Environment)
func StartStandaloneTestEnvironment ¶ added in v0.4.1
func StartStandaloneTestEnvironment(opts ...EnvironmentOption)
Types ¶
type CapabilityInfo ¶ added in v0.4.1
type Environment ¶ added in v0.4.1
type Environment struct { EnvironmentOptions TestBin string Logger *zap.SugaredLogger CRDDirectoryPaths []string Processes struct { Etcd future.Future[*os.Process] APIServer future.Future[*os.Process] } // contains filtered or unexported fields }
func (*Environment) EtcdClient ¶ added in v0.4.1
func (e *Environment) EtcdClient() (*clientv3.Client, error)
func (*Environment) EtcdConfig ¶ added in v0.4.1
func (e *Environment) EtcdConfig() *v1beta1.EtcdStorageSpec
func (*Environment) GatewayConfig ¶ added in v0.4.1
func (e *Environment) GatewayConfig() *v1beta1.GatewayConfig
func (*Environment) GatewayTLSConfig ¶ added in v0.4.1
func (e *Environment) GatewayTLSConfig() *tls.Config
func (*Environment) GetAgent ¶ added in v0.4.1
func (e *Environment) GetAgent(id string) RunningAgent
func (*Environment) NewManagementClient ¶ added in v0.4.1
func (e *Environment) NewManagementClient() managementv1.ManagementClient
func (*Environment) PrometheusAPIEndpoint ¶ added in v0.4.1
func (e *Environment) PrometheusAPIEndpoint() string
func (*Environment) Start ¶ added in v0.4.1
func (e *Environment) Start(opts ...EnvironmentOption) error
func (*Environment) StartAgent ¶ added in v0.4.1
func (e *Environment) StartAgent(id string, token *corev1.BootstrapToken, pins []string, opts ...StartAgentOption) (int, <-chan error)
func (*Environment) StartK8s ¶ added in v0.4.1
func (e *Environment) StartK8s() (*rest.Config, error)
func (*Environment) StartManager ¶ added in v0.4.1
func (e *Environment) StartManager(restConfig *rest.Config, reconcilers ...Reconciler) ctrl.Manager
func (*Environment) StartPrometheus ¶ added in v0.4.1
func (e *Environment) StartPrometheus(opniAgentPort int) int
func (*Environment) Stop ¶ added in v0.4.1
func (e *Environment) Stop() error
type EnvironmentOption ¶ added in v0.4.1
type EnvironmentOption func(*EnvironmentOptions)
func WithDefaultAgentOpts ¶ added in v0.5.4
func WithDefaultAgentOpts(opts ...StartAgentOption) EnvironmentOption
func WithEnableCortex ¶ added in v0.4.1
func WithEnableCortex(enableCortex bool) EnvironmentOption
func WithEnableEtcd ¶ added in v0.4.1
func WithEnableEtcd(enableEtcd bool) EnvironmentOption
func WithEnableGateway ¶ added in v0.4.1
func WithEnableGateway(enableGateway bool) EnvironmentOption
type EnvironmentOptions ¶ added in v0.4.1
type EnvironmentOptions struct {
// contains filtered or unexported fields
}
type KeyringStoreHandler ¶ added in v0.4.1
type LeaseStore ¶ added in v0.4.1
type LeaseStore struct {
// contains filtered or unexported fields
}
func NewLeaseStore ¶ added in v0.4.1
func NewLeaseStore(ctx context.Context) *LeaseStore
func (*LeaseStore) LeaseExpired ¶ added in v0.4.1
func (ls *LeaseStore) LeaseExpired() <-chan string
type Reconciler ¶
type StartAgentOption ¶ added in v0.4.1
type StartAgentOption func(*StartAgentOptions)
func WithContext ¶ added in v0.4.1
func WithContext(ctx context.Context) StartAgentOption
func WithRemoteGatewayAddress ¶ added in v0.5.4
func WithRemoteGatewayAddress(addr string) StartAgentOption
type StartAgentOptions ¶ added in v0.4.1
type StartAgentOptions struct {
// contains filtered or unexported fields
}
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mock
|
|
apiextensions
Package mock_apiextensions is a generated GoMock package.
|
Package mock_apiextensions is a generated GoMock package. |
capability
Package mock_capability is a generated GoMock package.
|
Package mock_capability is a generated GoMock package. |
ext
Package mock_ext is a generated GoMock package.
|
Package mock_ext is a generated GoMock package. |
ident
Package mock_ident is a generated GoMock package.
|
Package mock_ident is a generated GoMock package. |
rbac
Package mock_rbac is a generated GoMock package.
|
Package mock_rbac is a generated GoMock package. |
rules
Package mock_rules is a generated GoMock package.
|
Package mock_rules is a generated GoMock package. |
storage
Package mock_storage is a generated GoMock package.
|
Package mock_storage is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.