Skip to content
Snippets Groups Projects
Commit 18d2945b authored by Joshua David Akers's avatar Joshua David Akers
Browse files

Merge branch 'PLATFORM-2172-webhook' into 'main'

PLATFORM-2172 - webhook, api version

See merge request !37
parents 2ff7400e 29ec9b19
1 merge request!37PLATFORM-2172 - webhook, api version
Pipeline #1001144 failed with stages
in 1 minute and 56 seconds
......@@ -5,7 +5,7 @@ const Util = require("../util");
const WEBHOOK_SYNCED_ANNOTATION = "platform.it.vt.edu/webhook-synced";
const PROJECT_PATH_ANNOTATION = "platform.it.vt.edu/webhook-sync-project";
const API_GROUP = "notification.toolkit.fluxcd.io";
const API_VERSION = "v1beta1";
const API_VERSION = "v1";
const KIND_PLURAL = "receivers";
function WebhookSyncer(k8sClient, webhookBaseUrl, gitLabClient) {
......@@ -42,7 +42,7 @@ WebhookSyncer.prototype.onEvent = async function (eventType, receiver) {
if (eventType !== "DELETED" && receiver.metadata.annotations && receiver.metadata.annotations[WEBHOOK_SYNCED_ANNOTATION]) return;
if (!receiver.status || !receiver.status.webhookPath) {
return logger.warn(`Receiver ${receiver.metadata.name} doesn't have status or is missing webhookPath.`);
return logger.warn(`Receiver ${receiver.metadata.name} doesn't have status or is missing webhookPath. status: ${receiver.status}`);
}
if (receiver.spec.resources.length !== 1) {
......
{
"apiVersion": "notification.toolkit.fluxcd.io/v1beta2",
"apiVersion": "notification.toolkit.fluxcd.io/v1",
"kind": "Receiver",
"metadata": {
"annotations": {
......@@ -20,7 +20,7 @@
],
"resources": [
{
"apiVersion": "source.toolkit.fluxcd.io/v1beta1",
"apiVersion": "source.toolkit.fluxcd.io/v1",
"kind": "GitRepository",
"name": "test"
}
......
......@@ -112,7 +112,7 @@ describe("event handling", () => {
expect(k8sClient.getSecretData).toHaveBeenCalled();
expect(k8sClient.getCustomResource).toHaveBeenCalledWith(
"source.toolkit.fluxcd.io",
"v1beta1",
"v1",
"gitrepositories",
"test"
);
......@@ -125,7 +125,7 @@ describe("event handling", () => {
expect(k8sClient.addAnnotationsToCustomObject).toHaveBeenCalledWith(
"notification.toolkit.fluxcd.io",
"v1beta1",
"v1",
"receivers",
"test",
"325926",
......@@ -149,7 +149,7 @@ describe("event handling", () => {
expect(k8sClient.addAnnotationsToCustomObject).toHaveBeenCalledWith(
"notification.toolkit.fluxcd.io",
"v1beta1",
"v1",
"receivers",
"test",
"325926",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment