generate work name based on different resource (#232)
Signed-off-by: lihanbo <lihanbo2@huawei.com>
This commit is contained in:
parent
51d56624c6
commit
65a4f32e3e
|
@ -194,7 +194,13 @@ func (c *WorkStatusController) handleDeleteEvent(key string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
workName := names.GenerateBindingName(clusterWorkload.Namespace, clusterWorkload.GVK.Kind, clusterWorkload.Name)
|
||||
var workName string
|
||||
if clusterWorkload.Namespace == "" {
|
||||
workName = names.GenerateClusterResourceBindingName(clusterWorkload.GVK.Kind, clusterWorkload.Name)
|
||||
} else {
|
||||
workName = names.GenerateBindingName(clusterWorkload.Namespace, clusterWorkload.GVK.Kind, clusterWorkload.Name)
|
||||
}
|
||||
|
||||
work := &workv1alpha1.Work{}
|
||||
if err := c.Client.Get(context.TODO(), client.ObjectKey{Namespace: executionSpace, Name: workName}, work); err != nil {
|
||||
// Stop processing if resource no longer exist.
|
||||
|
|
Loading…
Reference in New Issue