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 43
43
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
44
44
45
45
<javax .annotation.version>1.3.2</javax .annotation.version>
46
- <snakeyaml .version>1.33</snakeyaml .version>
47
46
<slf4j .version>2.0.5</slf4j .version>
47
+ <snakeyaml .version>2.0</snakeyaml .version>
48
48
<caffeine .version>2.9.3</caffeine .version>
49
49
<protobuf .version>3.21.10</protobuf .version>
50
50
<junit .version>4.13</junit .version>
Original file line number Diff line number Diff line change 17
17
import java .io .IOException ;
18
18
import java .util .ArrayList ;
19
19
import java .util .HashMap ;
20
+ import org .yaml .snakeyaml .LoaderOptions ;
20
21
import org .yaml .snakeyaml .Yaml ;
21
22
import org .yaml .snakeyaml .constructor .SafeConstructor ;
22
23
@@ -51,7 +52,7 @@ public void save(
51
52
// Note this is imperfect, should protect against other processes writing this file too...
52
53
synchronized (configFile ) {
53
54
try (FileWriter fw = new FileWriter (configFile )) {
54
- Yaml yaml = new Yaml (new SafeConstructor ());
55
+ Yaml yaml = new Yaml (new SafeConstructor (new LoaderOptions () ));
55
56
yaml .dump (config , fw );
56
57
fw .flush ();
57
58
}
Original file line number Diff line number Diff line change 37
37
import org .apache .commons .codec .binary .Base64 ;
38
38
import org .slf4j .Logger ;
39
39
import org .slf4j .LoggerFactory ;
40
+ import org .yaml .snakeyaml .LoaderOptions ;
40
41
import org .yaml .snakeyaml .Yaml ;
41
42
import org .yaml .snakeyaml .constructor .SafeConstructor ;
42
43
@@ -83,7 +84,7 @@ public static void registerAuthenticator(Authenticator auth) {
83
84
84
85
/** Load a Kubernetes config from a Reader */
85
86
public static KubeConfig loadKubeConfig (Reader input ) {
86
- Yaml yaml = new Yaml (new SafeConstructor ());
87
+ Yaml yaml = new Yaml (new SafeConstructor (new LoaderOptions () ));
87
88
Object config = yaml .load (input );
88
89
Map <String , Object > configMap = (Map <String , Object >) config ;
89
90
Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ private Object constructDateTime(ScalarNode node) {
269
269
270
270
public static class CustomRepresenter extends Representer {
271
271
public CustomRepresenter () {
272
+ super (new DumperOptions ());
272
273
this .setDefaultFlowStyle (DumperOptions .FlowStyle .BLOCK );
273
274
this .representers .put (IntOrString .class , new RepresentIntOrString ());
274
275
this .representers .put (byte [].class , new RepresentByteArray ());
Original file line number Diff line number Diff line change 16
16
import com .google .gson .JsonElement ;
17
17
import io .kubernetes .client .openapi .JSON ;
18
18
import java .util .Map ;
19
+ import org .yaml .snakeyaml .LoaderOptions ;
19
20
import org .yaml .snakeyaml .Yaml ;
20
21
import org .yaml .snakeyaml .constructor .SafeConstructor ;
21
22
22
23
public class Dynamics {
23
24
24
25
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 () ));
26
27
27
28
public static DynamicKubernetesObject newFromJson (String jsonContent ) {
28
29
return newFromJson (internalJSONCodec .getGson (), jsonContent );
You can’t perform that action at this time.
0 commit comments