diff --git a/internal/cli/client/service.go b/internal/cli/client/service.go index dad3397c..952d6381 100644 --- a/internal/cli/client/service.go +++ b/internal/cli/client/service.go @@ -114,6 +114,7 @@ func (c *Client) RunService(ctx context.Context, opts *ServiceOptions) (RunServi machinecore.DockerNetworkName: {}, }, } + // TODO: pull image if it doesn't exist on the machine. createResp, err := c.CreateContainer(ctx, config, nil, netConfig, nil, containerName) if err != nil { return resp, fmt.Errorf("create container: %w", err) diff --git a/internal/machine/store/schema.sql b/internal/machine/store/schema.sql index 5366d065..e8f6463e 100644 --- a/internal/machine/store/schema.sql +++ b/internal/machine/store/schema.sql @@ -22,7 +22,9 @@ CREATE TABLE containers container TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(container)), machine_id TEXT NOT NULL DEFAULT '', service_id TEXT AS (json_extract(container, '$.Labels."uncloud.service.id"')), - service_name TEXT AS (json_extract(container, '$.Labels."uncloud.service.name"')) + service_name TEXT AS (json_extract(container, '$.Labels."uncloud.service.name"')), + -- updated_at is the last time the record was updated. + updated_at TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00' ); CREATE INDEX idx_machines_name ON machines (name);