operator-framework / operator-framework/java-operator-sdk

Apply CRDs on startup of operator

Offen
#807 1 Kommentar 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

@metacosm arbeitet bereits daran.

Seit 13.1.2022.

help wanted needs-discussion
Vorherrschende Sprache
Java
Sterne
944
Forks
242
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
43

Beschreibung

CRDs can be generated by using io.fabric8:crd-generator-apt as an annotationProcessor. The CRDs need to be applied manually to the cluster every time they change. This results in a bad development experience.

The quarkus-operator-sdk already deals with both tasks (Generating CRDs, Applying CRDs) and provides a configuration property to enable/disable CRD installation.

Workaround Gradle

A simple workaround could be to create an additional task. The task could be structured like the following (will fail with Kubernetes 1.22+):

task applyCrds(type: Exec) {
    commandLine = ["kubectl", "apply", "-f", "$buildDir/classes/java/main/META-INF/fabric8/"]

    tasks.compileJava.finalizedBy(tasks.applyCrds)
}

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.