-
Notifications
You must be signed in to change notification settings - Fork 145
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
Comments
We face this problem as well. Did you try your code with this pull request: jenkinsci/job-dsl-plugin#1202 ? |
I guess your actually affected by jenkinsci/jenkins#4516 |
any news on this? is it possible to create approle credentials with dsl? |
Blocked by jenkinsci/job-dsl-plugin#1202 |
This is now unblocked 😄 |
Closing issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 tosecretId
, 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
The text was updated successfully, but these errors were encountered: