Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: defenseunicorns/pepr
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.20.3
Choose a base ref
...
head repository: defenseunicorns/pepr
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.21.0
Choose a head ref
  • 2 commits
  • 7 files changed
  • 2 contributors

Commits on Dec 29, 2023

  1. chore: bump the production-dependencies group with 2 updates (#452)

    Bumps the production-dependencies group with 2 updates:
    [pino](https://github.com/pinojs/pino) and
    [pino-pretty](https://github.com/pinojs/pino-pretty).
    
    Updates `pino` from 8.17.1 to 8.17.2
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/pinojs/pino/releases">pino's
    releases</a>.</em></p>
    <blockquote>
    <h2>v8.17.2</h2>
    <h2>What's Changed</h2>
    <ul>
    <li>build(deps): bump process-warning from 2.3.2 to 3.0.0 by <a
    href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
    href="https://redirect.github.com/pinojs/pino/pull/1869">pinojs/pino#1869</a></li>
    <li>fix: type of child logger with custom levels by <a
    href="https://github.com/UndefinedBehaviour"><code>@​UndefinedBehaviour</code></a>
    in <a
    href="https://redirect.github.com/pinojs/pino/pull/1871">pinojs/pino#1871</a></li>
    </ul>
    <p><strong>Full Changelog</strong>: <a
    href="https://github.com/pinojs/pino/compare/v8.17.1...v8.17.2">https://github.com/pinojs/pino/compare/v8.17.1...v8.17.2</a></p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/pinojs/pino/commit/6539b5c18fff59cfc0e191d1c31843dd8a32cc9e"><code>6539b5c</code></a>
    Bumped v8.17.2</li>
    <li><a
    href="https://github.com/pinojs/pino/commit/44d06c84985da722cce80c0032b850acd8bb60e1"><code>44d06c8</code></a>
    fix: type of child logger with custom levels (<a
    href="https://redirect.github.com/pinojs/pino/issues/1871">#1871</a>)</li>
    <li><a
    href="https://github.com/pinojs/pino/commit/05b70e4a41ff06dc6406bfa7b72dd7eea32de850"><code>05b70e4</code></a>
    build(deps): bump process-warning from 2.3.2 to 3.0.0 (<a
    href="https://redirect.github.com/pinojs/pino/issues/1869">#1869</a>)</li>
    <li>See full diff in <a
    href="https://github.com/pinojs/pino/compare/v8.17.1...v8.17.2">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    Updates `pino-pretty` from 10.3.0 to 10.3.1
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/pinojs/pino-pretty/releases">pino-pretty's
    releases</a>.</em></p>
    <blockquote>
    <h2>v10.3.1</h2>
    <h2>What's Changed</h2>
    <ul>
    <li>Bump tsd from 0.29.0 to 0.30.0 by <a
    href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
    href="https://redirect.github.com/pinojs/pino-pretty/pull/483">pinojs/pino-pretty#483</a></li>
    <li>Add build function export in type define file. by <a
    href="https://github.com/jaredhan418"><code>@​jaredhan418</code></a> in
    <a
    href="https://redirect.github.com/pinojs/pino-pretty/pull/484">pinojs/pino-pretty#484</a></li>
    </ul>
    <h2>New Contributors</h2>
    <ul>
    <li><a
    href="https://github.com/jaredhan418"><code>@​jaredhan418</code></a>
    made their first contribution in <a
    href="https://redirect.github.com/pinojs/pino-pretty/pull/484">pinojs/pino-pretty#484</a></li>
    </ul>
    <p><strong>Full Changelog</strong>: <a
    href="https://github.com/pinojs/pino-pretty/compare/v10.3.0...v10.3.1">https://github.com/pinojs/pino-pretty/compare/v10.3.0...v10.3.1</a></p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/pinojs/pino-pretty/commit/9d89a596f492eb2efee1632f54be9bc9b93356f4"><code>9d89a59</code></a>
    Bumped v10.3.1</li>
    <li><a
    href="https://github.com/pinojs/pino-pretty/commit/2286bde5d9eae2f31aaeea086cfb184d95877e19"><code>2286bde</code></a>
    Add build function export in type define file. (<a
    href="https://redirect.github.com/pinojs/pino-pretty/issues/484">#484</a>)</li>
    <li><a
    href="https://github.com/pinojs/pino-pretty/commit/88610aa707256764a4e70d2d84290643e2bfa22a"><code>88610aa</code></a>
    Bump tsd from 0.29.0 to 0.30.0 (<a
    href="https://redirect.github.com/pinojs/pino-pretty/issues/483">#483</a>)</li>
    <li>See full diff in <a
    href="https://github.com/pinojs/pino-pretty/compare/v10.3.0...v10.3.1">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore <dependency name> major version` will close this
    group update PR and stop Dependabot creating any more for the specific
    dependency's major version (unless you unignore this specific
    dependency's major version or upgrade to it yourself)
    - `@dependabot ignore <dependency name> minor version` will close this
    group update PR and stop Dependabot creating any more for the specific
    dependency's minor version (unless you unignore this specific
    dependency's minor version or upgrade to it yourself)
    - `@dependabot ignore <dependency name>` will close this group update PR
    and stop Dependabot creating any more for the specific dependency
    (unless you unignore this specific dependency or upgrade to it yourself)
    - `@dependabot unignore <dependency name>` will remove all of the ignore
    conditions of the specified dependency
    - `@dependabot unignore <dependency name> <ignore condition>` will
    remove the ignore condition of the specified dependency and ignore
    conditions
    
    
    </details>
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Dec 29, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f3ce975 View commit details

Commits on Jan 1, 2024

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d54f4fb View commit details
Showing with 324 additions and 123 deletions.
  1. +67 −67 package-lock.json
  2. +3 −3 package.json
  3. +2 −2 src/lib/controller/index.ts
  4. +3 −3 src/lib/controller/store.ts
  5. +5 −1 src/lib/module.ts
  6. +159 −35 src/lib/watch-processor.test.ts
  7. +85 −12 src/lib/watch-processor.ts
134 changes: 67 additions & 67 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -32,9 +32,9 @@
"@types/ramda": "0.29.9",
"express": "4.18.2",
"fast-json-patch": "3.1.1",
"kubernetes-fluent-client": "1.10.0",
"pino": "8.17.1",
"pino-pretty": "10.3.0",
"kubernetes-fluent-client": "2.0.1",
"pino": "8.17.2",
"pino-pretty": "10.3.1",
"prom-client": "15.1.0",
"ramda": "0.29.1"
},
4 changes: 2 additions & 2 deletions src/lib/controller/index.ts
Original file line number Diff line number Diff line change
@@ -45,12 +45,12 @@ export class Controller {
this.#capabilities = capabilities;

// Initialize the Pepr store for each capability
new PeprControllerStore(config, capabilities, `pepr-${config.uuid}-store`, () => {
new PeprControllerStore(capabilities, `pepr-${config.uuid}-store`, () => {
this.#bindEndpoints();
onReady && onReady();
Log.info("✅ Controller startup complete");
// Initialize the schedule store for each capability
new PeprControllerStore(config, capabilities, `pepr-${config.uuid}-schedule`, () => {
new PeprControllerStore(capabilities, `pepr-${config.uuid}-schedule`, () => {
Log.info("✅ Scheduling processed");
});
});
6 changes: 3 additions & 3 deletions src/lib/controller/store.ts
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ import { startsWith } from "ramda";
import { Capability } from "../capability";
import { PeprStore } from "../k8s";
import Log from "../logger";
import { ModuleConfig } from "../module";
import { DataOp, DataSender, DataStore, Storage } from "../storage";

const namespace = "pepr-system";
@@ -20,7 +19,7 @@ export class PeprControllerStore {
#sendDebounce: NodeJS.Timeout | undefined;
#onReady?: () => void;

constructor(config: ModuleConfig, capabilities: Capability[], name: string, onReady?: () => void) {
constructor(capabilities: Capability[], name: string, onReady?: () => void) {
this.#onReady = onReady;

// Setup Pepr State bindings
@@ -71,7 +70,8 @@ export class PeprControllerStore {
}

#setupWatch = () => {
void K8s(PeprStore, { name: this.#name, namespace }).Watch(this.#receive);
const watcher = K8s(PeprStore, { name: this.#name, namespace }).Watch(this.#receive);
watcher.start().catch(e => Log.error(e, "Error starting Pepr store watch"));
};

#receive = (store: PeprStore) => {
6 changes: 5 additions & 1 deletion src/lib/module.ts
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ import { ValidateError } from "./errors";
import { AdmissionRequest, MutateResponse, ValidateResponse, WebhookIgnore } from "./k8s";
import { CapabilityExport } from "./types";
import { setupWatch } from "./watch-processor";
import { Log } from "../lib";

/** Global configuration for the Pepr runtime. */
export type ModuleConfig = {
@@ -102,7 +103,10 @@ export class PeprModule {
this.#controller = new Controller(config, capabilities, opts.beforeHook, opts.afterHook, () => {
// Wait for the controller to be ready before setting up watches
if (isWatchMode() || isDevMode()) {
setupWatch(capabilities);
setupWatch(config.uuid, capabilities).catch(e => {
Log.error(e, "Error setting up watch");
process.exit(1);
});
}
});

Loading