Simplify conditional

This commit is contained in:
max furman 2021-11-16 10:02:04 -08:00
parent a7d144996f
commit 922d239171

View file

@ -105,12 +105,10 @@ func (a *Authority) GetSSHConfig(ctx context.Context, typ string, data map[strin
// Backwards compatibility for version of the cli older than v0.18.0. // Backwards compatibility for version of the cli older than v0.18.0.
// Before v0.18.0 we were not passing any value for SSHTemplateVersionKey // Before v0.18.0 we were not passing any value for SSHTemplateVersionKey
// from the cli. // from the cli.
if o.Name == "step_includes.tpl" { if o.Name == "step_includes.tpl" && data[templates.SSHTemplateVersionKey] == "" {
if val, ok := data[templates.SSHTemplateVersionKey]; !ok || val == "" {
o.Type = templates.File o.Type = templates.File
o.Path = strings.TrimPrefix(o.Path, "${STEPPATH}/") o.Path = strings.TrimPrefix(o.Path, "${STEPPATH}/")
} }
}
output = append(output, o) output = append(output, o)
} }