Skip to content

Commit

Permalink
Fixed status updated only when Kafka instance ready with no updating (#…
Browse files Browse the repository at this point in the history
…472)

* Fixed status updated only when Kafka instance ready with no updating

* Reviewed comments
  • Loading branch information
ppatierno authored Aug 9, 2021
1 parent e94d1b2 commit 13133bc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.bf2.operator.resources.v1alpha1.ManagedKafka;
import org.bf2.operator.resources.v1alpha1.ManagedKafkaCapacityBuilder;
import org.bf2.operator.resources.v1alpha1.ManagedKafkaCondition;
import org.bf2.operator.resources.v1alpha1.ManagedKafkaCondition.Reason;
import org.bf2.operator.resources.v1alpha1.ManagedKafkaCondition.Status;
import org.bf2.operator.resources.v1alpha1.ManagedKafkaStatus;
import org.bf2.operator.resources.v1alpha1.ManagedKafkaStatusBuilder;
Expand Down Expand Up @@ -132,7 +133,11 @@ private void updateManagedKafkaStatus(ManagedKafka managedKafka) {

if (Status.True.equals(readiness.getStatus())) {
status.setCapacity(new ManagedKafkaCapacityBuilder(managedKafka.getSpec().getCapacity()).build());
status.setVersions(new VersionsBuilder(managedKafka.getSpec().getVersions()).build());
if (!Reason.StrimziUpdating.equals(readiness.getReason())) {
status.setVersions(new VersionsBuilder(managedKafka.getSpec().getVersions()).build());
} else {
// just keep the current version
}
status.setAdminServerURI(kafkaInstance.getAdminServer().uri(managedKafka));
}
}
Expand Down

0 comments on commit 13133bc

Please sign in to comment.