Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions cmd/crossplane/validate/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package validate

import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
Expand All @@ -29,7 +28,6 @@ import (

"github.com/crossplane/crossplane-runtime/v2/pkg/errors"
"github.com/crossplane/crossplane-runtime/v2/pkg/logging"
"github.com/crossplane/crossplane-runtime/v2/pkg/version"

"github.com/crossplane/cli/v2/cmd/crossplane/common/load"
pkgvalidate "github.com/crossplane/cli/v2/pkg/validate"
Expand Down Expand Up @@ -78,9 +76,9 @@ type Cmd struct {
Resources string `arg:"" help:"Resource sources as a comma-separated list of files, directories, or '-' for standard input."`

// Flags. Keep them in alphabetical order.
CacheDir string `default:"~/.crossplane/cache" help:"Absolute path to the cache directory for downloaded schemas." predictor:"directory"`
CacheDir string `default:"~/.crossplane/cache" help:"Absolute path to the cache directory for downloaded schemas." predictor:"directory"`
CleanCache bool `help:"Clean the cache directory before downloading package schemas."`
CrossplaneImage string `help:"Specify the Crossplane image for validating built-in schemas."`
CrossplaneImage string `default:"xpkg.crossplane.io/crossplane/crossplane:stable" help:"Specify the Crossplane image for validating built-in schemas."`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks reasonable since we've now diverged versions and it looks like it correctly points to the most current stable image:

❯ docker run --rm xpkg.crossplane.io/crossplane/crossplane:stable --version
v2.3.3

ErrorOnMissingSchemas bool `default:"false" help:"Return non zero exit code if missing schemas."`
// rendererFlag.Decode rejects unknown formats, which is what Kong's
// "enum" tag would normally enforce — but enum doesn't apply to
Expand Down Expand Up @@ -112,10 +110,6 @@ func (c *Cmd) Run(k *kong.Context, _ logging.Logger) error {
return errors.New("cannot use stdin for both extensions and resources")
}

if len(c.CrossplaneImage) < 1 {
c.CrossplaneImage = fmt.Sprintf("xpkg.crossplane.io/crossplane/crossplane:%s", version.New().GetVersionString())
}

// Load all extensions
extensionLoader, err := load.NewLoader(c.Extensions)
if err != nil {
Expand Down
Loading