generated from quarkiverse/quarkiverse-template
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: delay accessing ConfigurationService from DevUI until ready (#640)
* fix: inject Operator in JSONRPCService The Operator should be ready at that point. * chore: remove old-style Dev UI * refactor: simplify and remove unused code in DependentInfo
- Loading branch information
Showing
9 changed files
with
45 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
...t/src/main/java/io/quarkiverse/operatorsdk/deployment/devconsole/DevConsoleProcessor.java
This file was deleted.
Oops, something went wrong.
61 changes: 0 additions & 61 deletions
61
core/deployment/src/main/resources/dev-templates/controllers.html
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
core/deployment/src/main/resources/dev-templates/embedded.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
...time/src/main/java/io/quarkiverse/operatorsdk/runtime/devconsole/ControllersSupplier.java
This file was deleted.
Oops, something went wrong.
58 changes: 4 additions & 54 deletions
58
core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/devconsole/DependentInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 12 additions & 5 deletions
17
core/runtime/src/main/java/io/quarkiverse/operatorsdk/runtime/devui/JSONRPCService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,30 @@ | ||
package io.quarkiverse.operatorsdk.runtime.devui; | ||
|
||
import java.util.Collection; | ||
import java.util.stream.Collectors; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
|
||
import io.javaoperatorsdk.operator.Operator; | ||
import io.javaoperatorsdk.operator.processing.Controller; | ||
import io.quarkiverse.operatorsdk.runtime.devconsole.ControllerInfo; | ||
import io.quarkiverse.operatorsdk.runtime.devconsole.ControllersSupplier; | ||
|
||
@ApplicationScoped | ||
public class JSONRPCService { | ||
private final ControllersSupplier supplier = new ControllersSupplier(); | ||
@Inject | ||
Operator operator; | ||
|
||
@SuppressWarnings("rawtypes") | ||
@SuppressWarnings({ "rawtypes", "unchecked" }) | ||
public Collection<ControllerInfo> getControllers() { | ||
return supplier.get(); | ||
return operator.getRegisteredControllers().stream() | ||
.map(Controller.class::cast) | ||
.map(registeredController -> new ControllerInfo(registeredController)) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
@SuppressWarnings("unused") | ||
public int controllersCount() { | ||
return supplier.count(); | ||
return operator.getRegisteredControllersNumber(); | ||
} | ||
} |