return nil when the obj not managed by Karmada in work status controller
Signed-off-by: lihanbo <lihanbo2@huawei.com>
This commit is contained in:
parent
209be7f540
commit
cc0f6ed08b
|
@ -116,11 +116,11 @@ func generateKey(obj interface{}) (util.QueueKey, error) {
|
|||
resource := obj.(*unstructured.Unstructured)
|
||||
cluster, err := getClusterNameFromLabel(resource)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return nil, err
|
||||
}
|
||||
// it happens when the obj not managed by Karmada.
|
||||
// return a nil key when the obj not managed by Karmada, which will be discarded before putting to queue.
|
||||
if cluster == "" {
|
||||
return "", nil
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return keys.FederatedKeyFunc(cluster, obj)
|
||||
|
|
Loading…
Reference in New Issue