Skip to content

Commit

Permalink
Update constructor to follow CasC best practices (#406)
Browse files Browse the repository at this point in the history
* move non-required values into databound setters and create validations

* create default value constants for primitives of FleetClouds and clean up getters

* create new constructors with CasC best practices

* fix CasC unit tests

* update casc docs to reflect new defaults, add unlisted fields to examples, and include EC2FleetLabelCloud examples

* change default minSize to 0 in jelly for consistency
  • Loading branch information
vineeth-bandi authored Sep 21, 2023
1 parent a3aae88 commit ae77bfa
Show file tree
Hide file tree
Showing 9 changed files with 512 additions and 157 deletions.
126 changes: 97 additions & 29 deletions docs/CONFIGURATION-AS-CODE.md

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/main/java/com/amazon/jenkins/ec2fleet/CloudConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.amazon.jenkins.ec2fleet;

class CloudConstants {

static final String EC2_INSTANCE_TAG_NAMESPACE = "ec2-fleet-plugin";
static final String EC2_INSTANCE_CLOUD_NAME_TAG = EC2_INSTANCE_TAG_NAMESPACE + ":cloud-name";
static final boolean DEFAULT_PRIVATE_IP_USED = false;

static final boolean DEFAULT_ALWAYS_RECONNECT = false;

static final int DEFAULT_IDLE_MINUTES = 0;

static final int DEFAULT_MIN_SIZE = 0;

static final int DEFAULT_MAX_SIZE = 1;

static final int DEFAULT_MIN_SPARE_SIZE = 0;

static final int DEFAULT_NUM_EXECUTORS = 1;

static final boolean DEFAULT_ADD_NODE_ONLY_IF_RUNNING = false;

static final boolean DEFAULT_RESTRICT_USAGE = false;

static final boolean DEFAULT_SCALE_EXECUTORS_BY_WEIGHT = false;

static final int DEFAULT_CLOUD_STATUS_INTERVAL_SEC = 10;

static final int DEFAULT_INIT_ONLINE_TIMEOUT_SEC = 3 * 60;
static final int DEFAULT_INIT_ONLINE_CHECK_INTERVAL_SEC = 15;

static final int DEFAULT_MAX_TOTAL_USES = -1;
}
Loading

0 comments on commit ae77bfa

Please sign in to comment.