Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address feedback of #9917 #10338

Merged
merged 2 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func resourceStorageDataLakeGen2FileSystemCreate(d *schema.ResourceData, meta in
}

aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func resourceStorageDataLakeGen2FileSystemUpdate(d *schema.ResourceData, meta in
}

aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -309,7 +309,7 @@ func resourceStorageDataLakeGen2FileSystemRead(d *schema.ResourceData, meta inte
if err != nil {
return fmt.Errorf("Error parsing response ACL %q: %s", pathResponse.ACL, err)
}
d.Set("ace", parse.FlattenDataLakeGen2AceList(acl))
d.Set("ace", FlattenDataLakeGen2AceList(acl))

return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func resourceStorageDataLakeGen2PathCreate(d *schema.ResourceData, meta interfac
return fmt.Errorf("Unhandled resource type %q", resourceString)
}
aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -248,7 +248,7 @@ func resourceStorageDataLakeGen2PathUpdate(d *schema.ResourceData, meta interfac
path := d.Get("path").(string)

aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -336,7 +336,7 @@ func resourceStorageDataLakeGen2PathRead(d *schema.ResourceData, meta interface{
if err != nil {
return fmt.Errorf("Error parsing response ACL %q: %s", resp.ACL, err)
}
d.Set("ace", parse.FlattenDataLakeGen2AceList(acl))
d.Set("ace", FlattenDataLakeGen2AceList(acl))

return nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package parse
package storage

import (
"github.com/google/uuid"
Expand Down Expand Up @@ -58,9 +58,11 @@ func FlattenDataLakeGen2AceList(acl accesscontrol.ACL) []interface{} {
}
ace["scope"] = scope
ace["type"] = string(v.TagType)
id := ""
if v.TagQualifier != nil {
ace["id"] = v.TagQualifier.String()
id = v.TagQualifier.String()
}
ace["id"] = id
ace["permissions"] = v.Permissions

output[i] = ace
Expand Down