feat!: drop support for legacy parameters (#7663)

This commit is contained in:
Marcin Tojek
2023-06-02 11:16:46 +02:00
committed by GitHub
parent 2b63492649
commit a7366a8b76
106 changed files with 1153 additions and 8553 deletions

View File

@ -131,8 +131,7 @@ func validationEnabled(param TemplateVersionParameter) bool {
// correctly validates.
// @typescript-ignore ParameterResolver
type ParameterResolver struct {
Legacy []Parameter
Rich []WorkspaceBuildParameter
Rich []WorkspaceBuildParameter
}
// ValidateResolve checks the provided value, v, against the parameter, p, and the previous build. If v is nil, it also
@ -173,16 +172,5 @@ func (r *ParameterResolver) findLastValue(p TemplateVersionParameter) *Workspace
return &rp
}
}
// For migration purposes, we also support using a legacy variable
if p.LegacyVariableName != "" {
for _, lp := range r.Legacy {
if lp.Name == p.LegacyVariableName {
return &WorkspaceBuildParameter{
Name: p.Name,
Value: lp.SourceValue,
}
}
}
}
return nil
}