mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-30 09:56:21 -05:00
f204c24174
Version validation checks that the configured versions are not more than one minor version below the CLI's version. The validation can be disabled using --force. This is necessary for now during development as the CLI does not have a prerelease version, as our images do.
38 lines
914 B
Go
38 lines
914 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
// Package cmd contains the cdbg CLI.
|
|
package cmd
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/edgelesssys/constellation/v2/internal/constants"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newRootCmd() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "cdbg",
|
|
Short: "Constellation debugging client",
|
|
Long: `cdbg is the constellation debugging client.
|
|
It connects to Constellation instances running debugd and deploys a self-compiled version of the bootstrapper.`,
|
|
}
|
|
cmd.PersistentFlags().String("config", constants.ConfigFilename, "Constellation config file")
|
|
cmd.PersistentFlags().Bool("force", false, "disables version validation errors - might result in corrupted clusters")
|
|
|
|
cmd.AddCommand(newDeployCmd())
|
|
return cmd
|
|
}
|
|
|
|
// Execute starts the CLI.
|
|
func Execute() {
|
|
cmd := newRootCmd()
|
|
if err := cmd.Execute(); err != nil {
|
|
os.Exit(1)
|
|
}
|
|
}
|