mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
refactor: compose deployment with pluggable spec resolver, basic test
This commit is contained in:
1 parent
fb01604d21
commit
041d51b74f
10 files changed
+185
-15
No files matched your search
@@ -19,11 +19,14 @@ import (
|
||||
func (cli *Client) PrepareDeploymentSpec(ctx context.Context, spec api.ServiceSpec) (api.ServiceSpec, error) {
|
||||
domain, err := cli.GetDomain(ctx)
|
||||
if err != nil && !errors.Is(err, ErrNotFound) {
|
||||
return spec, fmt.Errorf("get domain: %w", err)
|
||||
return spec, fmt.Errorf("get cluster domain: %w", err)
|
||||
}
|
||||
|
||||
// If the domain is not found (not reserved), an empty domain is used for the resolver.
|
||||
resolver := NewServiceSpecResolver(domain)
|
||||
resolver := ServiceSpecResolver{
|
||||
// If the domain is not found (not reserved), an empty domain is used for the resolver.
|
||||
ClusterDomain: domain,
|
||||
// TODO: provide an image resolver.
|
||||
}
|
||||
|
||||
if err = resolver.Resolve(&spec); err != nil {
|
||||
return spec, err
|
||||
|
||||
Reference in new issue
Block a user