Skip to content

jenkins_plugin resource does not respect :cli_credential_file #778

@mromero-convoso

Description

@mromero-convoso

👻 Brief Description

If a Chef recipe is configured with the ":cli_credential_file" setting set in its run state, the "jenkins_plugin" resource will still attempt to invoke jenkins-cli without the appropriate auth file.

🥞 Cookbook version

9.5.0

👩‍🍳 Chef-Infra Version

17.8.25

🎩 Platform details

Ubuntu 20.04 LTS

Steps To Reproduce

Steps to reproduce the behavior:

  1. With authentication configured in some manner beyond the default, place the following snippet within a recipe.
file ::File.join(Chef::Config[:file_cache_path], 'creds') do
  content "jenkinsmgr:somepassword"
  mode '0644'
  owner 'jenkins'
  group 'jenkins'
  sensitive true
end

node.run_state[:cli_credential_file] = ::File.join(Chef::Config[:file_cache_path], 'creds')

jenkins_plugin <some plugin> do
  action  :install
  version <some version>
  install_deps false
end

The install will attempt to install the plugin without specifying -auth @<creds file> in the args to jenkins-cli

🚓 Expected behavior

Expect that jenkins_plugin respects the :cli_credential_file variable, when set, similar to how the jenkins_script resource does. There are perhaps other resources that will need to be examined for support for :cli_credential_file as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions