Skip to content

Running on GKE, need to use Upadate() instead of UpdateStatus() in cnat-client-go/controller.go. #8

Open
@enakai00

Description

@enakai00

Hi, in my set-up (Google Kubernetes Engine), as the CustomResourceSubresources feature gate is not enabled, I get the following error while running the cnat-client-go/controller.go:

E1012 22:10:45.503547 52194 controller.go:193] error syncing 'default/example-at': the server could not find the requested resource (put ats.cnat.programming-kubernetes.info example-at), requeuing

This could be resolved by replacing UpdateStatus(instance) with Update(instance) on L295

_, err = c.cnatClientset.CnatV1alpha1().Ats(instance.Namespace).UpdateStatus(instance)

as described in the sample-controller:

	// If the CustomResourceSubresources feature gate is not enabled,
	// we must use Update instead of UpdateStatus to update the Status block of the Foo resource.
	// UpdateStatus will not allow changes to the Spec of the resource,
	// which is ideal for ensuring nothing other than resource status has been updated.
	_, err := c.sampleclientset.SamplecontrollerV1alpha1().Foos(foo.Namespace).Update(fooCopy)

Does it make sense to add some logic to cnat-client-go/controller.go so that it can handle both set-ups (the CustomResourceSubresources feature gate is enabled / disabled)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions