refactor: embed ServiceSpecResolver into Deployment to handle spec only there

This commit is contained in:
Pavel Sviderski
2025-03-24 20:10:28 +10:00
parent 7a9d0cf9db
commit 3910101a88
17 changed files with 191 additions and 148 deletions
+5 -2
View File
@@ -1,12 +1,15 @@
package client
import (
"context"
"github.com/psviderski/uncloud/pkg/api"
"github.com/psviderski/uncloud/pkg/client/deploy"
)
// NewDeployment creates a new deployment for the given service specification.
// If strategy is nil, a default deploy.RollingStrategy will be used.
func (cli *Client) NewDeployment(spec api.ServiceSpec, strategy deploy.Strategy) *deploy.Deployment {
return deploy.NewDeployment(cli, spec, strategy)
func (cli *Client) NewDeployment(
ctx context.Context, spec api.ServiceSpec, strategy deploy.Strategy,
) (*deploy.Deployment, error) {
return deploy.NewDeployment(ctx, cli, spec, strategy)
}