Skip to content

Commit

Permalink
[PLAT-14532] Import Local Release will now try to process all releases.
Browse files Browse the repository at this point in the history
Summary:
We want to ensure we process every local release, and don't error out early if we
see an issue with a local file (such as name validation, or an artifact of that type already
existing).

Test Plan:
Tested bad imports to make sure they are still processed
itest

Reviewers: muthu, anijhawan, sanketh

Reviewed By: sanketh

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D36304
  • Loading branch information
shubin-yb committed Jul 3, 2024
1 parent b8fedf6 commit 65145f6
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions managed/src/main/java/com/yugabyte/yw/common/ReleaseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,26 @@ public synchronized void importLocalReleases() {
getPackageFilter(
"glob:**yugabyte*{centos,alma,linux,el}*{x86_64,aarch64}.tar.gz"))
.filter(p -> !currentFilePaths.contains(p.toString())) // Filter files already known
.forEach(p -> createLocalRelease(p));
.forEach(
p -> {
try {
createLocalRelease(p);
} catch (Exception e) {
log.warn("failed to add local release", e);
}
});
// helm charts
Files.walk(Paths.get(ybReleasesPath))
.filter(ybChartFilter)
.filter(p -> !currentFilePaths.contains(p.toString())) // Filter files already known
.forEach(p -> createLocalRelease(p));
.forEach(
p -> {
try {
createLocalRelease(p);
} catch (Exception e) {
log.warn("failed to add local release", e);
}
});
} catch (Exception e) {
log.error("failed to read local releases", e);
}
Expand Down Expand Up @@ -732,7 +746,18 @@ private void createLocalRelease(Path p) {
if (release == null) {
release = Release.create(metadata.version, metadata.release_type, metadata.releaseTag);
}
release.addArtifact(artifact);
try {
release.addArtifact(artifact);
} catch (PlatformServiceException e) {
log.warn(
"release {} already has package {}:{}({}), skipping add of local file {}",
release.getVersion(),
artifact.getPlatform(),
artifact.getArchitecture(),
artifact.getArtifactUUID(),
p.toString());
throw e;
}
}

private void importLocalLegacyReleases(
Expand Down

0 comments on commit 65145f6

Please sign in to comment.