Kubernetes Discovery using bearer token as credential will fail with error 'JAVASCRIPT_CODE_FAILURE: "bearerTokenAuth" is not defined'DescriptionKubernetes pattern in its first step (Get namespaces) runs an operation called "Kubernetes Get Call". This operation calls a MID server script include "KubernetesCommandMetadata" A function 'getCredentials' in the script is used to check whether bearer token is to be used for authentication. It appears the variable bearerTokenAuth is not defined.Steps to Reproduce Create a credential of type Kubernetes and configure it use 'Bearer token'.Create a Serverless Discovery schedule for Kubernetes.Configure serverless execution pattern for the schedule and set 'credentialAlias' to use the credential created in step 1.Run discovery and notice that it fails with the error 'JAVASCRIPT_CODE_FAILURE: "bearerTokenAuth" is not defined'.WorkaroundThis problem has been fixed. If you are able to upgrade, review the Fixed In or Intended Fix Version fields to determine whether any versions have a planned or permanent fix. The previous workaround consisted in editing the MID Server Script Include "KubernetesCommandMetadata": Look for function 'getCredentials' Add the following lines, just before the 'while' loop: var bearerTokenAuth; var credDataMap;Look for function 'formHeader'Just before the 'if' condition add the following line: var bearerHeader; Related Problem: PRB1354647