Skip to content

Commit

Permalink
chore: use kfc WatchPhase enum (#787)
Browse files Browse the repository at this point in the history
## Description
Noticed we were redefining WatchPhase enum

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor
Guide](https://github.com/defenseunicorns/uds-template-capability/blob/main/CONTRIBUTING.md)
followed

Co-authored-by: Micah Nagel <[email protected]>
  • Loading branch information
rjferguson21 and mjnagel authored Sep 20, 2024
1 parent c24e833 commit df4d2da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/pepr/operator/controllers/exemptions/exemptions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
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 df4d2da

Please sign in to comment.