Skip to content

Commit 1bf0866

Browse files
committed
fix resources volumes allocation
1 parent 93609ca commit 1bf0866

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROP TABLE IF EXISTS workspace_agent_memory_resource_monitors;
2+
DROP TABLE IF EXISTS workspace_agent_volume_resource_monitors;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
CREATE TABLE workspace_agent_memory_resource_monitors (
2+
agent_id uuid NOT NULL REFERENCES workspace_agents(id) ON DELETE CASCADE,
3+
enabled boolean NOT NULL,
4+
threshold integer NOT NULL,
5+
created_at timestamp with time zone NOT NULL,
6+
PRIMARY KEY (agent_id)
7+
);
8+
9+
CREATE TABLE workspace_agent_volume_resource_monitors (
10+
agent_id uuid NOT NULL REFERENCES workspace_agents(id) ON DELETE CASCADE,
11+
enabled boolean NOT NULL,
12+
threshold integer NOT NULL,
13+
path text NOT NULL,
14+
created_at timestamp with time zone NOT NULL,
15+
PRIMARY KEY (agent_id, path)
16+
);

provisioner/terraform/resources.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
257257
}
258258

259259
resourcesMonitoring := &proto.ResourcesMonitoring{
260-
Volumes: make([]*proto.VolumeResourceMonitor, len(attrs.ResourcesMonitoring)),
260+
Volumes: make([]*proto.VolumeResourceMonitor, 0),
261261
}
262262

263263
for _, resource := range attrs.ResourcesMonitoring {

0 commit comments

Comments
 (0)