File tree Expand file tree Collapse file tree 5 files changed +8
-4
lines changed
util/src/main/java/io/kubernetes/client/util Expand file tree Collapse file tree 5 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4343 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
4444
4545 <javax .annotation.version>1.3.2</javax .annotation.version>
46- <snakeyaml .version>1.33</snakeyaml .version>
4746 <slf4j .version>2.0.5</slf4j .version>
47+ <snakeyaml .version>2.0</snakeyaml .version>
4848 <caffeine .version>2.9.3</caffeine .version>
4949 <protobuf .version>3.21.10</protobuf .version>
5050 <junit .version>4.13</junit .version>
Original file line number Diff line number Diff line change 1717import java .io .IOException ;
1818import java .util .ArrayList ;
1919import java .util .HashMap ;
20+ import org .yaml .snakeyaml .LoaderOptions ;
2021import org .yaml .snakeyaml .Yaml ;
2122import org .yaml .snakeyaml .constructor .SafeConstructor ;
2223
@@ -51,7 +52,7 @@ public void save(
5152 // Note this is imperfect, should protect against other processes writing this file too...
5253 synchronized (configFile ) {
5354 try (FileWriter fw = new FileWriter (configFile )) {
54- Yaml yaml = new Yaml (new SafeConstructor ());
55+ Yaml yaml = new Yaml (new SafeConstructor (new LoaderOptions () ));
5556 yaml .dump (config , fw );
5657 fw .flush ();
5758 }
Original file line number Diff line number Diff line change 3737import org .apache .commons .codec .binary .Base64 ;
3838import org .slf4j .Logger ;
3939import org .slf4j .LoggerFactory ;
40+ import org .yaml .snakeyaml .LoaderOptions ;
4041import org .yaml .snakeyaml .Yaml ;
4142import org .yaml .snakeyaml .constructor .SafeConstructor ;
4243
@@ -83,7 +84,7 @@ public static void registerAuthenticator(Authenticator auth) {
8384
8485 /** Load a Kubernetes config from a Reader */
8586 public static KubeConfig loadKubeConfig (Reader input ) {
86- Yaml yaml = new Yaml (new SafeConstructor ());
87+ Yaml yaml = new Yaml (new SafeConstructor (new LoaderOptions () ));
8788 Object config = yaml .load (input );
8889 Map <String , Object > configMap = (Map <String , Object >) config ;
8990
Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ private Object constructDateTime(ScalarNode node) {
269269
270270 public static class CustomRepresenter extends Representer {
271271 public CustomRepresenter () {
272+ super (new DumperOptions ());
272273 this .setDefaultFlowStyle (DumperOptions .FlowStyle .BLOCK );
273274 this .representers .put (IntOrString .class , new RepresentIntOrString ());
274275 this .representers .put (byte [].class , new RepresentByteArray ());
Original file line number Diff line number Diff line change 1616import com .google .gson .JsonElement ;
1717import io .kubernetes .client .openapi .JSON ;
1818import java .util .Map ;
19+ import org .yaml .snakeyaml .LoaderOptions ;
1920import org .yaml .snakeyaml .Yaml ;
2021import org .yaml .snakeyaml .constructor .SafeConstructor ;
2122
2223public class Dynamics {
2324
2425 static final JSON internalJSONCodec = new JSON ();
25- static final Yaml internalYamlCodec = new Yaml (new SafeConstructor ());
26+ static final Yaml internalYamlCodec = new Yaml (new SafeConstructor (new LoaderOptions () ));
2627
2728 public static DynamicKubernetesObject newFromJson (String jsonContent ) {
2829 return newFromJson (internalJSONCodec .getGson (), jsonContent );
You can’t perform that action at this time.
0 commit comments