mirror of https://github.com/status-im/consul.git
fix templated policy cli output (#18821)
This commit is contained in:
parent
9c1a1ffcde
commit
e24b3d9b3f
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue