Documentation
¶
Index ¶
- func DeleteObject(ctx context.Context, k8sClient client.Client, obj client.Object)
- func MockComponent(ctx context.Context, name, namespace string, options *MockComponentOptions) *v1alpha1.Component
- func MockResource(ctx context.Context, name, namespace string, options *MockResourceOptions) *v1alpha1.Resource
- func SanitizeNameForK8s(name string) string
- func SetupRepositoryWithSpecData(ctx context.Context, k8sClient client.Client, namespace, repositoryName string, ...) *v1alpha1.Repository
- func WaitForNotReadyObject(ctx context.Context, k8sClient client.Client, obj util.Getter, ...)
- func WaitForReadyObject(ctx context.Context, k8sClient client.Client, obj util.Getter, ...)
- type MockComponentOptions
- type MockResourceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteObject ¶
func MockComponent ¶
func MockResource ¶
func SanitizeNameForK8s ¶
func WaitForNotReadyObject ¶
func WaitForReadyObject ¶
func WaitForReadyObject(ctx context.Context, k8sClient client.Client, obj util.Getter, waitForField map[string]any)
WaitForReadyObject waits for a Kubernetes object to reach a ready state.
Parameters: - ctx: The context for managing request deadlines and cancellations. - k8sClient: The Kubernetes client used to interact with the cluster. - obj: The Kubernetes object to monitor, implementing the util.Getter interface. - waitForField: A map specifying field-value pairs to validate on the object.
Behavior: - Periodically checks if the object exists, is not being deleted, and is in a ready state. - Verifies that the specified fields in waitForField match the expected values. - Fails the test if the object does not meet the conditions within 15 seconds.
Types ¶
type MockComponentOptions ¶
type MockComponentOptions struct {
Client client.Client
Recorder record.EventRecorder
Info v1alpha1.ComponentInfo
Repository string
}
type MockResourceOptions ¶
type MockResourceOptions struct {
ComponentRef corev1.LocalObjectReference
ComponentInfo *v1alpha1.ComponentInfo
ResourceInfo *v1alpha1.ResourceInfo
Clnt client.Client
Recorder record.EventRecorder
}
Click to show internal directories.
Click to hide internal directories.