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

Apply CRDs on startup of operator

Open
#807 1 comment 0 reactions 2 assignees View on GitHub

@metacosm is already working on this.

Since Jan 13, 2022.

help wanted needs-discussion
Dominant language
Java
Stars
944
Forks
242
Avg merge
1d 4h
Merged PRs (30d)
43

Description

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)
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.