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
-31
View File
@@ -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 {
+2 -7
View File
@@ -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) {