mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
feat(compose): add TODO to address deployment idempotency
This commit is contained in:
@@ -40,6 +40,7 @@ func (cli *Client) CreateContainer(
|
||||
}
|
||||
containerName := fmt.Sprintf("%s-%s", spec.Name, suffix)
|
||||
|
||||
// TODO: calculate the spec hash and set it as a label to detect changes in the service spec.
|
||||
config := &container.Config{
|
||||
Cmd: spec.Container.Command,
|
||||
Hostname: containerName,
|
||||
|
||||
@@ -97,6 +97,8 @@ func (s *RollingStrategy) planReplicated(
|
||||
// Skip containers that are not running.
|
||||
continue
|
||||
}
|
||||
// TODO: determine if the spec has changed by comparing the hashes.
|
||||
// Refactor all the spec comparison logic below.
|
||||
cs, err := c.Container.ServiceSpec()
|
||||
if err == nil {
|
||||
runningSpecs[c.Container.ID] = cs
|
||||
|
||||
@@ -7,6 +7,9 @@ import (
|
||||
)
|
||||
|
||||
func ServiceSpecFromCompose(name string, service types.ServiceConfig) (api.ServiceSpec, error) {
|
||||
// TODO: resolve the image to a digest and supported platforms using an image resolver that broadcasts requests
|
||||
// to all machines in the cluster.
|
||||
// TODO: configure placement filter based on the supported platforms of the image.
|
||||
spec := api.ServiceSpec{
|
||||
Container: api.ContainerSpec{
|
||||
Command: service.Command,
|
||||
|
||||
@@ -15,6 +15,8 @@ service Docker {
|
||||
rpc ListContainers(ListContainersRequest) returns (ListContainersResponse);
|
||||
rpc RemoveContainer(RemoveContainerRequest) returns (google.protobuf.Empty);
|
||||
rpc PullImage(PullImageRequest) returns (stream JSONMessage);
|
||||
// TODO: implement InspectImageFromRegistry to resolve image name to digest and supported platforms using
|
||||
// the configured Docker auth.
|
||||
}
|
||||
|
||||
message CreateContainerRequest {
|
||||
|
||||
Reference in New Issue
Block a user