INNER CODE UNIT · Go
deleteRBAC
vmware-tanzu/sonobuoy · pkg/client/delete.go:158
func deleteRBAC(client kubernetes.Interface, cfg *DeleteConfig) (ConditionFuncWithProgress, error) {
// ClusterRole and ClusterRoleBindings aren't namespaced, so delete them separately.
selector := metav1.AddLabelToSelector(
&metav1.LabelSelector{},
clusterRoleFieldName,
clusterRoleFieldValue,
)
// Just delete the one for the target namespace unless using DeleteAll.
if cfg != nil && !cfg.DeleteAll {
selector = metav1.AddLabelToSelector(
selector,
clusterRoleFieldNamespace,
cfg.Namespace,
)
}
var dryRun []string