Skip to content

docker-entrypoint doesn't properly identify atlantis subcommands #870

@sparky005

Description

@sparky005

The docker entrypoint has the following snippet to identify if a given command is an atlantis subcommand

if atlantis --help "$1" 2>&1 | grep -q "atlantis $1"; then
    # We can't use the return code to check for the existence of a subcommand, so
    # we have to use grep to look for a pattern in the help output.
    set -- atlantis "$@"
fi

https://github.com/runatlantis/atlantis/blob/master/docker-entrypoint.sh#L19-L23

However, this doesn't work, as the atlantis --help output actually looks like this:

Terraform Pull Request Automation

Usage:
  atlantis [command]

Available Commands:
  help        Help about any command
  server      Start the atlantis server
  testdrive   Start a guided tour of Atlantis
  version     Print the current Atlantis version

Flags:
  -h, --help   help for atlantis

Use "atlantis [command] --help" for more information about a command.

So this logic doesn't actually work for any subcommand other than "atlantis server," which itself only works because the description happens to contain the string "atlantis server."

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions