Issue
1.Login into the application as admin user.
2.Run openshift kubernetes discovery.
3.Check OpenShift Kubernetes discovery works fine.
Actual:
OpenShift Kubernetes discovery fails with JAVASCRIPT_CODE_FAILURE due to getcredentials function not having enough arguments.
Make YAML Extension last one to execute.
Expected:
OpenShift Kubernetes discovery works fine.
except YAML extension all extensions should be participate in discovery along with main pattern.
Release
Cause
The following function at line 13 in the script include KubernetesCommandMetadata expecting following arguments.
getCredentials: function(managementIp, credId, tag,contentType)
But in the OpenShift Get Call Custom operation having only 3 arguments.
getCredentials(host, null, credsAlias);
This is causing Java script Error in custom operation
Resolution
- Login into the application as admin user.
- Go to Pattern Designer --> Custom Operations.
- Open OpenShift Get Call Custom operation.
- Replace line number 41 with following workaround code snippet.
Line Number 41:
var creds = scriptInit.getCredentials(host, null, credsAlias);
workaround code snippet :
var contentType = "accept:application/json";
var creds = scriptInit.getCredentials(host, null, credsAlias,contentType);