Add ability to delete an instance-level serverless domain
Summary
As a follow up to #35591 (closed), a user should be able to delete the instance-level serverless domain. Since the domain name is not editable, deleting and recreating the domain is the only way to change the name.
More context (copied from comment #35591 (comment 274899100)):
I think that deleting a domain needs to be handled a bit differently from what is currently described in this issue.
In the case of a domain that is associated with clusters, deleting a domain will remove all access to functions on these clusters. The user also has no indication of what clusters are unreachable after deleting the domain.
To solve this, I think we should prevent the deletion of a domain while it is associated to clusters. This will force users to assign a new domain to clusters before deleting a domain, so they have no unexpected downtime.
To help a user delete a domain that is associated to clusters, we could provide them with a list of links to clusters that are currently using the domain. The user will have to navigate to each cluster page and disassociate the domain before the domain can be deleted.
When the domain is associated to one or more clusters
The user is not allowed to delete it. When a user tries to delete an instance level knative domain that is already attached to clusters, an error alert is triggered that reads:
You must disassociate
domain.com
from the following clusters before deletion: cluster1, cluster2
If we are unable to link to the specific domains in this iteration, a follow up issue should be created and the alert should read:
You must disassociate
domain.com
from all clusters it is attached to before deletion.
When the domain is not associated to any clusters
The user is able to delete the domain. A modal confirmation should appear as this is a destructive action. Modal copy:
Delete serverless domain?
You are about to delete
domain.com
from your instance. This domain will no longer be available to any Knative application.[Cancel] [Delete]