Browse Source

Merge "ssh-agent-credentials: Support ignore-missing-credentials param"

tags/2.3.0
Zuul 9 months ago
parent
commit
9428f49fe0

+ 8
- 0
jenkins_jobs/modules/wrappers.py View File

@@ -1752,6 +1752,8 @@ def ssh_agent_credentials(registry, xml_parent, data):
1752 1752
 
1753 1753
     :arg list users: A list of Jenkins users credential IDs (required)
1754 1754
     :arg str user: The user id of the jenkins user credentials (deprecated)
1755
+    :arg bool ignore-missing-credentials: Specifies the option to ignore
1756
+        missing credentials (default false)
1755 1757
 
1756 1758
     Example:
1757 1759
 
@@ -1812,6 +1814,12 @@ def ssh_agent_credentials(registry, xml_parent, data):
1812 1814
     for user in user_list:
1813 1815
         XML.SubElement(entry_xml, xml_key).text = user
1814 1816
 
1817
+    mapping = [
1818
+        ('ignore-missing-credentials', 'ignoreMissing', False),
1819
+    ]
1820
+    helpers.convert_mapping_to_xml(entry_xml, data, mapping,
1821
+                                   fail_required=False)
1822
+
1815 1823
 
1816 1824
 def credentials_binding(registry, xml_parent, data):
1817 1825
     """yaml: credentials-binding

+ 1
- 0
tests/wrappers/fixtures/ssh-agent-credentials001.xml View File

@@ -3,6 +3,7 @@
3 3
   <buildWrappers>
4 4
     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
5 5
       <user>49d20745-9889-4c02-b286-fc6fb89c36bd</user>
6
+      <ignoreMissing>false</ignoreMissing>
6 7
     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
7 8
   </buildWrappers>
8 9
 </project>

+ 1
- 0
tests/wrappers/fixtures/ssh-agent-credentials002.xml View File

@@ -6,6 +6,7 @@
6 6
         <string>44747833-247a-407a-a98f-a5a2d785111c</string>
7 7
         <string>f1c0f777-7ac6-43fd-b5c7-68b420aa1392</string>
8 8
         <string>dd647a01-be21-402b-bfc5-a4e89be7d0c4</string>
9
+        <ignoreMissing>false</ignoreMissing>
9 10
       </credentialIds>
10 11
     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
11 12
   </buildWrappers>

+ 1
- 0
tests/wrappers/fixtures/ssh-agent-credentials003.xml View File

@@ -5,6 +5,7 @@
5 5
       <credentialIds>
6 6
         <string>44747833-247a-407a-a98f-a5a2d785111c</string>
7 7
         <string>dd647a01-be21-402b-bfc5-a4e89be7d0c4</string>
8
+        <ignoreMissing>false</ignoreMissing>
8 9
       </credentialIds>
9 10
     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
10 11
   </buildWrappers>

+ 1
- 0
tests/wrappers/fixtures/ssh-agent-credentials004.xml View File

@@ -3,6 +3,7 @@
3 3
   <buildWrappers>
4 4
     <com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
5 5
       <user>49d20745-9889-4c02-b286-fc6fb89c36bd</user>
6
+      <ignoreMissing>false</ignoreMissing>
6 7
     </com.cloudbees.jenkins.plugins.sshagent.SSHAgentBuildWrapper>
7 8
   </buildWrappers>
8 9
 </project>

Loading…
Cancel
Save