Skip to content

Conversation

@olehermanse
Copy link
Member

More fixes are needed to fix the actual issue (not just the log spamming), but this is a good improvement.

This test might run into problems like being too slow, or running
out of API quotas / rate limiting. We might disable it in the
future, or merge it into the other similar test, at
'tests/shell/validate.sh'.

However, for now, it is useful, especially as I'm debugging why this
fails in the other repo.

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
When we use warn_about_unused_keys from _validate_config() we really
want it to raise exceptions, like the rest of the valiation code.
validate_config() will handle the exception, and the code calling it
will determine how strict to be when it comes to the result.

(cfbs validate should be very strict, cfbs build is intentionally not
strict for backwards compatibility, other commands are somewhere in
between).

This fixes an issue seen in the build index tests, where these warnings
are printed many times by cfbs validate, because the "index" field is
not recognized, and cfbs validate still exits with 0 (success).

Further fixes are needed for other commands and for making cfbs validate
recognize the "index" field, this is just the first step.

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
When we are not using exceptions, avoid printing the same warning
again and again.

This fix is only for the places where we don't use the exceptions,
for example, it has no effect on cfbs validate.

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
It will be useful to call this function directly, in many cases.

Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole.elgesem@northern.tech>
@olehermanse olehermanse merged commit 5cd64ec into cfengine:master Jul 16, 2025
11 checks passed
@olehermanse olehermanse deleted the fixes branch July 16, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants