Actions
Bug #24885
openIt's impossible to import a technique within a subdirectory in Rudder 8.1
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No
Description
I created a technique in the folder systemSettings/hardening_pack_rudder/1.0
It starts with
id: hardening_pack_rudder name: Hardening pack for Rudder version: 1.0
when I tried to import it in Rudder with curl, I got the following error
# curl -k -X POST -H "X-API-TOKEN: $(cat /var/rudder/run/api-token)" https://localhost/rudder/api/latest/archives/import --form "archive=@hardening-archive.zip" {"action":"import","result":"error","errorDetails":"error when committing Technique 'hardening_pack_rudder/1.0'; cause was: Inconsistency: Technique descriptor at path '/var/rudder/configuration-repository/techniques/systemSettings/hardening_pack_rudder/1.0' contains a technique 'id' or 'version' attribute that does not match the conventional path of the technique which must be: '.../category/parts/.../{techniqueId}/{techniqueVersion}/technique.yml'. Please change either technique directory or the descriptor information so that they match one other each others."}
error is because in the scala code, we do the following comparision
techniqueBaseDirectory.path.endsWith(techniqueDescriptor.path)
so we compare
/var/rudder/configuration-repository/techniques/systemSettings/hardening_pack_rudder/1.0with
techniques/${category}/${id.value}/${version.value}, so there is no chance that we can import a technique in a subdirectory
happens in 8.1, may happen in 8.0
Actions