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 GAL-369, Introduce a System property to disable capability checks #356

Merged
merged 1 commit into from
Nov 12, 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
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2019 Red Hat, Inc. and/or its affiliates
* Copyright 2016-2024 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -72,6 +72,7 @@ private static boolean getBooleanProp(Map<String, String> props, String name, bo
private List<ResolvedFeature> orderedFeatures = Collections.emptyList();
private List<ResolvedFeature> independentBatchBranch = Collections.emptyList();
private List<ResolvedFeature> independentNonBatchBranch = Collections.emptyList();
private final boolean ignoreCapabilities;

DefaultBranchedConfigArranger(ConfigModelStack configStack) {
this.configStack = configStack;
Expand All @@ -83,6 +84,8 @@ private static boolean getBooleanProp(Map<String, String> props, String name, bo
branchIsBatch = getBooleanProp(configStack.props, ConfigModel.BRANCH_IS_BATCH, false);
isolateCircularDeps = getBooleanProp(configStack.props, ConfigModel.ISOLATE_CIRCULAR_DEPS, false);
mergeIndependentBranches = getBooleanProp(configStack.props, ConfigModel.MERGE_INDEPENDENT_BRANCHES, false);
// When analyzing incomplete configuration, capabilities can be missing and capability check be disabled.
ignoreCapabilities = Boolean.getBoolean("org.jboss.galleon.internal.ignore.capability.providers");
}

List<ResolvedFeature> orderFeatures() throws ProvisioningException {
Expand Down Expand Up @@ -626,7 +629,7 @@ private List<CircularRefInfo> orderCapabilityProviders(ResolvedFeature feature,
throws ProvisioningException {
for (CapabilitySpec capSpec : feature.spec.xmlSpec.getRequiredCapabilities()) {
final List<String> resolvedCaps = capResolver.resolve(capSpec, feature);
if (resolvedCaps.isEmpty()) {
if (resolvedCaps.isEmpty() || ignoreCapabilities) {
continue;
}
for (String resolvedCap : resolvedCaps) {
Expand Down
Loading