Commit 466e4b0
Migrate CLI tools to Cobra for richer help and flag handling
Replace the stdlib flag package in both cmd/puppet-ca and
cmd/puppet-ca-ctl with github.com/spf13/cobra. The server becomes a
single root command with all flags declared via pflag; --cadir is now
enforced required by Cobra rather than a manual post-parse check.
The control CLI gains a proper subcommand tree with persistent global
flags (server-url, ca-cert, client-cert, client-key, verbose) that
work before or after the subcommand name. Required flags on each
subcommand (--certname, --cadir, etc.) are enforced by Cobra. The
fatalf/os.Exit pattern is replaced with error returns through RunE,
and checkHTTP now returns an error instead of exiting inline.
Replace the multi-stage in-container Go build with a slim runtime
image (Dockerfile.run) that COPYs pre-built binaries from bin/.
All integration test targets (integ, integCompose, loadCompose,
bench, stress) now depend on Build.All first, ensuring the local
binary is what gets tested. The original multi-stage Dockerfile is
kept for standalone docker-build use cases where Go is not installed
locally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a7c922e commit 466e4b0
12 files changed
Lines changed: 549 additions & 476 deletions
File tree
- cmd
- puppet-ca-ctl
- puppet-ca
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
0 commit comments