mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
cli: deprecate "compliance" command
dist-spec community is now maintaining its own conformance suite hosted at https://oci.bloodorange.io which over time will be more complete. This makes zot's compliance cli superfluous. Hence, deprecating the cli. However, we keep the unit tests itself though.
This commit is contained in:
@@ -1,20 +1,14 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/anuvu/zot/errors"
|
||||
"github.com/anuvu/zot/pkg/api"
|
||||
"github.com/anuvu/zot/pkg/compliance"
|
||||
"github.com/anuvu/zot/pkg/storage"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
dspec "github.com/opencontainers/distribution-spec"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/anuvu/zot/pkg/compliance/v1_0_0"
|
||||
)
|
||||
|
||||
// metadataConfig reports metadata after parsing, which we use to track
|
||||
@@ -88,46 +82,6 @@ func NewRootCmd() *cobra.Command {
|
||||
gcCmd.Flags().BoolVarP(&gcDryRun, "dry-run", "d", false,
|
||||
"do everything except remove the blobs")
|
||||
|
||||
// "compliance"
|
||||
complianceConfig := compliance.NewConfig()
|
||||
complianceCmd := &cobra.Command{
|
||||
Use: "compliance",
|
||||
Aliases: []string{"co"},
|
||||
Short: "`compliance` checks compliance with respect to OCI distribution-spec",
|
||||
Long: "`compliance` checks compliance with respect to OCI distribution-spec",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
t := &testing.T{}
|
||||
switch complianceConfig.Version {
|
||||
case "all":
|
||||
fallthrough
|
||||
default:
|
||||
v1_0_0.CheckWorkflows(t, complianceConfig)
|
||||
}
|
||||
if t.Failed() {
|
||||
os.Exit(1)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
complianceCmd.Flags().StringVarP(&complianceConfig.Address, "address", "H", "",
|
||||
"Registry server address")
|
||||
|
||||
if err := complianceCmd.MarkFlagRequired("address"); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
complianceCmd.Flags().StringVarP(&complianceConfig.Port, "port", "P", "",
|
||||
"Registry server port")
|
||||
|
||||
if err := complianceCmd.MarkFlagRequired("port"); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
complianceCmd.Flags().StringVarP(&complianceConfig.Version, "version", "V", "all",
|
||||
"OCI dist-spec version to check")
|
||||
complianceCmd.Flags().BoolVarP(&complianceConfig.OutputJSON, "json", "j", false,
|
||||
"output test results as JSON")
|
||||
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "zot",
|
||||
Short: "`zot`",
|
||||
@@ -142,7 +96,6 @@ func NewRootCmd() *cobra.Command {
|
||||
|
||||
rootCmd.AddCommand(serveCmd)
|
||||
rootCmd.AddCommand(gcCmd)
|
||||
rootCmd.AddCommand(complianceCmd)
|
||||
rootCmd.Flags().BoolVarP(&showVersion, "version", "v", false, "show the version and exit")
|
||||
|
||||
return rootCmd
|
||||
|
||||
Reference in New Issue
Block a user