Skip to content

Support flag to control log directory & handling kubeconfig duplicates #68

@rh-rahulshetty

Description

@rh-rahulshetty

Hello!

I observed that after running the krknctl graph run command, log outputs for individual test scenarios are generated in the same directory, as shown below.

Image

Some observations that could help improve krknctl for automation:

  • It would be helpful to have a flag like --output or -o to control the output path for log files. Currently, they are written to the same directory from which the krknctl command is executed.

  • The current naming convention for these log files appears to follow the format krknctl-<testname>-<random-id>.log, which can make it tricky with using pattern matching to read them. Since each testname in the graph JSON is already unique, it would be more convenient to use a simpler format such as krknctl-<testname>.log or just <testname>.log.

  • I also noticed that the kubeconfig files for the cluster are copied again into the execution directory. It would be better to either clean up these files automatically or directly reference the original path provided with the --kubeconfig flag, rather than duplicating them. I’ve had to manually remove these files multiple times and add a .gitignore rule to prevent them from being checked into version control.

A simple example that can be used to reproduce these findings:

{
    "B": {
        "image": "containers.krkn-chaos.dev/krkn-chaos/krkn-hub:dummy-scenario",
        "name": "dummy-scenario",
        "env": {
            "END": "10",
            "EXIT_STATUS": "0"
        },
        "depends_on": "A"
    },
    "A": {
        "image": "containers.krkn-chaos.dev/krkn-chaos/krkn-hub:dummy-scenario",
        "name": "dummy-scenario",
        "env": {
            "END": "10",
            "EXIT_STATUS": "0"
        }
    }
}

Command: krknctl graph run test.json --kubeconfig=<path-to-kubeconfig.yaml>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions