cscli/hub: don't return error if some file can't be recognized (#3150)

In k8s there can be extra directories while mounting config maps, which
leads to a failure while parsing the hub state. The PR changes these
kind of errors to warnings.
This commit is contained in:
mmetc 2024-07-24 16:29:38 +02:00 committed by GitHub
parent 36d15fedce
commit 20067a85a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -193,3 +193,10 @@ teardown() {
rune -0 jq -c '.tainted' <(output)
assert_output 'false'
}
@test "skip files if we can't guess their type" {
rune -0 mkdir -p "$CONFIG_DIR/scenarios/foo"
rune -0 touch "$CONFIG_DIR/scenarios/foo/bar.yaml"
rune -0 cscli hub list
assert_stderr --partial "Ignoring file $CONFIG_DIR/scenarios/foo/bar.yaml: unknown configuration type"
}