diff --git a/changes/15436-fleetctl-generate-context b/changes/15436-fleetctl-generate-context new file mode 100644 index 0000000000..cd0271cee4 --- /dev/null +++ b/changes/15436-fleetctl-generate-context @@ -0,0 +1 @@ +- Fixed bug where fleetctl did not allow placement of `--context` and `--debug` flages following the `generate mdm-apple` and `generate mdm-apple-bm` commands. diff --git a/cmd/fleetctl/generate.go b/cmd/fleetctl/generate.go index 97778e2ef3..b9a9ada070 100644 --- a/cmd/fleetctl/generate.go +++ b/cmd/fleetctl/generate.go @@ -38,6 +38,8 @@ func generateMDMAppleCommand() *cli.Command { Aliases: []string{"mdm_apple"}, Usage: "Generates certificate signing request (CSR) and key for Apple Push Notification Service (APNs) and certificate and key for Simple Certificate Enrollment Protocol (SCEP) to turn on MDM features.", Flags: []cli.Flag{ + contextFlag(), + debugFlag(), &cli.StringFlag{ Name: "email", Usage: "The email address to send the signed APNS csr to.", @@ -132,6 +134,8 @@ func generateMDMAppleBMCommand() *cli.Command { Aliases: []string{"mdm_apple_bm"}, Usage: "Generate Apple Business Manager public and private keys to enable automatic enrollment for macOS hosts.", Flags: []cli.Flag{ + contextFlag(), + debugFlag(), &cli.StringFlag{ Name: "public-key", Usage: "The output path for the Apple Business Manager public key certificate.", diff --git a/cmd/fleetctl/generate_test.go b/cmd/fleetctl/generate_test.go index 960271a775..28bb13d31c 100644 --- a/cmd/fleetctl/generate_test.go +++ b/cmd/fleetctl/generate_test.go @@ -86,6 +86,8 @@ func TestGenerateMDMApple(t *testing.T) { "--apns-key", apnsKeyPath, "--scep-cert", scepCertPath, "--scep-key", scepKeyPath, + "--debug", + "--context", "default", }) require.Contains(t, out, fmt.Sprintf("Generated your APNs key at %s", apnsKeyPath))