jenkins-job-builder/jenkins_jobs
Ken Dreyer 787164e09a wrappers: omit blank settings for ssh-user-private-key credential
For the ssh-user-private-key credential-wrapper, the "key-file-variable"
setting is mandatory, but the "username-variable" and
"passphrase-variable" settings are optional.

Prior to this commit, if a user omitted "username-variable" or
"passphrase-variable" settings, JJB would write empty
<usernameVariable/> or <passphraseVariable/> entries. When both were
empty, the credentials-binding plugin would crash with an error:

  IllegalArgumentException("Cannot use the same key in both secretValues and publicValues")

To resolve this, do not write XML entries for these optional parameters
when the user does not specify them.

Add a minimal test case reproducer.

Change-Id: I94a4437eee6a8fdaf655c1a3bf69d46844b225bc
2022-06-09 16:37:50 -04:00
..
cli ListSubCommand: return job fullname 2022-04-25 19:42:05 +08:00
modules wrappers: omit blank settings for ssh-user-private-key credential 2022-06-09 16:37:50 -04:00
sphinx Fix: Update sphinx version pin, fix warnings 2022-03-31 15:44:40 -07:00
__init__.py Refactor modules and templating. 2012-08-10 16:00:42 +00:00
__main__.py Allow jjb to be called as a module 2018-06-19 23:25:43 +01:00
alphanum.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
builder.py Fix flake8 BLK100 and BLK999 issues 2020-08-31 10:54:19 -04:00
cache.py Fix the yaml load warning. 2019-12-10 09:52:40 +01:00
config.py Fix flake8 BLK100 and BLK999 issues 2020-08-31 10:54:19 -04:00
constants.py Remove YamlParser from jenkins_jobs.builder 2015-04-22 11:59:07 -07:00
errors.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
formatter.py Merge "Introduce a new '!j2-yaml:' tag" 2020-09-25 15:25:31 +00:00
local_yaml.py Bumping black to 22.3.0 2022-03-31 09:27:41 +02:00
parallel.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
parser.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
registry.py Fix: Avoid LegacyVersion casting due to hyphens 2022-04-12 11:21:49 -07:00
utils.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
version.py Auto-generated output from python-black 2019-09-09 19:23:24 +01:00
xml_config.py Fix: add support for fips-enabled systems using Python3.6 or greater. 2022-03-09 23:03:31 +00:00