Skip to content

Commit ace7bb2

Browse files
maelvlswallrj
authored andcommitted
feature: send errors to the pod's event to increase visibility
WARNING: starting with this commit, the Agent must be know about the namespace in which the agent's pod is running: - If the pod has a service account mounted, then the agent will load the namespace from the file /var/run/secrets/kubernetes.io/serviceaccount/namespace. - Otherwise, you can provide the namespace using --install-namespace (meant for running the agent out-of-cluster for testing purposes). Previously, --install-namespace was only needed when using the VenafiConnection mode (i.e., using --venafi-connection).
1 parent 64a9255 commit ace7bb2

File tree

4 files changed

+142
-64
lines changed

4 files changed

+142
-64
lines changed

deploy/charts/venafi-kubernetes-agent/templates/rbac.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
---
22
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: {{ include "venafi-kubernetes-agent.fullname" . }}-event-emitted
6+
labels:
7+
{{- include "venafi-kubernetes-agent.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups: [""]
10+
resources: ["events"]
11+
verbs: ["create"]
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: ClusterRoleBinding
15+
metadata:
16+
name: {{ include "venafi-kubernetes-agent.fullname" . }}-event-emitted
17+
labels:
18+
{{- include "venafi-kubernetes-agent.labels" . | nindent 4 }}
19+
roleRef:
20+
apiGroup: rbac.authorization.k8s.io
21+
kind: ClusterRole
22+
name: {{ include "venafi-kubernetes-agent.fullname" . }}-event-emitted
23+
subjects:
24+
- kind: ServiceAccount
25+
name: {{ include "venafi-kubernetes-agent.serviceAccountName" . }}
26+
namespace: {{ .Release.Namespace }}
27+
---
28+
apiVersion: rbac.authorization.k8s.io/v1
329
kind: ClusterRoleBinding
430
metadata:
531
name: {{ include "venafi-kubernetes-agent.fullname" . }}-cluster-viewer

pkg/agent/config.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ func InitAgentCmdFlags(c *cobra.Command, cfg *AgentCmdFlags) {
273273
"install-namespace",
274274
"",
275275
"For testing purposes. Namespace in which the agent is running. "+
276-
"Only needed with the "+string(VenafiCloudVenafiConnection)+" mode"+
277-
"when running the agent outside of Kubernetes.",
276+
"Only needed when running the agent outside of Kubernetes.",
278277
)
279278
c.PersistentFlags().BoolVarP(
280279
&cfg.Profiling,
@@ -314,6 +313,7 @@ type CombinedConfig struct {
314313
BackoffMaxTime time.Duration
315314
StrictMode bool
316315
OneShot bool
316+
InstallNS string
317317

318318
// Used by JetstackSecureOAuth, JetstackSecureAPIToken, and
319319
// VenafiCloudKeypair. Ignored in VenafiCloudVenafiConnection mode.
@@ -330,7 +330,6 @@ type CombinedConfig struct {
330330
// VenafiCloudVenafiConnection mode only.
331331
VenConnName string
332332
VenConnNS string
333-
InstallNS string
334333

335334
// Only used for testing purposes.
336335
OutputPath string
@@ -530,20 +529,20 @@ func ValidateAndCombineConfig(log *log.Logger, cfg Config, flags AgentCmdFlags)
530529
res.StrictMode = flags.StrictMode
531530
}
532531

533-
// Validation of --venafi-connection, --venafi-connection-namespace, and
534-
// --install-namespace.
535-
if res.AuthMode == VenafiCloudVenafiConnection {
536-
var installNS string = flags.InstallNS
537-
if flags.InstallNS == "" {
538-
var err error
539-
installNS, err = getInClusterNamespace()
540-
if err != nil {
541-
errs = multierror.Append(errs, fmt.Errorf("could not guess which namespace the agent is running in: %w", err))
542-
}
532+
// Validation of --install-namespace.
533+
var installNS string = flags.InstallNS
534+
if flags.InstallNS == "" {
535+
var err error
536+
installNS, err = getInClusterNamespace()
537+
if err != nil {
538+
errs = multierror.Append(errs, fmt.Errorf("could not guess which namespace the agent is running in: %w", err))
543539
}
544-
res.InstallNS = installNS
545-
res.VenConnName = flags.VenConnName
540+
}
541+
res.InstallNS = installNS
546542

543+
// Validation of --venafi-connection and --venafi-connection-namespace.
544+
if res.AuthMode == VenafiCloudVenafiConnection {
545+
res.VenConnName = flags.VenConnName
547546
var venConnNS string = flags.VenConnNS
548547
if flags.VenConnNS == "" {
549548
venConnNS = installNS

pkg/agent/config_test.go

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,30 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
2525
// OAuth mode.
2626
fakeCredsPath := withFile(t, `{"user_id":"foo","user_secret":"bar","client_id": "baz","client_secret": "foobar","auth_server_domain":"bazbar"}`)
2727

28-
t.Run("period must be given with either --period/-p or period field in config", func(t *testing.T) {
28+
// Usually, the namespace is guessed from the file
29+
// /var/run/secrets/kubernetes.io/serviceaccount/namespace. But since we
30+
// can't realistically set that file in tests, we pass the flag
31+
// --install-namespace in all the tests.
32+
t.Run("--install-namespace must be provided if namespace file doesn't exist", func(t *testing.T) {
2933
_, _, err := ValidateAndCombineConfig(discardLogs(),
3034
withConfig(testutil.Undent(`
3135
server: https://api.venafi.eu
3236
organization_id: foo
3337
cluster_id: bar
38+
period: 5m
3439
`)),
3540
withCmdLineFlags("--credentials-file", fakeCredsPath))
41+
assert.EqualError(t, err, "1 error occurred:\n\t* could not guess which namespace the agent is running in: not running in cluster, please use --install-namespace to specify the namespace in which the agent is running\n\n")
42+
})
43+
44+
t.Run("period must be given with either --period/-p or period field in config", func(t *testing.T) {
45+
_, _, err := ValidateAndCombineConfig(discardLogs(),
46+
withConfig(testutil.Undent(`
47+
server: https://api.venafi.eu
48+
organization_id: foo
49+
cluster_id: bar
50+
`)),
51+
withCmdLineFlags("--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
3652
assert.EqualError(t, err, "1 error occurred:\n\t* period must be set using --period or -p, or using the 'period' field in the config file\n\n")
3753

3854
})
@@ -44,12 +60,12 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
4460
cluster_id: bar
4561
`))
4662

47-
got, _, err := ValidateAndCombineConfig(discardLogs(), given, withCmdLineFlags("--period", "5m", "--credentials-file", fakeCredsPath))
63+
got, _, err := ValidateAndCombineConfig(discardLogs(), given, withCmdLineFlags("--period", "5m", "--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
4864

4965
require.NoError(t, err)
5066
assert.Equal(t, 5*time.Minute, got.Period)
5167

52-
got, _, err = ValidateAndCombineConfig(discardLogs(), given, withCmdLineFlags("-p", "3m", "--credentials-file", fakeCredsPath))
68+
got, _, err = ValidateAndCombineConfig(discardLogs(), given, withCmdLineFlags("-p", "3m", "--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
5369
require.NoError(t, err)
5470
assert.Equal(t, 3*time.Minute, got.Period)
5571
})
@@ -62,7 +78,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
6278
organization_id: foo
6379
cluster_id: bar
6480
`)),
65-
withCmdLineFlags("--credentials-file", fakeCredsPath))
81+
withCmdLineFlags("--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
6682
require.NoError(t, err)
6783
assert.Equal(t, 7*time.Minute, got.Period)
6884
})
@@ -76,7 +92,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
7692
organization_id: foo
7793
cluster_id: bar
7894
`)),
79-
withCmdLineFlags("--period", "99m", "--credentials-file", fakeCredsPath))
95+
withCmdLineFlags("--period", "99m", "--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
8096
require.NoError(t, err)
8197
assert.Equal(t, testutil.Undent(`
8298
Using the Jetstack Secure OAuth auth mode since --credentials-file was specified without --venafi-cloud.
@@ -92,7 +108,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
92108
organization_id: foo
93109
cluster_id: bar
94110
`)),
95-
withCmdLineFlags("--credentials-file", fakeCredsPath))
111+
withCmdLineFlags("--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
96112
require.NoError(t, err)
97113
assert.Equal(t, "https://preflight.jetstack.io", got.Server)
98114
})
@@ -106,7 +122,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
106122
venafi-cloud:
107123
upload_path: /foo/bar
108124
`)),
109-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath))
125+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--install-namespace", "venafi"))
110126
require.NoError(t, err)
111127
assert.Equal(t, "https://api.venafi.cloud", got.Server)
112128
})
@@ -122,7 +138,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
122138
- kind: dummy
123139
name: dummy
124140
`)),
125-
withCmdLineFlags("--credentials-file", fakeCredsPath))
141+
withCmdLineFlags("--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
126142
assert.EqualError(t, gotErr, testutil.Undent(`
127143
1 error occurred:
128144
* server "something not a URL" is not a valid URL
@@ -137,7 +153,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
137153
organization_id: "my_org"
138154
cluster_id: "my_cluster"
139155
`)),
140-
withCmdLineFlags("--strict", "--credentials-file", fakeCredsPath))
156+
withCmdLineFlags("--strict", "--credentials-file", fakeCredsPath, "--install-namespace", "venafi"))
141157
require.NoError(t, gotErr)
142158
assert.Equal(t, true, got.StrictMode)
143159
})
@@ -182,7 +198,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
182198
config:
183199
always-fail: false
184200
`)),
185-
withCmdLineFlags("--credentials-file", credsPath),
201+
withCmdLineFlags("--credentials-file", credsPath, "--install-namespace", "venafi"),
186202
)
187203
expect := CombinedConfig{
188204
AuthMode: "Jetstack Secure OAuth",
@@ -196,6 +212,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
196212
OrganizationID: "example",
197213
EndpointPath: "api/v1/data",
198214
BackoffMaxTime: 10 * time.Minute,
215+
InstallNS: "venafi",
199216
}
200217
require.NoError(t, err)
201218
assert.Equal(t, expect, got)
@@ -221,7 +238,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
221238
uploader_id: test-agent
222239
upload_path: "/testing/path"
223240
`)),
224-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--backoff-max-time", "99m"),
241+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--backoff-max-time", "99m", "--install-namespace", "venafi"),
225242
)
226243
expect := CombinedConfig{
227244
Server: "http://localhost:8080",
@@ -235,6 +252,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
235252
AuthMode: VenafiCloudKeypair,
236253
ClusterID: "the cluster name",
237254
BackoffMaxTime: 99 * time.Minute,
255+
InstallNS: "venafi",
238256
}
239257
require.NoError(t, err)
240258
assert.Equal(t, expect, got)
@@ -251,7 +269,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
251269
venafi-cloud:
252270
upload_path: "/foo/bar"
253271
`)),
254-
withCmdLineFlags("--client-id", "5bc7d07c-45da-11ef-a878-523f1e1d7de1", "--private-key-path", privKeyPath),
272+
withCmdLineFlags("--client-id", "5bc7d07c-45da-11ef-a878-523f1e1d7de1", "--private-key-path", privKeyPath, "--install-namespace", "venafi"),
255273
)
256274
require.NoError(t, err)
257275
assert.Equal(t, VenafiCloudKeypair, got.AuthMode)
@@ -260,7 +278,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
260278

261279
t.Run("jetstack-secure-oauth-auth: fail if organization_id or cluster_id is missing and --venafi-cloud not enabled", func(t *testing.T) {
262280
credsPath := withFile(t, `{"user_id":"[email protected]","user_secret":"foo","client_id": "k3TrDbfLhCgnpAbOiiT2kIE1AbovKzjo","client_secret": "f39w_3KT9Vp0VhzcPzvh-uVbudzqCFmHER3Huj0dvHgJwVrjxsoOQPIw_1SDiCfa","auth_server_domain":"auth.jetstack.io"}`)
263-
_, _, err := ValidateAndCombineConfig(discardLogs(), withConfig(""), withCmdLineFlags("--credentials-file", credsPath))
281+
_, _, err := ValidateAndCombineConfig(discardLogs(), withConfig(""), withCmdLineFlags("--credentials-file", credsPath, "--install-namespace", "venafi"))
264282
assert.EqualError(t, err, testutil.Undent(`
265283
3 errors occurred:
266284
* organization_id is required
@@ -278,7 +296,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
278296
venafi-cloud:
279297
upload_path: /foo/bar
280298
`)),
281-
withCmdLineFlags("--venafi-cloud", "--period", "1m", "--client-id", "test-client-id", "--private-key-path", path))
299+
withCmdLineFlags("--venafi-cloud", "--period", "1m", "--client-id", "test-client-id", "--private-key-path", path, "--install-namespace", "venafi"))
282300
require.NoError(t, err)
283301
assert.IsType(t, &client.VenafiCloudClient{}, cl)
284302
})
@@ -291,7 +309,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
291309
venafi-cloud:
292310
upload_path: /foo/bar
293311
`)),
294-
withCmdLineFlags("--venafi-cloud", "--period", "1m", "--private-key-path", path, "--client-id", "test-client-id"))
312+
withCmdLineFlags("--venafi-cloud", "--period", "1m", "--private-key-path", path, "--client-id", "test-client-id", "--install-namespace", "venafi"))
295313
require.NoError(t, err)
296314
assert.IsType(t, &client.VenafiCloudClient{}, cl)
297315
})
@@ -304,7 +322,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
304322
venafi-cloud:
305323
upload_path: /foo/bar
306324
`)),
307-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--period", "1m"))
325+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--period", "1m", "--install-namespace", "venafi"))
308326
require.NoError(t, err)
309327
assert.IsType(t, &client.VenafiCloudClient{}, cl)
310328
})
@@ -319,7 +337,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
319337
uploader_id: test-agent
320338
cluster_id: "the cluster name"
321339
`)),
322-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath))
340+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--install-namespace", "venafi"))
323341
require.EqualError(t, err, "1 error occurred:\n\t* the venafi-cloud.upload_path field is required when using the Venafi Cloud Key Pair Service Account mode\n\n")
324342
})
325343

@@ -335,9 +353,9 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
335353
organization_id: foo
336354
cluster_id: bar
337355
`)),
338-
withCmdLineFlags("--credentials-file", path))
356+
withCmdLineFlags("--credentials-file", path, "--install-namespace", "venafi"))
339357
require.NoError(t, err)
340-
assert.Equal(t, CombinedConfig{Server: "https://api.venafi.eu", Period: time.Hour, OrganizationID: "foo", ClusterID: "bar", AuthMode: JetstackSecureOAuth, BackoffMaxTime: 10 * time.Minute}, got)
358+
assert.Equal(t, CombinedConfig{Server: "https://api.venafi.eu", Period: time.Hour, OrganizationID: "foo", ClusterID: "bar", AuthMode: JetstackSecureOAuth, BackoffMaxTime: 10 * time.Minute, InstallNS: "venafi"}, got)
341359
assert.IsType(t, &client.OAuthClient{}, cl)
342360
})
343361

@@ -349,7 +367,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
349367
organization_id: foo
350368
cluster_id: bar
351369
`)),
352-
withCmdLineFlags("--credentials-file", "credentials.json"))
370+
withCmdLineFlags("--credentials-file", "credentials.json", "--install-namespace", "venafi"))
353371
assert.EqualError(t, err, testutil.Undent(`
354372
validating creds: failed loading config using the Jetstack Secure OAuth mode: 1 error occurred:
355373
* credentials file: failed to load credentials from file credentials.json: open credentials.json: no such file or directory
@@ -367,7 +385,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
367385
organization_id: foo
368386
cluster_id: bar
369387
`)),
370-
withCmdLineFlags("--credentials-file", credsPath))
388+
withCmdLineFlags("--credentials-file", credsPath, "--install-namespace", "venafi"))
371389
assert.EqualError(t, err, testutil.Undent(`
372390
validating creds: failed loading config using the Jetstack Secure OAuth mode: 2 errors occurred:
373391
* credentials file: user_id cannot be empty
@@ -409,9 +427,9 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
409427
venafi-cloud:
410428
upload_path: /foo/bar
411429
`)),
412-
withCmdLineFlags("--client-id", "5bc7d07c-45da-11ef-a878-523f1e1d7de1", "--private-key-path", path))
430+
withCmdLineFlags("--client-id", "5bc7d07c-45da-11ef-a878-523f1e1d7de1", "--private-key-path", path, "--install-namespace", "venafi"))
413431
require.NoError(t, err)
414-
assert.Equal(t, CombinedConfig{Server: "https://api.venafi.eu", Period: time.Hour, AuthMode: VenafiCloudKeypair, ClusterID: "the cluster name", UploadPath: "/foo/bar", BackoffMaxTime: 10 * time.Minute}, got)
432+
assert.Equal(t, CombinedConfig{Server: "https://api.venafi.eu", Period: time.Hour, AuthMode: VenafiCloudKeypair, ClusterID: "the cluster name", UploadPath: "/foo/bar", BackoffMaxTime: 10 * time.Minute, InstallNS: "venafi"}, got)
415433
assert.IsType(t, &client.VenafiCloudClient{}, cl)
416434
})
417435

@@ -430,9 +448,9 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
430448
venafi-cloud:
431449
upload_path: /foo/bar
432450
`)),
433-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath))
451+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--install-namespace", "venafi"))
434452
require.NoError(t, err)
435-
assert.Equal(t, CombinedConfig{Server: "https://api.venafi.eu", Period: time.Hour, AuthMode: VenafiCloudKeypair, ClusterID: "the cluster name", UploadPath: "/foo/bar", BackoffMaxTime: 10 * time.Minute}, got)
453+
assert.Equal(t, CombinedConfig{Server: "https://api.venafi.eu", Period: time.Hour, AuthMode: VenafiCloudKeypair, ClusterID: "the cluster name", UploadPath: "/foo/bar", BackoffMaxTime: 10 * time.Minute, InstallNS: "venafi"}, got)
436454
})
437455

