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

Creating VaultAppRoleCredential with jenkins-dsl #77

Closed
jsknnr opened this issue Feb 6, 2020 · 6 comments
Closed

Creating VaultAppRoleCredential with jenkins-dsl #77

jsknnr opened this issue Feb 6, 2020 · 6 comments

Comments

@jsknnr
Copy link

jsknnr commented Feb 6, 2020

I am trying to create a VaultAppRoleCredential and attach it to the properties of a folder during creation via jenkins-dsl. The folder, the FolderCredentialProperty and the DomainCredential all are being created just fine. When I get to actually creating the VaultAppRoleCredential to attach it I end up getting a method signature exception on type Secret secretId.

I am correctly importing hudson.util.Secret and using the fromString method to create a secret to assign to secretId, however, I am still getting: No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.secretId() is applicable for argument types: (hudson.util.Secret)

The job-dsl describable context helper is correctly finding VaultAppRoleCredential and correctly returning the constructor as: public com.datapipe.jenkins.vault.credentials.VaultAppRoleCredential(com.cloudbees.plugins.credentials.CredentialsScope,java.lang.String,java.lang.String,java.lang.String,hudson.util.Secret,java.lang.String)

This has been super confusing to me as I am handing it exactly what it expects. After logs of debugging I think I may have found the issue. Further through the context building when job-dsl tries to, I guess for a lack of a better word, resolve, the constructor types it ends up displaying this: VaultAppRoleCredential(scope: CredentialsScope[SYSTEM, GLOBAL, USER], id: String, description: String, roleId: String, secretId: org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class hudson.util.Secret, path: String)

At this point it appears to set the value type of secretId to an ErrorType instead of a hudson.util.Secret type, resulting in the method signature error I ultimately end up receiving.

Is there any insight on how to resolve this issue with the DataBoundConstructor?

Version information:
Jenkins: 2.190.2
Folders Plugin: 6.10.1
Credentials Plugin: 2.3.0
Hashicorp Vault Plugin : 3.0.0
Jenkins Job-DSL Plugin: 1.76

@jfroche
Copy link

jfroche commented Feb 20, 2020

We face this problem as well. Did you try your code with this pull request: jenkinsci/job-dsl-plugin#1202 ?

@jetersen
Copy link
Member

I guess your actually affected by jenkinsci/jenkins#4516

@hypePG
Copy link

hypePG commented Jun 25, 2020

any news on this? is it possible to create approle credentials with dsl?

@jetersen
Copy link
Member

jetersen commented Jul 1, 2020

Blocked by jenkinsci/job-dsl-plugin#1202

@jamietanna
Copy link

This is now unblocked 😄

@jetersen
Copy link
Member

Closing issue

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

5 participants