Skip to content

Commit

Permalink
[fix][fn] Do not delete managed package when delete function (#18030)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng authored Nov 9, 2022
1 parent 641887c commit ef5346b
Showing 1 changed file with 7 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -524,21 +524,13 @@ private void deleteComponentFromStorage(String tenant, String namespace, String
String functionPackagePath) {
if (!functionPackagePath.startsWith(Utils.HTTP)
&& !functionPackagePath.startsWith(Utils.FILE)
&& !functionPackagePath.startsWith(Utils.BUILTIN)) {
if (worker().getWorkerConfig().isFunctionsWorkerEnablePackageManagement()) {
try {
worker().getBrokerAdmin().packages().delete(functionPackagePath);
} catch (PulsarAdminException e) {
log.error("{}/{}/{} Failed to cleanup package in package management with url {}", tenant,
namespace, componentName, functionPackagePath, e);
}
} else {
try {
WorkerUtils.deleteFromBookkeeper(worker().getDlogNamespace(), functionPackagePath);
} catch (IOException e) {
log.error("{}/{}/{} Failed to cleanup package in BK with path {}", tenant, namespace, componentName,
functionPackagePath, e);
}
&& !functionPackagePath.startsWith(Utils.BUILTIN)
&& !worker().getWorkerConfig().isFunctionsWorkerEnablePackageManagement()) {
try {
WorkerUtils.deleteFromBookkeeper(worker().getDlogNamespace(), functionPackagePath);
} catch (IOException e) {
log.error("{}/{}/{} Failed to cleanup package in BK with path {}", tenant, namespace, componentName,
functionPackagePath, e);
}

}
Expand Down

0 comments on commit ef5346b

Please sign in to comment.