Documentation

Index

Constants

View Source
const (
	Name = "deletecrs"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	K8sClient k8sclient.Interface
	Logger    micrologger.Logger
	// NewObjFunc is to return an instance of a pointer for the CR type that
	// should be scheduled for deletion.
	//
	//     &infrastructurev1alpha2.G8sControlPlane{}
	//     &apiv1alpha2.MachineDeployment{}
	//
	NewObjFunc func() runtime.Object
}

type Resource

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

Resource receives the runtime object of the underlying controller it is wired into and deletes the runtime object of the configured matching types. This is to initialize deletion for the following CRs.

watch      |    delete
---------------------------------
Cluster    |    G8sControlPlane
Cluster    |    MachineDeployment

func New

func New(config Config) (*Resource, error)

func (*Resource) EnsureCreated

func (r *Resource) EnsureCreated(ctx context.Context, obj interface{}) error

func (*Resource) EnsureDeleted

func (r *Resource) EnsureDeleted(ctx context.Context, obj interface{}) error

func (*Resource) Name

func (r *Resource) Name() string