artifactory-user-plugins icon indicating copy to clipboard operation
artifactory-user-plugins copied to clipboard

cleanDockerImages: dryRun=false is not honored

Open e-gris opened this issue 4 years ago • 1 comments

curl --silent --show-error --request POST 'http://<url>/artifactory/api/plugins/execute/cleanDockerImages?params=dryRun=false'

Returns the following JSON

{
    "status": "okay",
    "dryRun": true,
    "deleted": [
        
    ]
}

e-gris avatar Feb 28 '20 00:02 e-gris

It seems the groovy syntax is not honoring the above configuration for dryRun in cleanDockerImages.groovy file.

Can you check by changing the below line from

 def dryRun = params['dryRun'] ? params['dryRun'][0] as boolean : false

to

 def dryRun = params['dryRun'] ? params['dryRun'][0].toBoolean() : false

or

def dryRun = params['dryRun'] ? new Boolean(params['dryRun'][0]) : false

The above change works for me. You can find the above line here.

akash-jain-10 avatar Aug 31 '21 12:08 akash-jain-10