diff --git a/gradle.properties b/gradle.properties index b4d7f0f..fce46f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ # limitations under the License. # -release_version = 2.3.5 +release_version = 2.3.6 springboot_version = 3.0.2 kotlin_version = 1.6.21 diff --git a/src/main/java/com/exactpro/th2/inframgr/JobController.java b/src/main/java/com/exactpro/th2/inframgr/JobController.java index 9a2f464..588b92e 100644 --- a/src/main/java/com/exactpro/th2/inframgr/JobController.java +++ b/src/main/java/com/exactpro/th2/inframgr/JobController.java @@ -51,6 +51,7 @@ public class JobController { @PutMapping("/jobs/{schemaName}/{jobName}") public void putSecrets(@PathVariable(name = "schemaName") String schemaName, @PathVariable(name = "jobName") String jobName) { + logger.debug("received request for job creation, job name: {}", jobName); if (!K8sCustomResource.isSchemaNameValid(schemaName)) { throw new NotAcceptableException(BAD_RESOURCE_NAME, "Invalid schema name"); } @@ -74,7 +75,9 @@ public void putSecrets(@PathVariable(name = "schemaName") String schemaName, gitter.unlock(); } kube.deleteCustomResource(resource); + logger.info("Delete resource : {}", resourceLabel); kube.createCustomResource(resource); + logger.info("Created job with name : {}", resourceLabel); } catch (IOException e) { throw new ServiceException(HttpStatus.INTERNAL_SERVER_ERROR, CONFIG_ERROR, e.getMessage()); } diff --git a/src/main/java/com/exactpro/th2/inframgr/docker/monitoring/DynamicResourceProcessor.java b/src/main/java/com/exactpro/th2/inframgr/docker/monitoring/DynamicResourceProcessor.java index 9499caf..c928557 100644 --- a/src/main/java/com/exactpro/th2/inframgr/docker/monitoring/DynamicResourceProcessor.java +++ b/src/main/java/com/exactpro/th2/inframgr/docker/monitoring/DynamicResourceProcessor.java @@ -132,15 +132,21 @@ private static void updateTrackedResources(String schema, @PostConstruct public void start() throws IOException { - Kubernetes kube = new Kubernetes(Config.getInstance().getKubernetes(), null); - RegistryCredentialLookup secretMapper = new RegistryCredentialLookup(kube); - RegistryConnection registryConnection = new RegistryConnection(secretMapper.getCredentials()); - RegistryWatcher registryWatcher = new RegistryWatcher( - REGISTRY_CHECK_INITIAL_DELAY_SECONDS, - REGISTRY_CHECK_PERIOD_SECONDS, - registryConnection - ); - registryWatcher.startWatchingRegistry(); - logger.info("DynamicResourceProcessor has been started"); + try { + Kubernetes kube = new Kubernetes(Config.getInstance().getKubernetes(), null); + RegistryCredentialLookup secretMapper = new RegistryCredentialLookup(kube); + RegistryConnection registryConnection = new RegistryConnection(secretMapper.getCredentials()); + RegistryWatcher registryWatcher = new RegistryWatcher( + REGISTRY_CHECK_INITIAL_DELAY_SECONDS, + REGISTRY_CHECK_PERIOD_SECONDS, + registryConnection + ); + registryWatcher.startWatchingRegistry(); + logger.info("DynamicResourceProcessor has been started"); + } catch (Exception e) { + logger.error("Exception while starting DynamicResourceProcessor. " + + "resources with dynamic versions will not be monitored", e); + throw e; + } } }