Skip to content

Commit 53cfafa

Browse files
committed
Bump default GoCD agent image version
1 parent d4f3db3 commit 53cfafa

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/java/cd/go/contrib/elasticagent/KubernetesInstanceFactory.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private static String image(Map<String, String> properties) {
231231
private KubernetesInstance createUsingPodYaml(CreateAgentRequest request, PluginSettings settings, KubernetesClient client, PluginRequest pluginRequest) {
232232
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
233233
String podYaml = request.properties().get(POD_CONFIGURATION.getKey());
234-
String templatizedPodYaml = getTemplatizedPodSpec(podYaml);
234+
String templatizedPodYaml = getTemplatedPodSpec(podYaml);
235235

236236
Pod elasticAgentPod = new Pod();
237237
try {
@@ -267,8 +267,8 @@ else if ("yaml".equalsIgnoreCase(fileType)) {
267267
Files.copy(downloadStream, podSpecFile);
268268
LOG.debug(format("Finished downloading %s to %s", fileToDownload, podSpecFile));
269269
String spec = Files.readString(podSpecFile, UTF_8);
270-
String templatizedPodSpec = getTemplatizedPodSpec(spec);
271-
elasticAgentPod = mapper.readValue(templatizedPodSpec, Pod.class);
270+
String templatedPodSpec = getTemplatedPodSpec(spec);
271+
elasticAgentPod = mapper.readValue(templatedPodSpec, Pod.class);
272272
setPodNameIfNecessary(elasticAgentPod, spec);
273273
Files.deleteIfExists(podSpecFile);
274274
LOG.debug(format("Deleted %s", podSpecFile));
@@ -282,13 +282,13 @@ else if ("yaml".equalsIgnoreCase(fileType)) {
282282

283283
private void setPodNameIfNecessary(Pod elasticAgentPod, String spec) {
284284
if (!spec.contains(POD_POSTFIX)) {
285-
String newPodName = elasticAgentPod.getMetadata().getName().concat(String.format("-%s", UUID.randomUUID().toString()));
285+
String newPodName = elasticAgentPod.getMetadata().getName().concat(String.format("-%s", UUID.randomUUID()));
286286
elasticAgentPod.getMetadata().setName(newPodName);
287287
}
288288
}
289289

290290

291-
public static String getTemplatizedPodSpec(String podSpec) {
291+
public static String getTemplatedPodSpec(String podSpec) {
292292
StringWriter writer = new StringWriter();
293293
MustacheFactory mf = new DefaultMustacheFactory();
294294
Mustache mustache = mf.compile(new StringReader(podSpec), "templatePod");
@@ -297,11 +297,11 @@ public static String getTemplatizedPodSpec(String podSpec) {
297297
}
298298

299299
private static Map<String, String> getJinJavaContext() {
300-
HashMap<String, String> context = new HashMap<>();
300+
Map<String, String> context = new HashMap<>();
301301
context.put(POD_POSTFIX, UUID.randomUUID().toString());
302302
context.put(CONTAINER_POSTFIX, UUID.randomUUID().toString());
303303
context.put(GOCD_AGENT_IMAGE, "gocd/gocd-agent-wolfi");
304-
context.put(LATEST_VERSION, "v24.1.0");
304+
context.put(LATEST_VERSION, "v24.3.0");
305305
return context;
306306
}
307307
}

src/main/java/cd/go/contrib/elasticagent/executors/ProfileValidateRequestExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private void validatePodYaml(HashMap<String, String> properties, ArrayList<Map<S
129129
Pod pod = new Pod();
130130
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
131131
try {
132-
pod = mapper.readValue(KubernetesInstanceFactory.getTemplatizedPodSpec(podYaml), Pod.class);
132+
pod = mapper.readValue(KubernetesInstanceFactory.getTemplatedPodSpec(podYaml), Pod.class);
133133
} catch (IOException e) {
134134
addError(result, key, "Invalid Pod Yaml.");
135135
return;

0 commit comments

Comments
 (0)