From 5321bc4e39e9c41c4aa08ad230e9978e8da3cd1b Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 22 May 2026 09:27:01 +0100 Subject: [PATCH 1/3] Bump SDK version Signed-off-by: liamfallon --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b0a42ca557..670a59d58e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/go-containerregistry v0.21.6 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 - github.com/kptdev/krm-functions-sdk/go/fn v1.0.2 + github.com/kptdev/krm-functions-sdk/go/fn v1.0.3 github.com/otiai10/copy v1.14.1 github.com/philopon/go-toposort v0.0.0-20170620085441-9be86dbd762f github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 8b32c380e9..1b2e9b4356 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= -github.com/kptdev/krm-functions-sdk/go/fn v1.0.2 h1:g9N6SW5axEXMagUbHliH14XpfvvvwkAVDLcN3ApVh2M= -github.com/kptdev/krm-functions-sdk/go/fn v1.0.2/go.mod h1:NSfdmtQ9AwNg5wdS9gE/H9SQs7Vomzq7E7N9hyEju1U= +github.com/kptdev/krm-functions-sdk/go/fn v1.0.3 h1:Gmkqbc2cbwJxamVoRSs409TZinuNGZaMYmNmlQcF6Bs= +github.com/kptdev/krm-functions-sdk/go/fn v1.0.3/go.mod h1:+MgNIVQMGs6WcNhQZYIbgFINnmskX8VMYcUvJBtE01M= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= From 78be3790c06a8046e9a2d998c3d34a6f1f301423 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 22 May 2026 17:20:29 +0100 Subject: [PATCH 2/3] Added input for test to fix test Signed-off-by: liamfallon --- pkg/fn/runtime/container_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/fn/runtime/container_test.go b/pkg/fn/runtime/container_test.go index ad523cfdd6..5522ad9b63 100644 --- a/pkg/fn/runtime/container_test.go +++ b/pkg/fn/runtime/container_test.go @@ -38,6 +38,7 @@ func TestContainerFn(t *testing.T) { { name: "no-op function", image: "ghcr.io/kptdev/krm-functions-catalog/no-op:latest", + input: "apiVersion: v1\nkind: ResourceList\nmetadata:\n name: input\nitems: []\n", output: "apiVersion: v1\nkind: ResourceList\nmetadata:\n name: output\nitems: []\n", }, { From 5390158915beba8b87cc63bbaab732fadf90564e Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 25 May 2026 07:21:29 +0100 Subject: [PATCH 3/3] Fix no-op test Signed-off-by: liamfallon --- pkg/fn/runtime/container_test.go | 42 +++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/pkg/fn/runtime/container_test.go b/pkg/fn/runtime/container_test.go index 5522ad9b63..8495696d3b 100644 --- a/pkg/fn/runtime/container_test.go +++ b/pkg/fn/runtime/container_test.go @@ -36,10 +36,44 @@ func TestContainerFn(t *testing.T) { err bool }{ { - name: "no-op function", - image: "ghcr.io/kptdev/krm-functions-catalog/no-op:latest", - input: "apiVersion: v1\nkind: ResourceList\nmetadata:\n name: input\nitems: []\n", - output: "apiVersion: v1\nkind: ResourceList\nmetadata:\n name: output\nitems: []\n", + name: "no-op function", + image: "ghcr.io/kptdev/krm-functions-catalog/no-op:latest", + input: `apiVersion: config.kubernetes.io/v1 +kind: ResourceList +items: + - apiVersion: apps/v1 + kind: Deployment + metadata: + name: nginx-deployment + annotations: + internal.config.kubernetes.io/index: '0' + internal.config.kubernetes.io/path: 'deployment.yaml' + - apiVersion: v1 + kind: Service + metadata: + name: nginx-svc + annotations: + internal.config.kubernetes.io/index: '0' + internal.config.kubernetes.io/path: 'svc.yaml' +`, + output: `apiVersion: config.kubernetes.io/v1 +kind: ResourceList +items: +- apiVersion: apps/v1 + kind: Deployment + metadata: + name: nginx-deployment + annotations: + internal.config.kubernetes.io/index: '0' + internal.config.kubernetes.io/path: 'deployment.yaml' +- apiVersion: v1 + kind: Service + metadata: + name: nginx-svc + annotations: + internal.config.kubernetes.io/index: '0' + internal.config.kubernetes.io/path: 'svc.yaml' +`, }, { name: "non-existing image",