mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
feat: process image templates in compose services, set default git-based tags if not specified
This commit is contained in:
@@ -53,6 +53,11 @@ func LoadProject(ctx context.Context, paths []string, opts ...composecli.Project
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Process image templates in services to expand Go template expressions using git repo state.
|
||||
if project, err = ProcessImageTemplates(project); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return project, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// loadProjectFromContent loads a compose project from YAML content
|
||||
// loadProjectFromContent loads a compose project from YAML content.
|
||||
// Keep the implementation in sync with LoadProject.
|
||||
func loadProjectFromContent(t *testing.T, content string) (*types.Project, error) {
|
||||
t.Helper()
|
||||
ctx := context.Background()
|
||||
@@ -62,6 +63,11 @@ func loadProjectFromContent(t *testing.T, content string) (*types.Project, error
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Process image templates in services to expand Go template expressions using git repo state.
|
||||
if project, err = ProcessImageTemplates(project); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return project, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user