Closed schulzh closed 11 months ago
Looks like it does not filter correctly yet when namespace is not set, I'll see if I can fix that as well
Works correctly now:
Hi @schulzh,
Thank you very much for the contribution, but I'd suggest instead of so many checks on whether there is a namespace or not to check whether the 'mta_namespace' is empty you could use '!mta_namespace' thus filtering only these apps/services without mta_namspace:
Example: cf curl 'v3/apps?label_selector=mta_id=595b4fc924d1b0615b395b2dad14f950,!mta_namespace&space_guids=5c52910a-4072-4b3a-b5b2-bc9497f63aa7' -v
cf curl 'v3/apps?label_selector=mta_id=595b4fc924d1b0615b395b2dad14f950,mta_namespace=YOUR-NAMESPACE&space_guids=5c52910a-4072-4b3a-b5b2-bc9497f63aa7' -v
You can calculate the URL based on whether there is or isn't a namespace then just execute 1 call and return the results instead of filtering already filtered results.
Thanks and best regards, Ivan
Thanks @IvanBorislavovDimitrov , I searched for a way to filter on the absence of a label but did not find it. I'll update the PR.
Thanks again for the contribution
Description:
Implement filtering using the
mta_namespace
label on CF resources (apps and service instances).Issue:
Fixes https://github.com/cloudfoundry/multiapps-cli-plugin/issues/189