versionsapi: fix list command by allowing empty set of patch versions for a given minor version (#1609)

This commit is contained in:
Malte Poll 2023-04-04 12:10:07 +02:00 committed by GitHub
parent 8f17e4b9df
commit 2ca2dbae22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,12 +12,13 @@ import (
"errors"
"fmt"
"github.com/edgelesssys/constellation/v2/internal/logger"
"github.com/edgelesssys/constellation/v2/internal/versionsapi"
verclient "github.com/edgelesssys/constellation/v2/internal/versionsapi/client"
"github.com/spf13/cobra"
"go.uber.org/zap/zapcore"
"golang.org/x/mod/semver"
"github.com/edgelesssys/constellation/v2/internal/logger"
"github.com/edgelesssys/constellation/v2/internal/versionsapi"
verclient "github.com/edgelesssys/constellation/v2/internal/versionsapi/client"
)
func newListCmd() *cobra.Command {
@ -137,10 +138,6 @@ func listPatchVersions(ctx context.Context, client *verclient.Client, ref string
return nil, fmt.Errorf("listing patch versions: %w", err)
}
if len(list.Versions) == 0 {
return nil, fmt.Errorf("no versions found")
}
patchVers = append(patchVers, list.StructuredVersions()...)
}