diff --git a/src/syncers/webhookSyncer.js b/src/syncers/webhookSyncer.js index ca5121ae85accc8b3b2906ea6016f35b5edd1227..0ef47d4f93c6c5ab7adb637d6b59aa0c3deb191e 100644 --- a/src/syncers/webhookSyncer.js +++ b/src/syncers/webhookSyncer.js @@ -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) { diff --git a/test/syncers/events/receiver.json b/test/syncers/events/receiver.json index 016db8b1244fb36a9d1ca0aca389e9b522cf16aa..87dc0b4245f94a9cc0dd4b565937023abb9c5cb6 100644 --- a/test/syncers/events/receiver.json +++ b/test/syncers/events/receiver.json @@ -1,5 +1,5 @@ { - "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" } diff --git a/test/syncers/webhookSyncer.spec.js b/test/syncers/webhookSyncer.spec.js index 57a9c12cc50f4b66c2ca06cf81e86eb416c6649d..3497d78f5479b6e53c31731ac353c4b5001e56f4 100644 --- a/test/syncers/webhookSyncer.spec.js +++ b/test/syncers/webhookSyncer.spec.js @@ -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",