goss-org / goss

Quick and Easy server testing/validation
https://goss.rocks
Apache License 2.0
5.5k stars 470 forks source link

kgoss uses a chmod call not supported by busybox #868

Closed erkules closed 5 months ago

erkules commented 5 months ago

Describe the bug kgoss will not run with Containers using busybox

chmod: unrecognized option: recursive
BusyBox v1.36.1 (2023-07-27 17:12:24 UTC) multi-call binary.

Usage: chmod [-Rcvf] MODE[,MODE]... FILE...

MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst]

        -R      Recurse
        -c      List changed files
        -v      Verbose
        -f      Hide errors
command terminated with exit code 1

Expected Behavior

cat >goss.yaml <<EOF port: tcp:80: listening: true EOF

$ kgoss run  -i nginx:alpine
[INFO]: Parsing command line
[INFO]: using image: nginx:alpine
[INFO]: going to execute (may be blank): -- 
[INFO]: Preparing files to copy into container
[INFO]: Creating Kubernetes pod/container to test
++ /usr/local/bin/kubectl run kgoss-tester-6558 --image-pull-policy=Always --restart=Never --labels=app=kgoss-test '--output=jsonpath={.metadata.name}' --image=nginx:alpine --
+ id=kgoss-tester-6558
+ set +x
[INFO]: Waiting for container to be ready
pod/kgoss-tester-6558 condition met
[INFO]: Copying goss files into pod/container
[INFO]: Marking copied files as executable
[INFO]: Using pod/container: kgoss-tester-6558
[INFO]: Running tests within pod/container
Port: tcp:80: listening: matches expectation: true

Total Duration: 0.000s
Count: 1, Failed: 0, Skipped: 0
[INFO]: Deleting pod/container

Actual Behavior

$ kgoss run  -i nginx:alpine
[INFO]: Parsing command line
[INFO]: using image: nginx:alpine
[INFO]: going to execute (may be blank): -- 
[INFO]: Preparing files to copy into container
[INFO]: Creating Kubernetes pod/container to test
++ /usr/local/bin/kubectl run kgoss-tester-13743 --image-pull-policy=Always --restart=Never --labels=app=kgoss-test '--output=jsonpath={.metadata.name}' --image=nginx:alpine --
+ id=kgoss-tester-13743
+ set +x
[INFO]: Waiting for container to be ready
pod/kgoss-tester-13743 condition met
[INFO]: Copying goss files into pod/container
[INFO]: Marking copied files as executable
chmod: unrecognized option: recursive
BusyBox v1.36.1 (2023-11-06 11:32:24 UTC) multi-call binary.

Usage: chmod [-Rcvf] MODE[,MODE]... FILE...

MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst]

        -R      Recurse
        -c      List changed files
        -v      Verbose
        -f      Hide errors
command terminated with exit code 1
erkules commented 5 months ago

wow that was fast. thx a lot \o/