Unable to Remove Kubernetes cluster integration when cluster name has trailing white space

Summary

When I created a Kubes cluster I named the project with a trailing white space. This was definitely dumb on my part but now I cannot delete the cluster. When I try to remove integrations and resouces, enter the resource name and click delete I get a 500 http response.

Steps to reproduce

  1. Create a Kubernetes cluster
  2. Create the project with a trailing white space in the name
  3. Try to remove the cluster for gitlab
  4. 500 Redirect error

What is the current bug behavior?

Instead of removing the cluster, a 500 http redirect is given

What is the expected correct behavior?

Cluster should be removed from gitlab

Relevant logs and/or screenshots

3b109230-fcc8-49c7-a3d1-e57ce8a80b3e

Possible fixes

The object is not referenced correctly when the Kubes cluster name has a trailing white space.