Skip to content

Commit c14e5ad

Browse files
committed
chore: peprstore cleanup
1 parent b2c4e62 commit c14e5ad

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uds-core",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"description": "A collection of capabilities for UDS Core",
55
"keywords": [
66
"pepr",

pepr.ts

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import cfg from "./package.json";
44

55
import { istio } from "./src/pepr/istio";
66
import { operator } from "./src/pepr/operator";
7+
import { Policy } from "./src/pepr/operator/crd";
78
import { registerCRDs } from "./src/pepr/operator/crd/register";
89
import { policies, startExemptionWatch } from "./src/pepr/policies";
910
import { prometheus } from "./src/pepr/prometheus";
@@ -26,6 +27,15 @@ import { prometheus } from "./src/pepr/prometheus";
2627
// Prometheus monitoring stack
2728
prometheus,
2829
]);
30+
// Remove legacy policy entries from the pepr store for the 0.5.0 upgrade
31+
if (process.env.PEPR_WATCH_MODE === "true" && cfg.version === "0.5.0") {
32+
Log.debug("Clearing legacy pepr store exemption entries...");
33+
policies.Store.onReady(() => {
34+
for (const p of Object.values(Policy)) {
35+
policies.Store.removeItem(p);
36+
}
37+
});
38+
}
2939
})().catch(err => {
3040
Log.error(err);
3141
process.exit(1);

0 commit comments

Comments
 (0)