From 0c382399f81dd18cd891378ef62b676ce2bec42b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 11 Jul 2023 11:26:59 +0200 Subject: [PATCH 1/7] Update Quarkus stack for getting SnakeYAML CVE fixed --- ...utorecoveries.kaap.oss.datastax.com-v1.yml | 21 + .../bastions.kaap.oss.datastax.com-v1.yml | 21 + .../bookkeepers.kaap.oss.datastax.com-v1.yml | 96 +++- .../crds/brokers.kaap.oss.datastax.com-v1.yml | 110 ++++- ...ctionsworkers.kaap.oss.datastax.com-v1.yml | 48 +- .../crds/proxies.kaap.oss.datastax.com-v1.yml | 110 ++++- ...ulsarclusters.kaap.oss.datastax.com-v1.yml | 461 +++++++++++++++--- .../zookeepers.kaap.oss.datastax.com-v1.yml | 55 ++- operator/pom.xml | 6 +- .../oss/kaap/LeaderElectionConfig.java | 2 +- .../autoscaler/BookKeeperSetAutoscaler.java | 2 +- .../kaap/controllers/AbstractController.java | 10 +- .../controllers/PulsarClusterController.java | 4 +- .../bookkeeper/BookKeeperController.java | 2 +- .../datastax/oss/kaap/crds/GlobalSpec.java | 4 +- .../autorecovery/AutorecoveryFullSpec.java | 2 +- .../crds/autorecovery/AutorecoverySpec.java | 4 +- .../kaap/crds/bastion/BastionFullSpec.java | 2 +- .../oss/kaap/crds/bastion/BastionSpec.java | 4 +- .../bookkeeper/BookKeeperAutoRackConfig.java | 2 +- .../bookkeeper/BookKeeperAutoscalerSpec.java | 12 +- .../crds/bookkeeper/BookKeeperFullSpec.java | 2 +- .../crds/bookkeeper/BookKeeperSetSpec.java | 6 +- .../kaap/crds/bookkeeper/BookKeeperSpec.java | 2 +- .../crds/broker/BrokerAutoscalerSpec.java | 18 +- .../oss/kaap/crds/broker/BrokerFullSpec.java | 2 +- .../oss/kaap/crds/broker/BrokerSetSpec.java | 6 +- .../oss/kaap/crds/broker/BrokerSpec.java | 2 +- .../kaap/crds/cluster/PulsarClusterSpec.java | 4 +- .../function/FunctionsWorkerFullSpec.java | 2 +- .../crds/function/FunctionsWorkerSpec.java | 4 +- .../oss/kaap/crds/proxy/ProxyFullSpec.java | 2 +- .../oss/kaap/crds/proxy/ProxySetSpec.java | 4 +- .../oss/kaap/crds/proxy/ProxySpec.java | 2 +- .../oss/kaap/crds/validation/ValidSpec.java | 4 +- .../kaap/crds/validation/ValidableSpec.java | 2 +- .../crds/zookeeper/ZooKeeperFullSpec.java | 2 +- .../kaap/crds/zookeeper/ZooKeeperSpec.java | 4 +- pom.xml | 18 +- tests/pom.xml | 3 - 40 files changed, 852 insertions(+), 215 deletions(-) diff --git a/helm/kaap/crds/autorecoveries.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/autorecoveries.kaap.oss.datastax.com-v1.yml index dd4d4114..f959c38c 100644 --- a/helm/kaap/crds/autorecoveries.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/autorecoveries.kaap.oss.datastax.com-v1.yml @@ -521,6 +521,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1068,6 +1075,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1197,6 +1211,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/bastions.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/bastions.kaap.oss.datastax.com-v1.yml index 59e6cd16..02233b48 100644 --- a/helm/kaap/crds/bastions.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/bastions.kaap.oss.datastax.com-v1.yml @@ -521,6 +521,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1068,6 +1075,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1197,6 +1211,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/bookkeepers.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/bookkeepers.kaap.oss.datastax.com-v1.yml index f89c8362..89212237 100644 --- a/helm/kaap/crds/bookkeepers.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/bookkeepers.kaap.oss.datastax.com-v1.yml @@ -786,6 +786,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1382,6 +1389,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1555,6 +1569,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -1564,6 +1589,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1572,15 +1604,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -2593,6 +2616,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2963,6 +2993,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3557,6 +3594,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3729,6 +3773,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -3738,6 +3793,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3746,15 +3808,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -4767,6 +4820,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/brokers.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/brokers.kaap.oss.datastax.com-v1.yml index ecb4a96f..53287ff6 100644 --- a/helm/kaap/crds/brokers.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/brokers.kaap.oss.datastax.com-v1.yml @@ -695,6 +695,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -821,6 +828,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1340,6 +1354,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1513,6 +1534,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -1522,6 +1554,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1530,15 +1569,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -2551,6 +2581,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2843,6 +2880,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2967,6 +3011,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3484,6 +3535,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3656,6 +3714,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -3665,6 +3734,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3673,15 +3749,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -4694,6 +4761,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/functionsworkers.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/functionsworkers.kaap.oss.datastax.com-v1.yml index 01c0bfb2..fdd484e3 100644 --- a/helm/kaap/crds/functionsworkers.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/functionsworkers.kaap.oss.datastax.com-v1.yml @@ -724,6 +724,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1268,6 +1275,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1440,6 +1454,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -1449,6 +1474,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1457,15 +1489,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -2478,6 +2501,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/proxies.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/proxies.kaap.oss.datastax.com-v1.yml index 91a7e5ff..e74d68a5 100644 --- a/helm/kaap/crds/proxies.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/proxies.kaap.oss.datastax.com-v1.yml @@ -661,6 +661,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -816,6 +823,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1332,6 +1346,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1505,6 +1526,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -1514,6 +1546,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1522,15 +1561,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -2543,6 +2573,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2801,6 +2838,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2956,6 +3000,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3470,6 +3521,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3642,6 +3700,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -3651,6 +3720,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3659,15 +3735,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -4680,6 +4747,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/pulsarclusters.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/pulsarclusters.kaap.oss.datastax.com-v1.yml index 801e6108..ed29d53b 100644 --- a/helm/kaap/crds/pulsarclusters.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/pulsarclusters.kaap.oss.datastax.com-v1.yml @@ -661,6 +661,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -816,6 +823,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1332,6 +1346,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1505,6 +1526,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -1514,6 +1546,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -1522,15 +1561,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -2543,6 +2573,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2801,6 +2838,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -2956,6 +3000,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3470,6 +3521,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3642,6 +3700,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -3651,6 +3720,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -3659,15 +3735,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -4680,6 +4747,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -4893,6 +4967,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -5011,6 +5092,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -5552,6 +5640,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -5724,6 +5819,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -5733,6 +5839,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -5741,15 +5854,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -6762,6 +6866,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -7436,6 +7547,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -7983,6 +8101,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -8112,6 +8237,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -8665,6 +8797,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -9212,6 +9351,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -9341,6 +9487,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -9541,6 +9694,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -10085,6 +10245,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -10257,6 +10424,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -10266,6 +10444,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -10274,15 +10459,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -11295,6 +11471,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -11585,6 +11768,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -11711,6 +11901,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -12230,6 +12427,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -12403,6 +12607,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -12412,6 +12627,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -12420,15 +12642,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -13441,6 +13654,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -13733,6 +13953,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -13857,6 +14084,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -14374,6 +14608,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -14546,6 +14787,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -14555,6 +14807,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -14563,15 +14822,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -15584,6 +15834,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -15965,6 +16222,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -16561,6 +16825,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -16734,6 +17005,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -16743,6 +17025,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -16751,15 +17040,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -17772,6 +18052,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -18142,6 +18429,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -18736,6 +19030,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -18908,6 +19209,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -18917,6 +19229,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -18925,15 +19244,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -19946,6 +20256,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/helm/kaap/crds/zookeepers.kaap.oss.datastax.com-v1.yml b/helm/kaap/crds/zookeepers.kaap.oss.datastax.com-v1.yml index 5f54c3dd..0275767c 100644 --- a/helm/kaap/crds/zookeepers.kaap.oss.datastax.com-v1.yml +++ b/helm/kaap/crds/zookeepers.kaap.oss.datastax.com-v1.yml @@ -59,6 +59,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -177,6 +184,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -718,6 +732,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -890,6 +911,17 @@ spec: apiGroup: type: string type: object + dataSourceRef: + properties: + name: + type: string + kind: + type: string + namespace: + type: string + apiGroup: + type: string + type: object resources: properties: limits: @@ -899,6 +931,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: @@ -907,15 +946,6 @@ spec: x-kubernetes-int-or-string: true type: object type: object - dataSourceRef: - properties: - name: - type: string - kind: - type: string - apiGroup: - type: string - type: object accessModes: items: type: string @@ -1928,6 +1958,13 @@ spec: - type: string x-kubernetes-int-or-string: true type: object + claims: + items: + properties: + name: + type: string + type: object + type: array requests: additionalProperties: anyOf: diff --git a/operator/pom.xml b/operator/pom.xml index 398ee5db..ff37d4e0 100644 --- a/operator/pom.xml +++ b/operator/pom.xml @@ -28,8 +28,7 @@ true - - + true @@ -40,13 +39,11 @@ io.fabric8 crd-generator-api - ${kubernetes-client.version} provided io.fabric8 certmanager-model-v1 - ${kubernetes-client.version} io.quarkiverse.operatorsdk @@ -146,7 +143,6 @@ io.quarkus quarkus-maven-plugin - 2.15.1.Final diff --git a/operator/src/main/java/com/datastax/oss/kaap/LeaderElectionConfig.java b/operator/src/main/java/com/datastax/oss/kaap/LeaderElectionConfig.java index 3f9c23da..32a11f9a 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/LeaderElectionConfig.java +++ b/operator/src/main/java/com/datastax/oss/kaap/LeaderElectionConfig.java @@ -17,7 +17,7 @@ import io.javaoperatorsdk.operator.api.config.LeaderElectionConfiguration; import io.quarkus.arc.Unremovable; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; @ApplicationScoped @Unremovable diff --git a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java index d8f2a45a..d83030f2 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java +++ b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java @@ -34,7 +34,7 @@ import java.util.TreeMap; import java.util.concurrent.RejectedExecutionException; import java.util.stream.Collectors; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.Data; import lombok.SneakyThrows; import lombok.extern.jbosslog.JBossLog; diff --git a/operator/src/main/java/com/datastax/oss/kaap/controllers/AbstractController.java b/operator/src/main/java/com/datastax/oss/kaap/controllers/AbstractController.java index efaba89a..b8f86b36 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/controllers/AbstractController.java +++ b/operator/src/main/java/com/datastax/oss/kaap/controllers/AbstractController.java @@ -40,17 +40,17 @@ import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.Reconciler; import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; +import jakarta.inject.Inject; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validation; +import jakarta.validation.Validator; import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import javax.inject.Inject; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; import lombok.AllArgsConstructor; import lombok.Data; import lombok.SneakyThrows; diff --git a/operator/src/main/java/com/datastax/oss/kaap/controllers/PulsarClusterController.java b/operator/src/main/java/com/datastax/oss/kaap/controllers/PulsarClusterController.java index 67b4e1d5..81bf2b18 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/controllers/PulsarClusterController.java +++ b/operator/src/main/java/com/datastax/oss/kaap/controllers/PulsarClusterController.java @@ -59,12 +59,12 @@ import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; import io.quarkus.runtime.ShutdownEvent; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.event.Observes; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.event.Observes; import lombok.SneakyThrows; import lombok.extern.jbosslog.JBossLog; diff --git a/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java b/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java index 6f2f2779..4bf0c84b 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java +++ b/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java @@ -42,7 +42,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import javax.enterprise.event.Observes; +import jakarta.enterprise.event.Observes; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/GlobalSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/GlobalSpec.java index ab155999..18befb6f 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/GlobalSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/GlobalSpec.java @@ -27,13 +27,13 @@ import io.fabric8.kubernetes.api.model.PodDNSConfig; import io.fabric8.kubernetes.api.model.PodDNSConfigBuilder; import io.fabric8.kubernetes.api.model.PodDNSConfigOptionBuilder; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.NotNull; import java.util.Map; import java.util.Set; import java.util.TreeSet; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.validation.ConstraintValidatorContext; -import javax.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoveryFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoveryFullSpec.java index 13509f2e..76d1eb17 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoveryFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoveryFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java index 49f4bbe2..adc133dd 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java @@ -35,8 +35,8 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionFullSpec.java index af4c91db..3ad43058 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java index 66faf9d6..9cf88454 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java @@ -35,8 +35,8 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoRackConfig.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoRackConfig.java index 175d08a1..8a86807b 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoRackConfig.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoRackConfig.java @@ -31,7 +31,7 @@ public class BookKeeperAutoRackConfig { @JsonPropertyDescription("Enable rack configuration monitoring.") Boolean enabled; @Min(1000) - @javax.validation.constraints.Min(1000) + @jakarta.validation.constraints.Min(1000) @JsonPropertyDescription("Period for the schedule of the monitoring thread.") Long periodMs; } diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoscalerSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoscalerSpec.java index c7ee306f..c2d0e99a 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoscalerSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperAutoscalerSpec.java @@ -33,7 +33,7 @@ public class BookKeeperAutoscalerSpec { Boolean enabled; @Min(1000) - @javax.validation.constraints.Min(1000) + @jakarta.validation.constraints.Min(1000) @JsonPropertyDescription("The interval in milliseconds between two consecutive autoscaling checks.") Long periodMs; @@ -52,7 +52,7 @@ public class BookKeeperAutoscalerSpec { Double diskUsageToleranceLwm; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription( "Min number of writable bookies. The autoscaler will scale up if not enough writable bookies are detected" + ". For instance, if a bookie went to read-only mode, " @@ -60,23 +60,23 @@ public class BookKeeperAutoscalerSpec { Integer minWritableBookies; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("The number of bookies to add at each scale up. Default is '1'") Integer scaleUpBy; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("Max number of bookies. If the number of bookies is equals to this value, the " + "autoscaler will never scale up.") Integer scaleUpMaxLimit; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("The number of bookies to remove at each scale down. Default is '1'") Integer scaleDownBy; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription( "The stabilization window is used to restrict the flapping of replica count when the metrics used for " + "scaling keep fluctuating. " diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperFullSpec.java index 6ed75914..bfd743ad 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java index ecbb4f88..530af950 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java @@ -35,9 +35,9 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.Valid; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java index 617aea5d..2ea4f8aa 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java @@ -23,7 +23,7 @@ import java.util.Arrays; import java.util.LinkedHashMap; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerAutoscalerSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerAutoscalerSpec.java index 1ab8afd9..9f246ac5 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerAutoscalerSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerAutoscalerSpec.java @@ -35,11 +35,11 @@ public class BrokerAutoscalerSpec { @JsonPropertyDescription("Enable autoscaling for brokers.") Boolean enabled; @Min(1000) - @javax.validation.constraints.Min(1000) + @jakarta.validation.constraints.Min(1000) @JsonPropertyDescription("The interval in milliseconds between two consecutive autoscaling checks.") Long periodMs; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("Min number of brokers. If the number of brokers is equals to this value, the autoscaler" + " will never scale down.") Integer min; @@ -48,28 +48,28 @@ public class BrokerAutoscalerSpec { Integer max; @Min(0) @Max(1) - @javax.validation.constraints.Min(0) - @javax.validation.constraints.Max(1) + @jakarta.validation.constraints.Min(0) + @jakarta.validation.constraints.Max(1) @JsonPropertyDescription("The threshold to trigger a scale down. The autoscaler will scale down if all the " + "brokers cpu usage is lower than this threshold. Default is '0.4'") Double lowerCpuThreshold; @Min(0) @Max(1) - @javax.validation.constraints.Min(0) - @javax.validation.constraints.Max(1) + @jakarta.validation.constraints.Min(0) + @jakarta.validation.constraints.Max(1) @JsonPropertyDescription("The threshold to trigger a scale up. The autoscaler will scale up if all the " + "brokers cpu usage is higher than this threshold. Default is '0.8'") Double higherCpuThreshold; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("The number of brokers to add at each scale up. Default is '1'") Integer scaleUpBy; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("The number of brokers to remove at each scale down. Default is '1'") Integer scaleDownBy; @Min(1) - @javax.validation.constraints.Min(1) + @jakarta.validation.constraints.Min(1) @JsonPropertyDescription("The stabilization window is used to restrict the flapping of replica count when the metrics used for scaling keep fluctuating. " + "The autoscaling algorithm uses this window to infer a previous desired state and avoid unwanted changes to workload scale." + "Default value is 5 minutes after the pod readiness.") diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerFullSpec.java index 8823727d..157b0492 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java index 6d7cafe4..828c517f 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java @@ -34,9 +34,9 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.Valid; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java index d5bf5e0e..5139f0ac 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Arrays; import java.util.LinkedHashMap; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/cluster/PulsarClusterSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/cluster/PulsarClusterSpec.java index e470369c..cacee678 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/cluster/PulsarClusterSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/cluster/PulsarClusterSpec.java @@ -32,12 +32,12 @@ import com.datastax.oss.kaap.crds.validation.ValidSpec; import com.datastax.oss.kaap.crds.validation.ValidableSpec; import com.datastax.oss.kaap.crds.zookeeper.ZooKeeperSpec; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Valid; import java.lang.reflect.Field; import java.util.Collections; import java.util.Map; import java.util.Set; -import javax.validation.ConstraintValidatorContext; -import javax.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerFullSpec.java index 3d0ad50b..485a7667 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java index 4ebde435..741ca3f4 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java @@ -34,8 +34,8 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxyFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxyFullSpec.java index 93cbb7c9..530f4260 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxyFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxyFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java index d747ce71..2d3c3def 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java @@ -34,8 +34,8 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java index e3e5c25d..332c3116 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyDescription; import java.util.Arrays; import java.util.LinkedHashMap; -import javax.validation.ConstraintValidatorContext; +import jakarta.validation.ConstraintValidatorContext; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java index 36dfb6d0..37468fe7 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java @@ -17,8 +17,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; -import javax.validation.Constraint; -import javax.validation.Payload; +import jakarta.validation.Constraint; +import jakarta.validation.Payload; @Retention(RUNTIME) @Constraint(validatedBy = {}) diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidableSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidableSpec.java index cb307b82..fb2705a0 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidableSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidableSpec.java @@ -15,7 +15,7 @@ */ package com.datastax.oss.kaap.crds.validation; -import javax.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidator; import lombok.NoArgsConstructor; import lombok.experimental.SuperBuilder; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperFullSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperFullSpec.java index 468eff33..c5b7410d 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperFullSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperFullSpec.java @@ -18,7 +18,7 @@ import com.datastax.oss.kaap.crds.FullSpecWithDefaults; import com.datastax.oss.kaap.crds.GlobalSpec; import com.datastax.oss.kaap.crds.validation.ValidSpec; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java index a50233b0..4704ce08 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java @@ -34,8 +34,8 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.validation.ConstraintValidatorContext; -import javax.validation.constraints.Min; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/pom.xml b/pom.xml index 26755b83..a04ef163 100644 --- a/pom.xml +++ b/pom.xml @@ -41,9 +41,8 @@ 17 UTF-8 UTF-8 - 5.0.1 - - 6.2.0 + 6.2.1 + 6.7.2 7.7.0 4.10.0 1.18.24 @@ -60,6 +59,7 @@ 1.5.1 4.2.0 5.4.0 + 1.70 @@ -110,7 +110,7 @@ io.fabric8 crd-generator-api - ${kubernetes-client.version} + ${crd-generator-api.version} io.jsonwebtoken @@ -160,6 +160,16 @@ curator-test ${curator.version} + + org.bouncycastle + bcprov-jdk15on + ${bouncy-castle.version} + + + org.bouncycastle + bcpkix-jdk15on + ${bouncy-castle.version} + diff --git a/tests/pom.xml b/tests/pom.xml index 26c51fbb..4971ddf7 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -71,7 +71,6 @@ jakarta.validation jakarta.validation-api - 2.0.2 test @@ -123,13 +122,11 @@ io.fabric8 kubernetes-client - ${kubernetes-client.version} test io.fabric8 certmanager-client - ${kubernetes-client.version} test From 6a1ff8c6a23bb4d3a4dd6627f0ce08711c415fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Tue, 11 Jul 2023 11:30:15 +0200 Subject: [PATCH 2/7] style --- .../oss/kaap/autoscaler/BookKeeperSetAutoscaler.java | 2 +- .../kaap/controllers/bookkeeper/BookKeeperController.java | 2 +- .../oss/kaap/crds/autorecovery/AutorecoverySpec.java | 4 ++-- .../com/datastax/oss/kaap/crds/bastion/BastionSpec.java | 4 ++-- .../oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java | 6 +++--- .../datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java | 2 +- .../com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java | 6 +++--- .../java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java | 2 +- .../oss/kaap/crds/function/FunctionsWorkerSpec.java | 4 ++-- .../java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java | 4 ++-- .../java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java | 2 +- .../com/datastax/oss/kaap/crds/validation/ValidSpec.java | 2 +- .../com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java | 4 ++-- pom.xml | 1 - 14 files changed, 22 insertions(+), 23 deletions(-) diff --git a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java index d83030f2..e77a0ceb 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java +++ b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java @@ -28,13 +28,13 @@ import com.datastax.oss.kaap.crds.bookkeeper.BookKeeperSetSpec; import com.datastax.oss.kaap.crds.cluster.PulsarClusterSpec; import io.fabric8.kubernetes.client.KubernetesClient; +import jakarta.validation.Valid; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.TreeMap; import java.util.concurrent.RejectedExecutionException; import java.util.stream.Collectors; -import jakarta.validation.Valid; import lombok.Data; import lombok.SneakyThrows; import lombok.extern.jbosslog.JBossLog; diff --git a/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java b/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java index 4bf0c84b..7a93878e 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java +++ b/operator/src/main/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperController.java @@ -37,12 +37,12 @@ import io.javaoperatorsdk.operator.api.reconciler.Constants; import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; import io.quarkus.runtime.ShutdownEvent; +import jakarta.enterprise.event.Observes; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import jakarta.enterprise.event.Observes; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java index adc133dd..d94eaf3e 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/autorecovery/AutorecoverySpec.java @@ -32,11 +32,11 @@ import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.fabric8.kubernetes.api.model.ResourceRequirementsBuilder; import io.fabric8.kubernetes.api.model.Toleration; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java index 9cf88454..bdb12e8a 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bastion/BastionSpec.java @@ -32,11 +32,11 @@ import io.fabric8.kubernetes.api.model.ResourceRequirements; import io.fabric8.kubernetes.api.model.ResourceRequirementsBuilder; import io.fabric8.kubernetes.api.model.Toleration; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java index 530af950..8744f1a9 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSetSpec.java @@ -31,13 +31,13 @@ import io.fabric8.kubernetes.api.model.ServicePort; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategy; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategyBuilder; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java index 2ea4f8aa..4d748d4d 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/bookkeeper/BookKeeperSpec.java @@ -20,10 +20,10 @@ import com.datastax.oss.kaap.crds.GlobalSpec; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import jakarta.validation.ConstraintValidatorContext; import java.util.Arrays; import java.util.LinkedHashMap; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java index 828c517f..3a4483e4 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSetSpec.java @@ -30,13 +30,13 @@ import io.fabric8.kubernetes.api.model.ResourceRequirementsBuilder; import io.fabric8.kubernetes.api.model.ServicePort; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategy; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java index 5139f0ac..f234dbe0 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/broker/BrokerSpec.java @@ -19,9 +19,9 @@ import com.datastax.oss.kaap.crds.GlobalSpec; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import jakarta.validation.ConstraintValidatorContext; import java.util.Arrays; import java.util.LinkedHashMap; -import jakarta.validation.ConstraintValidatorContext; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java index 741ca3f4..5017c831 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/function/FunctionsWorkerSpec.java @@ -31,11 +31,11 @@ import io.fabric8.kubernetes.api.model.ServicePort; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategy; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategyBuilder; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java index 2d3c3def..50b8a555 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySetSpec.java @@ -31,11 +31,11 @@ import io.fabric8.kubernetes.api.model.ServicePort; import io.fabric8.kubernetes.api.model.apps.DeploymentStrategy; import io.fabric8.kubernetes.api.model.apps.DeploymentStrategyBuilder; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java index 332c3116..564e49b8 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/proxy/ProxySpec.java @@ -17,9 +17,9 @@ import com.datastax.oss.kaap.crds.GlobalSpec; import com.fasterxml.jackson.annotation.JsonPropertyDescription; +import jakarta.validation.ConstraintValidatorContext; import java.util.Arrays; import java.util.LinkedHashMap; -import jakarta.validation.ConstraintValidatorContext; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java index 37468fe7..02afa9e0 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/validation/ValidSpec.java @@ -16,9 +16,9 @@ package com.datastax.oss.kaap.crds.validation; import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Retention; import jakarta.validation.Constraint; import jakarta.validation.Payload; +import java.lang.annotation.Retention; @Retention(RUNTIME) @Constraint(validatedBy = {}) diff --git a/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java b/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java index 4704ce08..afa83d35 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java +++ b/operator/src/main/java/com/datastax/oss/kaap/crds/zookeeper/ZooKeeperSpec.java @@ -31,11 +31,11 @@ import io.fabric8.kubernetes.api.model.ServicePort; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategy; import io.fabric8.kubernetes.api.model.apps.StatefulSetUpdateStrategyBuilder; +import jakarta.validation.ConstraintValidatorContext; +import jakarta.validation.constraints.Min; import java.util.List; import java.util.Map; import java.util.function.Supplier; -import jakarta.validation.ConstraintValidatorContext; -import jakarta.validation.constraints.Min; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; diff --git a/pom.xml b/pom.xml index a04ef163..f7a92da2 100644 --- a/pom.xml +++ b/pom.xml @@ -216,7 +216,6 @@ UTF-8 true true - true -parameters -Xlint:all From 9a3f872c78ba4cb07f1ff30d3f72bb4c8d3003e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 17 Jul 2023 13:08:01 +0200 Subject: [PATCH 3/7] Fix all --- docs/api-reference.md | 1771 +++++++++++++++-- operator/pom.xml | 6 + .../oss/kaap/KubernetesClientFactory.java | 17 + .../autoscaler/BookKeeperSetAutoscaler.java | 4 +- .../bookkeeper/BookieAdminClient.java | 4 +- .../bookkeeper/BookieDecommissionUtil.java | 12 +- .../bookkeeper/PodExecBookieAdminClient.java | 47 +- .../src/main/resources/application.properties | 1 + .../autoscaler/BookKeeperAutoscalerTest.java | 90 +- .../BookKeeperSetsControllerTest.java | 14 +- 10 files changed, 1730 insertions(+), 236 deletions(-) create mode 100644 operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java diff --git a/docs/api-reference.md b/docs/api-reference.md index b77c1feb..03419b67 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -2189,6 +2189,13 @@ Indicates the provisioner property for the StorageClass. + claims + []object + +
+ + false + limits map[string]int or string @@ -2206,6 +2213,32 @@ Indicates the provisioner property for the StorageClass. +### PulsarCluster.spec.autorecovery.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.autorecovery.initContainers[index].securityContext @@ -3158,6 +3191,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -3175,6 +3215,32 @@ Resources requirements. +### PulsarCluster.spec.autorecovery.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.autorecovery.sidecars[index] @@ -4705,6 +4771,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -4722,6 +4795,32 @@ Resources requirements. +### PulsarCluster.spec.autorecovery.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.autorecovery.sidecars[index].securityContext @@ -7450,6 +7549,13 @@ Indicates the provisioner property for the StorageClass. + claims + []object + +
+ + false + limits map[string]int or string @@ -7467,6 +7573,32 @@ Indicates the provisioner property for the StorageClass. +### PulsarCluster.spec.bastion.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bastion.initContainers[index].securityContext @@ -8419,6 +8551,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -8436,6 +8575,32 @@ Resources requirements. +### PulsarCluster.spec.bastion.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bastion.sidecars[index] @@ -9966,6 +10131,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -9983,6 +10155,32 @@ Resources requirements. +### PulsarCluster.spec.bastion.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bastion.sidecars[index].securityContext @@ -12354,6 +12552,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -12374,6 +12579,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -12391,6 +12603,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.bookkeeper.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -16006,6 +16244,13 @@ Autoscaling config. + claims + []object + +
+ + false + limits map[string]int or string @@ -16023,6 +16268,32 @@ Autoscaling config. +### PulsarCluster.spec.bookkeeper.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.initContainers[index].securityContext @@ -17177,6 +17448,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -17194,6 +17472,32 @@ Resources requirements. +### PulsarCluster.spec.bookkeeper.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.service @@ -18966,6 +19270,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -18986,6 +19297,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -19003,6 +19321,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.bookkeeper.sets[key].additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.sets[key].additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -22583,6 +22927,13 @@ Autoscaling config. + claims + []object + +
+ + false + limits map[string]int or string @@ -22600,6 +22951,32 @@ Autoscaling config. +### PulsarCluster.spec.bookkeeper.sets[key].initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.sets[key].initContainers[index].securityContext @@ -23754,6 +24131,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -23771,6 +24155,32 @@ Resources requirements. +### PulsarCluster.spec.bookkeeper.sets[key].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.sets[key].service @@ -25395,6 +25805,13 @@ Service configuration. + claims + []object + +
+ + false + limits map[string]int or string @@ -25412,6 +25829,32 @@ Service configuration. +### PulsarCluster.spec.bookkeeper.sets[key].sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.sets[key].sidecars[index].securityContext @@ -27915,6 +28358,13 @@ Indicates if a StorageClass is used. The operator will create the StorageClass i + claims + []object + +
+ + false + limits map[string]int or string @@ -27932,6 +28382,32 @@ Indicates if a StorageClass is used. The operator will create the StorageClass i +### PulsarCluster.spec.bookkeeper.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.bookkeeper.sidecars[index].securityContext @@ -30604,6 +31080,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -30624,6 +31107,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -30641,6 +31131,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.broker.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -34226,6 +34742,13 @@ Autoscaling config. + claims + []object + +
+ + false + limits map[string]int or string @@ -34243,6 +34766,32 @@ Autoscaling config. +### PulsarCluster.spec.broker.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.initContainers[index].securityContext @@ -35444,6 +35993,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -35461,6 +36017,32 @@ Resources requirements. +### PulsarCluster.spec.broker.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.service @@ -37247,6 +37829,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -37267,6 +37856,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -37284,6 +37880,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.broker.sets[key].additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.sets[key].additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -40869,6 +41491,13 @@ Autoscaling config. + claims + []object + +
+ + false + limits map[string]int or string @@ -40886,6 +41515,32 @@ Autoscaling config. +### PulsarCluster.spec.broker.sets[key].initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.sets[key].initContainers[index].securityContext @@ -42087,6 +42742,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -42104,6 +42766,32 @@ Resources requirements. +### PulsarCluster.spec.broker.sets[key].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.sets[key].service @@ -43735,6 +44423,13 @@ Service configuration. + claims + []object + +
+ + false + limits map[string]int or string @@ -43752,6 +44447,32 @@ Service configuration. +### PulsarCluster.spec.broker.sets[key].sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.sets[key].sidecars[index].securityContext @@ -44506,6 +45227,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -44523,6 +45251,32 @@ Resources requirements. +### PulsarCluster.spec.broker.sets[key].transactions.initJob.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.sets[key].updateStrategy @@ -46119,6 +46873,13 @@ Update strategy for the StatefulSet. + claims + []object + +
+ + false + limits map[string]int or string @@ -46136,6 +46897,32 @@ Update strategy for the StatefulSet. +### PulsarCluster.spec.broker.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.sidecars[index].securityContext @@ -46890,6 +47677,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -46907,6 +47701,32 @@ Resources requirements. +### PulsarCluster.spec.broker.transactions.initJob.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.broker.updateStrategy @@ -48637,6 +49457,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -48657,6 +49484,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -48674,6 +49508,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.functionsWorker.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.functionsWorker.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -52154,6 +53014,13 @@ Indicates the provisioner property for the StorageClass. + claims + []object + +
+ + false + limits map[string]int or string @@ -52171,6 +53038,32 @@ Indicates the provisioner property for the StorageClass. +### PulsarCluster.spec.functionsWorker.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.functionsWorker.initContainers[index].securityContext @@ -53459,6 +54352,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -53476,6 +54376,32 @@ Resources requirements. +### PulsarCluster.spec.functionsWorker.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.functionsWorker.service @@ -55107,6 +56033,13 @@ Service configuration. + claims + []object + +
+ + false + limits map[string]int or string @@ -55124,6 +56057,32 @@ Service configuration. +### PulsarCluster.spec.functionsWorker.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.functionsWorker.sidecars[index].securityContext @@ -59337,35 +60296,9 @@ Mount additional volumes to the pod.
false - - - - -### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources - - - - - - - - - - - - - - - - - - - - - + + @@ -59374,7 +60307,7 @@ Mount additional volumes to the pod.
NameTypeDescriptionRequired
limitsmap[string]int or string -
-
false
requestsmap[string]int or stringnamespacestring
-### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources @@ -59390,55 +60323,22 @@ Mount additional volumes to the pod. - matchExpressions + claims []object
false - matchLabels - map[string]string - -
- - false - - - - -### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[index] - - - - - - - - - - - - - - - - - - - - - - + + - - + + @@ -59447,7 +60347,7 @@ Mount additional volumes to the pod.
NameTypeDescriptionRequired
keystring -
-
false
operatorstringlimitsmap[string]int or string
false
values[]stringrequestsmap[string]int or string
-### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].fc +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] @@ -59463,45 +60363,17 @@ Mount additional volumes to the pod. - fsType + name string
false - - lun - integer - -
- - false - - readOnly - boolean - -
- - false - - targetWWNs - []string - -
- - false - - wwids - []string - -
- - false -### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].flexVolume +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -59517,45 +60389,24 @@ Mount additional volumes to the pod. - driver - string - -
- - false - - fsType - string + matchExpressions + []object
false - options + matchLabels map[string]string
false - - readOnly - boolean - -
- - false - - secretRef - object - -
- - false -### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].flexVolume.secretRef +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector.matchExpressions[index] @@ -59571,41 +60422,22 @@ Mount additional volumes to the pod. - name + key string
false - - - - -### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].flocker - - - - - - - - - - - - - - - - + + - - + + @@ -59614,7 +60446,174 @@ Mount additional volumes to the pod.
NameTypeDescriptionRequired
datasetName
operator string
false
datasetUUIDstringvalues[]string
-### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].gcePersistentDisk +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].fc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
fsTypestring +
+
false
luninteger +
+
false
readOnlyboolean +
+
false
targetWWNs[]string +
+
false
wwids[]string +
+
false
+ + +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].flexVolume + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
driverstring +
+
false
fsTypestring +
+
false
optionsmap[string]string +
+
false
readOnlyboolean +
+
false
secretRefobject +
+
false
+ + +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].flexVolume.secretRef + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].flocker + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
datasetNamestring +
+
false
datasetUUIDstring +
+
false
+ + +### PulsarCluster.spec.proxy.additionalVolumes.volumes[index].gcePersistentDisk @@ -62854,6 +63853,13 @@ Indicates the provisioner property for the StorageClass. + claims + []object + +
+ + false + limits map[string]int or string @@ -62871,6 +63877,32 @@ Indicates the provisioner property for the StorageClass. +### PulsarCluster.spec.proxy.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.initContainers[index].securityContext @@ -64058,6 +65090,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -64075,6 +65114,32 @@ Resources requirements. +### PulsarCluster.spec.proxy.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.service @@ -65854,6 +66919,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -65874,6 +66946,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -65891,6 +66970,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.proxy.sets[key].additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.sets[key].additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -69371,6 +70476,13 @@ Indicates the provisioner property for the StorageClass. + claims + []object + +
+ + false + limits map[string]int or string @@ -69388,6 +70500,32 @@ Indicates the provisioner property for the StorageClass. +### PulsarCluster.spec.proxy.sets[key].initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.sets[key].initContainers[index].securityContext @@ -70575,6 +71713,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -70592,6 +71737,32 @@ Resources requirements. +### PulsarCluster.spec.proxy.sets[key].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.sets[key].service @@ -72237,6 +73408,13 @@ Service configuration. + claims + []object + +
+ + false + limits map[string]int or string @@ -72254,6 +73432,32 @@ Service configuration. +### PulsarCluster.spec.proxy.sets[key].sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.sets[key].sidecars[index].securityContext @@ -73224,6 +74428,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -73241,6 +74452,32 @@ Resources requirements. +### PulsarCluster.spec.proxy.sets[key].webSocket.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.sidecars[index] @@ -74771,6 +76008,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -74788,6 +76032,32 @@ Resources requirements. +### PulsarCluster.spec.proxy.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.proxy.sidecars[index].securityContext @@ -75758,6 +77028,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -75775,6 +77052,32 @@ Resources requirements. +### PulsarCluster.spec.proxy.webSocket.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.zookeeper @@ -77432,6 +78735,13 @@ Mount additional volumes to the pod.
false + + namespace + string + +
+ + false @@ -77452,6 +78762,13 @@ Mount additional volumes to the pod. + claims + []object + +
+ + false + limits map[string]int or string @@ -77469,6 +78786,32 @@ Mount additional volumes to the pod. +### PulsarCluster.spec.zookeeper.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.zookeeper.additionalVolumes.volumes[index].ephemeral.volumeClaimTemplate.spec.selector @@ -81050,6 +82393,13 @@ Indicates if a StorageClass is used. The operator will create the StorageClass i + claims + []object + +
+ + false + limits map[string]int or string @@ -81067,6 +82417,32 @@ Indicates if a StorageClass is used. The operator will create the StorageClass i +### PulsarCluster.spec.zookeeper.initContainers[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.zookeeper.initContainers[index].securityContext @@ -81734,6 +83110,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -81751,6 +83134,32 @@ Resources requirements. +### PulsarCluster.spec.zookeeper.metadataInitializationJob.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.zookeeper.nodeAffinity @@ -82287,6 +83696,13 @@ Resources requirements. + claims + []object + +
+ + false + limits map[string]int or string @@ -82304,6 +83720,32 @@ Resources requirements. +### PulsarCluster.spec.zookeeper.resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.zookeeper.service @@ -83928,6 +85370,13 @@ Service configuration. + claims + []object + +
+ + false + limits map[string]int or string @@ -83945,6 +85394,32 @@ Service configuration. +### PulsarCluster.spec.zookeeper.sidecars[index].resources.claims[index] + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionRequired
namestring +
+
false
+ + ### PulsarCluster.spec.zookeeper.sidecars[index].securityContext diff --git a/operator/pom.xml b/operator/pom.xml index ff37d4e0..fe09a776 100644 --- a/operator/pom.xml +++ b/operator/pom.xml @@ -72,6 +72,11 @@ + + io.fabric8 + kubernetes-httpclient-okhttp + + org.bouncycastle bcprov-jdk15on @@ -226,6 +231,7 @@ skip-crds false + false diff --git a/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java b/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java new file mode 100644 index 00000000..b5217497 --- /dev/null +++ b/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java @@ -0,0 +1,17 @@ +package com.datastax.oss.kaap; + +import io.fabric8.kubernetes.client.KubernetesClient; +import io.fabric8.kubernetes.client.KubernetesClientBuilder; +import io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory; +import jakarta.enterprise.inject.Produces; +import jakarta.inject.Singleton; + +@Singleton +public class KubernetesClientFactory { + @Produces + public KubernetesClient kubernetesClient() { + return new KubernetesClientBuilder() + .withHttpClientFactory(new OkHttpClientFactory()) + .build(); + } +} diff --git a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java index e77a0ceb..b5d2e17c 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java +++ b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/BookKeeperSetAutoscaler.java @@ -228,7 +228,7 @@ private boolean checkIfCanScaleDown(double diskUsageLwm, .filter(d -> { boolean res = isDiskUsageAboveTolerance(d, diskUsageLwm); log.infof("isDiskUsageAboveTolerance: %s for %s (%s)", res, - info.getLeft().getPodResource().get().getMetadata().getName(), + info.getLeft().getBookiePod().getMetadata().getName(), d); return res; }) @@ -238,7 +238,7 @@ private boolean checkIfCanScaleDown(double diskUsageLwm, // don't want to go back and forth if bookies disk usage may result in // switch to read-only/scale up soon log.infof("Not all disks are ready for %s", - info.getLeft().getPodResource().get().getMetadata().getName()); + info.getLeft().getBookiePod().getMetadata().getName()); return false; } } diff --git a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieAdminClient.java b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieAdminClient.java index 8db37d46..3c34b2f9 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieAdminClient.java +++ b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieAdminClient.java @@ -15,7 +15,7 @@ */ package com.datastax.oss.kaap.autoscaler.bookkeeper; -import io.fabric8.kubernetes.client.dsl.PodResource; +import io.fabric8.kubernetes.api.model.Pod; import java.util.List; import lombok.Builder; import lombok.Data; @@ -25,7 +25,7 @@ public interface BookieAdminClient { @Data @Builder class BookieInfo { - PodResource podResource; + Pod bookiePod; String bookieId; } diff --git a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieDecommissionUtil.java b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieDecommissionUtil.java index be843672..fd9425de 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieDecommissionUtil.java +++ b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/BookieDecommissionUtil.java @@ -60,7 +60,7 @@ private static int decommissionBookies(List bookie boolean success = true; for (BookieAdminClient.BookieInfo bookieInfo : bookiesToDecommission) { - String bookieName = bookieInfo.getPodResource().get().getMetadata().getName(); + String bookieName = bookieInfo.getBookiePod().getMetadata().getName(); log.infof("Attempting decommission of bookie %s with bookieId = %s", bookieName, bookieInfo.getBookieId()); @@ -89,7 +89,7 @@ private static int decommissionBookies(List bookie // and on restart the bookie will fail if (!deleteCookie(bookieInfo, bookieAdminClient)) { log.warnf("Can't scale down, failed to delete cookie for %s", - bookieInfo.getPodResource().get().getMetadata().getName()); + bookieInfo.getBookiePod().getMetadata().getName()); break; } bookiesSetAsReadonly.remove(bookieInfo); @@ -122,13 +122,13 @@ private static boolean runBookieRecovery(BookieAdminClient.BookieInfo bookieInfo bookieAdminClient.recoverAndDeleteCookieInZk(bookieInfo, false); if (bookieAdminClient.existsLedger(bookieInfo)) { log.warnf("Bookie %s still has ledgers assigned to it, will not delete cookie", - bookieInfo.getPodResource().get().getMetadata().getName()); + bookieInfo.getBookiePod().getMetadata().getName()); return false; } return true; } catch (Exception e) { log.errorf(e, "Error while recovering bookie %s", - bookieInfo.getPodResource().get().getMetadata().getName()); + bookieInfo.getBookiePod().getMetadata().getName()); return false; } } @@ -137,7 +137,7 @@ private static boolean deleteCookie(BookieAdminClient.BookieInfo bookieInfo, Boo try { if (bookieAdminClient.existsLedger(bookieInfo)) { log.warnf("Bookie %s has ledgers assigned to it, will not delete cookie", - bookieInfo.getPodResource().get().getMetadata().getName()); + bookieInfo.getBookiePod().getMetadata().getName()); return false; } @@ -147,7 +147,7 @@ private static boolean deleteCookie(BookieAdminClient.BookieInfo bookieInfo, Boo return true; } catch (Exception e) { log.errorf(e, "Error while deleting a cookie for bookie %s", - bookieInfo.getPodResource().get().getMetadata().getName()); + bookieInfo.getBookiePod().getMetadata().getName()); return false; } } diff --git a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/PodExecBookieAdminClient.java b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/PodExecBookieAdminClient.java index 48ae5547..bf105d21 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/PodExecBookieAdminClient.java +++ b/operator/src/main/java/com/datastax/oss/kaap/autoscaler/bookkeeper/PodExecBookieAdminClient.java @@ -26,7 +26,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.client.KubernetesClient; -import io.fabric8.kubernetes.client.dsl.PodResource; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -76,9 +75,10 @@ public PodExecBookieAdminClient(KubernetesClient client, String namespace, @Override public List collectBookieInfos() { - this.bookieInfos = client.pods().inNamespace(namespace).withLabels(podSelector).resources() + this.bookieInfos = client.pods().inNamespace(namespace).withLabels(podSelector).list().getItems() + .stream() .map(pod -> getBookieInfo(pod)) - .sorted(Comparator.comparing(b -> b.podResource.get().getMetadata().getName())).toList(); + .sorted(Comparator.comparing(b -> b.bookiePod.getMetadata().getName())).toList(); return bookieInfos; } @@ -90,14 +90,14 @@ private List getBookieInfos() { } @SneakyThrows - protected BookieInfo getBookieInfo(PodResource pod) { + protected BookieInfo getBookieInfo(Pod pod) { if (log.isDebugEnabled()) { - log.debugf("getting BookieInfo for pod %s", pod.get().getMetadata().getName()); + log.debugf("getting BookieInfo for pod %s", pod.getMetadata().getName()); } return BookieInfo.builder() - .podResource(pod) + .bookiePod(pod) .bookieId(getBookieId(pod)) .build(); } @@ -105,7 +105,7 @@ protected BookieInfo getBookieInfo(PodResource pod) { @Override @SneakyThrows public BookieStats collectBookieStats(BookieInfo bookieInfo) { - final Pod pod = bookieInfo.getPodResource().get(); + final Pod pod = bookieInfo.getBookiePod(); CompletableFuture bkStateOut = AutoscalerUtils.execInPod(client, namespace, pod.getMetadata().getName(), @@ -178,8 +178,9 @@ private BookieLedgerDiskInfo parseAndFillDiskUsage(String bkStateOutput, Pod pod @Override @SneakyThrows public void setReadOnly(BookieInfo bookieInfo, boolean readonly) { + final String podName = bookieInfo.getBookiePod().getMetadata().getName(); CompletableFuture curlOut = AutoscalerUtils.execInPod(client, namespace, - bookieInfo.getPodResource().get().getMetadata().getName(), + podName, BookKeeperResourcesFactory.getBookKeeperContainerName(globalSpec), "curl -s -X PUT -H \"Content-Type: application/json\" " + "-d '{\"readOnly\":" + readonly + "}' " @@ -187,10 +188,10 @@ public void setReadOnly(BookieInfo bookieInfo, boolean readonly) { curlOut.whenComplete((s, e) -> { if (e != null) { log.errorf(e, "Error making bookie read-only %s", - bookieInfo.getPodResource().get().getMetadata().getName()); + podName); } else { log.infof("Bookie %s is set to read-only=%b", - bookieInfo.getPodResource().get().getMetadata().getName(), + podName, readonly); } }); @@ -200,7 +201,7 @@ public void setReadOnly(BookieInfo bookieInfo, boolean readonly) { @Override @SneakyThrows public void recoverAndDeleteCookieInZk(BookieInfo bookieInfo, boolean deleteCookie) { - final String podName = bookieInfo.getPodResource().get().getMetadata().getName(); + final String podName = bookieInfo.getBookiePod().getMetadata().getName(); String res = internalRecoverAndDeleteCookieInZk(bookieInfo, deleteCookie); log.debugf("Recover output: %s", res); if (!deleteCookie) { @@ -222,14 +223,14 @@ public void recoverAndDeleteCookieInZk(BookieInfo bookieInfo, boolean deleteCook @SneakyThrows private String internalRecoverAndDeleteCookieInZk(BookieInfo bookieInfo, boolean deleteCookie) { - final String podName = bookieInfo.getPodResource().get().getMetadata().getName(); + final String podName = bookieInfo.getBookiePod().getMetadata().getName(); final long start = System.nanoTime(); log.info("Starting bookie recovery for bookie " + podName); CompletableFuture recoverOut = AutoscalerUtils.execInPod(client, namespace, podName, BookKeeperResourcesFactory.getBookKeeperContainerName(globalSpec), "bin/bookkeeper shell recover -f " + (deleteCookie ? "-d " : "") - + getBookieId(bookieInfo.getPodResource())); + + getBookieId(bookieInfo.getBookiePod())); recoverOut.whenComplete((s, e) -> { if (e != null) { log.errorf(e, "Error recovering bookie %s", @@ -245,12 +246,12 @@ private String internalRecoverAndDeleteCookieInZk(BookieInfo bookieInfo, boolean @Override @SneakyThrows public boolean existsLedger(BookieInfo bookieInfo) { - final String podName = bookieInfo.getPodResource().get().getMetadata().getName(); + final String podName = bookieInfo.getBookiePod().getMetadata().getName(); CompletableFuture out = AutoscalerUtils.execInPod(client, namespace, podName, BookKeeperResourcesFactory.getBookKeeperContainerName(globalSpec), "bin/bookkeeper shell listledgers -meta -bookieid " - + getBookieId(bookieInfo.getPodResource())); + + getBookieId(bookieInfo.getBookiePod())); out.whenComplete((s, e) -> { if (e != null) { log.errorf(e, "Error running listledgers for bookie %s", @@ -280,9 +281,9 @@ public boolean doesNotHaveUnderReplicatedLedgers() { $ curl -s localhost:8000/api/v1/autorecovery/list_under_replicated_ledger/ No under replicated ledgers found */ - final PodResource pod = getBookieInfos().get(0).getPodResource(); + final Pod pod = getBookieInfos().get(0).getBookiePod(); CompletableFuture urLedgersOut = AutoscalerUtils.execInPod(client, namespace, - pod.get().getMetadata().getName(), + pod.getMetadata().getName(), BookKeeperResourcesFactory.getBookKeeperContainerName(globalSpec), "curl -s " + bookieAdminUrl + "/api/v1/autorecovery/list_under_replicated_ledger/"); @@ -311,25 +312,25 @@ private String computeBookieUrl() { @SneakyThrows public void triggerAudit() { final BookieInfo bookieInfo = getBookieInfos().get(0); + final String podName = bookieInfo.getBookiePod().getMetadata().getName(); CompletableFuture curlOut = AutoscalerUtils.execInPod(client, namespace, - bookieInfo.getPodResource().get().getMetadata().getName(), + podName, BookKeeperResourcesFactory.getBookKeeperContainerName(globalSpec), "curl -s -X PUT " + bookieAdminUrl + "/api/v1/autorecovery/trigger_audit"); curlOut.whenComplete((s, e) -> { if (e != null) { log.errorf(e, "Error triggering audit %s", - bookieInfo.getPodResource().get().getMetadata().getName()); + podName); } else { log.infof("Triggered audit", - bookieInfo.getPodResource().get().getMetadata().getName()); + podName); } }); curlOut.get(1, TimeUnit.MINUTES); } - protected String getBookieId(PodResource podResource) { - Pod pod = podResource.get(); + protected String getBookieId(Pod pod) { return getBookieId(pod, bookkeeperSetName, currentBookKeeperSetSpec, globalSpec, namespace); } @@ -366,7 +367,7 @@ public static String getBookieId(String podHostname, String bookieSet, @SneakyThrows public void deleteCookieOnDisk(BookieInfo bookieInfo) { // moving rather than deleting, into a random name - final String podName = bookieInfo.getPodResource().get().getMetadata().getName(); + final String podName = bookieInfo.getBookiePod().getMetadata().getName(); CompletableFuture cookieOut = AutoscalerUtils.execInPod(client, namespace, podName, BookKeeperResourcesFactory.getBookKeeperContainerName(globalSpec), diff --git a/operator/src/main/resources/application.properties b/operator/src/main/resources/application.properties index a8e0243d..4faa7947 100644 --- a/operator/src/main/resources/application.properties +++ b/operator/src/main/resources/application.properties @@ -17,6 +17,7 @@ ## quarkus options quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{3.}] (%t) %s%e%n +quarkus.operator-sdk.fail-on-version-check=true ## container-image options diff --git a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java index 1f4f25d4..ac1ffe10 100644 --- a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java +++ b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java @@ -27,7 +27,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.fabric8.kubernetes.api.model.ConfigMapBuilder; import io.fabric8.kubernetes.api.model.ContainerStatusBuilder; -import io.fabric8.kubernetes.api.model.ObjectMeta; import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.PodBuilder; import io.fabric8.kubernetes.api.model.PodList; @@ -42,7 +41,8 @@ import io.fabric8.kubernetes.api.model.metrics.v1beta1.PodMetricsList; import io.fabric8.kubernetes.api.model.metrics.v1beta1.PodMetricsListBuilder; import io.fabric8.kubernetes.client.KubernetesClient; -import io.fabric8.kubernetes.client.dsl.PodResource; +import io.fabric8.kubernetes.client.NamespacedKubernetesClient; +import io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; import io.fabric8.kubernetes.client.server.mock.OutputStreamMessage; import io.fabric8.mockwebserver.utils.BodyProvider; @@ -59,6 +59,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Function; import lombok.Builder; @@ -66,7 +67,6 @@ import lombok.SneakyThrows; import okhttp3.mockwebserver.RecordedRequest; import org.apache.commons.lang3.tuple.Pair; -import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.Test; @@ -110,8 +110,16 @@ void start() { final String clusterName = pulsarClusterSpec.getGlobal().getName(); - server = new KubernetesServer(false); + + AtomicReference client = new AtomicReference(null); + server = new KubernetesServer(false) { + @Override + public NamespacedKubernetesClient getClient() { + return client.get(); + } + }; server.before(); + client.set(server.getKubernetesMockServer().createClient(new OkHttpClientFactory())); final int replicas = pulsarClusterSpec.getBookkeeper().getReplicas(); @@ -190,7 +198,7 @@ void start() { .get() .withPath("/api/v1/namespaces/ns/pods/%s".formatted(podName)) .andReturn(HttpURLConnection.HTTP_OK, pod) - .once(); + .always(); } final PodList podList = new PodListBuilder() .withItems(pods) @@ -339,7 +347,7 @@ public void testNoScaleUpOrDownNeeded() { enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { long usedBytes = 100000; @@ -352,7 +360,7 @@ public void testNoScaleUpOrDownNeeded() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(true) @@ -368,17 +376,7 @@ public void testNoScaleUpOrDownNeeded() { Assert.assertNull(mockServer.patchOp); } - private PodResource getMockPodResource() { - return getMockPodResource("dummyPodName"); - } - private PodResource getMockPodResource(String podName) { - PodResource pr = Mockito.mock(PodResource.class); - ObjectMeta meta = new ObjectMeta(); - meta.setName(podName); - Mockito.when(pr.get()).thenReturn(new PodBuilder().withMetadata(meta).build()); - return pr; - } /** * 2 out of 3 bookies are read-only: @@ -396,7 +394,7 @@ public void testScaleUpReadOnlyBookie() { """; final AtomicInteger count = new AtomicInteger(0); - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; long usedBytes = 100000; @@ -414,7 +412,7 @@ public void testScaleUpReadOnlyBookie() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -444,7 +442,7 @@ public void testScaleUpFromZeroBookies() { enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; long usedBytes = 100000; @@ -457,7 +455,7 @@ public void testScaleUpFromZeroBookies() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -487,7 +485,7 @@ public void testScaleUpLowDiskSpaceBookie() { enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; long usedBytes = 990000; @@ -501,7 +499,7 @@ public void testScaleUpLowDiskSpaceBookie() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -532,7 +530,7 @@ public void testScaleUpLowDiskSpaceAndReadOnlyBookies() { """; final AtomicInteger count = new AtomicInteger(0); - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; long usedBytes = 100000; @@ -553,7 +551,7 @@ public void testScaleUpLowDiskSpaceAndReadOnlyBookies() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -583,7 +581,7 @@ public void testScaleDownBookie() { enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; long usedBytes = 10000; @@ -597,7 +595,7 @@ public void testScaleDownBookie() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -691,7 +689,7 @@ public void testNotScaleDownUnderReplicatedCluster() { enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; long usedBytes = 10000; @@ -705,7 +703,7 @@ public void testNotScaleDownUnderReplicatedCluster() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -749,7 +747,7 @@ public void testNotScaleDownReadOnlyBookie() { """; AtomicBoolean isWritable = new AtomicBoolean(false); - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { long usedBytes = 10000; @@ -762,7 +760,7 @@ public void testNotScaleDownReadOnlyBookie() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable.getAndSet(true)) @@ -793,7 +791,7 @@ public void testNotScaleDownFullBookie() { """; AtomicLong usedBytes = new AtomicLong(990000L); - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; @@ -806,7 +804,7 @@ public void testNotScaleDownFullBookie() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -833,7 +831,7 @@ public void testStsNotReady() { autoscaler: enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; @@ -846,7 +844,7 @@ public void testStsNotReady() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -873,7 +871,7 @@ public void testPodJustStarted() { autoscaler: enabled: true """; - Function> bookieInfofunc = + Function> bookieInfofunc = podSpec -> { boolean isWritable = true; @@ -886,7 +884,7 @@ public void testPodJustStarted() { ledgerDiskInfos.add(diskInfo); return Pair.of(BookieAdminClient.BookieInfo.builder() - .podResource(podSpec) + .bookiePod(podSpec) .build(), BookieAdminClient.BookieStats.builder() .isWritable(isWritable) @@ -906,14 +904,14 @@ public void testPodJustStarted() { } private MockServer runAutoscaler(String spec, MockServer.PodConsumer podConf, Consumer stsConf, - Function> bookieInfofunc) { return runAutoscaler(spec, podConf, stsConf, bookieInfofunc, x -> { }); } private MockServer runAutoscaler(String spec, MockServer.PodConsumer podConf, Consumer stsConf, - Function> bookieInfofunc, Consumer serverAfter) { final PulsarClusterSpec pulsarClusterSpec = MockKubernetesClient.readYaml(spec, PulsarClusterSpec.class); @@ -945,24 +943,24 @@ protected BookieAdminClient newBookieAdminClient(GlobalSpec currentGlobalSpec, } private static class MockBookieAdminClient extends PodExecBookieAdminClient { - Function> bookieInfofunc; + Function> bookieInfofunc; Map> functionResult = new HashMap<>(); public MockBookieAdminClient(KubernetesClient client, String namespace, GlobalSpec globalSpec, String bookkeeperSetName, BookKeeperSetSpec currentBookKeeperSetSpec, - Function> bookieInfofunc) { + Function> bookieInfofunc) { super(client, namespace, globalSpec, bookkeeperSetName, currentBookKeeperSetSpec); this.bookieInfofunc = bookieInfofunc; } @Override - protected BookieInfo getBookieInfo(PodResource pod) { + protected BookieInfo getBookieInfo(Pod pod) { if (bookieInfofunc != null) { final Pair res = bookieInfofunc.apply(pod); - System.out.println("putting result in " + pod.get().getMetadata().getName() + " " + res); - functionResult.put(pod.get().getMetadata().getName(), res); + System.out.println("putting result in " + pod.getMetadata().getName() + " " + res); + functionResult.put(pod.getMetadata().getName(), res); return res.getLeft(); } return super.getBookieInfo(pod); @@ -972,7 +970,7 @@ protected BookieInfo getBookieInfo(PodResource pod) { public BookieStats collectBookieStats(BookieInfo bookieInfo) { if (bookieInfofunc != null) { - final String k = bookieInfo.getPodResource().get().getMetadata().getName(); + final String k = bookieInfo.getBookiePod().getMetadata().getName(); System.out.println("getting result with " + k); return functionResult.get(k).getRight(); } @@ -980,7 +978,7 @@ public BookieStats collectBookieStats(BookieInfo bookieInfo) { } @Override - protected String getBookieId(PodResource podResource) { + protected String getBookieId(Pod podResource) { return "mockId"; } diff --git a/operator/src/test/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperSetsControllerTest.java b/operator/src/test/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperSetsControllerTest.java index 2a47151e..cc12e2db 100644 --- a/operator/src/test/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperSetsControllerTest.java +++ b/operator/src/test/java/com/datastax/oss/kaap/controllers/bookkeeper/BookKeeperSetsControllerTest.java @@ -33,15 +33,15 @@ import com.datastax.oss.kaap.mocks.MockKubernetesClient; import com.datastax.oss.kaap.mocks.MockResourcesResolver; import io.fabric8.kubernetes.api.model.ConfigMap; +import io.fabric8.kubernetes.api.model.ObjectMetaBuilder; import io.fabric8.kubernetes.api.model.PersistentVolumeClaim; import io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder; -import io.fabric8.kubernetes.api.model.PodBuilder; +import io.fabric8.kubernetes.api.model.Pod; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.apps.StatefulSet; import io.fabric8.kubernetes.api.model.policy.v1.PodDisruptionBudget; import io.fabric8.kubernetes.api.model.storage.StorageClass; import io.fabric8.kubernetes.client.KubernetesClient; -import io.fabric8.kubernetes.client.dsl.PodResource; import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -1169,15 +1169,11 @@ private void mockBookieAdminClient(int replicas) { } private BookieAdminClient.BookieInfo genBookieInfo(String bookieId) { - final PodResource pod = Mockito.mock(PodResource.class); - when(pod.get()).thenReturn(new PodBuilder() - .withNewMetadata() - .withName(bookieId) - .endMetadata() - .build()); + final Pod pod = Mockito.mock(Pod.class); + when(pod.getMetadata()).thenReturn(new ObjectMetaBuilder().withName(bookieId).build()); return BookieAdminClient.BookieInfo.builder() .bookieId(bookieId) - .podResource(pod) + .bookiePod(pod) .build(); } } From b568357bb8c5af1f5fb77b01c28b0a2521cec6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 17 Jul 2023 13:08:14 +0200 Subject: [PATCH 4/7] lic --- .../oss/kaap/KubernetesClientFactory.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java b/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java index b5217497..f4a4c3f8 100644 --- a/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java +++ b/operator/src/main/java/com/datastax/oss/kaap/KubernetesClientFactory.java @@ -1,3 +1,18 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.datastax.oss.kaap; import io.fabric8.kubernetes.client.KubernetesClient; From 9252689e4490e60a2a2f1db51110f48734f9001c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 17 Jul 2023 13:54:17 +0200 Subject: [PATCH 5/7] fix (again) --- operator-common/pom.xml | 5 +++ .../oss/kaap/mocks/MockKubeServer.java | 34 +++++++++++++++++++ .../autoscaler/BookKeeperAutoscalerTest.java | 14 ++------ .../kaap/autoscaler/BrokerAutoscalerTest.java | 3 +- .../LoadReportResourceUsageSourceTest.java | 10 +++++- .../oss/kaap/tests/BaseK8sEnvTest.java | 5 ++- 6 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java diff --git a/operator-common/pom.xml b/operator-common/pom.xml index 54b3b981..0088f177 100644 --- a/operator-common/pom.xml +++ b/operator-common/pom.xml @@ -40,6 +40,11 @@ org.skyscreamer jsonassert + + io.fabric8 + kubernetes-server-mock + test + diff --git a/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java b/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java new file mode 100644 index 00000000..cd1d2287 --- /dev/null +++ b/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java @@ -0,0 +1,34 @@ +package com.datastax.oss.kaap.mocks; + +import io.fabric8.kubernetes.client.NamespacedKubernetesClient; +import io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory; +import io.fabric8.kubernetes.client.server.mock.KubernetesServer; +import java.util.concurrent.atomic.AtomicReference; + +public class MockKubeServer extends KubernetesServer { + + private AtomicReference client = new AtomicReference(null); + + public MockKubeServer() { + super(false); + } + + @Override + public void before() { + super.before(); + client.set(getKubernetesMockServer().createClient(new OkHttpClientFactory())); + } + + @Override + public NamespacedKubernetesClient getClient() { + return client.get(); + } + + @Override + public void after() { + super.after(); + if (client.get() != null) { + client.get().close(); + } + } +} diff --git a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java index ac1ffe10..7008c611 100644 --- a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java +++ b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BookKeeperAutoscalerTest.java @@ -23,6 +23,7 @@ import com.datastax.oss.kaap.crds.bookkeeper.BookKeeperFullSpec; import com.datastax.oss.kaap.crds.bookkeeper.BookKeeperSetSpec; import com.datastax.oss.kaap.crds.cluster.PulsarClusterSpec; +import com.datastax.oss.kaap.mocks.MockKubeServer; import com.datastax.oss.kaap.mocks.MockKubernetesClient; import com.fasterxml.jackson.databind.ObjectMapper; import io.fabric8.kubernetes.api.model.ConfigMapBuilder; @@ -41,8 +42,6 @@ import io.fabric8.kubernetes.api.model.metrics.v1beta1.PodMetricsList; import io.fabric8.kubernetes.api.model.metrics.v1beta1.PodMetricsListBuilder; import io.fabric8.kubernetes.client.KubernetesClient; -import io.fabric8.kubernetes.client.NamespacedKubernetesClient; -import io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory; import io.fabric8.kubernetes.client.server.mock.KubernetesServer; import io.fabric8.kubernetes.client.server.mock.OutputStreamMessage; import io.fabric8.mockwebserver.utils.BodyProvider; @@ -59,7 +58,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Function; import lombok.Builder; @@ -110,16 +108,8 @@ void start() { final String clusterName = pulsarClusterSpec.getGlobal().getName(); - - AtomicReference client = new AtomicReference(null); - server = new KubernetesServer(false) { - @Override - public NamespacedKubernetesClient getClient() { - return client.get(); - } - }; + server = new MockKubeServer(); server.before(); - client.set(server.getKubernetesMockServer().createClient(new OkHttpClientFactory())); final int replicas = pulsarClusterSpec.getBookkeeper().getReplicas(); diff --git a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BrokerAutoscalerTest.java b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BrokerAutoscalerTest.java index 8c0994d8..11fcccbb 100644 --- a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BrokerAutoscalerTest.java +++ b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/BrokerAutoscalerTest.java @@ -19,6 +19,7 @@ import com.datastax.oss.kaap.crds.broker.Broker; import com.datastax.oss.kaap.crds.broker.BrokerFullSpec; import com.datastax.oss.kaap.crds.cluster.PulsarClusterSpec; +import com.datastax.oss.kaap.mocks.MockKubeServer; import com.datastax.oss.kaap.mocks.MockKubernetesClient; import com.fasterxml.jackson.databind.ObjectMapper; import io.fabric8.kubernetes.api.model.ConfigMapBuilder; @@ -96,7 +97,7 @@ void start() { final String clusterName = pulsarClusterSpec.getGlobal().getName(); - server = new KubernetesServer(false); + server = new MockKubeServer(); server.before(); final int replicas = pulsarClusterSpec.getBroker().getReplicas(); diff --git a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/broker/LoadReportResourceUsageSourceTest.java b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/broker/LoadReportResourceUsageSourceTest.java index d87bee92..8ff76f7d 100644 --- a/operator/src/test/java/com/datastax/oss/kaap/autoscaler/broker/LoadReportResourceUsageSourceTest.java +++ b/operator/src/test/java/com/datastax/oss/kaap/autoscaler/broker/LoadReportResourceUsageSourceTest.java @@ -19,6 +19,7 @@ import com.datastax.oss.kaap.crds.broker.Broker; import com.datastax.oss.kaap.crds.broker.BrokerFullSpec; import com.datastax.oss.kaap.crds.cluster.PulsarClusterSpec; +import com.datastax.oss.kaap.mocks.MockKubeServer; import com.datastax.oss.kaap.mocks.MockKubernetesClient; import io.fabric8.kubernetes.api.model.ConfigMapBuilder; import io.fabric8.kubernetes.api.model.Pod; @@ -66,7 +67,7 @@ void start() { final String clusterName = pulsarClusterSpec.getGlobal().getName(); - server = new KubernetesServer(false); + server = new MockKubeServer(); server.before(); List pods = new ArrayList<>(); @@ -93,6 +94,11 @@ void start() { .build(); podConsumer.accept(pod, this); pods.add(pod); + server.expect() + .get() + .withPath("/api/v1/namespaces/ns/pods/%s".formatted(podName)) + .andReturn(HttpURLConnection.HTTP_OK, pod) + .always(); } final PodList podList = new PodListBuilder() @@ -109,6 +115,8 @@ void start() { .andReturn(HttpURLConnection.HTTP_OK, podList) .once(); + + } @Override diff --git a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java index 56ac7099..2fffca19 100644 --- a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java +++ b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java @@ -64,6 +64,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.function.BiConsumer; @@ -527,7 +528,9 @@ protected void deleteManifest(String manifest) { protected void deleteManifest(byte[] manifest) { final List resources = - client.load(new ByteArrayInputStream(manifest)).get(); + client.load(new ByteArrayInputStream(manifest)).get() + .stream().filter(Objects::nonNull).collect(Collectors.toList()); + log.info("deleting {} resources", resources.size()); client.resourceList(resources).inNamespace(namespace).delete(); } From 63fc619f2ca0758788effb052c1bb67ccf0b092c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 17 Jul 2023 13:58:25 +0200 Subject: [PATCH 6/7] fix lic --- .../datastax/oss/kaap/mocks/MockKubeServer.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java b/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java index cd1d2287..a3de7c69 100644 --- a/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java +++ b/operator-common/src/test/java/com/datastax/oss/kaap/mocks/MockKubeServer.java @@ -1,3 +1,18 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.datastax.oss.kaap.mocks; import io.fabric8.kubernetes.client.NamespacedKubernetesClient; From f058e37e13204e3793728a425a6db511f499b3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 17 Jul 2023 14:35:02 +0200 Subject: [PATCH 7/7] Fix tests and upgrade logback --- migration-tool/pom.xml | 1 - .../migrationtool/PulsarClusterResourceGeneratorTest.java | 2 ++ pom.xml | 6 ++++++ tests/pom.xml | 1 - 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/migration-tool/pom.xml b/migration-tool/pom.xml index be3979a0..70fde245 100644 --- a/migration-tool/pom.xml +++ b/migration-tool/pom.xml @@ -30,7 +30,6 @@ ch.qos.logback logback-classic - 1.2.3 ${project.groupId} diff --git a/migration-tool/src/test/java/com/datastax/oss/kaap/migrationtool/PulsarClusterResourceGeneratorTest.java b/migration-tool/src/test/java/com/datastax/oss/kaap/migrationtool/PulsarClusterResourceGeneratorTest.java index f4649a21..b317699c 100644 --- a/migration-tool/src/test/java/com/datastax/oss/kaap/migrationtool/PulsarClusterResourceGeneratorTest.java +++ b/migration-tool/src/test/java/com/datastax/oss/kaap/migrationtool/PulsarClusterResourceGeneratorTest.java @@ -1097,6 +1097,7 @@ private void assertValue(File tmpDir) { instanceLivenessCheckFreqMs: 30000 kubernetesContainerFactory: jobNamespace: pulsar + k8Uri: "" percentMemoryPadding: 50 pulsarAdminUrl: http://pulsar-cluster-function.pulsar:6750/ pulsarDockerImageName: pulsar:latest @@ -1118,6 +1119,7 @@ private void assertValue(File tmpDir) { prometheus.io/path: /metrics prometheus.io/port: 9094 prometheus.io/scrape: "true" + extraLabels: "" jobNamespace: pulsar nodeSelectorLabels: astra-node: functionworker diff --git a/pom.xml b/pom.xml index f7a92da2..da71a3ac 100644 --- a/pom.xml +++ b/pom.xml @@ -60,6 +60,7 @@ 4.2.0 5.4.0 1.70 + 1.3.8 @@ -170,6 +171,11 @@ bcpkix-jdk15on ${bouncy-castle.version} + + ch.qos.logback + logback-classic + ${logback-classic.version} + diff --git a/tests/pom.xml b/tests/pom.xml index 4971ddf7..6bf51a05 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -103,7 +103,6 @@ ch.qos.logback logback-classic - 1.2.3 test