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

is jenkins_secret_text_credentials supposed to update or only create? #584

Open
ehaselwanter opened this issue Mar 16, 2017 · 5 comments
Open

Comments

@ehaselwanter
Copy link

does the credential resource only create or does it update too?

jenkins_secret_text_credentials with a new value does detect the difference, but does not change the value

Cookbook version

5.0.0

Chef-client version

12.18.31

Platform Details

[Operating system distribution and release version. Cloud provider if running in the cloud]

Scenario:

update a jenkins_secret_text_credentials

Steps to Reproduce:

run chef-client with value 'a', change value to 'b' run chef-client again

Expected Result:

updated credential

Actual Result:

old value still there
odd thing: the resource does recognise that it is different, it just does not update it.

jenkins_secret_text_credentials[gitlab_jenkins_api_token] action create (up to date)

next run:

  * jenkins_secret_text_credentials[gitlab_jenkins_api_token] action create
    - Create jenkins_secret_text_credentials[gitlab_jenkins_api_token]

from now on it keeps reporting the create unless you change the credential in the dashboard to the new value. after that it does show (up to date) again.

so I wonder if I need to :delete :create ...

my least surprise implementation would be a :create_or_update action

@ehaselwanter
Copy link
Author

@cheeseplus any opinion on that?

@ehaselwanter
Copy link
Author

ok. this is unexpected

  * jenkins_secret_text_credentials[slack_jenkins_api_token] action delete

    ================================================================================
    Error executing action `delete` on resource 'jenkins_secret_text_credentials[slack_jenkins_api_token]'
    ================================================================================

    Chef::Exceptions::ValidationFailed
    ----------------------------------
    secret is required

@cheeseplus
Copy link

I don't have an opinion right off but that is largely because I'm still getting familiar with the cookbook and Jenkins. That said this is a good start for me to dive into the resources as I've mostly just worked on the core bits.

Is this a regression? I don't think we changed anything regarding the resource since 4.2.1 but if so that'll make the hunt a bit easier.

@ehaselwanter
Copy link
Author

I do not think it is a regression. IMHO we need to have an expectation on how it should behave and I guess (like with other parts in this cookbook) it is about 2nd day operations. most of the things work for initial creation but not for updating things.

so my suggestion is to spice up the integration tests with update behaviours.

@vorezal
Copy link

vorezal commented Sep 5, 2019

Just in case anyone else runs into this, it still seems to be a thing. As a workaround I've switched entirely over to jenkins_password_credential resources even when having a username doesn't really make sense since they update fine.

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

4 participants