438456
t.Run("venafi-cloud-keypair-auth: venafi-cloud.upload_path field is required", func(t *testing.T) {
@@ -446,7 +464,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
446464
venafi-cloud:
447465
upload_path: "" # <-- Cannot be left empty
448466
`)),
449-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath))
467+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--install-namespace", "venafi"))
450468
require.EqualError(t, err, testutil.Undent(`
451469
1 error occurred:
452470
* the venafi-cloud.upload_path field is required when using the Venafi Cloud Key Pair Service Account mode
@@ -463,7 +481,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
463481
period: 1h
464482
cluster_id: the cluster name
465483
`)),
466-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--private-key-path", privKeyPath))
484+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--private-key-path", privKeyPath, "--install-namespace", "venafi"))
467485
require.EqualError(t, err, testutil.Undent(`
468486
1 error occurred:
469487
* the venafi-cloud.upload_path field is required when using the Venafi Cloud Key Pair Service Account mode
@@ -483,7 +501,7 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
483501
uploader_id: test-agent
484502
upload_path: /testing/path
485503
`)),
486-
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--private-key-path", privKeyPath))
504+
withCmdLineFlags("--venafi-cloud", "--credentials-file", credsPath, "--private-key-path", privKeyPath, "--install-namespace", "venafi"))
487505
require.EqualError(t, err, testutil.Undent(`
488506
1 error occurred:
489507
* cluster_id is required in Venafi Cloud Key Pair Service Account mode
@@ -514,23 +532,6 @@ func Test_ValidateAndCombineConfig(t *testing.T) {
514532
assert.IsType(t, &client.VenConnClient{}, cl)
515533
})
516534

517-
t.Run("venafi-cloud-workload-identity-auth: namespace can't be read from disk", func(t *testing.T) {
518-
t.Setenv("KUBECONFIG", withFile(t, fakeKubeconfig))
519-
got, _, err := ValidateAndCombineConfig(discardLogs(),
520-
withConfig(testutil.Undent(`
521-
server: https://api.venafi.eu
522-
period: 1h
523-
`)),
524-
withCmdLineFlags("--venafi-connection", "venafi-components"))
525-
assert.EqualError(t, err, testutil.Undent(`
526-
2 errors occurred:
527-
* cluster_id is required in Venafi Cloud VenafiConnection mode
528-
* could not guess which namespace the agent is running in: not running in cluster, please use --install-namespace to specify the namespace in which the agent is running
529-
530-
`))
531-
assert.Equal(t, CombinedConfig{}, got)
532-
})
533-
534535
t.Run("venafi-cloud-workload-identity-auth: warning about server, venafi-cloud.uploader_id, and venafi-cloud.upload_path being skipped", func(t *testing.T) {
535536
t.Setenv("KUBECONFIG", withFile(t, fakeKubeconfig))
536537
log, gotLogs := recordLogs()
@@ -595,11 +596,11 @@ func Test_ValidateAndCombineConfig_VenafiCloudKeyPair(t *testing.T) {
595596
uploader_id: no
596597
upload_path: /v1/tlspk/upload/clusterdata
597598
`)),
598-
withCmdLineFlags("--client-id", "5bc7d07c-45da-11ef-a878-523f1e1d7de1", "--private-key-path", privKeyPath),
599+
withCmdLineFlags("--client-id", "5bc7d07c-45da-11ef-a878-523f1e1d7de1", "--private-key-path", privKeyPath, "--install-namespace", "venafi"),
599600
)
601+
require.NoError(t, err)
600602
testutil.TrustCA(t, cl, cert)
601603
assert.Equal(t, VenafiCloudKeypair, got.AuthMode)
602-
require.NoError(t, err)
603604

604605
err = cl.PostDataReadingsWithOptions(nil, client.Options{ClusterName: "test cluster name"})
605606
require.NoError(t, err)

0 commit comments

Comments
 (0)