mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(logging): escape apostrophes in formatted diagnostics (#8776)
Java's MessageFormat reads a lone apostrophe as the start of a quoted section, so thirteen log patterns that used one in a word like "image's" printed their placeholders as literal text or lost the apostrophe. Each apostrophe is now doubled, so the warnings show their arguments again; the EKS legacy-state warning names the volume to pass to docker volume inspect. WarmPoolTest drops a cleanup stub that could go unused once the original stop finished, since the released latch's answer already serves any later stop. Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
aeba963c8a
commit
0dedd49f79
12 files changed
+13
-14
No files matched your search
@@ -485,7 +485,7 @@ public class ContainerLifecycleManager {
|
||||
copyIntoContainerDir(containerId, trustStore.get(), ContainerCaBundle.JAVA_TRUST_STORE_FILE_NAME);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Could not copy the Java trust store into container {0}, whose JVMs keep the image's trust"
|
||||
LOG.warnv("Could not copy the Java trust store into container {0}, whose JVMs keep the image''s trust"
|
||||
+ " store and will not trust Floci HTTPS: {1}", containerId, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ public class ContainerLifecycleManager {
|
||||
String[] env = imageConfig == null ? null : imageConfig.getEnv();
|
||||
return Optional.of(env == null ? List.of() : List.of(env));
|
||||
} catch (Exception e) {
|
||||
LOG.warnv("Could not read the environment of image {0}, so the JVMs in its container keep the image's"
|
||||
LOG.warnv("Could not read the environment of image {0}, so the JVMs in its container keep the image''s"
|
||||
+ " trust store and will not trust Floci HTTPS: {1}", resolvedImage, e.getMessage());
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class DockerDaemon {
|
||||
String os = dockerClient.infoCmd().exec().getOperatingSystem();
|
||||
return Optional.ofNullable(os).map(value -> value.toLowerCase(Locale.ROOT));
|
||||
} catch (Exception e) {
|
||||
LOG.debugv("Could not read the Docker daemon's operating system: {0}", e.getMessage());
|
||||
LOG.debugv("Could not read the Docker daemon''s operating system: {0}", e.getMessage());
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public class CertificateGenerator {
|
||||
// character, which the JDK rejects outright rather than resolving. Emitting it as a DNS
|
||||
// name keeps the name covered; dropping it would silently stop the server
|
||||
// serving that host, which fails a handshake with nothing to point at.
|
||||
LOG.debugv("Could not parse '{0}' as IP address, treating as DNS name", san);
|
||||
LOG.debugv("Could not parse ''{0}'' as IP address, treating as DNS name", san);
|
||||
return new GeneralName(GeneralName.dNSName, san);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public enum KeyAlgorithm {
|
||||
return alg;
|
||||
}
|
||||
}
|
||||
LOG.warnv("Unknown key algorithm '{0}', defaulting to RSA_2048", name);
|
||||
LOG.warnv("Unknown key algorithm ''{0}'', defaulting to RSA_2048", name);
|
||||
return RSA_2048;
|
||||
}
|
||||
}
|
||||
@@ -1714,7 +1714,7 @@ public class CloudFormationService implements ResourceProvider {
|
||||
current.resolveNodeOmittingNoValue(props));
|
||||
} catch (RuntimeException e) {
|
||||
LOG.warnv("Resolved create-only values of {0} ({1}) could not be compared; the update adds no "
|
||||
+ "replacement beyond the engine's own decision: {2}", logicalId, resourceType, e.getMessage());
|
||||
+ "replacement beyond the engine''s own decision: {2}", logicalId, resourceType, e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -793,7 +793,7 @@ public class Ec2ContainerManager {
|
||||
return version;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.debugv("Could not read the Docker host's kernel version: {0}", e.getMessage());
|
||||
LOG.debugv("Could not read the Docker host''s kernel version: {0}", e.getMessage());
|
||||
}
|
||||
LOG.warn("Docker host kernel version unknown; systemd guest launches without /lib/modules");
|
||||
return null;
|
||||
|
||||
@@ -1395,7 +1395,7 @@ public class Ec2Service implements ContainerTeardown, ResourceProvider, Resettab
|
||||
moved++;
|
||||
}
|
||||
}
|
||||
LOG.infov("Moved {0} EC2 tag record(s) under their resource's region; kept {1} for instances not yet"
|
||||
LOG.infov("Moved {0} EC2 tag record(s) under their resource''s region; kept {1} for instances not yet"
|
||||
+ " restored; dropped {2} whose resource no region holds", moved, kept, dropped);
|
||||
}
|
||||
|
||||
|
||||
@@ -1458,7 +1458,7 @@ public class EksClusterManager
|
||||
return configured;
|
||||
}
|
||||
LOG.warnv("floci.services.eks.node-instance-type {0} is absent from the EC2 catalog; sizing EKS nodes "
|
||||
+ "from their node group's instance type", configured.get());
|
||||
+ "from their node group''s instance type", configured.get());
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@@ -1743,7 +1743,7 @@ public class EksClusterManager
|
||||
LOG.warnv("EKS cluster {0} (account {1}) starts under its account-qualified Docker name; "
|
||||
+ "a pre-upgrade {2} named {3} survives but carries no verifiable owning account, "
|
||||
+ "so it is NOT adopted. If its data belongs to this cluster, copy it into the "
|
||||
+ "cluster's qualified volume manually (docker volume inspect {3}).",
|
||||
+ "cluster''s qualified volume manually (docker volume inspect {3}).",
|
||||
cluster.getName(), cluster.getAccountId(), kind, legacy);
|
||||
}
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ public class EmrServerlessService {
|
||||
throw new AwsException("InternalServerException", "The custom image " + imageUri
|
||||
+ " could not be resolved: " + e.getMessage(), 500);
|
||||
}
|
||||
LOG.infov("The custom image {0} has no digest in Floci's ECR ({1}), so each run resolves it: {2}",
|
||||
LOG.infov("The custom image {0} has no digest in Floci''s ECR ({1}), so each run resolves it: {2}",
|
||||
imageUri, e.getErrorCode(), e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public class WebIdentityTokenIssuer {
|
||||
key.setPublicKey(Base64.getEncoder().encodeToString(pair.getPublic().getEncoded()));
|
||||
key.setPrivateKey(Base64.getEncoder().encodeToString(pair.getPrivate().getEncoded()));
|
||||
AccountAwareStorageBackend.putInAccount(keyStore, accountId, algorithm.name(), key);
|
||||
LOG.debugv("Generated the account's {0} web identity token signing key", algorithm);
|
||||
LOG.debugv("Generated the account''s {0} web identity token signing key", algorithm);
|
||||
return key;
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
@@ -398,7 +398,7 @@ public class ContainerLauncher implements LambdaRuntimeLauncher {
|
||||
// Mount host AWS config into Lambda container (read-only) for SDK credential discovery
|
||||
awsConfigPath.ifPresent(hostPath -> {
|
||||
if (!Files.isDirectory(Path.of(hostPath))) {
|
||||
LOG.warnv("awsConfigPath '{0}' does not exist or is not a directory; "
|
||||
LOG.warnv("awsConfigPath ''{0}'' does not exist or is not a directory; "
|
||||
+ "Lambda containers may fail to discover credentials", hostPath);
|
||||
}
|
||||
specBuilder.withReadOnlyBind(hostPath, "/opt/aws-config");
|
||||
|
||||
@@ -271,7 +271,6 @@ class WarmPoolTest {
|
||||
} finally {
|
||||
releaseSlowStop.countDown();
|
||||
executor.shutdownNow();
|
||||
doNothing().when(containerLauncher).stop(slow);
|
||||
pool.afterReset();
|
||||
pool.shutdown();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user