Skip to content

Commit aad0946

Browse files
author
Jeremy Jacobson
committed
Change from ReplaceAll to Sprintf
1 parent 209e57a commit aad0946

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

agent/structs/acl.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,38 +56,38 @@ const (
5656
ACLReservedIDPrefix = "00000000-0000-0000-0000-0000000000"
5757

5858
aclPolicyGlobalRulesTemplate = `
59-
acl = "###"
59+
acl = "%[1]s"
6060
agent_prefix "" {
61-
policy = "###"
61+
policy = "%[1]s"
6262
}
6363
event_prefix "" {
64-
policy = "###"
64+
policy = "%[1]s"
6565
}
6666
key_prefix "" {
67-
policy = "###"
67+
policy = "%[1]s"
6868
}
69-
keyring = "###"
69+
keyring = "%[1]s"
7070
node_prefix "" {
71-
policy = "###"
71+
policy = "%[1]s"
7272
}
73-
operator = "###"
74-
mesh = "###"
75-
peering = "###"
73+
operator = "%[1]s"
74+
mesh = "%[1]s"
75+
peering = "%[1]s"
7676
query_prefix "" {
77-
policy = "###"
77+
policy = "%[1]s"
7878
}
7979
service_prefix "" {
80-
policy = "###"
81-
intentions = "###"
80+
policy = "%[1]s"
81+
intentions = "%[1]s"
8282
}
8383
session_prefix "" {
84-
policy = "###"
84+
policy = "%[1]s"
8585
}`
8686
)
8787

8888
var (
89-
ACLPolicyGlobalReadOnlyRules = strings.ReplaceAll(aclPolicyGlobalRulesTemplate, "###", "read") + EnterpriseACLPolicyGlobalReadOnly
90-
ACLPolicyGlobalManagementRules = strings.ReplaceAll(aclPolicyGlobalRulesTemplate, "###", "write") + EnterpriseACLPolicyGlobalManagement
89+
ACLPolicyGlobalReadOnlyRules = fmt.Sprintf(aclPolicyGlobalRulesTemplate, "read") + EnterpriseACLPolicyGlobalReadOnly
90+
ACLPolicyGlobalManagementRules = fmt.Sprintf(aclPolicyGlobalRulesTemplate, "write") + EnterpriseACLPolicyGlobalManagement
9191

9292
ACLBuiltinPolicies = map[string]ACLPolicy{
9393
ACLPolicyGlobalManagementID: {

0 commit comments

Comments
 (0)