diff --git a/plugin/service/host/plugin.go b/plugin/service/host/plugin.go index bf7249a..bbf5aff 100644 --- a/plugin/service/host/plugin.go +++ b/plugin/service/host/plugin.go @@ -191,7 +191,7 @@ func (p *HostPlugin) OnUpdateCatalog(ctx context.Context, req *pb.OnUpdateCatalo return nil, errors.BadRequestStatusf("error loading persisted state: %s", err) } - // perform dry run to ensure we can interact with AWS as expected. + // New: perform dry run to ensure we can interact with AWS as expected. opts := []ec2Option{} if newCatalogAttributes.DualStack { opts = append(opts, WithDualStack(newCatalogAttributes.DualStack)) diff --git a/plugin/service/host/plugin_test.go b/plugin/service/host/plugin_test.go index 2bf23d8..9e7de7f 100644 --- a/plugin/service/host/plugin_test.go +++ b/plugin/service/host/plugin_test.go @@ -742,6 +742,9 @@ func TestPluginOnCreateCatalogErr(t *testing.T) { testMockEC2WithDescribeInstancesError(errors.New(testDescribeInstancesError)), )), }, + // checkHosts returns the DescribeInstances error as-is rather than + // wrapping it in a gRPC FailedPrecondition status like the old + // dryRunValidation did. A plain Go error maps to codes.Unknown. expectedErrContains: testDescribeInstancesError, expectedErrCode: codes.Unknown, }, @@ -994,6 +997,9 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) { testMockEC2WithDescribeInstancesError(errors.New(testDescribeInstancesError)), )), }, + // checkHosts returns the DesribeInstances errror as-is rather than wrapping it + // in a gRpc FailedPrecodndition status like the old dryRunValidiation did. + // A plain Go error maps to codeds.Unknown. expectedErrContains: testDescribeInstancesError, expectedErrCode: codes.Unknown, }, @@ -1036,6 +1042,9 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) { testMockEC2WithDescribeInstancesError(errors.New(testDescribeInstancesError)), )), }, + // checkHosts returns the DescribeInstances error as-is rather than wrapping it + // in a gRPC FailedPrecondition status like the old dryRunValidiation did. + // A plain Go error maps to codes.Unknown. expectedErrContains: testDescribeInstancesError, expectedErrCode: codes.Unknown, }, @@ -1211,6 +1220,9 @@ func TestPluginOnUpdateCatalogErr(t *testing.T) { testMockEC2WithDescribeInstancesError(fmt.Errorf("oops there was an error")), )), }, + // checkHosts returns the DescribeInstances error as-is rather than wrapping it + // in a gRPC FailedPrecondition status like the old dryRunValidiation did. + // A plain Go error maps to codes.Unknown. expectedErrContains: "oops there was an error", expectedErrCode: codes.Unknown, },