Skip to content

Commit

Permalink
[hyperfoil] Add property to set Hyperfoil version
Browse files Browse the repository at this point in the history
  • Loading branch information
ecervena committed Aug 14, 2023
1 parent 1bfeeb7 commit a6d3df3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ public int getPortMapping(int port) {
}

private Map<String, Object> getHyperfoilDefinition(boolean includesAgentLog) {
LOG.info("Hyperfoil version is set to: " + HyperfoilConfiguration.getHyperfoilVersion());
Map<String, Object> metadata = Map.of("name", APP_NAME, "namespace", OpenshiftClient.get().getNamespace());
Map<String, Object> spec = Map.of("agentDeployTimeout", 120000, "version", "latest", "route",
Map<String, Object> spec = Map.of("agentDeployTimeout", 120000, "version", HyperfoilConfiguration.getHyperfoilVersion(), "route",
Map.of("host", OpenshiftClient.get().generateHostname("hyperfoil")) // "hyperfoil.apps.mycloud.example.com"
);
if (includesAgentLog) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class HyperfoilConfiguration extends Configuration {
public static final String RETRY_NUMBER_OF_RETRIES = "hyperfoil.http.retry.policy.retries";
public static final String RETRY_POLICY_ENABLED = "hyperfoil.http.retry.policy.enabled";

private static final String HYPERFOIL_VERSION = "hyperfoil.version";

public static boolean keepRunning() {
return getBoolean(KEEP_RUNNING, false);
}
Expand Down Expand Up @@ -55,4 +57,8 @@ public static int retryNumberOfRetries() {
public static boolean isRetryPolicyEnabled() {
return getBoolean(RETRY_POLICY_ENABLED, false);
}

public static String getHyperfoilVersion() {
return getProperty(HYPERFOIL_VERSION, "latest");
}
}

0 comments on commit a6d3df3

Please sign in to comment.