-
Bug
-
Resolution: Done
-
High
-
Casablanca Release
-
None
-
None
while input an empty array in Optimization Configuration, it reports policy validation logic issue using below cmd to easily reproduce:
curl -k -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{"configBody":"{\"service\":\"hpaPolicy\",\"description\":\"OOF Policy\",\"version\":\"CSIT\",\"priority\":\"5\",\"riskType\":\"Test\",\"riskLevel\":\"2\",\"guard\":\"false\",\"content\":{\"resources\":null,\"identity\":null,\"policyScope\":[\"HPA\",\"Test2\"],\"policyType\":\"Optimization\",\"flavorFeatures\":[{\"id\":\"vdu_vnf_2\",\"type\":\"tosca.node.nfv.Vdu.Compute\",\"directives\":[{\"type\":\"flavor_directive\",\"attributes\":[
]}],\"flavorProperties\":[{\"hpa-feature\":\"BasicCapabilities\",\"mandatory\":\"true\",\"architecture\":\"generic\",\"hpa-version\":\"v1\",\"directives\":[],\"hpa-feature-attributes\":[
{\"hpa-attribute-key\":\"virtualMemSize\",\"hpa-attribute-value\":\"4096\",\"operator\":\"\",\"unit\":\"MB\"}]}]}]}}",
"policyConfigType": "Optimization",
"policyName": "Test.HPA1016v9",
"onapName": "OOF"
}' 'https://pdp:8081/pdp/api/createPolicy'
add some value into "directives" like \"directives\:[\"TEST\"] could pass the createPolicy.