mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 03:53:33 +00:00
refactor: compose deployment plan to not use PrepareDeploymentSpec
This commit is contained in:
@@ -43,14 +43,11 @@ func (d *ComposeDeployment) Plan(ctx context.Context) (SequenceOperation, error)
|
|||||||
|
|
||||||
plan := SequenceOperation{}
|
plan := SequenceOperation{}
|
||||||
err := graph.InDependencyOrder(ctx, d.Project,
|
err := graph.InDependencyOrder(ctx, d.Project,
|
||||||
func(ctx context.Context, name string, service types.ServiceConfig) error {
|
func(ctx context.Context, name string, _ types.ServiceConfig) error {
|
||||||
spec, err := compose.ServiceSpecFromCompose(name, service)
|
spec, err := d.ServiceSpec(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("convert compose service '%s' to service spec: %w", name, err)
|
return fmt.Errorf("convert compose service '%s' to service spec: %w", name, err)
|
||||||
}
|
}
|
||||||
if spec, err = d.Client.PrepareDeploymentSpec(ctx, spec); err != nil {
|
|
||||||
return fmt.Errorf("prepare service '%s' spec ready for deployment: %w", name, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: properly handle dependency conditions in the service deployment plan as the first operation.
|
// TODO: properly handle dependency conditions in the service deployment plan as the first operation.
|
||||||
deploy, err := d.Client.NewDeployment(spec, nil)
|
deploy, err := d.Client.NewDeployment(spec, nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user