testreconciler

package
v1.125.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExpectedUnsuccessfulReconcileResult = reconcile.Result{Requeue: false, RequeueAfter: 0 * time.Minute}
	ExpectedRequeueReconcileStruct      = reconcile.Result{Requeue: true}
)

Functions

func ExpectedSuccessfulReconcileResultFor added in v1.100.0

func ExpectedSuccessfulReconcileResultFor(r *TestReconciler, u *unstructured.Unstructured) reconcile.Result

Types

type ReconcilerType added in v1.124.0

type ReconcilerType string
const (
	ReconcilerTypeTerraform        ReconcilerType = "tf"
	ReconcilerTypeDCL              ReconcilerType = "dcl"
	ReconcilerTypeDirect           ReconcilerType = "direct"
	ReconcilerTypeIAMPolicy        ReconcilerType = "iampolicy"
	ReconcilerTypeIAMPartialPolicy ReconcilerType = "iampartialpolicy"
	ReconcilerTypeIAMPolicyMember  ReconcilerType = "iampolicymember"
	ReconcilerTypeIAMAuditConfig   ReconcilerType = "iamauditconfig"
	ReconcilerTypeUnknown          ReconcilerType = "unknown"
)

func ReconcilerTypeForObject added in v1.124.0

func ReconcilerTypeForObject(u *unstructured.Unstructured) (ReconcilerType, error)

type ResourceCleanupPolicy

type ResourceCleanupPolicy string
const (
	// Always clean up resources.
	CleanupPolicyAlways ResourceCleanupPolicy = "Always"
	// Clean up resources on test success or while a test is successful, once the test enters a FAILed state do not
	// clean up any more resources.
	CleanupPolicyOnSuccess ResourceCleanupPolicy = "OnSuccess"
)

type TestReconciler

type TestReconciler struct {
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, mgr manager.Manager, provider *tfschema.Provider) *TestReconciler

TODO(kcc-eng): consolidate New() and NewTestReconciler() and keep the name as New() by refactoring all existing usages

func NewTestReconciler added in v1.118.0

func NewTestReconciler(t *testing.T, mgr manager.Manager, provider *tfschema.Provider, dclConfig *mmdcl.Config, httpClient *http.Client) *TestReconciler

func (*TestReconciler) BuildCleanupFunc

func (r *TestReconciler) BuildCleanupFunc(ctx context.Context, unstruct *unstructured.Unstructured, cleanupPolicy ResourceCleanupPolicy) func()

func (*TestReconciler) Reconcile

func (r *TestReconciler) Reconcile(ctx context.Context, unstruct *unstructured.Unstructured, expectedResult reconcile.Result, expectedErrorRegex *regexp.Regexp)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL