From 9b41b8652f95e49b55a10e906f6d025a86a9674b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:13:35 +0000 Subject: [PATCH 1/4] chore(deps): update dependency go to v1.27.0 --- .github/workflows/ci.yml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb4efae..c2bccc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: env: # Common versions - GO_VERSION: '1.25.14' + GO_VERSION: '1.27.0' GOLANGCI_VERSION: 'v2.13.1' DOCKER_BUILDX_VERSION: 'v0.36.1' diff --git a/go.mod b/go.mod index 1f5ef4b..3211ca6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/crossplane-contrib/function-go-templating -go 1.25.14 +go 1.27.0 require ( dario.cat/mergo v1.0.2 From 472a7a307339aef5b7202ba78486ac5fd879b998 Mon Sep 17 00:00:00 2001 From: Bob Haddleton Date: Thu, 27 Aug 2026 09:21:28 -0500 Subject: [PATCH 2/4] Fix lint errors Signed-off-by: Bob Haddleton --- claimconditions_test.go | 66 +++++++++++++++++------------------------ fn_test.go | 16 +++++----- 2 files changed, 35 insertions(+), 47 deletions(-) diff --git a/claimconditions_test.go b/claimconditions_test.go index 3a3b2f2..e87f791 100644 --- a/claimconditions_test.go +++ b/claimconditions_test.go @@ -6,13 +6,11 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/test" xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" + "github.com/crossplane/function-sdk-go/errors" + fnv1 "github.com/crossplane/function-sdk-go/proto/v1" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "k8s.io/api/core/v1" - "k8s.io/utils/ptr" - - "github.com/crossplane/function-sdk-go/errors" - fnv1 "github.com/crossplane/function-sdk-go/proto/v1" ) func Test_UpdateClaimConditions(t *testing.T) { @@ -40,12 +38,10 @@ func Test_UpdateClaimConditions(t *testing.T) { rsp: &fnv1.RunFunctionResponse{}, c: []TargetedCondition{ { - Condition: xpv2.Condition{ - Message: "Ready Message", - Status: v1.ConditionTrue, - Type: "Ready", - }, - Target: CompositionTargetComposite, + Message: "Ready Message", + Status: v1.ConditionTrue, + Type: "Ready", + Target: CompositionTargetComposite, }, }, }, @@ -68,27 +64,21 @@ func Test_UpdateClaimConditions(t *testing.T) { rsp: &fnv1.RunFunctionResponse{}, c: []TargetedCondition{ { - Condition: xpv2.Condition{ - Message: "Creating Resource", - Status: v1.ConditionFalse, - Type: "NetworkReady", - }, - Target: CompositionTargetCompositeAndClaim, + Message: "Creating Resource", + Status: v1.ConditionFalse, + Type: "NetworkReady", + Target: CompositionTargetCompositeAndClaim, }, { - Condition: xpv2.Condition{ - Message: "Ready Message", - Status: v1.ConditionTrue, - Type: "DatabaseReady", - }, - Target: CompositionTargetComposite, + Message: "Ready Message", + Status: v1.ConditionTrue, + Type: "DatabaseReady", + Target: CompositionTargetComposite, }, { - Condition: xpv2.Condition{ - Message: "No Target should add CompositeAndClaim", - Status: v1.ConditionTrue, - Type: "NoTarget", - }, + Message: "No Target should add CompositeAndClaim", + Status: v1.ConditionTrue, + Type: "NoTarget", }, }, }, @@ -96,19 +86,19 @@ func Test_UpdateClaimConditions(t *testing.T) { rsp: &fnv1.RunFunctionResponse{ Conditions: []*fnv1.Condition{ { - Message: ptr.To("Creating Resource"), + Message: new("Creating Resource"), Status: fnv1.Status_STATUS_CONDITION_FALSE, Target: fnv1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), Type: "NetworkReady", }, { - Message: ptr.To("Ready Message"), + Message: new("Ready Message"), Status: fnv1.Status_STATUS_CONDITION_TRUE, Target: fnv1.Target_TARGET_COMPOSITE.Enum(), Type: "DatabaseReady", }, { - Message: ptr.To("No Target should add CompositeAndClaim"), + Message: new("No Target should add CompositeAndClaim"), Status: fnv1.Status_STATUS_CONDITION_TRUE, Target: fnv1.Target_TARGET_COMPOSITE.Enum(), Type: "NoTarget", @@ -153,7 +143,7 @@ func Test_transformCondition(t *testing.T) { }, }, want: &fnv1.Condition{ - Message: ptr.To("Basic Message"), + Message: new("Basic Message"), Status: fnv1.Status_STATUS_CONDITION_TRUE, Target: fnv1.Target_TARGET_COMPOSITE.Enum(), Type: "TestType", @@ -183,7 +173,7 @@ func Test_transformCondition(t *testing.T) { }, }, want: &fnv1.Condition{ - Message: ptr.To("Basic Message"), + Message: new("Basic Message"), Status: fnv1.Status_STATUS_CONDITION_FALSE, Target: fnv1.Target_TARGET_COMPOSITE.Enum(), Type: "TestType", @@ -267,7 +257,7 @@ func Test_UpdateResponseWithCondition(t *testing.T) { args: args{ rsp: &fnv1.RunFunctionResponse{}, c: &fnv1.Condition{ - Message: ptr.To("Basic Message"), + Message: new("Basic Message"), Status: fnv1.Status_STATUS_CONDITION_FALSE, Target: fnv1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), Type: "TestType", @@ -276,7 +266,7 @@ func Test_UpdateResponseWithCondition(t *testing.T) { want: &fnv1.RunFunctionResponse{ Conditions: []*fnv1.Condition{ { - Message: ptr.To("Basic Message"), + Message: new("Basic Message"), Status: fnv1.Status_STATUS_CONDITION_FALSE, Target: fnv1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), Type: "TestType", @@ -290,7 +280,7 @@ func Test_UpdateResponseWithCondition(t *testing.T) { rsp: &fnv1.RunFunctionResponse{ Conditions: []*fnv1.Condition{ { - Message: ptr.To("Existing Message"), + Message: new("Existing Message"), Status: fnv1.Status_STATUS_CONDITION_TRUE, Target: fnv1.Target_TARGET_COMPOSITE.Enum(), Type: "ExistingTestType", @@ -298,7 +288,7 @@ func Test_UpdateResponseWithCondition(t *testing.T) { }, }, c: &fnv1.Condition{ - Message: ptr.To("Basic Message"), + Message: new("Basic Message"), Status: fnv1.Status_STATUS_CONDITION_FALSE, Target: fnv1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), Type: "TestType", @@ -307,13 +297,13 @@ func Test_UpdateResponseWithCondition(t *testing.T) { want: &fnv1.RunFunctionResponse{ Conditions: []*fnv1.Condition{ { - Message: ptr.To("Existing Message"), + Message: new("Existing Message"), Status: fnv1.Status_STATUS_CONDITION_TRUE, Target: fnv1.Target_TARGET_COMPOSITE.Enum(), Type: "ExistingTestType", }, { - Message: ptr.To("Basic Message"), + Message: new("Basic Message"), Status: fnv1.Status_STATUS_CONDITION_FALSE, Target: fnv1.Target_TARGET_COMPOSITE_AND_CLAIM.Enum(), Type: "TestType", diff --git a/fn_test.go b/fn_test.go index 9a65169..749797c 100644 --- a/fn_test.go +++ b/fn_test.go @@ -9,15 +9,13 @@ import ( "github.com/crossplane-contrib/function-go-templating/input/v1beta1" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" + fnv1 "github.com/crossplane/function-sdk-go/proto/v1" + "github.com/crossplane/function-sdk-go/resource" + "github.com/crossplane/function-sdk-go/response" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/durationpb" - "k8s.io/utils/ptr" - - fnv1 "github.com/crossplane/function-sdk-go/proto/v1" - "github.com/crossplane/function-sdk-go/resource" - "github.com/crossplane/function-sdk-go/response" ) var ( @@ -913,21 +911,21 @@ func TestRunFunction(t *testing.T) { Type: "TestCondition", Status: fnv1.Status_STATUS_CONDITION_FALSE, Reason: "InstallFail", - Message: ptr.To("failed to install"), + Message: new("failed to install"), Target: fnv1.Target_TARGET_COMPOSITE.Enum(), }, { Type: "ConditionTrue", Status: fnv1.Status_STATUS_CONDITION_TRUE, Reason: "this condition is true", - Message: ptr.To("we are true"), + Message: new("we are true"), Target: fnv1.Target_TARGET_COMPOSITE.Enum(), }, { Type: "DatabaseReady", Status: fnv1.Status_STATUS_CONDITION_TRUE, Reason: "Ready", - Message: ptr.To("Database is ready"), + Message: new("Database is ready"), Target: fnv1.Target_TARGET_COMPOSITE.Enum(), }, }, @@ -1916,7 +1914,7 @@ func TestRunFunction(t *testing.T) { Match: &fnv1.ResourceSelector_MatchName{ MatchName: "cool-extra-resource", }, - Namespace: ptr.To("default"), + Namespace: new("default"), }, }, }, From 5511e63ba6df71fdeef835ea0fa36ecf998e36ff Mon Sep 17 00:00:00 2001 From: Bob Haddleton Date: Thu, 27 Aug 2026 09:25:56 -0500 Subject: [PATCH 3/4] Run go mod tidy Signed-off-by: Bob Haddleton --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3211ca6..5a22a64 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,6 @@ require ( gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.35.4 k8s.io/apimachinery v0.35.4 - k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 sigs.k8s.io/controller-tools v0.20.1 ) @@ -95,6 +94,7 @@ require ( k8s.io/gengo/v2 v2.0.0-20251215205346-5ee0d033ba5b // indirect k8s.io/klog/v2 v2.140.0 // indirect k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 // indirect + k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3 // indirect sigs.k8s.io/controller-runtime v0.23.1 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect From 2bf20e5e11fb87a27afff613e492135d37799d62 Mon Sep 17 00:00:00 2001 From: Bob Haddleton Date: Thu, 27 Aug 2026 09:49:58 -0500 Subject: [PATCH 4/4] Fix formatting Signed-off-by: Bob Haddleton --- claimconditions_test.go | 5 +++-- fn_test.go | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/claimconditions_test.go b/claimconditions_test.go index e87f791..f4e935d 100644 --- a/claimconditions_test.go +++ b/claimconditions_test.go @@ -6,11 +6,12 @@ import ( "github.com/crossplane/crossplane-runtime/v2/pkg/test" xpv2 "github.com/crossplane/crossplane/apis/v2/core/v2" - "github.com/crossplane/function-sdk-go/errors" - fnv1 "github.com/crossplane/function-sdk-go/proto/v1" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "k8s.io/api/core/v1" + + "github.com/crossplane/function-sdk-go/errors" + fnv1 "github.com/crossplane/function-sdk-go/proto/v1" ) func Test_UpdateClaimConditions(t *testing.T) { diff --git a/fn_test.go b/fn_test.go index 749797c..7410568 100644 --- a/fn_test.go +++ b/fn_test.go @@ -9,13 +9,14 @@ import ( "github.com/crossplane-contrib/function-go-templating/input/v1beta1" "github.com/crossplane/crossplane-runtime/v2/pkg/logging" - fnv1 "github.com/crossplane/function-sdk-go/proto/v1" - "github.com/crossplane/function-sdk-go/resource" - "github.com/crossplane/function-sdk-go/response" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/protobuf/testing/protocmp" "google.golang.org/protobuf/types/known/durationpb" + + fnv1 "github.com/crossplane/function-sdk-go/proto/v1" + "github.com/crossplane/function-sdk-go/resource" + "github.com/crossplane/function-sdk-go/response" ) var (