From 0fa8dd8efca765ef6ae753991014c28ce777d890 Mon Sep 17 00:00:00 2001 From: Steven Borrelli Date: Fri, 6 Feb 2026 16:43:52 -0600 Subject: [PATCH] remove annotations Signed-off-by: Steven Borrelli --- src/function.ts | 6 ------ src/test-helpers.ts | 22 ---------------------- test-cases/example.yaml | 2 -- 3 files changed, 30 deletions(-) diff --git a/src/function.ts b/src/function.ts index 1f95cf2..a08b064 100644 --- a/src/function.ts +++ b/src/function.ts @@ -94,7 +94,6 @@ export class Function implements FunctionHandler { ...commonMetadata, name: serviceAccountConfig.name || name, annotations: { - 'crossplane.io/composition-resource-name': 'serviceaccount', ...(serviceAccountConfig.annotations || {}), }, }, @@ -111,9 +110,6 @@ export class Function implements FunctionHandler { const service = new Service({ metadata: { ...commonMetadata, - annotations: { - 'crossplane.io/composition-resource-name': 'service', - }, }, spec: { type: serviceConfig.type || 'ClusterIP', @@ -141,7 +137,6 @@ export class Function implements FunctionHandler { metadata: { ...commonMetadata, annotations: { - 'crossplane.io/composition-resource-name': 'deployment', ...(deploymentConfig.podAnnotations || {}), }, }, @@ -227,7 +222,6 @@ export class Function implements FunctionHandler { metadata: { ...commonMetadata, annotations: { - 'crossplane.io/composition-resource-name': 'ingress', ...(ingressConfig.annotations || {}), }, }, diff --git a/src/test-helpers.ts b/src/test-helpers.ts index 62cc71e..37a8a96 100644 --- a/src/test-helpers.ts +++ b/src/test-helpers.ts @@ -355,32 +355,10 @@ export function assertResourceTypes(response: RunFunctionResponse, expectedTypes } } -/** - * Assert that all resources have the crossplane.io/composition-resource-name annotation - */ -export function assertCompositionResourceNames(response: RunFunctionResponse) { - const desiredResources = response.desired?.resources || {}; - - for (const [key, resource] of Object.entries(desiredResources)) { - const resourceData = resource?.resource as KubernetesResource | undefined; - const metadata = resourceData?.metadata as KubernetesMetadata | undefined; - const compositionResourceName = - metadata?.annotations?.['crossplane.io/composition-resource-name']; - - if (!compositionResourceName) { - throw new Error( - `Resource '${key}' is missing required annotation 'crossplane.io/composition-resource-name'` - ); - } - } -} - /** * Run all assertions for a test case */ export function assertTestCase(response: RunFunctionResponse, testCase: TestCase) { - // Always assert that all resources have composition-resource-name annotation - assertCompositionResourceNames(response); if (testCase.expected.resources) { assertResources(response, testCase.expected.resources); diff --git a/test-cases/example.yaml b/test-cases/example.yaml index 4465e65..51fb67b 100644 --- a/test-cases/example.yaml +++ b/test-cases/example.yaml @@ -21,8 +21,6 @@ expected: app.kubernetes.io/name: hello-app app.kubernetes.io/instance: hello-app app.kubernetes.io/managed-by: crossplane - annotations: - crossplane.io/composition-resource-name: serviceaccount automountServiceAccountToken: true service: