Skip to content

Commit ae77bfa

Browse files
Update constructor to follow CasC best practices (#406)
* 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
1 parent a3aae88 commit ae77bfa

File tree

9 files changed

+512
-157
lines changed

9 files changed

+512
-157
lines changed

docs/CONFIGURATION-AS-CODE.md

+97-29
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.amazon.jenkins.ec2fleet;
2+
3+
class CloudConstants {
4+
5+
static final String EC2_INSTANCE_TAG_NAMESPACE = "ec2-fleet-plugin";
6+
static final String EC2_INSTANCE_CLOUD_NAME_TAG = EC2_INSTANCE_TAG_NAMESPACE + ":cloud-name";
7+
static final boolean DEFAULT_PRIVATE_IP_USED = false;
8+
9+
static final boolean DEFAULT_ALWAYS_RECONNECT = false;
10+
11+
static final int DEFAULT_IDLE_MINUTES = 0;
12+
13+
static final int DEFAULT_MIN_SIZE = 0;
14+
15+
static final int DEFAULT_MAX_SIZE = 1;
16+
17+
static final int DEFAULT_MIN_SPARE_SIZE = 0;
18+
19+
static final int DEFAULT_NUM_EXECUTORS = 1;
20+
21+
static final boolean DEFAULT_ADD_NODE_ONLY_IF_RUNNING = false;
22+
23+
static final boolean DEFAULT_RESTRICT_USAGE = false;
24+
25+
static final boolean DEFAULT_SCALE_EXECUTORS_BY_WEIGHT = false;
26+
27+
static final int DEFAULT_CLOUD_STATUS_INTERVAL_SEC = 10;
28+
29+
static final int DEFAULT_INIT_ONLINE_TIMEOUT_SEC = 3 * 60;
30+
static final int DEFAULT_INIT_ONLINE_CHECK_INTERVAL_SEC = 15;
31+
32+
static final int DEFAULT_MAX_TOTAL_USES = -1;
33+
}

0 commit comments

Comments
 (0)