Răsfoiți Sursa

Simplify conditional

max furman 5 ani în urmă
părinte
comite
922d239171
1 a modificat fișierele cu 3 adăugiri și 5 ștergeri
  1. 3 5
      authority/ssh.go

+ 3 - 5
authority/ssh.go

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