From 3b9c9b6bd604b360514bc1a06cdf3fbef13eb49e Mon Sep 17 00:00:00 2001 From: Jakub Ramut Date: Mon, 9 Nov 2026 17:13:12 +0100 Subject: [PATCH 1/2] chore: bump go to 1.26.10, golangci-lint to v2.11.4 and runtime base to distroless static-debian13 Signed-off-by: Jakub Ramut --- .github/workflows/ci.yml | 4 ++-- Dockerfile | 2 +- go.mod | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41dbdf1..7cab801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,8 @@ on: env: # Common versions - GO_VERSION: '1.25.4' - GOLANGCI_VERSION: 'v2.6.2' + GO_VERSION: '1.26.10' + GOLANGCI_VERSION: 'v2.11.4' DOCKER_BUILDX_VERSION: 'v0.24.0' # These environment variables are important to the Crossplane CLI install.sh diff --git a/Dockerfile b/Dockerfile index 36b633a..a5e8c32 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,7 +40,7 @@ RUN --mount=target=. \ # Produce the Function image. We use a very lightweight 'distroless' image that # does not include any of the build tools used in previous stages. -FROM gcr.io/distroless/static-debian12:nonroot AS image +FROM gcr.io/distroless/static-debian13:nonroot AS image WORKDIR / COPY --from=build /function /function EXPOSE 9443 diff --git a/go.mod b/go.mod index 1b1993a..7824697 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/crossplane-contrib/function-extra-resources -go 1.25.0 +go 1.26.10 require ( github.com/alecthomas/kong v1.14.0 From 2c2eb227fc1db98ebe08149a71d6334246814323 Mon Sep 17 00:00:00 2001 From: Jakub Ramut Date: Mon, 9 Nov 2026 17:13:12 +0100 Subject: [PATCH 2/2] test: replace ptr.To string literals with new(expr) for modernize newexpr Signed-off-by: Jakub Ramut --- fn_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fn_test.go b/fn_test.go index 2e53f0a..c66f57b 100644 --- a/fn_test.go +++ b/fn_test.go @@ -207,7 +207,7 @@ func TestRunFunction(t *testing.T) { Match: &fnv1.ResourceSelector_MatchName{ MatchName: "my-foo", }, - Namespace: ptr.To("my-namespace"), + Namespace: new("my-namespace"), }, "obj-6": { ApiVersion: "test.crossplane.io/v1alpha1", @@ -219,7 +219,7 @@ func TestRunFunction(t *testing.T) { }, }, }, - Namespace: ptr.To("my-namespace"), + Namespace: new("my-namespace"), }, }, }, @@ -839,7 +839,7 @@ func TestVerifyAndSortExtras(t *testing.T) { in: &v1beta1.Input{Spec: v1beta1.InputSpec{ExtraResources: []v1beta1.ResourceSource{{ Type: v1beta1.ResourceSourceTypeSelector, Into: "objs", - Namespace: ptr.To("ns-a"), + Namespace: new("ns-a"), Selector: &v1beta1.ResourceSourceSelector{}, }}}}, extra: map[string][]resource.Required{"objs": {nsResource("ns-a", "keep"), nsResource("ns-b", "drop")}}, @@ -850,7 +850,7 @@ func TestVerifyAndSortExtras(t *testing.T) { in: &v1beta1.Input{Spec: v1beta1.InputSpec{ExtraResources: []v1beta1.ResourceSource{{ Type: v1beta1.ResourceSourceTypeSelector, Into: "objs", - Namespace: ptr.To("ns-a"), + Namespace: new("ns-a"), Selector: &v1beta1.ResourceSourceSelector{MinMatch: ptr.To[uint64](2)}, }}}}, extra: map[string][]resource.Required{"objs": {nsResource("ns-a", "keep"), nsResource("ns-b", "drop")}}, @@ -861,7 +861,7 @@ func TestVerifyAndSortExtras(t *testing.T) { in: &v1beta1.Input{Spec: v1beta1.InputSpec{ExtraResources: []v1beta1.ResourceSource{{ Type: v1beta1.ResourceSourceTypeSelector, Into: "objs", - Namespace: ptr.To("ns-a"), + Namespace: new("ns-a"), Selector: &v1beta1.ResourceSourceSelector{ MaxMatch: ptr.To[uint64](2), SortByFieldPath: "metadata.name", @@ -880,7 +880,7 @@ func TestVerifyAndSortExtras(t *testing.T) { in: &v1beta1.Input{Spec: v1beta1.InputSpec{ExtraResources: []v1beta1.ResourceSource{{ Type: v1beta1.ResourceSourceTypeSelector, Into: "objs", - Namespace: ptr.To("ns-a"), + Namespace: new("ns-a"), Selector: &v1beta1.ResourceSourceSelector{MinMatch: ptr.To[uint64](1)}, }}}}, extra: map[string][]resource.Required{"objs": {clusterResource("env-a"), clusterResource("env-b")}}, @@ -891,7 +891,7 @@ func TestVerifyAndSortExtras(t *testing.T) { in: &v1beta1.Input{Spec: v1beta1.InputSpec{ExtraResources: []v1beta1.ResourceSource{{ Type: v1beta1.ResourceSourceTypeSelector, Into: "objs", - Namespace: ptr.To(""), + Namespace: new(""), Selector: &v1beta1.ResourceSourceSelector{}, }}}}, extra: map[string][]resource.Required{"objs": {clusterResource("cluster-scoped"), nsResource("ns-a", "namespaced")}}, @@ -902,7 +902,7 @@ func TestVerifyAndSortExtras(t *testing.T) { in: &v1beta1.Input{Spec: v1beta1.InputSpec{ExtraResources: []v1beta1.ResourceSource{{ Type: v1beta1.ResourceSourceTypeReference, Into: "obj", - Namespace: ptr.To("ns-a"), + Namespace: new("ns-a"), Ref: &v1beta1.ResourceSourceReference{Name: "missing"}, }}}}, extra: map[string][]resource.Required{"obj": {}},