Skip to content

Commit 50423ca

Browse files
committed
remove resource if endpoint is disabled out-of-band
1 parent 8efe479 commit 50423ca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/provider/metrics_endpoint_resource.go

+5
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ func (r *metricsEndpointResource) Read(ctx context.Context, req resource.ReadReq
177177
return
178178
}
179179

180+
if accResp.GetAccount().GetMetrics().GetUri() == "" {
181+
resp.State.RemoveResource(ctx)
182+
return
183+
}
184+
180185
updateMetricsEndpointModelFromSpec(&state, accResp.GetAccount())
181186
resp.Diagnostics.Append(resp.State.Set(ctx, state)...)
182187
}

0 commit comments

Comments
 (0)