feat: process image templates in compose services, set default git-based tags if not specified

This commit is contained in:
Pasha Sviderski
2025-11-01 16:06:52 +10:00
parent 328ace1fd1
commit 26c3699a9e
3 changed files with 19 additions and 4 deletions
+5
View File
@@ -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
}
+7 -1
View File
@@ -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
}