This commit is contained in:
Alex Dadgar
2018-08-13 11:10:33 -07:00
parent 1736d93430
commit 2de5989e37
4 changed files with 16 additions and 15 deletions

View File

@@ -33,7 +33,10 @@ type PluginBase struct {
}
func (p *PluginBase) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error {
proto.RegisterBasePluginServer(s, &basePluginServer{impl: p.impl})
proto.RegisterBasePluginServer(s, &basePluginServer{
impl: p.impl,
broker: broker,
})
return nil
}

View File

@@ -16,27 +16,27 @@ var (
// testSpec is an hcl Spec for testing
testSpec = &hclspec.Spec{
Block: &hclspec.Spec_Object{
&hclspec.Object{
Object: &hclspec.Object{
Attributes: map[string]*hclspec.Spec{
"foo": &hclspec.Spec{
"foo": {
Block: &hclspec.Spec_Attr{
&hclspec.Attr{
Attr: &hclspec.Attr{
Type: "string",
Required: false,
},
},
},
"bar": &hclspec.Spec{
"bar": {
Block: &hclspec.Spec_Attr{
&hclspec.Attr{
Attr: &hclspec.Attr{
Type: "number",
Required: true,
},
},
},
"baz": &hclspec.Spec{
"baz": {
Block: &hclspec.Spec_Attr{
&hclspec.Attr{
Attr: &hclspec.Attr{
Type: "bool",
},
},

View File

@@ -82,8 +82,6 @@ func decodeSpecBlock(spec *Spec, impliedName string) (hcldec.Spec, hcl.Diagnosti
})
return nil, diags
}
return nil, nil
}
func decodeObjectSpec(obj *Object) (hcldec.Spec, hcl.Diagnostics) {

View File

@@ -46,7 +46,7 @@ func TestDec_Convert_Object(t *testing.T) {
Block: &Spec_Object{
&Object{
Attributes: map[string]*Spec{
"foo": &Spec{
"foo": {
Block: &Spec_Attr{
&Attr{
Type: "string",
@@ -54,7 +54,7 @@ func TestDec_Convert_Object(t *testing.T) {
},
},
},
"bar": &Spec{
"bar": {
Block: &Spec_Attr{
&Attr{
Type: "number",
@@ -62,7 +62,7 @@ func TestDec_Convert_Object(t *testing.T) {
},
},
},
"baz": &Spec{
"baz": {
Block: &Spec_Attr{
&Attr{
Type: "bool",
@@ -106,7 +106,7 @@ func TestDec_Convert_Array(t *testing.T) {
Block: &Spec_Array{
Array: &Array{
Values: []*Spec{
&Spec{
{
Block: &Spec_Attr{
&Attr{
Name: "foo",
@@ -115,7 +115,7 @@ func TestDec_Convert_Array(t *testing.T) {
},
},
},
&Spec{
{
Block: &Spec_Attr{
&Attr{
Name: "bar",