private void recreateSystemContainer(ContainerState containerState, String containerHostLink) { logFine("recreate system container %s", containerState.documentSelfLink); deleteSystemContainer(containerState, (o, error) -> { if (error) { logSevere("Failure deleting system container."); } else { if (o.customProperties != null) { String systemContainerName = o.customProperties.get(SYSTEM_CONTAINER_NAME); installSystemContainerToHost(containerHostLink, systemContainerName, null); } } }, null); }
logFine("Host container list callback invoked for host [%s] with container IDs: %s", containerHostLink, body.containerIdsAndNames.keySet()); Instant.now().isBefore(Instant.ofEpochMilli( (state.containerHostLinks.get(containerHostLink))))) { logFine("Host container list callback for host [%s] with container IDs: %s skipped," + " another instance is active", containerHostLink, body.containerIdsAndNames.keySet());
private void createDiscoveredContainerDescription(ContainerState containerState) { logFine("Creating ContainerDescription for discovered container: %s", containerState.id); ContainerDescription containerDesc = ContainerUtil .createContainerDescription(containerState); sendRequest(OperationUtil .createForcedPost(this, ContainerDescriptionService.FACTORY_LINK) .setBodyNoCloning(containerDesc) .setCompletion((o, ex) -> { if (ex != null) { logSevere("Failed to create ContainerDescription for discovered container" + " (id=%s): %s", containerState.id, ex.getMessage()); } else { logInfo("Created ContainerDescription for discovered container: %s", containerState.id); } })); }
logWarning("Failed to retrieve containers for host: %s", containerHostLink); } else { logFine("Found %s containers for container host: %s", String.valueOf(r.getCount()), containerHostLink); state.customProperties.put(
private BiConsumer<CallbackServiceHandlerState, Boolean> createSystemContainerReadyHandler( ContainerState container) { return (o, error) -> { if (error) { logSevere("Failure creating system container."); } else { // Upload trusted self-signed registry certificates to host logFine("Distribute certificates for host %s", container.parentLink); HostConfigCertificateDistributionState distState = new HostConfigCertificateDistributionState(); distState.hostLink = container.parentLink; distState.tenantLinks = container.tenantLinks; sendRequest(Operation .createPost(this, HostConfigCertificateDistributionService.SELF_LINK) .setBodyNoCloning(distState)); // Import agent SSL certificate importAgentSslCertificate(container, null, SYSTEM_CONTAINER_SSL_RETRIES_COUNT); } }; }
@Override public void handlePut(Operation put) { if (put.hasPragmaDirective(Operation.PRAGMA_DIRECTIVE_POST_TO_PUT)) { logFine("Ignoring converted PUT."); put.complete(); return; } if (!checkForBody(put)) { return; } HostContainerListDataCollectionState putBody = put .getBody(HostContainerListDataCollectionState.class); this.setState(put, putBody); put.setBodyNoCloning(putBody).complete(); }
private void createDiscoveredContainer(Consumer<Throwable> callback, AtomicInteger counter, ContainerState containerState) { logFine("Creating ContainerState for discovered container: %s", containerState.id); URI containerFactoryUri = UriUtils.buildUri(getHost(), ContainerFactoryService.class);
logFine("start existing system container %s", containerState.documentSelfLink); startSystemContainer(containerState, null);
.setCompletion((o, ex) -> { if (o.getStatusCode() == Operation.STATUS_CODE_NOT_FOUND) { logFine("Container %s not found to be marked as missing.", containerState.documentSelfLink); } else if (ex != null) {
return; logFine("Patch the state from provisioning to running of system" + " container state on host %s", containerHostLink); }));
logFine("Import SSL certificate for system container %s", container.documentSelfLink);