Skip to content

Commit

Permalink
Added Namespace and Cluster to Schema resource for AuditLog (#148)
Browse files Browse the repository at this point in the history
* Fixed schemas allow singular/plural in CLI

* Added Namespace and Cluster to Schema resource for AuditLog
  • Loading branch information
twobeeb authored Jan 6, 2022
1 parent 6705c9e commit 3e25472
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ public class ApiResourcesController {
.namespaced(true)
.synchronizable(false)
.path("schemas")
.names(List.of("schemas", "schemas", "sc"))
.names(List.of("schemas", "schema", "sc"))
.build();
public static final ResourceDefinition NAMESPACE = ResourceDefinition.builder()
.kind("Namespace")
.namespaced(false)
.synchronizable(false)
.path("namespaces")
.names(List.of("namespaces", "namespace", "ns"))
.namespaced(false)
.synchronizable(false)
.path("namespaces")
.names(List.of("namespaces", "namespace", "ns"))
.build();

@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public Optional<Schema> getLatestSubject(Namespace namespace, String subject) {

return Optional.of(Schema.builder()
.metadata(ObjectMeta.builder()
.cluster(namespace.getMetadata().getCluster())
.namespace(namespace.getMetadata().getName())
.name(response.get().subject())
.build())
.spec(Schema.SchemaSpec.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ void getBySubjectAndVersion() {

Assertions.assertTrue(retrievedSchema.isPresent());
Assertions.assertEquals("prefix.schema-one", retrievedSchema.get().getMetadata().getName());
Assertions.assertEquals("local", retrievedSchema.get().getMetadata().getCluster());
Assertions.assertEquals("myNamespace", retrievedSchema.get().getMetadata().getNamespace());
}

/**
Expand Down

0 comments on commit 3e25472

Please sign in to comment.