Skip to content

Commit

Permalink
add DataBoundConstructors to classes
Browse files Browse the repository at this point in the history
  • Loading branch information
gbhat618 committed Dec 19, 2024
1 parent 11c7068 commit 8d7f256
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ public static SshConfiguration defaultSshConfiguration() {

@SuppressWarnings("unused") // jelly
public ProvisioningType defaultProvisioningType() {
return new Standard();
return new Standard(0);
}

public static NetworkConfiguration defaultNetworkConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@
import com.google.api.services.compute.model.Scheduling;
import hudson.Extension;
import hudson.util.FormValidation;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;

public class SpotVm extends ProvisioningType {

private long maxRunDurationSeconds;

// required for casc
@DataBoundConstructor
public SpotVm(long maxRunDurationSeconds) {
this.maxRunDurationSeconds = maxRunDurationSeconds;
}

@SuppressWarnings("unused") // jelly
@DataBoundSetter
public void setMaxRunDurationSeconds(long maxRunDurationSeconds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@
import com.google.api.services.compute.model.Scheduling;
import hudson.Extension;
import hudson.util.FormValidation;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;

public class Standard extends ProvisioningType {

private long maxRunDurationSeconds;

// required for casc
@DataBoundConstructor
public Standard(long maxRunDurationSeconds) {
this.maxRunDurationSeconds = maxRunDurationSeconds;
}

@SuppressWarnings("unused") // jelly
@DataBoundSetter
public void setMaxRunDurationSeconds(long maxRunDurationSeconds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public static InstanceConfiguration.Builder instanceConfigurationBuilder() {
.machineType(MACHINE_TYPE)
.numExecutorsStr(NUM_EXECUTORS)
.startupScript(STARTUP_SCRIPT)
.provisioningType(PREEMPTIBLE ? new PreemptibleVm() : new Standard())
.provisioningType(PREEMPTIBLE ? new PreemptibleVm() : new Standard(0))
.labels(LABEL)
.description(CONFIG_DESC)
.bootDiskType(BOOT_DISK_TYPE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static InstanceConfiguration.Builder instanceConfigurationBuilder() {
.region(REGION)
.zone(ZONE)
.machineType(MACHINE_TYPE)
.provisioningType(PREEMPTIBLE ? new PreemptibleVm() : new Standard())
.provisioningType(PREEMPTIBLE ? new PreemptibleVm() : new Standard(0))
.minCpuPlatform(MIN_CPU_PLATFORM)
.description(CONFIG_DESC)
.bootDiskType(BOOT_DISK_TYPE)
Expand Down

0 comments on commit 8d7f256

Please sign in to comment.