Fixing a problem where tags and custom attributes couldn't be added

The tags and custom attribute requests were never being made due to a recent change.

This change filtered out requests that didn't have a datacenter degined for everything but the datacenter resource. However this should've included 3 other resources that don't need a datacenter during the request.

rancher/rancher#31285
This commit is contained in:
Cody Jackson 2021-02-22 10:04:56 -07:00
parent dadf03e5f2
commit e947e44194
1 changed files with 3 additions and 1 deletions

View File

@ -579,7 +579,9 @@ export default Component.extend(NodeDriver, {
return true;
},
async requestOptions(resource, cloudCredentialId, dataCenter, library) {
if (!cloudCredentialId || (resource !== 'data-centers' && !dataCenter)) {
const datacenterLessResources = ['tag-categories', 'tags', 'data-centers', 'custom-attributes'];
if (!cloudCredentialId || (!datacenterLessResources.includes(resource) && !dataCenter)) {
return [];
}