Skip to content

Commit

Permalink
fix(operator): use a correct tag in the install file, other small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsenko committed Dec 2, 2024
1 parent e44c339 commit 400742d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ jobs:
unset IMAGE
unset BUNDLE_IMAGE
unset CATALOG_IMAGE
make INSTALL_FILE=install/install.yaml dist-install-file
make IMAGE_TAG=latest-snapshot INSTALL_FILE=install/install.yaml dist-install-file
- name: Check install file
run: |
git add operator/install/install.yaml || true
if ! git diff --staged --exit-code; then
echo 'Install file needs to be updated. Please run "cd operator; make SKIP_TESTS=true build INSTALL_FILE=install/install.yaml dist-install-file" and commit the result.';
echo 'Install file needs to be updated. Please run "cd operator; make SKIP_TESTS=true build IMAGE_TAG=latest-snapshot INSTALL_FILE=install/install.yaml dist-install-file" and commit the result.';
exit 1;
else
echo "No changes to the install file.";
Expand Down
2 changes: 1 addition & 1 deletion operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ OpenShift). Alternatively, you can use the following steps:
4. Run:
```shell
curl -sSL "https://raw.githubusercontent.com/Apicurio/apicurio-registry/$VERSION/operator/install/install.yaml" | sed "s/PLACEHOLDER_NAMESPACE/$NAMESPACE/g" | kubectl -n $NAMESPACE apply -f -
kubectl -n $NAMESPACE apply -f controller/src/main/deploy/examples/simple-apicurioregistry3.yaml
kubectl -n $NAMESPACE apply -f controller/src/main/deploy/examples/simple.apicurioregistry3.yaml
```

### Local Development Quickstart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class PostgresSql {

public static boolean configureDatasource(ApicurioRegistry3 primary, Map<String, EnvVar> env) {
if (primary.getSpec().getApp().getSql() != null
&& primary.getSpec().getApp().getSql().getDatasource() != null) {
var datasource = primary.getSpec().getApp().getSql().getDatasource();
&& primary.getSpec().getApp().getSql().getDataSource() != null) {
var datasource = primary.getSpec().getApp().getSql().getDataSource();

addEnvVar(env, new EnvVarBuilder().withName(ENV_APICURIO_STORAGE_KIND).withValue("sql").build());
addEnvVar(env, new EnvVarBuilder().withName(ENV_APICURIO_STORAGE_SQL_KIND).withValue("postgresql")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import io.apicurio.registry.operator.api.v1.ApicurioRegistry3;
import io.apicurio.registry.operator.api.v1.spec.Sql;
import io.apicurio.registry.operator.api.v1.spec.sql.Datasource;
import io.apicurio.registry.operator.api.v1.spec.sql.DataSource;
import io.apicurio.registry.operator.resource.ResourceFactory;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
Expand All @@ -13,14 +13,14 @@
import static org.awaitility.Awaitility.await;

@QuarkusTest
public class SqlDatasourceITTest extends ITBase {
public class SqlDataSourceITTest extends ITBase {

private static final Logger log = LoggerFactory.getLogger(SqlDatasourceITTest.class);
private static final Logger log = LoggerFactory.getLogger(SqlDataSourceITTest.class);

@Test
void testSqlDatasource() {
client.load(
SqlDatasourceITTest.class.getResourceAsStream("/k8s/examples/postgres/example-postgres.yaml"))
SqlDataSourceITTest.class.getResourceAsStream("/k8s/examples/postgres/example-postgres.yaml"))
.create();
// await for postgres to be available
await().ignoreExceptions().until(() -> (1 == client.apps().statefulSets().inNamespace(namespace)
Expand All @@ -31,8 +31,8 @@ void testSqlDatasource() {
registry.getMetadata().setNamespace(namespace);
var sql = new Sql();
registry.getSpec().getApp().setSql(sql);
var datasource = new Datasource();
sql.setDatasource(datasource);
var datasource = new DataSource();
sql.setDataSource(datasource);
datasource.setUrl("jdbc:postgresql://postgres-db:5432/apicurio");
datasource.setUsername("postgres-username");
datasource.setPassword("postgres-password");
Expand Down
4 changes: 2 additions & 2 deletions operator/install/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3012,7 +3012,7 @@ spec:
sql:
description: Configuration of Apicurio Registry SQL storage.
properties:
datasource:
dataSource:
description: SQL data source.
properties:
password:
Expand Down Expand Up @@ -9184,7 +9184,7 @@ spec:
value: quay.io/apicurio/apicurio-registry-ui:latest-snapshot
- name: STUDIO_UI_IMAGE
value: quay.io/apicurio/apicurio-studio-ui:latest-snapshot
image: quay.io/apicurio/apicurio-registry-operator:3.0.5-snapshot
image: quay.io/apicurio/apicurio-registry-operator:latest-snapshot
imagePullPolicy: Always
livenessProbe:
httpGet:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.apicurio.registry.operator.api.v1.spec.sql.Datasource;
import io.apicurio.registry.operator.api.v1.spec.sql.DataSource;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({ "datasource" })
@JsonPropertyOrder({ "dataSource" })
@JsonDeserialize(using = JsonDeserializer.None.class)
@Getter
@Setter
@ToString
public class Sql {

@JsonProperty("datasource")
@JsonProperty("dataSource")
@JsonPropertyDescription("""
SQL data source.""")
@JsonSetter(nulls = Nulls.SKIP)
private Datasource datasource;
private DataSource dataSource;

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@Getter
@Setter
@ToString
public class Datasource {
public class DataSource {

@JsonProperty("url")
@JsonPropertyDescription("""
Expand Down

0 comments on commit 400742d

Please sign in to comment.