-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from aytuncbeken/JENKINS-44285
[JENKINS-44285] Tool Location overwrites are not preserved
- Loading branch information
Showing
7 changed files
with
217 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/org/csanchez/jenkins/plugins/kubernetes/PodTemplateToolLocation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
Copyright (c) 2018 Aytunc Beken | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation | ||
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | ||
and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions | ||
of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO | ||
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
package org.csanchez.jenkins.plugins.kubernetes; | ||
|
||
import hudson.model.Saveable; | ||
import hudson.slaves.NodeProperty; | ||
import hudson.slaves.NodePropertyDescriptor; | ||
import hudson.util.DescribableList; | ||
|
||
import java.io.Serializable; | ||
import java.util.Collection; | ||
|
||
/** | ||
* Pod Template Tool Location | ||
* This class extends Jenkins DescribableList as implemented in Slave Class. Also implements Serializable interface | ||
* for PodTemplate Class. | ||
* Using DescribableList is not possible directly in PodTemplate because DescribableList is not Serializable. | ||
* | ||
* @author <a href="mailto:aytuncbeken.ab@gmail.com">Aytunc BEKEN</a> | ||
*/ | ||
public class PodTemplateToolLocation extends DescribableList<NodeProperty<?>,NodePropertyDescriptor> implements Serializable { | ||
|
||
public PodTemplateToolLocation() {} | ||
|
||
|
||
public PodTemplateToolLocation(DescribableList.Owner owner) { | ||
super(owner); | ||
} | ||
|
||
public PodTemplateToolLocation(Saveable owner) { | ||
super(owner); | ||
} | ||
|
||
public PodTemplateToolLocation(Saveable owner, Collection<? extends NodeProperty<?>> initialList) { | ||
super(owner,initialList); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/test/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesCloudTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
...ources/org/csanchez/jenkins/plugins/kubernetes/KubernetesTest/upgradeFrom_0_10/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<hudson> | ||
<disabledAdministrativeMonitors/> | ||
<version>2.7.4</version> | ||
<numExecutors>2</numExecutors> | ||
<mode>NORMAL</mode> | ||
<useSecurity>true</useSecurity> | ||
<authorizationStrategy class="hudson.security.AuthorizationStrategy$Unsecured"/> | ||
<securityRealm class="hudson.security.SecurityRealm$None"/> | ||
<disableRememberMe>false</disableRememberMe> | ||
<projectNamingStrategy class="jenkins.model.ProjectNamingStrategy$DefaultProjectNamingStrategy"/> | ||
<workspaceDir>${JENKINS_HOME}/workspace/${ITEM_FULLNAME}</workspaceDir> | ||
<buildsDir>${ITEM_ROOTDIR}/builds</buildsDir> | ||
<jdks/> | ||
<viewsTabBar class="hudson.views.DefaultViewsTabBar"/> | ||
<myViewsTabBar class="hudson.views.DefaultMyViewsTabBar"/> | ||
<clouds> | ||
<org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud plugin="kubernetes@0.10"> | ||
<name>kubernetes</name> | ||
<templates> | ||
<org.csanchez.jenkins.plugins.kubernetes.PodTemplate> | ||
<inheritFrom></inheritFrom> | ||
<name>maven</name> | ||
<instanceCap>2147483647</instanceCap> | ||
<idleMinutes>0</idleMinutes> | ||
<label>maven</label> | ||
<nodeSelector></nodeSelector> | ||
<volumes/> | ||
<containers> | ||
<org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate> | ||
<name>maven</name> | ||
<image>maven:alpine</image> | ||
<privileged>false</privileged> | ||
<alwaysPullImage>false</alwaysPullImage> | ||
<workingDir>/home/jenkins</workingDir> | ||
<command>/bin/sh -c</command> | ||
<args>cat</args> | ||
<ttyEnabled>true</ttyEnabled> | ||
<resourceRequestCpu></resourceRequestCpu> | ||
<resourceRequestMemory></resourceRequestMemory> | ||
<resourceLimitCpu></resourceLimitCpu> | ||
<resourceLimitMemory></resourceLimitMemory> | ||
<envVars/> | ||
</org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate> | ||
</containers> | ||
<envVars/> | ||
<annotations/> | ||
<imagePullSecrets/> | ||
<nodeProperties> | ||
<hudson.tools.ToolLocationNodeProperty> | ||
<locations> | ||
<hudson.tools.ToolLocationNodeProperty_-ToolLocation> | ||
<type>hudson.plugins.git.GitTool$DescriptorImpl</type> | ||
<name>Default</name> | ||
<home>/custom/path</home> | ||
</hudson.tools.ToolLocationNodeProperty_-ToolLocation> | ||
</locations> | ||
</hudson.tools.ToolLocationNodeProperty> | ||
</nodeProperties> | ||
</org.csanchez.jenkins.plugins.kubernetes.PodTemplate> | ||
</templates> | ||
<serverUrl>http://example.com</serverUrl> | ||
<skipTlsVerify>false</skipTlsVerify> | ||
<namespace>default</namespace> | ||
<jenkinsUrl></jenkinsUrl> | ||
<containerCap>10</containerCap> | ||
<retentionTimeout>5</retentionTimeout> | ||
<connectTimeout>0</connectTimeout> | ||
<readTimeout>0</readTimeout> | ||
</org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud> | ||
</clouds> | ||
<quietPeriod>5</quietPeriod> | ||
<scmCheckoutRetryCount>0</scmCheckoutRetryCount> | ||
<views> | ||
<hudson.model.AllView> | ||
<owner class="hudson" reference="../../.."/> | ||
<name>All</name> | ||
<filterExecutors>false</filterExecutors> | ||
<filterQueue>false</filterQueue> | ||
<properties class="hudson.model.View$PropertyList"/> | ||
</hudson.model.AllView> | ||
</views> | ||
<primaryView>All</primaryView> | ||
<slaveAgentPort>-1</slaveAgentPort> | ||
<label></label> | ||
<crumbIssuer class="hudson.security.csrf.DefaultCrumbIssuer"> | ||
<excludeClientIPFromCrumb>false</excludeClientIPFromCrumb> | ||
</crumbIssuer> | ||
<nodeProperties/> | ||
<globalNodeProperties/> | ||
</hudson> |