Skip to content

Commit

Permalink
Monitor.Invoke and Provider.Invoke take different arguments (pulumi/p…
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle committed Apr 14, 2022
1 parent 499402e commit 604fb11
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sdk/Pulumi/Deployment/Deployment_Invoke.cs
Expand Up @@ -105,7 +105,7 @@ private async Task<SerializationResult> InvokeRawAsync(string token, Serializati

var provider = await ProviderResource.RegisterAsync(GetProvider(token, options)).ConfigureAwait(false);

var result = await this.Monitor.InvokeAsync(new InvokeRequest
var result = await this.Monitor.InvokeAsync(new ResourceInvokeRequest
{
Tok = token,
Provider = provider ?? "",
Expand Down
12 changes: 6 additions & 6 deletions sdk/Pulumi/Deployment/GrpcMonitor.cs
Expand Up @@ -29,7 +29,7 @@ public GrpcMonitor(string monitorAddress)
// A channel already exists for this address
this._client = new ResourceMonitor.ResourceMonitorClient(monitorChannel);
}
else
else
{
lock (_channelsLock)
{
Expand All @@ -38,7 +38,7 @@ public GrpcMonitor(string monitorAddress)
// A channel already exists for this address
this._client = new ResourceMonitor.ResourceMonitorClient(monitorChannel);
}
else
else
{
// Inititialize the monitor channel once for this monitor address
var channel = GrpcChannel.ForAddress(new Uri($"http://{monitorAddress}"), new GrpcChannelOptions
Expand All @@ -54,22 +54,22 @@ public GrpcMonitor(string monitorAddress)
}
}
}

public async Task<SupportsFeatureResponse> SupportsFeatureAsync(SupportsFeatureRequest request)
=> await this._client.SupportsFeatureAsync(request);

public async Task<InvokeResponse> InvokeAsync(InvokeRequest request)
public async Task<InvokeResponse> InvokeAsync(ResourceInvokeRequest request)
=> await this._client.InvokeAsync(request);

public async Task<CallResponse> CallAsync(CallRequest request)
=> await this._client.CallAsync(request);

public async Task<ReadResourceResponse> ReadResourceAsync(Resource resource, ReadResourceRequest request)
=> await this._client.ReadResourceAsync(request);

public async Task<RegisterResourceResponse> RegisterResourceAsync(Resource resource, RegisterResourceRequest request)
=> await this._client.RegisterResourceAsync(request);

public async Task RegisterResourceOutputsAsync(RegisterResourceOutputsRequest request)
=> await this._client.RegisterResourceOutputsAsync(request);
}
Expand Down
8 changes: 4 additions & 4 deletions sdk/Pulumi/Deployment/IMonitor.cs
Expand Up @@ -9,14 +9,14 @@ internal interface IMonitor
{
Task<SupportsFeatureResponse> SupportsFeatureAsync(SupportsFeatureRequest request);

Task<InvokeResponse> InvokeAsync(InvokeRequest request);
Task<InvokeResponse> InvokeAsync(ResourceInvokeRequest request);

Task<CallResponse> CallAsync(CallRequest request);

Task<ReadResourceResponse> ReadResourceAsync(Resource resource, ReadResourceRequest request);

Task<RegisterResourceResponse> RegisterResourceAsync(Resource resource, RegisterResourceRequest request);

Task RegisterResourceOutputsAsync(RegisterResourceOutputsRequest request);
}
}
4 changes: 2 additions & 2 deletions sdk/Pulumi/Testing/MockMonitor.cs
Expand Up @@ -30,7 +30,7 @@ public Task<SupportsFeatureResponse> SupportsFeatureAsync(SupportsFeatureRequest
return Task.FromResult(new SupportsFeatureResponse { HasSupport = hasSupport });
}

public async Task<InvokeResponse> InvokeAsync(InvokeRequest request)
public async Task<InvokeResponse> InvokeAsync(ResourceInvokeRequest request)
{
var args = ToDictionary(request.Args);

Expand All @@ -47,7 +47,7 @@ public async Task<InvokeResponse> InvokeAsync(InvokeRequest request)
}
return new InvokeResponse { Return = await SerializeAsync(registeredResource).ConfigureAwait(false) };
}

var result = await _mocks.CallAsync(new MockCallArgs
{
Token = request.Tok,
Expand Down

0 comments on commit 604fb11

Please sign in to comment.