-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Critical
-
Component/s: anchore-container-scanner-plugin
-
None
Plugin works fine when directly used in pipeline script  as below
Â
Â
node('some node') { stage('Scan Docker Image') {   imageLine = imageId   writeFile file: 'anchore_images', text: imageLine   anchore name: 'anchore_images', inputQueries: [[query: 'list-packages all'], [query: 'list-files     all'], [query: 'cve-scan all'], [query: 'show-pkg-diffs base']]  } }
Â
Â
However, when used with shared library script it throws the error
import groovy.json.JsonSlurper def call(body) { // evaluate the body block, and collect configuration into the object def config = [:] body.resolveStrategy = Closure.DELEGATE_FIRST body.delegate = config body() node('some node') { stage('Scan Docker Image') {   imageLine = imageId   writeFile file: 'anchore_images', text: imageLine   anchore name: 'anchore_images', inputQueries: [[query: 'list-packages all'], [query: 'list-files     all'], [query: 'cve-scan all'], [query: 'show-pkg-diffs base']]  } } }
Â
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: anchore.call() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:anchore_images, inputQueries:[[query:list-packages all], ...]]] Possible solutions: wait(), any(), wait(long), main([Ljava.lang.String, any(groovy.lang.Closure), each(groovy.lang.Closure)