@@ -231,7 +231,7 @@ private static String image(Map<String, String> properties) {
231
231
private KubernetesInstance createUsingPodYaml (CreateAgentRequest request , PluginSettings settings , KubernetesClient client , PluginRequest pluginRequest ) {
232
232
ObjectMapper mapper = new ObjectMapper (new YAMLFactory ());
233
233
String podYaml = request .properties ().get (POD_CONFIGURATION .getKey ());
234
- String templatizedPodYaml = getTemplatizedPodSpec (podYaml );
234
+ String templatizedPodYaml = getTemplatedPodSpec (podYaml );
235
235
236
236
Pod elasticAgentPod = new Pod ();
237
237
try {
@@ -267,8 +267,8 @@ else if ("yaml".equalsIgnoreCase(fileType)) {
267
267
Files .copy (downloadStream , podSpecFile );
268
268
LOG .debug (format ("Finished downloading %s to %s" , fileToDownload , podSpecFile ));
269
269
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 );
272
272
setPodNameIfNecessary (elasticAgentPod , spec );
273
273
Files .deleteIfExists (podSpecFile );
274
274
LOG .debug (format ("Deleted %s" , podSpecFile ));
@@ -282,13 +282,13 @@ else if ("yaml".equalsIgnoreCase(fileType)) {
282
282
283
283
private void setPodNameIfNecessary (Pod elasticAgentPod , String spec ) {
284
284
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 ()));
286
286
elasticAgentPod .getMetadata ().setName (newPodName );
287
287
}
288
288
}
289
289
290
290
291
- public static String getTemplatizedPodSpec (String podSpec ) {
291
+ public static String getTemplatedPodSpec (String podSpec ) {
292
292
StringWriter writer = new StringWriter ();
293
293
MustacheFactory mf = new DefaultMustacheFactory ();
294
294
Mustache mustache = mf .compile (new StringReader (podSpec ), "templatePod" );
@@ -297,11 +297,11 @@ public static String getTemplatizedPodSpec(String podSpec) {
297
297
}
298
298
299
299
private static Map <String , String > getJinJavaContext () {
300
- HashMap <String , String > context = new HashMap <>();
300
+ Map <String , String > context = new HashMap <>();
301
301
context .put (POD_POSTFIX , UUID .randomUUID ().toString ());
302
302
context .put (CONTAINER_POSTFIX , UUID .randomUUID ().toString ());
303
303
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" );
305
305
return context ;
306
306
}
307
307
}
0 commit comments