@@ -45,7 +45,6 @@ public class Example {
45
45
46
46
private final CoreV1Api corev1Api ;
47
47
private final static String DEFAULT_NAME_SPACE = "default" ;
48
- private final static Integer TIME_OUT_VALUE = 180 ;
49
48
50
49
/*
51
50
For API_SERVER_NAME, you can get the server name as follows.
@@ -58,7 +57,7 @@ public class Example {
58
57
$ kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t'
59
58
*/
60
59
private static final String ACCESS_TOKEN = "********************************" ;
61
-
60
+
62
61
private final static Logger LOGGER = Logger .getLogger (Example .class .getName ());
63
62
64
63
/**
@@ -124,7 +123,7 @@ public void executeCommand() throws ApiException {
124
123
* @throws ApiException
125
124
*/
126
125
public List <String > getAllNameSapces () throws ApiException {
127
- V1NamespaceList listNamespace = corev1Api .listNamespace ("true" , null , null , Boolean .FALSE , null , 0 , null , Integer .MAX_VALUE , Boolean .FALSE );
126
+ V1NamespaceList listNamespace = corev1Api .listNamespace ("true" , null , null , Boolean .FALSE , null , Integer . SIZE , null , Integer .BYTES , Boolean .FALSE );
128
127
List <String > list = listNamespace .getItems ()
129
128
.stream ()
130
129
.map (v1Namespace -> v1Namespace .getMetadata ().getName ())
@@ -177,7 +176,7 @@ public List<String> getNamespacedPod(String namespace) throws ApiException {
177
176
* @throws ApiException
178
177
*/
179
178
public List <String > getNamespacedPod (String namespace , String label ) throws ApiException {
180
- V1PodList listNamespacedPod = corev1Api .listNamespacedPod (namespace , null , null , null , Boolean .FALSE , label , Integer .MAX_VALUE , null , TIME_OUT_VALUE , Boolean .FALSE );
179
+ V1PodList listNamespacedPod = corev1Api .listNamespacedPod (namespace , null , null , null , Boolean .FALSE , label , Integer .SIZE , null , Integer . BYTES , Boolean .FALSE );
181
180
List <String > listPods = listNamespacedPod .getItems ()
182
181
.stream ()
183
182
.map (v1pod -> v1pod .getMetadata ().getName ())
@@ -192,7 +191,7 @@ public List<String> getNamespacedPod(String namespace, String label) throws ApiE
192
191
* @throws ApiException
193
192
*/
194
193
public List <String > getServices () throws ApiException {
195
- V1ServiceList listNamespacedService = corev1Api .listNamespacedService (DEFAULT_NAME_SPACE , null , null , null , Boolean .FALSE , null , Integer .MAX_VALUE , null , TIME_OUT_VALUE , Boolean .FALSE );
194
+ V1ServiceList listNamespacedService = corev1Api .listNamespacedService (DEFAULT_NAME_SPACE , null , null , null , Boolean .FALSE , null , Integer .SIZE , null , Integer . BYTES , Boolean .FALSE );
196
195
return listNamespacedService .getItems ().stream ().map (v1service -> v1service .getMetadata ().getName ()).collect (Collectors .toList ());
197
196
}
198
197
0 commit comments