feat: print warning on some unsupported compose features (#288)

* feat: error on unsupported compose features

This implements a check for the unimplemented features of the uncloud
support matrix and points to the matrix in the error.

Fixes: #237

This redos #277, as I messed up my branch, (basically rebase gone
wrong).

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix tests by capturing stderr

The error should be nil, but we _do_ want to know if the user saw an
warning. Redirect stderr to capture this as the error is emited by
printing to stderr.

Signed-off-by: Miek Gieben <miek@miek.nl>

---------

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2026-03-31 16:37:35 +10:00
committed by GitHub
parent 636307d3ea
commit d38312fec6
3 changed files with 143 additions and 0 deletions
+5
View File
@@ -12,6 +12,7 @@ import (
"github.com/compose-spec/compose-go/v2/transform"
"github.com/compose-spec/compose-go/v2/tree"
"github.com/compose-spec/compose-go/v2/types"
"github.com/psviderski/uncloud/internal/cli/tui"
"github.com/psviderski/uncloud/pkg/api"
)
@@ -66,6 +67,10 @@ func LoadProject(ctx context.Context, paths []string, opts ...composecli.Project
return nil, err
}
if err = validateServicesFeatures(project); err != nil {
tui.PrintWarning(err.Error())
}
// Process image templates in services to expand Go template expressions using git repo state.
if project, err = ProcessImageTemplates(project); err != nil {
return nil, err