Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Glass <pglass@hashicorp.com>
  • Loading branch information
jjacobson93 and Paul Glass authored Jul 31, 2023
1 parent d54e3a9 commit 9878915
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .changelog/18319.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
```release-note:improvement
acl: added builtin ACL policy that provides global read-only access (builtin/global-read-only)
```
```release-note:improvement
acl: allow for a single slash character in policy names
```
6 changes: 5 additions & 1 deletion agent/consul/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,11 @@ func (s *Server) initializeACLs(ctx context.Context) error {
return nil
}

func (s *Server) initializePolicy(newPolicy structs.ACLPolicy) error {
// writeBuiltinACLPolicy writes the given built-in policy to Raft if the policy
// is not found or if the policy rules have been changed. The name and
// description of a built-in policy are user-editable and must be preserved
// during updates. This function must only be called in a primary datacenter.
func (s *Server) writeBuiltinACLPolicy(newPolicy structs.ACLPolicy) error {
_, policy, err := s.fsm.State().ACLPolicyGetByID(nil, newPolicy.ID, structs.DefaultEnterpriseMetaInDefaultPartition())
if err != nil {
return fmt.Errorf("failed to get the builtin %s policy", newPolicy.Name)
Expand Down

0 comments on commit 9878915

Please sign in to comment.