Skip to content

Commit

Permalink
revert: remove guessing of provider URL since it's potentially dangerous
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <claprun@redhat.com>
  • Loading branch information
metacosm committed Mar 19, 2024
1 parent e6bc310 commit 52b9884
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ CSVMetadataBuildItem gatherCSVMetadata(KubernetesConfig kubernetesConfig,

final var defaultReplaces = bundleConfiguration.replaces.orElse(null);

final var defaultProviderURL = getDefaultProviderURLFromSCMInfo(appConfiguration, jarBuildItem);
final var sharedMetadataHolders = getSharedMetadataHolders(defaultName, defaultVersion, defaultReplaces, index,
defaultProviderURL);
final var sharedMetadataHolders = getSharedMetadataHolders(defaultName, defaultVersion, defaultReplaces, index);
final var csvGroups = new HashMap<CSVMetadataHolder, List<ReconcilerAugmentedClassInfo>>();

ClassUtils.getKnownReconcilers(index, log)
Expand Down Expand Up @@ -121,7 +119,7 @@ CSVMetadataBuildItem gatherCSVMetadata(KubernetesConfig kubernetesConfig,
}
csvMetadata = createMetadataHolder(csvMetadataAnnotation,
new CSVMetadataHolder(sharedMetadataName, defaultVersion, defaultReplaces,
DEFAULT_PROVIDER_NAME, defaultProviderURL, origin));
DEFAULT_PROVIDER_NAME, origin));
if (DEFAULT_PROVIDER_NAME.equals(csvMetadata.providerName)) {
log.warnv(
"It is recommended that you provide a provider name provided for {0}: ''{1}'' was used as default value.",
Expand Down Expand Up @@ -298,8 +296,8 @@ void generateBundle(ApplicationInfoBuildItem configuration,
}

private Map<String, CSVMetadataHolder> getSharedMetadataHolders(String name, String version, String defaultReplaces,
IndexView index, String vcsUrl) {
CSVMetadataHolder csvMetadata = new CSVMetadataHolder(name, version, defaultReplaces, vcsUrl, DEFAULT_PROVIDER_NAME,
IndexView index) {
CSVMetadataHolder csvMetadata = new CSVMetadataHolder(name, version, defaultReplaces, DEFAULT_PROVIDER_NAME,
"default");
final var sharedMetadataImpls = index.getAllKnownImplementors(SHARED_CSV_METADATA);
final var result = new HashMap<String, CSVMetadataHolder>(sharedMetadataImpls.size() + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public void shouldWriteBundleEvenWhenCsvMetadataIsNotUsed() throws IOException {
// by default, we shouldn't output the version label in the selector match labels as the default controlling this should be overridden by KubernetesLabelConfigOverrider
assertNull(deployment.getSpec().getSelector().getMatchLabels().get("app.kubernetes.io/version"));
assertEquals(System.getProperty("user.name"), csv.getSpec().getProvider().getName());
assertNotNull(csv.getSpec().getProvider().getUrl());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ public RequiredCRD(String kind, String name, String version) {

}

public CSVMetadataHolder(String bundleName, String version, String replaces, String providerName, String providerURL,
String origin) {
this(bundleName, null, null, null, null, null, providerName, providerURL, replaces, null, version, null, null, null,
public CSVMetadataHolder(String bundleName, String version, String replaces, String providerName, String origin) {
this(bundleName, null, null, null, null, null, providerName, null, replaces, null, version, null, null, null,
null, null,
null, null,
null,
Expand Down

0 comments on commit 52b9884

Please sign in to comment.