Skip to content

Commit 99b10f8

Browse files
committed
Improve validation to when using SA authentication
1 parent e6e9418 commit 99b10f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/server/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ func (o *ProxyRunOptions) Validate() error {
235235
// validate agent authentication params
236236
// all 4 parametes must be empty or must have value (except kubeconfigPath that might be empty)
237237
if o.agentNamespace != "" || o.agentServiceAccount != "" || o.authenticationAudience != "" || o.kubeconfigPath != "" {
238+
if o.clusterCaCert != "" {
239+
return fmt.Errorf("clusterCaCert can not be used when service account authentication is enabled")
240+
}
238241
if o.agentNamespace == "" {
239242
return fmt.Errorf("agentNamespace cannot be empty when agent authentication is enabled")
240243
}

0 commit comments

Comments
 (0)