mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat!: drop support for legacy parameters (#7663)
This commit is contained in:
@@ -72,21 +72,6 @@ var (
|
||||
Complete: &proto.Provision_Complete{},
|
||||
},
|
||||
}}
|
||||
|
||||
ParameterSuccess = []*proto.ParameterSchema{
|
||||
{
|
||||
AllowOverrideSource: true,
|
||||
Name: ParameterExecKey,
|
||||
Description: "description 1",
|
||||
DefaultSource: &proto.ParameterSource{
|
||||
Scheme: proto.ParameterSource_DATA,
|
||||
Value: formatExecValue(successKey, ""),
|
||||
},
|
||||
DefaultDestination: &proto.ParameterDestination{
|
||||
Scheme: proto.ParameterDestination_PROVISIONER_VARIABLE,
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// Serve starts the echo provisioner.
|
||||
@@ -151,22 +136,6 @@ func (e *echo) Provision(stream proto.DRPCProvisioner_ProvisionStream) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, param := range msg.GetPlan().GetParameterValues() {
|
||||
if param.Name == ParameterExecKey {
|
||||
toks := strings.Split(param.Value, "=")
|
||||
if len(toks) < 2 {
|
||||
break
|
||||
}
|
||||
|
||||
switch toks[0] {
|
||||
case errorKey:
|
||||
return xerrors.Errorf("returning error: %v", toks[1])
|
||||
default:
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for index := 0; ; index++ {
|
||||
var extension string
|
||||
if msg.GetPlan() != nil {
|
||||
|
||||
@@ -49,11 +49,7 @@ func TestEcho(t *testing.T) {
|
||||
},
|
||||
}, {
|
||||
Type: &proto.Parse_Response_Complete{
|
||||
Complete: &proto.Parse_Complete{
|
||||
ParameterSchemas: []*proto.ParameterSchema{{
|
||||
Name: "parameter-schema",
|
||||
}},
|
||||
},
|
||||
Complete: &proto.Parse_Complete{},
|
||||
},
|
||||
}}
|
||||
data, err := echo.Tar(&echo.Responses{
|
||||
@@ -69,8 +65,7 @@ func TestEcho(t *testing.T) {
|
||||
require.Equal(t, responses[0].GetLog().Output, log.GetLog().Output)
|
||||
complete, err := client.Recv()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, responses[1].GetComplete().ParameterSchemas[0].Name,
|
||||
complete.GetComplete().ParameterSchemas[0].Name)
|
||||
require.NotNil(t, complete)
|
||||
})
|
||||
|
||||
t.Run("Provision", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user