OpenCHAMI / configurator

An extensible tool to dynamically generate configs from SMD with Jinja 2 templating support.
MIT License
1 stars 1 forks source link

Fix minor issues #22

Closed davidallendj closed 2 weeks ago

davidallendj commented 2 weeks ago

This PR fixes a number of small issues such as --cacert not being available using the serve command, a type in the gorelease.yaml, and error messages being formatted incorrectly.

synackd commented 2 weeks ago

If -c is passed but the file doesn't exist, are default config values used? I did this and did not see an error that the config file did not exist.

davidallendj commented 2 weeks ago

If -c is passed but the file doesn't exist, are default config values used? I did this and did not see an error that the config file did not exist.

Yes, that's how it works.

synackd commented 2 weeks ago

If -c is passed but the file doesn't exist, are default config values used? I did this and did not see an error that the config file did not exist.

Yes, that's how it works.

I think it might be helpful to fail quickly if the config file isn't found if passed explicitly, that way the user doesn't assume that their file is getting read and can quickly pinpoint that the path they provided doesn't exist (e.g. mistyped or old path).

davidallendj commented 2 weeks ago

Yeah, that makes sense. I'll add an error for that.

synackd commented 2 weeks ago

I don't see lib/ anymore, so we can probably get rid of this line and this line. I get an error when building with them there:

  ⨯ release failed after 17s                         error=failed to find files to archive: globbing failed for pattern lib/: matching "./lib": file does not exist

also this line and optionally this one.

That will get it to build, then this line should be changed to

CMD ["/configurator/configurator"]

so the command works.

After all that, I can see the serve command.

# docker run --rm ghcr.io/openchami/configurator:v0.1.0
Tool for building common config files

Usage:
  configurator [flags]
  configurator [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  config      Create a new default config file
  fetch       Fetch a config file from a remote instance of configurator
  generate    Generate a config file from state management
  help        Help about any command
  inspect     Inspect generator plugin information
  serve       Start configurator as a server and listen for requests

Flags:
      --cacert string   path to CA cert. (defaults to system CAs)
  -c, --config string   set the config path (default "./config.yaml")
  -h, --help            help for configurator
  -v, --verbose         set to enable verbose output

Use "configurator [command] --help" for more information about a command.
davidallendj commented 2 weeks ago

Need to fix one more thing related to the --cacert flag.