Skip to content

Commit

Permalink
chore: use kfc WatchPhase type
Browse files Browse the repository at this point in the history
  • Loading branch information
rjferguson21 committed Sep 19, 2024
1 parent 1434b92 commit 25a81a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/pepr/operator/controllers/exemptions/exemptions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { beforeEach, describe, expect, it } from "@jest/globals";
import { WatchPhase } from "kubernetes-fluent-client/dist/fluent/types";
import { MatcherKind, Policy } from "../../crd";
import { Exemption } from "../../crd/generated/exemption-v1alpha1";
import { ExemptionStore } from "./exemption-store";
import { WatchPhase, processExemptions } from "./exemptions";
import { processExemptions } from "./exemptions";


const enforcerMatcher = {
namespace: "neuvector",
Expand Down
9 changes: 1 addition & 8 deletions src/pepr/operator/controllers/exemptions/exemptions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { WatchPhase } from "kubernetes-fluent-client/dist/fluent/types";
import { UDSExemption } from "../../crd";
import { ExemptionStore } from "./exemption-store";

export enum WatchPhase {
Added = "ADDED",
Modified = "MODIFIED",
Deleted = "DELETED",
Bookmark = "BOOKMARK",
Error = "ERROR",
}

// Handle adding, updating, and deleting exemptions from Policymap
export function processExemptions(exemption: UDSExemption, phase: WatchPhase) {
switch (phase) {
Expand Down

0 comments on commit 25a81a6

Please sign in to comment.