diff --git a/api/src/main/java/org/bf2/operator/resources/v1alpha1/ClusterCapacity.java b/api/src/main/java/org/bf2/operator/resources/v1alpha1/ClusterCapacity.java deleted file mode 100644 index 3ea79811f..000000000 --- a/api/src/main/java/org/bf2/operator/resources/v1alpha1/ClusterCapacity.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.bf2.operator.resources.v1alpha1; - -import io.fabric8.kubernetes.api.model.Quantity; -import io.sundr.builder.annotations.Buildable; -import lombok.Getter; -import lombok.Setter; - -@Buildable(builderPackage = "io.fabric8.kubernetes.api.builder") -@Getter -@Setter -public class ClusterCapacity { - private Quantity ingressEgressThroughputPerSec; - private Integer connections; - private Quantity dataRetentionSize; - private Integer partitions; - -} diff --git a/api/src/main/java/org/bf2/operator/resources/v1alpha1/ClusterResizeInfo.java b/api/src/main/java/org/bf2/operator/resources/v1alpha1/ClusterResizeInfo.java deleted file mode 100644 index b8d09136e..000000000 --- a/api/src/main/java/org/bf2/operator/resources/v1alpha1/ClusterResizeInfo.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.bf2.operator.resources.v1alpha1; - -import io.sundr.builder.annotations.Buildable; -import lombok.Getter; -import lombok.Setter; - -@Buildable(builderPackage = "io.fabric8.kubernetes.api.builder") -@Getter -@Setter -public class ClusterResizeInfo { - private int nodeDelta; - private ClusterCapacity delta; -} diff --git a/api/src/main/java/org/bf2/operator/resources/v1alpha1/ManagedKafkaAgentStatus.java b/api/src/main/java/org/bf2/operator/resources/v1alpha1/ManagedKafkaAgentStatus.java index dcc4930cd..9aca55aee 100644 --- a/api/src/main/java/org/bf2/operator/resources/v1alpha1/ManagedKafkaAgentStatus.java +++ b/api/src/main/java/org/bf2/operator/resources/v1alpha1/ManagedKafkaAgentStatus.java @@ -17,14 +17,6 @@ public class ManagedKafkaAgentStatus { private List conditions; - private ClusterCapacity total; - - private ClusterCapacity remaining; - - private NodeCounts nodeInfo; - - private ClusterResizeInfo resizeInfo; - private String updatedTimestamp; private List strimzi; diff --git a/api/src/main/java/org/bf2/operator/resources/v1alpha1/NodeCounts.java b/api/src/main/java/org/bf2/operator/resources/v1alpha1/NodeCounts.java deleted file mode 100644 index 64dd2730a..000000000 --- a/api/src/main/java/org/bf2/operator/resources/v1alpha1/NodeCounts.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.bf2.operator.resources.v1alpha1; - -import io.sundr.builder.annotations.Buildable; -import lombok.Getter; -import lombok.Setter; - -@Buildable(builderPackage = "io.fabric8.kubernetes.api.builder") -@Getter -@Setter -public class NodeCounts { - private int ceiling; - private int floor; - private int current; - private int currentWorkLoadMinimum; - -} diff --git a/operator/src/main/java/org/bf2/operator/controllers/ManagedKafkaAgentController.java b/operator/src/main/java/org/bf2/operator/controllers/ManagedKafkaAgentController.java index 5e86278d5..fb71914de 100644 --- a/operator/src/main/java/org/bf2/operator/controllers/ManagedKafkaAgentController.java +++ b/operator/src/main/java/org/bf2/operator/controllers/ManagedKafkaAgentController.java @@ -1,6 +1,5 @@ package org.bf2.operator.controllers; -import io.fabric8.kubernetes.api.model.Quantity; import io.javaoperatorsdk.operator.api.reconciler.Constants; import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; @@ -17,18 +16,12 @@ import org.bf2.operator.managers.InformerManager; import org.bf2.operator.managers.ObservabilityManager; import org.bf2.operator.managers.StrimziManager; -import org.bf2.operator.resources.v1alpha1.ClusterCapacity; -import org.bf2.operator.resources.v1alpha1.ClusterCapacityBuilder; -import org.bf2.operator.resources.v1alpha1.ClusterResizeInfo; -import org.bf2.operator.resources.v1alpha1.ClusterResizeInfoBuilder; import org.bf2.operator.resources.v1alpha1.ManagedKafkaAgent; import org.bf2.operator.resources.v1alpha1.ManagedKafkaAgentStatus; import org.bf2.operator.resources.v1alpha1.ManagedKafkaAgentStatusBuilder; import org.bf2.operator.resources.v1alpha1.ManagedKafkaCondition; import org.bf2.operator.resources.v1alpha1.ManagedKafkaCondition.Status; import org.bf2.operator.resources.v1alpha1.ManagedKafkaCondition.Type; -import org.bf2.operator.resources.v1alpha1.NodeCounts; -import org.bf2.operator.resources.v1alpha1.NodeCountsBuilder; import org.bf2.operator.resources.v1alpha1.ProfileCapacity; import org.bf2.operator.resources.v1alpha1.StrimziVersionStatus; import org.jboss.logging.Logger; @@ -128,46 +121,8 @@ private ManagedKafkaAgentStatus buildStatus(ManagedKafkaAgent resource) { Map capacity = capacityManager.buildCapacity(resource); - // dummy capacity information - to be removed - ClusterCapacity total = new ClusterCapacityBuilder() - .withConnections(10000) - .withDataRetentionSize(Quantity.parse("40Gi")) - .withIngressEgressThroughputPerSec(Quantity.parse("40Gi")) - .withPartitions(10000) - .build(); - - ClusterCapacity remaining = new ClusterCapacityBuilder() - .withConnections(10000) - .withDataRetentionSize(Quantity.parse("40Gi")) - .withIngressEgressThroughputPerSec(Quantity.parse("40Gi")) - .withPartitions(10000) - .build(); - - ClusterCapacity delta = new ClusterCapacityBuilder() - .withConnections(10000) - .withDataRetentionSize(Quantity.parse("40Gi")) - .withIngressEgressThroughputPerSec(Quantity.parse("40Gi")) - .withPartitions(10000) - .build(); - - NodeCounts nodeInfo = new NodeCountsBuilder() - .withCeiling(0) - .withCurrent(0) - .withCurrentWorkLoadMinimum(0) - .withFloor(0) - .build(); - - ClusterResizeInfo resize = new ClusterResizeInfoBuilder() - .withDelta(delta) - .withNodeDelta(3) - .build(); - return new ManagedKafkaAgentStatusBuilder() .withConditions(status == null ? Arrays.asList(readyCondition) : status.getConditions()) - .withTotal(total) - .withRemaining(remaining) - .withNodeInfo(nodeInfo) - .withResizeInfo(resize) .withUpdatedTimestamp(ConditionUtils.iso8601Now()) .withStrimzi(strimziVersions) .withCapacity(capacity) diff --git a/sync/src/test/java/org/bf2/sync/AgentPollerTest.java b/sync/src/test/java/org/bf2/sync/AgentPollerTest.java index 1491b8fa4..489c15b77 100644 --- a/sync/src/test/java/org/bf2/sync/AgentPollerTest.java +++ b/sync/src/test/java/org/bf2/sync/AgentPollerTest.java @@ -5,7 +5,6 @@ import io.quarkus.test.junit.mockito.InjectMock; import io.quarkus.test.kubernetes.client.WithKubernetesTestServer; import org.bf2.common.ManagedKafkaAgentResourceClient; -import org.bf2.operator.resources.v1alpha1.ClusterCapacityBuilder; import org.bf2.operator.resources.v1alpha1.ManagedKafkaAgent; import org.bf2.operator.resources.v1alpha1.ManagedKafkaAgentStatusBuilder; import org.bf2.sync.controlplane.ControlPlaneRestClient; @@ -16,6 +15,7 @@ import javax.inject.Inject; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @WithKubernetesTestServer @@ -50,8 +50,7 @@ public void testAddDelete() { managedKafkaAgentSync.loop(); // pick up the agent from the control plane ManagedKafkaAgent local = lookup.getLocalManagedKafkaAgent(); - local.setStatus(new ManagedKafkaAgentStatusBuilder() - .withRemaining(new ClusterCapacityBuilder().withConnections(1000).build()).build()); + local.setStatus(new ManagedKafkaAgentStatusBuilder().build()); client.replaceStatus(local); assertEquals("test-token", local.getSpec().getObservability().getAccessToken()); @@ -64,7 +63,7 @@ public void testAddDelete() { local = lookup.getLocalManagedKafkaAgent(); assertEquals("abc", local.getSpec().getObservability().getAccessToken()); - assertEquals(1000, local.getStatus().getRemaining().getConnections()); + assertNotNull(local.getStatus()); } } diff --git a/systemtest/src/main/java/org/bf2/systemtest/framework/AssertUtils.java b/systemtest/src/main/java/org/bf2/systemtest/framework/AssertUtils.java index 5caa68fa7..7bbca4115 100644 --- a/systemtest/src/main/java/org/bf2/systemtest/framework/AssertUtils.java +++ b/systemtest/src/main/java/org/bf2/systemtest/framework/AssertUtils.java @@ -44,9 +44,5 @@ public static void assertManagedKafkaStatus(ManagedKafka mk, ManagedKafkaStatus public static void assertManagedKafkaAgentStatus(ManagedKafkaAgentStatus agentStatus) { String yml = Serialization.asYaml(agentStatus); assertEquals(1, agentStatus.getConditions().size(), yml); - assertNotNull(agentStatus.getTotal(), yml); - assertNotNull(agentStatus.getRemaining(), yml); - assertNotNull(agentStatus.getResizeInfo(), yml); - assertNotNull(agentStatus.getNodeInfo(), yml); } }