@@ -116,14 +116,7 @@ public interface ResourceLookup {
116
116
List <Map <String , Object >> listClusters ();
117
117
}
118
118
119
- public static class Resources {
120
- public final Map <String , Object > domain ;
121
- public final List <Map <String , Object >> clusters ;
122
-
123
- public Resources (Map <String , Object > domain , List <Map <String , Object >> clusters ) {
124
- this .domain = domain ;
125
- this .clusters = clusters ;
126
- }
119
+ public record Resources (Map <String , Object > domain , List <Map <String , Object >> clusters ) {
127
120
}
128
121
129
122
/**
@@ -164,7 +157,7 @@ public Resources convertDomainSchema(Map<String, Object> domain, ResourceLookup
164
157
}
165
158
166
159
restore (PRESERVED_V8 , domain );
167
- restore (PRESERVED_AUX , domain , this ::validateRestoreLegacyAuxilaryImages );
160
+ restore (PRESERVED_AUX , domain , this ::validateRestoreLegacyAuxiliaryImages );
168
161
removeAddedAdminChannelPortForwardingEnabled (domain );
169
162
} else {
170
163
restore (PRESERVED_V9 , domain );
@@ -513,13 +506,7 @@ private static Object convertWithMap(Map<String, String> map, Object value) {
513
506
}
514
507
515
508
private Map <String , String > select (Map <String , String > apiVersion9 , Map <String , String > apiVersion8 ) {
516
- switch (targetAPIVersion ) {
517
- case API_VERSION_V8 :
518
- return apiVersion8 ;
519
- case API_VERSION_V9 :
520
- default :
521
- return apiVersion9 ;
522
- }
509
+ return targetAPIVersion .equals (API_VERSION_V8 ) ? apiVersion8 : apiVersion9 ;
523
510
}
524
511
525
512
private static final Map <String , String > serverStartPolicyMap = Map .of (
@@ -578,7 +565,7 @@ Map<String, Object> getMetadata(Map<String, Object> domain) {
578
565
}
579
566
580
567
@ SuppressWarnings ("unchecked" )
581
- private boolean validateRestoreLegacyAuxilaryImages (Map <String , Object > domain ,
568
+ private boolean validateRestoreLegacyAuxiliaryImages (Map <String , Object > domain ,
582
569
Map <String , Object > scope , Map <String , Object > value ) {
583
570
List <Object > auxiliaryImages = (List <Object >) value .get (AUXILIARY_IMAGES );
584
571
if (auxiliaryImages != null ) {
@@ -638,10 +625,10 @@ private void addAuxiliaryImageEnv(List<Object> auxiliaryImages, Map<String, Obje
638
625
private String getAuxiliaryImagePaths (List <Object > auxiliaryImages ,
639
626
List <Object > auxiliaryImageVolumes ) {
640
627
return Optional .ofNullable (auxiliaryImages ).map (
641
- aiList -> createauxiliaryImagePathsEnv (aiList , auxiliaryImageVolumes )).orElse (null );
628
+ aiList -> createAuxiliaryImagePathsEnv (aiList , auxiliaryImageVolumes )).orElse (null );
642
629
}
643
630
644
- private String createauxiliaryImagePathsEnv (List <Object > auxiliaryImages , List <Object > auxiliaryImageVolumes ) {
631
+ private String createAuxiliaryImagePathsEnv (List <Object > auxiliaryImages , List <Object > auxiliaryImageVolumes ) {
645
632
StringJoiner auxiliaryImagePaths = new StringJoiner ("," ,"" ,"" );
646
633
auxiliaryImages .forEach (auxiliaryImage -> auxiliaryImagePaths .add (
647
634
getMountPath ((Map <String ,Object >)auxiliaryImage , auxiliaryImageVolumes )));
@@ -815,7 +802,7 @@ private void removeAndPreserveConditionsV9(Map<String, Object> status, Map<Strin
815
802
return false ;
816
803
}
817
804
return true ;
818
- }).collect ( Collectors . toList () );
805
+ }).toList ();
819
806
if (filteredConditions .isEmpty ()) {
820
807
status .remove (CONDITIONS );
821
808
} else {
0 commit comments