Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue #72, Provisioning to OpenShift fails when using Microprofile GraphQL layer #73

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,14 @@ static final String generateValidName(String name) {
}
}
}
String ret = validName.toString();
if (ret.length() > 63) {
ret = ret.substring(0, 63);
return truncateValue(validName.toString());
}

private static String truncateValue(String val) {
if (val.length() > 63) {
val = val.substring(0, 63);
}
return ret;
return val;
}

public static void deploy(List<Path> deployments,
Expand Down Expand Up @@ -511,7 +514,7 @@ private static String bytesToHex(byte[] hash) {

private static Map<String, String> createCommonLabels(OpenShiftConfiguration osConfig) throws Exception {
Map<String, String> labels = new HashMap<>();
labels.put(osConfig.getLabelRadical(), "");
labels.put(truncateValue(osConfig.getLabelRadical()), "");
return labels;
}

Expand All @@ -526,10 +529,10 @@ private static Map<String, String> createServerImageLabels(Path target, Path pro
GalleonProvisioningConfig config = provider.newProvisioningBuilder(provisioning).setInstallationHome(dir).build().loadProvisioningConfig(provisioning);
GalleonConfigurationWithLayers cl = config.getDefinedConfig(new ConfigId("standalone", "standalone.xml"));
for (String s : cl.getIncludedLayers()) {
labels.put(osConfig.getLabelRadical() + ".layer." + s, "");
labels.put(truncateValue(osConfig.getLabelRadical() + ".layer." + s), "");
}
for (String s : cl.getExcludedLayers()) {
labels.put(osConfig.getLabelRadical() + ".excluded.layer." + s, "");
labels.put(truncateValue(osConfig.getLabelRadical() + ".excluded.layer." + s), "");
}
for (GalleonFeaturePackConfig gfpc : config.getFeaturePackDeps()) {
if (fps.length() != 0) {
Expand All @@ -542,12 +545,12 @@ private static Map<String, String> createServerImageLabels(Path target, Path pro
producerName = producerName.substring(i + 1);
}
producerName = producerName.replaceAll(":", "-");
labels.put(osConfig.getLabelRadical() + ".feature-pack." + producerName, gfpc.getLocation().getBuild());
labels.put(truncateValue(osConfig.getLabelRadical() + producerName), gfpc.getLocation().getBuild());
}
}

for (Entry<String, String> entry : serverImageBuildLabels.entrySet()) {
labels.put(entry.getKey(), entry.getValue());
labels.put(truncateValue(entry.getKey()), truncateValue(entry.getValue()));
}
labels.putAll(createCommonLabels(osConfig));
return labels;
Expand Down
Loading