Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find matching constructor #243

Open
adrian-wood opened this issue Oct 11, 2018 · 1 comment
Open

Could not find matching constructor #243

adrian-wood opened this issue Oct 11, 2018 · 1 comment

Comments

@adrian-wood
Copy link

I'm trying to create a new Docker Auth credential using Groovy (based on but keep running into errors.

I'm using this as my guide, but I'm quite new to all of this.

https://www.programcreek.com/java-api-examples/?code=KostyaSha/yet-another-docker-plugin/yet-another-docker-plugin-master/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/credentials/DockerRegistryAuthCredentials.java

I already use this method for pulling in password/ssh type credentials without any issue so I can't see that I have done anything wrong.

add-credentials.groovy file
creds = new DockerRegistryAuthCredentials(CredentialsScope.GLOBAL, it.value.id, it.value.description, it.value.username, it.value.password, it.value.email) store.addCredentials(domain, creds)

jenkins.properties file - This gets pulled into the file above at runtime using ConfigSlurper.

 dockerNode {
    email = ""
    type = "docker-node"
    username = "jenkins"
    id = "docker-node"
    description = "Docker login"
    password = ""
  }

Unfortunately I get the following error but just can't work out what I'm doing wrong.

[ Failed to run script file:/var/jenkins_home/init.groovy.d/add-credentials.groovy
groovy.lang.GroovyRuntimeException: Could not find matching constructor for: com.github.kostyasha.yad.credentials.DockerRegistryAuthCredentials(com.cloudbees.plugins.credentials.CredentialsScope$2, groovy.util.ConfigObject, java.lang.String, groovy.util.ConfigObject, java.lang.String, groovy.util.ConfigObject)](url)
@KostyaSha
Copy link
Owner

Sorry, i don't know what is ConfigSlurper
constructor is here, in your error message second argument looks strange
https://github.com/KostyaSha/yet-another-docker-plugin/blob/master/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/credentials/DockerRegistryAuthCredentials.java#L32-L40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants