Documentation ¶
Index ¶
- Variables
- func SetKubeServerVersion(major, minor, patch string)
- func SetKubeServerVersionWithDistro(major, minor, patch, distro string)
- type TestContext
- func (testCtx TestContext) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (testCtx TestContext) CreateNamespace() error
- func (testCtx TestContext) GetNamespaceKey() client.ObjectKey
- func (testCtx TestContext) GetNamespaceObj() corev1.Namespace
- func (testCtx TestContext) GetRandomStr() string
- func (testCtx TestContext) GetWebhookHostExternalName() string
- func (testCtx TestContext) UseDefaultNamespace() func(client.Object)
- func (testCtx TestContext) UsingExistingCluster() bool
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUninitError = fmt.Errorf("cli uninitialized error")
Functions ¶
func SetKubeServerVersion ¶
func SetKubeServerVersion(major, minor, patch string)
SetKubeServerVersion provide "_KUBE_SERVER_INFO" viper settings helper function.
func SetKubeServerVersionWithDistro ¶
func SetKubeServerVersionWithDistro(major, minor, patch, distro string)
SetKubeServerVersionWithDistro provide "_KUBE_SERVER_INFO" viper settings helper function.
Types ¶
type TestContext ¶
type TestContext struct { Ctx context.Context Cli client.Client TestEnv *envtest.Environment TestObjLabelKey string DefaultNamespace string DefaultEventuallyTimeout time.Duration DefaultEventuallyPollingInterval time.Duration DefaultConsistentlyDuration time.Duration DefaultConsistentlyPollingInterval time.Duration ClearResourceTimeout time.Duration ClearResourcePollingInterval time.Duration CreateObj func(ctx context.Context, obj client.Object, opts ...client.CreateOption) error CheckedCreateObj func(ctx context.Context, obj client.Object, opts ...client.CreateOption) error }
func NewDefaultTestContext ¶
func NewDefaultTestContext(ctx context.Context, cli client.Client, testEnv *envtest.Environment, namespace ...string) TestContext
NewDefaultTestContext create default test context, if provided namespace optional arg, a namespace will be created if not exist
func (TestContext) Create ¶
func (testCtx TestContext) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (TestContext) CreateNamespace ¶
func (testCtx TestContext) CreateNamespace() error
func (TestContext) GetNamespaceKey ¶
func (testCtx TestContext) GetNamespaceKey() client.ObjectKey
func (TestContext) GetNamespaceObj ¶
func (testCtx TestContext) GetNamespaceObj() corev1.Namespace
func (TestContext) GetRandomStr ¶
func (testCtx TestContext) GetRandomStr() string
func (TestContext) GetWebhookHostExternalName ¶
func (testCtx TestContext) GetWebhookHostExternalName() string
func (TestContext) UseDefaultNamespace ¶
func (testCtx TestContext) UseDefaultNamespace() func(client.Object)
func (TestContext) UsingExistingCluster ¶
func (testCtx TestContext) UsingExistingCluster() bool
Click to show internal directories.
Click to hide internal directories.