halkyonio / primaza-poc

Quarkus Primaza Application - POC
1 stars 7 forks source link

Primaza Claim operator fails to start #434

Closed aureamunoz closed 11 months ago

aureamunoz commented 11 months ago

I've created an operator using the quarkus extension for josdk and I the application doesn't start up if I convert the operator in a module of the Primaza parent project.

What I did:

1 - mkdir operator 2 - cd operator 3 - operator-sdk init --plugins quarkus --domain halkyon.io --project-name claim 4 - operator-sdk create api --version v1alpha1 --kind Claim At this point eh operator starts up correctly in devmode. 5 - Modify the pom.xml for adding the parent file info, remove properties and dependencyManagementsection resulting in:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>io.halkyon</groupId>
    <artifactId>primaza</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>io.halkyon</groupId>
  <artifactId>primaza-operator</artifactId>
  <name>Primaza :: Kubernetes Operator</name>
  <description>Watches for Claim resources</description>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>io.quarkiverse.operatorsdk</groupId>
      <artifactId>quarkus-operator-sdk</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <version>${quarkus.platform.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
    </plugin>
    <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>${compiler-plugin.version}</version>
    </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>native</id>
      <properties>
        <quarkus.package.type>native</quarkus.package.type>
      </properties>
    </profile>
  </profiles>

</project>

At this point I'm having the following error when starting:

2023-11-27 16:44:44,103 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2023-11-27 16:44:44,275 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: Failed to load steps from class io.quarkiverse.operatorsdk.deployment.devconsole.DevConsoleProcessor
        at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:164)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:107)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:251)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:112)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:433)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:55)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:138)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:93)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: java.lang.NoClassDefFoundError: io/quarkus/devconsole/spi/DevConsoleRuntimeTemplateInfoBuildItem
        at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3578)
        at java.base/java.lang.Class.getDeclaredMethods(Class.java:2676)
        at io.quarkus.deployment.ExtensionLoader.getMethods(ExtensionLoader.java:922)
        at io.quarkus.deployment.ExtensionLoader.loadStepsFromClass(ExtensionLoader.java:432)
        at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:162)
        ... 11 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:518)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:468)
        ... 17 more

The code is available in the https://github.com/aureamunoz/servicebox-poc/tree/setup-k8s-operator branch

aureamunoz commented 11 months ago

Fixed by b02ed66