|
1 | 1 | package com.github.containersolutions.operator.sample;
|
2 | 2 |
|
3 |
| -import com.github.containersolutions.operator.Context; |
4 | 3 | import com.github.containersolutions.operator.api.Controller;
|
5 | 4 | import com.github.containersolutions.operator.api.ResourceController;
|
6 | 5 | import org.slf4j.Logger;
|
|
14 | 13 |
|
15 | 14 | import static java.lang.String.format;
|
16 | 15 |
|
17 |
| -@Controller(customResourceClass = Schema.class, |
18 |
| - kind = SchemaController.KIND, |
19 |
| - group = SchemaController.GROUP, |
| 16 | +@Controller( |
| 17 | + crdName = "schemas.mysql.sample.javaoperatorsdk", |
| 18 | + customResourceClass = Schema.class, |
20 | 19 | customResourceListClass = SchemaList.class,
|
21 |
| - customResourceDonebaleClass = SchemaDoneable.class) |
| 20 | + customResourceDoneableClass = SchemaDoneable.class) |
22 | 21 | public class SchemaController implements ResourceController<Schema> {
|
23 | 22 |
|
24 |
| - static final String KIND = "MySQLSchema"; |
25 |
| - static final String GROUP = "mysql.sample.javaoperatorsdk"; |
26 | 23 |
|
27 | 24 | private final Logger log = LoggerFactory.getLogger(getClass());
|
28 | 25 |
|
29 | 26 | @Override
|
30 |
| - public Optional<Schema> createOrUpdateResource(Schema schema, Context<Schema> context) { |
| 27 | + public Optional<Schema> createOrUpdateResource(Schema schema) { |
31 | 28 | try {
|
32 | 29 | Connection connection = getConnection();
|
33 | 30 | ResultSet resultSet = connection.createStatement().executeQuery(
|
@@ -63,7 +60,7 @@ public Optional<Schema> createOrUpdateResource(Schema schema, Context<Schema> co
|
63 | 60 | }
|
64 | 61 |
|
65 | 62 | @Override
|
66 |
| - public boolean deleteResource(Schema schema, Context<Schema> context) { |
| 63 | + public boolean deleteResource(Schema schema) { |
67 | 64 | log.info("Execution deleteResource for: {}", schema.getMetadata().getName());
|
68 | 65 |
|
69 | 66 | try {
|
|
0 commit comments