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

Feat: support idleMinutes field in pipeline #154

Merged
merged 3 commits into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class PodTemplateStep extends Step implements Serializable {
private List<PodAnnotation> annotations = new ArrayList<>();

private int instanceCap;
private int idleMinutes;

private String serviceAccount;
private String nodeSelector;
private String workingDir = ContainerTemplate.DEFAULT_WORKING_DIR;
Expand Down Expand Up @@ -122,6 +124,15 @@ public void setInstanceCap(int instanceCap) {
this.instanceCap = instanceCap;
}

public int getIdleMinutes() {
return idleMinutes;
}

@DataBoundSetter
public void setIdleMinutes(int idleMinutes) {
this.idleMinutes = idleMinutes;
}

public String getServiceAccount() {
return serviceAccount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public boolean start() throws Exception {
newTemplate.setNamespace(namespace);
newTemplate.setInheritFrom(!Strings.isNullOrEmpty( podTemplateAction.getParentTemplates()) ? podTemplateAction.getParentTemplates() : step.getInheritFrom());
newTemplate.setInstanceCap(step.getInstanceCap());
newTemplate.setIdleMinutes(step.getIdleMinutes());
newTemplate.setLabel(step.getLabel());
newTemplate.setVolumes(step.getVolumes());
newTemplate.setCustomWorkspaceVolumeEnabled(step.getWorkspaceVolume() != null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
<f:entry field="instanceCap" title="${%Max number of instances}">
<f:textbox default="0"/>
</f:entry>
<f:entry field="serviceAccount" title="The service account">
<f:entry field="idleMinutes" title="${%Time in minutes to retain slave when idle}">
<f:textbox default="0"/>
</f:entry>
<f:entry field="serviceAccount" title="The service account">
<f:textbox/>
</f:entry>
<f:entry field="nodeSelector" title="The node selector">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
~ Copyright (C) 2015 Original Authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

Time in minutes to retain slave when idle