Skip to content

Commit 98fcfef

Browse files
committed
Use Kubernetes Java Client 21.0.1-legacy
1 parent cdd6914 commit 98fcfef

File tree

16 files changed

+696
-79
lines changed

16 files changed

+696
-79
lines changed

documentation/domains/Domain.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@
977977
},
978978
"resources": {
979979
"description": "Resources represents the minimum resources the volume should have. More info https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. ResourceRequirements describes the compute resource requirements.",
980-
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.28.2/_definitions.json#/definitions/io.k8s.api.core.v1.ResourceRequirements"
980+
"$ref": "#/definitions/V1VolumeResourceRequirements"
981981
}
982982
}
983983
},
@@ -1300,6 +1300,20 @@
13001300
}
13011301
}
13021302
},
1303+
"V1VolumeResourceRequirements": {
1304+
"description": "VolumeResourceRequirements describes the storage resource requirements for a volume.",
1305+
"type": "object",
1306+
"properties": {
1307+
"requests": {
1308+
"description": "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
1309+
"$ref": "#/definitions/Map"
1310+
},
1311+
"limits": {
1312+
"description": "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
1313+
"$ref": "#/definitions/Map"
1314+
}
1315+
}
1316+
},
13031317
"WDTTimeouts": {
13041318
"type": "object",
13051319
"properties": {

documentation/domains/Domain.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ The current status of the operation of the WebLogic domain. Updated automaticall
395395

396396
| Name | Type | Description |
397397
| --- | --- | --- |
398-
| `resources` | [Resource Requirements](k8s1.28.2.md#resource-requirements) | Resources represents the minimum resources the volume should have. More info https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. ResourceRequirements describes the compute resource requirements. |
398+
| `resources` | [V 1 Volume Resource Requirements](#v-1-volume-resource-requirements) | Resources represents the minimum resources the volume should have. More info https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources. ResourceRequirements describes the compute resource requirements. |
399399
| `storageClassName` | string | StorageClassName is the name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass. |
400400
| `volumeName` | string | VolumeName is the binding reference to the PersistentVolume backing this claim. |
401401

@@ -410,4 +410,13 @@ The current status of the operation of the WebLogic domain. Updated automaticall
410410
| `setServerGroupsTimeoutMillis` | integer | WDT set server groups timeout for extending a JRF domain configured cluster in milliseconds. Default: 180000. |
411411
| `startApplicationTimeoutMillis` | integer | WDT application start timeout in milliseconds. Default: 180000. |
412412
| `stopApplicationTimeoutMillis` | integer | WDT application stop timeout in milliseconds. Default: 180000. |
413-
| `undeployTimeoutMillis` | integer | WDT application or library undeployment timeout in milliseconds. Default: 180000. |
413+
| `undeployTimeoutMillis` | integer | WDT application or library undeployment timeout in milliseconds. Default: 180000. |
414+
415+
### V 1 Volume Resource Requirements
416+
417+
VolumeResourceRequirements describes the storage resource requirements for a volume.
418+
419+
| Name | Type | Description |
420+
| --- | --- | --- |
421+
| `limits` | Map | Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
422+
| `requests` | Map | Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/Domain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import io.kubernetes.client.custom.V1Patch;
1414
import io.kubernetes.client.openapi.ApiException;
15+
import io.kubernetes.client.openapi.models.RbacV1Subject;
1516
import io.kubernetes.client.openapi.models.V1ClusterRole;
1617
import io.kubernetes.client.openapi.models.V1ClusterRoleBinding;
1718
import io.kubernetes.client.openapi.models.V1LocalObjectReference;
@@ -20,7 +21,6 @@
2021
import io.kubernetes.client.openapi.models.V1PolicyRule;
2122
import io.kubernetes.client.openapi.models.V1RoleBinding;
2223
import io.kubernetes.client.openapi.models.V1RoleRef;
23-
import io.kubernetes.client.openapi.models.V1Subject;
2424
import oracle.weblogic.domain.DomainList;
2525
import oracle.weblogic.domain.DomainResource;
2626
import oracle.weblogic.kubernetes.actions.impl.primitive.Command;
@@ -952,7 +952,7 @@ private static boolean createRbacApiObjectsForWLDFScript(String domainNamespace,
952952
.apiVersion(RBAC_API_VERSION)
953953
.metadata(new V1ObjectMeta()
954954
.name(clusterRoleBindingName))
955-
.addSubjectsItem(new V1Subject()
955+
.addSubjectsItem(new RbacV1Subject()
956956
.kind("ServiceAccount")
957957
.name("default")
958958
.namespace(domainNamespace)
@@ -979,7 +979,7 @@ private static boolean createRbacApiObjectsForWLDFScript(String domainNamespace,
979979
.metadata(new V1ObjectMeta()
980980
.name(roleBindingName)
981981
.namespace(opNamespace))
982-
.addSubjectsItem(new V1Subject()
982+
.addSubjectsItem(new RbacV1Subject()
983983
.kind("ServiceAccount")
984984
.name("default")
985985
.namespace(domainNamespace)

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Kubernetes.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,8 @@ public static boolean createDomainCustomResource(DomainResource domain, String..
12931293
json, // JSON schema of the Resource to create
12941294
null, // pretty print output
12951295
null, // dry run
1296-
null // field manager
1296+
null, // field manager
1297+
null // field validation
12971298
);
12981299
} catch (ApiException apex) {
12991300
getLogger().severe(apex.getResponseBody());
@@ -1544,7 +1545,8 @@ public static boolean createClusterCustomResource(ClusterResource cluster, Strin
15441545
json, // JSON schema of the Resource to create
15451546
null, // pretty print output
15461547
null, // dry run
1547-
null // field manager
1548+
null, // field manager
1549+
null // field validation
15481550
);
15491551
} catch (ApiException apex) {
15501552
getLogger().severe(apex.getResponseBody());

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonLBTestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
import io.kubernetes.client.openapi.models.V1PersistentVolumeSpec;
3535
import io.kubernetes.client.openapi.models.V1PodSpec;
3636
import io.kubernetes.client.openapi.models.V1PodTemplateSpec;
37-
import io.kubernetes.client.openapi.models.V1ResourceRequirements;
3837
import io.kubernetes.client.openapi.models.V1Volume;
3938
import io.kubernetes.client.openapi.models.V1VolumeMount;
39+
import io.kubernetes.client.openapi.models.V1VolumeResourceRequirements;
4040
import oracle.weblogic.domain.AdminServer;
4141
import oracle.weblogic.domain.AdminService;
4242
import oracle.weblogic.domain.Channel;
@@ -163,7 +163,7 @@ public static List<String> createMultipleDomainsSharingPVUsingWlstAndVerify(Stri
163163
.spec(new V1PersistentVolumeClaimSpec()
164164
.addAccessModesItem("ReadWriteMany")
165165
.volumeName(sharingPvName)
166-
.resources(new V1ResourceRequirements()
166+
.resources(new V1VolumeResourceRequirements()
167167
.putRequestsItem("storage", Quantity.fromString("6Gi"))))
168168
.metadata(new V1ObjectMetaBuilder()
169169
.withName(sharingPvcName)

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DbUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.kubernetes.client.custom.IntOrString;
1919
import io.kubernetes.client.custom.Quantity;
2020
import io.kubernetes.client.openapi.ApiException;
21+
import io.kubernetes.client.openapi.models.RbacV1Subject;
2122
import io.kubernetes.client.openapi.models.V1ClusterRole;
2223
import io.kubernetes.client.openapi.models.V1ClusterRoleBinding;
2324
import io.kubernetes.client.openapi.models.V1Container;
@@ -54,7 +55,6 @@
5455
import io.kubernetes.client.openapi.models.V1ServicePort;
5556
import io.kubernetes.client.openapi.models.V1ServiceSpec;
5657
import io.kubernetes.client.openapi.models.V1StorageClass;
57-
import io.kubernetes.client.openapi.models.V1Subject;
5858
import io.kubernetes.client.openapi.models.V1Volume;
5959
import io.kubernetes.client.openapi.models.V1VolumeMount;
6060
import io.kubernetes.client.util.Yaml;
@@ -1206,7 +1206,7 @@ private static void createHostPathProvisionerObjects(String namespace, String ho
12061206
.metadata(new V1ObjectMeta()
12071207
.name(name))
12081208
.subjects(Arrays.asList(
1209-
new V1Subject()
1209+
new RbacV1Subject()
12101210
.kind("ServiceAccount")
12111211
.name(name)
12121212
.namespace(namespace)))
@@ -1247,7 +1247,7 @@ private static void createHostPathProvisionerObjects(String namespace, String ho
12471247
.name("leader-locking-hostpath-provisioner")
12481248
.namespace(namespace))
12491249
.subjects(Arrays.asList(
1250-
new V1Subject()
1250+
new RbacV1Subject()
12511251
.kind("ServiceAccount")
12521252
.name(name)
12531253
.namespace(namespace)))

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/PersistentVolumeUtils.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) 2021, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

4-
54
package oracle.weblogic.kubernetes.utils;
65

76
import java.io.IOException;
@@ -27,9 +26,9 @@
2726
import io.kubernetes.client.openapi.models.V1PersistentVolumeClaimSpec;
2827
import io.kubernetes.client.openapi.models.V1PersistentVolumeSpec;
2928
import io.kubernetes.client.openapi.models.V1Pod;
30-
import io.kubernetes.client.openapi.models.V1ResourceRequirements;
3129
import io.kubernetes.client.openapi.models.V1SecurityContext;
3230
import io.kubernetes.client.openapi.models.V1VolumeMount;
31+
import io.kubernetes.client.openapi.models.V1VolumeResourceRequirements;
3332
import oracle.weblogic.kubernetes.actions.impl.primitive.Command;
3433
import oracle.weblogic.kubernetes.actions.impl.primitive.Kubernetes;
3534
import oracle.weblogic.kubernetes.logging.LoggingFacade;
@@ -307,7 +306,7 @@ public static void createPVC(String pvName, String pvcName, String domainUid,
307306
.spec(new V1PersistentVolumeClaimSpec()
308307
.addAccessModesItem("ReadWriteMany")
309308
.volumeName(pvName)
310-
.resources(new V1ResourceRequirements()
309+
.resources(new V1VolumeResourceRequirements()
311310
.putRequestsItem("storage", Quantity.fromString("5Gi"))))
312311
.metadata(new V1ObjectMeta()
313312
.name(pvcName)
@@ -439,7 +438,7 @@ public static void createPvAndPvc(String nameSuffix, String namespace,
439438
.spec(new V1PersistentVolumeClaimSpec()
440439
.addAccessModesItem("ReadWriteMany")
441440
.volumeName("pv-test" + nameSuffix)
442-
.resources(new V1ResourceRequirements()
441+
.resources(new V1VolumeResourceRequirements()
443442
.putRequestsItem("storage", Quantity.fromString("10Gi"))))
444443
.metadata(new V1ObjectMeta()
445444
.name("pvc-" + nameSuffix)

0 commit comments

Comments
 (0)