-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(operator): update CRD field structure and some example files
- Loading branch information
Showing
61 changed files
with
1,401 additions
and
592 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
8 changes: 5 additions & 3 deletions
8
operator/controller/src/main/deploy/examples/simple.apicurioregistry3.yaml
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,9 +1,11 @@ | ||
apiVersion: registry.apicur.io/v1 | ||
kind: ApicurioRegistry3 | ||
metadata: | ||
name: simple-apicurioregistry3 | ||
name: simple | ||
spec: | ||
app: | ||
host: simple-apicurioregistry3-app.apps.yourcluster.example | ||
ingress: | ||
host: simple-app.apps.cluster.example | ||
ui: | ||
host: simple-apicurioregistry3-ui.apps.yourcluster.example | ||
ingress: | ||
host: simple-ui.apps.cluster.example |
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
23 changes: 14 additions & 9 deletions
23
operator/controller/src/main/java/io/apicurio/registry/operator/feat/KafkaSql.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,27 +1,32 @@ | ||
package io.apicurio.registry.operator.feat; | ||
|
||
import io.apicurio.registry.operator.api.v1.ApicurioRegistry3; | ||
import io.apicurio.registry.operator.api.v1.ApicurioRegistry3Spec; | ||
import io.apicurio.registry.operator.api.v1.spec.AppSpec; | ||
import io.apicurio.registry.operator.api.v1.spec.StorageSpec; | ||
import io.fabric8.kubernetes.api.model.EnvVar; | ||
import io.fabric8.kubernetes.api.model.EnvVarBuilder; | ||
|
||
import java.util.Map; | ||
|
||
import static io.apicurio.registry.operator.resource.app.AppDeploymentResource.addEnvVar; | ||
import static io.apicurio.registry.operator.utils.Utils.isBlank; | ||
import static java.util.Optional.ofNullable; | ||
|
||
public class KafkaSql { | ||
|
||
public static String ENV_STORAGE_KIND = "APICURIO_STORAGE_KIND"; | ||
public static String ENV_KAFKASQL_BOOTSTRAP_SERVERS = "APICURIO_KAFKASQL_BOOTSTRAP_SERVERS"; | ||
|
||
public static boolean configureKafkaSQL(ApicurioRegistry3 primary, Map<String, EnvVar> env) { | ||
if (primary.getSpec().getApp().getKafkasql() != null | ||
&& !isBlank(primary.getSpec().getApp().getKafkasql().getBootstrapServers())) { | ||
addEnvVar(env, new EnvVarBuilder().withName(ENV_STORAGE_KIND).withValue("kafkasql").build()); | ||
addEnvVar(env, new EnvVarBuilder().withName(ENV_KAFKASQL_BOOTSTRAP_SERVERS) | ||
.withValue(primary.getSpec().getApp().getKafkasql().getBootstrapServers()).build()); | ||
return true; | ||
} | ||
return false; | ||
public static void configureKafkaSQL(ApicurioRegistry3 primary, Map<String, EnvVar> env) { | ||
ofNullable(primary.getSpec()).map(ApicurioRegistry3Spec::getApp).map(AppSpec::getStorage) | ||
.map(StorageSpec::getKafkasql).ifPresent(kafkasql -> { | ||
if (!isBlank(kafkasql.getBootstrapServers())) { | ||
addEnvVar(env, | ||
new EnvVarBuilder().withName(ENV_STORAGE_KIND).withValue("kafkasql").build()); | ||
addEnvVar(env, new EnvVarBuilder().withName(ENV_KAFKASQL_BOOTSTRAP_SERVERS) | ||
.withValue(kafkasql.getBootstrapServers()).build()); | ||
} | ||
}); | ||
} | ||
} |
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
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
Oops, something went wrong.