Skip to content

Commit

Permalink
Merge pull request #516 from vmware/search_delete
Browse files Browse the repository at this point in the history
Skip marked_for_delete data sources in search by name/type
  • Loading branch information
asarfaty authored Nov 29, 2020
2 parents b1c0ae5 + 589e05b commit 2baad1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nsxt/policy_gm_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ func policyDataSourceResourceReadWithValidation(d *schema.ResourceData, connecto
}

func listPolicyResourcesByType(connector *client.RestConnector, resourceType *string, additionalQuery *string) ([]*data.StructValue, error) {
query := fmt.Sprintf("resource_type:%s", *resourceType)
query := fmt.Sprintf("resource_type:%s AND marked_for_delete:false", *resourceType)
return searchPolicyResources(connector, *buildPolicyResourcesQuery(&query, additionalQuery))
}

func listPolicyResourcesByID(connector *client.RestConnector, resourceID *string, additionalQuery *string) ([]*data.StructValue, error) {
query := fmt.Sprintf("id:%s", *resourceID)
query := fmt.Sprintf("id:%s AND marked_for_delete:false", *resourceID)
return searchPolicyResources(connector, *buildPolicyResourcesQuery(&query, additionalQuery))
}

Expand Down

0 comments on commit 2baad1e

Please sign in to comment.