Skip to content

Commit

Permalink
update: adapt push tests
Browse files Browse the repository at this point in the history
  • Loading branch information
loresuso committed Jul 27, 2023
1 parent 335ff36 commit 8098063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:
Expand Down
12 changes: 6 additions & 6 deletions cmd/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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")

Check failure on line 253 in cmd/push_test.go

View workflow job for this annotation

GitHub Actions / Lint golang files

line is 161 characters (lll)
})
})

Expand Down

0 comments on commit 8098063

Please sign in to comment.