Skip to content

Commit

Permalink
Add code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
robmonte committed Aug 31, 2022
1 parent 79bd83b commit 861fd6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vault/resource_consul_secret_backend_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ func consulSecretBackendRoleRead(ctx context.Context, d *schema.ResourceData, me
return diag.FromErr(err)
}

// Return either policies or consul_policies depending on the following criteria:
// * Vault version < 1.11: Always use policies
// * Vault version >= 1.11: Default consul_policies; use policies if the user specified it
policyField := "consul_policies"
if _, ok := d.GetOk("policies"); ok || !useAPIVer2 {
policyField = "policies"
Expand Down

0 comments on commit 861fd6f

Please sign in to comment.