From 80980637983378f36bff3bd720f12729f7339ff0 Mon Sep 17 00:00:00 2001 From: Lorenzo Susini Date: Thu, 27 Jul 2023 08:26:11 +0000 Subject: [PATCH] update: adapt push tests --- README.md | 2 +- cmd/push_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 07fe41369..2acaae8ea 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ Currently, *falcoctl* supports only two types of artifacts: **plugin** and **rul * `--annotation-source`: set annotation source for the artifact; * `--depends-on`: set an artifact dependency (can be specified multiple times). Example: `--depends-on my-plugin:1.2.3` * `--tag`: additional artifact tag. Can be repeated multiple time -* `--type`: type of artifact to be pushed. Allowed values: `rulesfile`, `plugin` +* `--type`: type of artifact to be pushed. Allowed values: `rulesfile`, `plugin`, `asset` ### Falcoctl registry pull Pulling **artifacts** involves specifying the reference. The type of **artifact** is not required since the tool will implicitly extract it from the OCI **artifact**: diff --git a/cmd/push_test.go b/cmd/push_test.go index 3585e80c6..e865c51db 100644 --- a/cmd/push_test.go +++ b/cmd/push_test.go @@ -44,7 +44,7 @@ Flags: --platform stringArray os and architecture of the artifact in OS/ARCH format (only for plugins artifacts) -r, --requires stringArray set an artifact requirement (can be specified multiple times). Example: "--requires plugin_api_version:1.2.3" -t, --tag stringArray additional artifact tag. Can be repeated multiple times - --type ArtifactType type of artifact to be pushed. Allowed values: "rulesfile", "plugin" (default ) + --type ArtifactType type of artifact to be pushed. Allowed values: "rulesfile", "plugin", "asset" (default ) --version string set the version of the artifact Global Flags: @@ -99,7 +99,7 @@ Flags: --platform stringArray os and architecture of the artifact in OS/ARCH format (only for plugins artifacts) -r, --requires stringArray set an artifact requirement (can be specified multiple times). Example: "--requires plugin_api_version:1.2.3" -t, --tag stringArray additional artifact tag. Can be repeated multiple times - --type ArtifactType type of artifact to be pushed. Allowed values: "rulesfile", "plugin" + --type ArtifactType type of artifact to be pushed. Allowed values: "rulesfile", "plugin", "asset" --version string set the version of the artifact Global Flags: @@ -189,10 +189,10 @@ var registryPushTests = Describe("push", func() { When("multiple rulesfiles", func() { BeforeEach(func() { - args = []string{registryCmd, pushCmd, rulesRepo, "--config", configFile, rulesfiletgz, rulesfiletgz, - "--type", "rulesfile", "--version", "1.1.1", "--plain-http"} + args = []string{registryCmd, pushCmd, "--config", configFile, + "--type", "rulesfile", "--version", "1.1.1", "--plain-http", rulesRepo, rulesfiletgz, rulesfiletgz} }) - pushAssertFailedBehavior(registryPushUsage, "ERRO: expecting 1 rulesfile object received 2: invalid number of rulesfiles\n") + pushAssertFailedBehavior(registryPushUsage, "ERRO: expecting 1 rulesfile object, received 2: invalid number of rulesfiles\n") }) When("unreachable registry", func() { @@ -250,7 +250,7 @@ var registryPushTests = Describe("push", func() { args = []string{registryCmd, pushCmd, pluginsRepo, pluginsRepo, "--config", configFile, "--type", "wrongType", "--version", "1.1.1", "--plain-http"} }) - pushAssertFailedBehavior(registryPushUsage, "ERRO: invalid argument \"wrongType\" for \"--type\" flag: must be one of \"rulesfile\", \"plugin\"\n") + pushAssertFailedBehavior(registryPushUsage, "ERRO: invalid argument \"wrongType\" for \"--type\" flag: must be one of \"rulesfile\", \"plugin\", \"asset\"\n") }) })