mirror of
https://github.com/hashicorp/packer.git
synced 2026-04-21 06:07:21 -04:00
make packer inspect not print sensitive variables.
This commit is contained in:
parent
c42b3a41a9
commit
98e933ca54
1 changed files with 10 additions and 0 deletions
|
|
@ -50,6 +50,11 @@ func (c *InspectCommand) Run(args []string) int {
|
|||
} else {
|
||||
requiredHeader := false
|
||||
for k, v := range tpl.Variables {
|
||||
for _, sensitive := range tpl.SensitiveVariables {
|
||||
if ok := strings.Compare(sensitive.Default, v.Default); ok == 0 {
|
||||
v.Default = "<sensitive>"
|
||||
}
|
||||
}
|
||||
if v.Required {
|
||||
if !requiredHeader {
|
||||
requiredHeader = true
|
||||
|
|
@ -82,6 +87,11 @@ func (c *InspectCommand) Run(args []string) int {
|
|||
if v.Required {
|
||||
continue
|
||||
}
|
||||
for _, sensitive := range tpl.SensitiveVariables {
|
||||
if ok := strings.Compare(sensitive.Default, v.Default); ok == 0 {
|
||||
v.Default = "<sensitive>"
|
||||
}
|
||||
}
|
||||
|
||||
padding := strings.Repeat(" ", max-len(k))
|
||||
output := fmt.Sprintf(" %s%s = %s", k, padding, v.Default)
|
||||
|
|
|
|||
Loading…
Reference in a new issue