fix templated policy cli output (#18821)

This commit is contained in:
Ronald 2023-09-15 10:20:44 -04:00 committed by GitHub
parent 9c1a1ffcde
commit e24b3d9b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 10 deletions

View File

@ -64,7 +64,7 @@ type prettyFormatter struct {
func (f *prettyFormatter) FormatTemplatedPolicy(templatedPolicy api.ACLTemplatedPolicyResponse) (string, error) { func (f *prettyFormatter) FormatTemplatedPolicy(templatedPolicy api.ACLTemplatedPolicyResponse) (string, error) {
var buffer bytes.Buffer var buffer bytes.Buffer
buffer.WriteString(fmt.Sprintf("Name: %s\n", templatedPolicy.TemplateName)) buffer.WriteString(fmt.Sprintf("Name: %s\n", templatedPolicy.TemplateName))
buffer.WriteString("Input variables:") buffer.WriteString("Input variables:")
switch templatedPolicy.TemplateName { switch templatedPolicy.TemplateName {
@ -77,7 +77,7 @@ func (f *prettyFormatter) FormatTemplatedPolicy(templatedPolicy api.ACLTemplated
buffer.WriteString("Example usage:\n") buffer.WriteString("Example usage:\n")
buffer.WriteString(fmt.Sprintf("%sconsul acl token create -templated-policy builtin/node -var name:node-1\n", WhitespaceIndent)) buffer.WriteString(fmt.Sprintf("%sconsul acl token create -templated-policy builtin/node -var name:node-1\n", WhitespaceIndent))
case api.ACLTemplatedPolicyDNSName: case api.ACLTemplatedPolicyDNSName:
buffer.WriteString(" None\n") buffer.WriteString(" None\n")
buffer.WriteString("Example usage:\n") buffer.WriteString("Example usage:\n")
buffer.WriteString(fmt.Sprintf("%sconsul acl token create -templated-policy builtin/dns\n", WhitespaceIndent)) buffer.WriteString(fmt.Sprintf("%sconsul acl token create -templated-policy builtin/dns\n", WhitespaceIndent))
default: default:

View File

@ -1,5 +1,5 @@
Name: builtin/dns Name: builtin/dns
Input variables: None Input variables: None
Example usage: Example usage:
consul acl token create -templated-policy builtin/dns consul acl token create -templated-policy builtin/dns
Raw Template: Raw Template:

View File

@ -1,4 +1,4 @@
Name: builtin/dns Name: builtin/dns
Input variables: None Input variables: None
Example usage: Example usage:
consul acl token create -templated-policy builtin/dns consul acl token create -templated-policy builtin/dns

View File

@ -1,4 +1,4 @@
Name: builtin/node Name: builtin/node
Input variables: Input variables:
Name: String - Required - The node name. Name: String - Required - The node name.
Example usage: Example usage:

View File

@ -1,4 +1,4 @@
Name: builtin/node Name: builtin/node
Input variables: Input variables:
Name: String - Required - The node name. Name: String - Required - The node name.
Example usage: Example usage:

View File

@ -1,4 +1,4 @@
Name: builtin/service Name: builtin/service
Input variables: Input variables:
Name: String - Required - The name of the service. Name: String - Required - The name of the service.
Example usage: Example usage:

View File

@ -1,4 +1,4 @@
Name: builtin/service Name: builtin/service
Input variables: Input variables:
Name: String - Required - The name of the service. Name: String - Required - The name of the service.
Example usage: Example usage: