Skip to content

Is the Using Finalizers doc up-to-date? #2508

@rayterrill

Description

@rayterrill

What broke? What's expected?

Attempted to follow the documentation to configure a finalizer for my controller:

    controlPlane := *controlplanev1beta1.AWSManagedControlPlane
    if err := r.Get(ctx, req.NamespacedName, controlPlane); err != nil {

This was resulting in the following:

expected pointer but got nil

I flipped this to the following (looking at the controller-runtime docs here: https://github.com/kubernetes-sigs/controller-runtime/blob/f236f0345ad2933912ebf34bfcf0f93620769654/example_test.go#L123):

	controlPlane := &controlplanev1beta1.AWSManagedControlPlane{}
	if err := r.Get(ctx, req.NamespacedName, controlPlane); err != nil {

This works fine.

Reproducing this issue

No response

KubeBuilder (CLI) Version

Version: main.version{KubeBuilderVersion:"3.3.0", KubernetesVendor:"unknown", GitCommit:"47859bf2ebf96a64db69a2f7074ffdec7f15c1ec", BuildDate:"2022-01-17T18:05:10Z", GoOs:"darwin", GoArch:"amd64"}

PROJECT version

3

Plugin versions

go.kubebuilder.io/v3

Other versions

No response

Extra Labels

No response

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.triage/needs-informationIndicates an issue needs more information in order to work on it.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions