Skip to content

Commit bb569cb

Browse files
committed
rm unauthenticated, rm impossible flag combinations, better err msgs
- The unauthenticated mode no longer exists. The unauthenticated mode caused a lot of confusion as it was randomly triggered when missing some flags. Now, if you don't provide the required flags, the command will fail with a helpful error showing you what you missed. - I have removed an impossible combination (that did not work): you can no longer use `--private-key-path` along with `--credentials-path`. Previously, `--private-key-path` would be ignored if `--credentials-path` was provided. Now, the two options are mutually exclusive and a helpful message is shown when trying to use both. - The field `uploader_id` in the configuration file is deprecated. Setting this field will no longer do anything. A warning is now shown when using this field. The reason this field was deprecated is that it was never used by the Venafi Cloud API. Behind the scenes, the uploader_id is arbitrarily set to `no` so that the API doesn't complain. - The --private-key-path flag now defaults to the empty string. Previously, it defaulted to `/etc/venafi/agent/key/privatekey.pem`. This location wasn't used by any of our deployment options, and was confusing to users trying to use `--client-id`. A helpful message is now shown when trying to run `--client-id` without `--private-key-path`. - The `--period` flag was required even though the `period` field in the config was set. You can now set the period using the `period` field in the config file without having to also pass `--period` or `-p`. Note that the `--period` flag takes precedence over the config file.
1 parent 2b90ff5 commit bb569cb

20 files changed

+1280
-903
lines changed

cmd/agent.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"fmt"
55
"os"
66

7+
"github.com/spf13/cobra"
8+
79
"github.com/jetstack/preflight/pkg/agent"
810
"github.com/jetstack/preflight/pkg/logs"
911
"github.com/jetstack/preflight/pkg/permissions"
10-
"github.com/spf13/cobra"
1112
)
1213

1314
var agentCmd = &cobra.Command{
@@ -39,11 +40,16 @@ var agentRBACCmd = &cobra.Command{
3940
if err != nil {
4041
logs.Log.Fatalf("Failed to read config file: %s", err)
4142
}
42-
cfg, err := agent.ParseConfig(b, false)
43+
cfg, err := agent.ParseConfig(b)
4344
if err != nil {
4445
logs.Log.Fatalf("Failed to parse config file: %s", err)
4546
}
4647

48+
err = agent.ValidateDataGatherers(cfg.DataGatherers)
49+
if err != nil {
50+
logs.Log.Fatalf("Failed to validate data gatherers: %s", err)
51+
}
52+
4753
out := permissions.GenerateFullManifest(cfg.DataGatherers)
4854
fmt.Print(out)
4955
},

cmd/echo.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package cmd
22

33
import (
4-
"github.com/jetstack/preflight/pkg/echo"
54
"github.com/spf13/cobra"
5+
6+
"github.com/jetstack/preflight/pkg/echo"
67
)
78

89
var echoCmd = &cobra.Command{

0 commit comments

Comments
 (0)