konveyor / kantra

A CLI that unifies analysis and transformation capabilities of Konveyor
Apache License 2.0
9 stars 27 forks source link

[BUG] Error using custom rules which are in a subdirectory: Error: creating named volume \"kai-examples/rules\": running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument\n" #357

Open jwmatthews opened 1 month ago

jwmatthews commented 1 month ago

Is there an existing issue for this?

Konveyor version

Latest as of Oct 3rd build, SHA: 9928bb083351904c0582bc1f4af2710985f56d2c

Priority

Critical

Current Behavior

I attempted to use Kantra with a custom rule directory which had some other subdirectories in it's path. Example:

I am running in a directory that has:

 kai_examples /
      rules

When I specify --rules ./kai_examples/rules kantra shows the below error

$ kantra analyze -i ./coolstore --enable-default-rulesets=false -o ./out --overwrite --rules ./kai-examples/rules
INFO[0000] running windup shim                           args="convert --outputdir=/opt/shimoutput /opt/xmlrules" output=/Users/jmatthews/tmp/r/out volumes="{\"./kai-examples/rules\":\"/opt/xmlrules/rules\",\"/var/folders/l1/1b7gzz8n02b5nrtdq51bnj4r0000gn/T/transform-output-996010118\":\"/opt/shimoutput\"}"
INFO[0000] generating shim log in file                   file=/Users/jmatthews/tmp/r/out/shim.log
/opt/podman/bin/podman run --rm --name SOUOLlpVvvDmXHps --entrypoint /usr/local/bin/windup-shim -v /var/folders/l1/1b7gzz8n02b5nrtdq51bnj4r0000gn/T/transform-output-996010118:/opt/shimoutput -v kai-examples/rules:/opt/xmlrules/rules quay.io/konveyor/kantra:latest convert --outputdir=/opt/shimoutput /opt/xmlrulesERRO[0000] container run error                           error="exit status 125"
ERRO[0000] failed to convert xml rules                   error="Error: creating named volume \"kai-examples/rules\": running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument\n"
Error: Error: creating named volume "kai-examples/rules": running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument

Grabbed latest Kantra available as of Oct 12, it looks to be a build from October 3 2024.

$ kantra version
version: latest
SHA: 9928bb083351904c0582bc1f4af2710985f56d2c
image: quay.io/konveyor/kantra

Also confirmed I see this with v0.5.3

version: v0.5.3
SHA: 215adcbbdfc337b5dee439404dc280d78e3e62f6
image: quay.io/konveyor/kantra

Expected Behavior

Assume kantra will be able to handle the extra directories in the path and use contents of the custom_rules directory

How Reproducible

Always (Default)

Steps To Reproduce

  1. git clone https://github.com/konveyor-ecosystem/coolstore.git
  2. git clone https://github.com/jmle/kai-examples.git
  3. kantra analyze -i ./coolstore --enable-default-rulesets=false -o ./out --overwrite --rules ./kai-examples/rules

Environment

Anything else?

No response

konveyor-ci-bot[bot] commented 1 month ago

This issue is currently awaiting triage. If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance. The triage/accepted label can be added by org members.