Skip to content

Commit

Permalink
Bump k8s.io/utils
Browse files Browse the repository at this point in the history
Including replacing the newly deprecated pointer package with the ptr
package.

Signed-off-by: Nic Cope <[email protected]>
  • Loading branch information
negz committed Nov 1, 2023
1 parent df2c9da commit 11c8437
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 137 deletions.
14 changes: 7 additions & 7 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

"github.com/crossplane/crossplane-runtime/pkg/errors"
"github.com/crossplane/crossplane-runtime/pkg/reconciler/managed"
Expand Down Expand Up @@ -64,32 +64,32 @@ func TestExtractConnectionDetails(t *testing.T) {
{
Type: v1beta1.ConnectionDetailTypeFromConnectionSecretKey,
Name: "bar",
FromConnectionSecretKey: pointer.String("bar"),
FromConnectionSecretKey: ptr.To[string]("bar"),
},
{
Type: v1beta1.ConnectionDetailTypeFromConnectionSecretKey,
Name: "none",
FromConnectionSecretKey: pointer.String("none"),
FromConnectionSecretKey: ptr.To[string]("none"),
},
{
Type: v1beta1.ConnectionDetailTypeFromConnectionSecretKey,
Name: "convfoo",
FromConnectionSecretKey: pointer.String("foo"),
FromConnectionSecretKey: ptr.To[string]("foo"),
},
{
Type: v1beta1.ConnectionDetailTypeFromValue,
Name: "fixed",
Value: pointer.String("value"),
Value: ptr.To[string]("value"),
},
{
Type: v1beta1.ConnectionDetailTypeFromFieldPath,
Name: "name",
FromFieldPath: pointer.String("objectMeta.name"),
FromFieldPath: ptr.To[string]("objectMeta.name"),
},
{
Type: v1beta1.ConnectionDetailTypeFromFieldPath,
Name: "generation",
FromFieldPath: pointer.String("objectMeta.generation"),
FromFieldPath: ptr.To[string]("objectMeta.generation"),
},
},
},
Expand Down
34 changes: 17 additions & 17 deletions fn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/structpb"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

"github.com/crossplane/crossplane-runtime/pkg/logging"

Expand Down Expand Up @@ -159,8 +159,8 @@ func TestRunFunction(t *testing.T) {
Patches: []v1beta1.Patch{
{
Type: v1beta1.PatchTypeFromCompositeFieldPath,
FromFieldPath: pointer.String("spec.widgets"),
ToFieldPath: pointer.String("spec.watchers"),
FromFieldPath: ptr.To[string]("spec.widgets"),
ToFieldPath: ptr.To[string]("spec.watchers"),
Transforms: []v1beta1.Transform{
{
Type: v1beta1.TransformTypeConvert,
Expand All @@ -172,7 +172,7 @@ func TestRunFunction(t *testing.T) {
Type: v1beta1.TransformTypeMath,
Math: &v1beta1.MathTransform{
Type: v1beta1.MathTransformTypeMultiply,
Multiply: pointer.Int64(3),
Multiply: ptr.To[int64](3),
},
},
},
Expand Down Expand Up @@ -224,8 +224,8 @@ func TestRunFunction(t *testing.T) {
Patches: []v1beta1.Patch{
{
Type: v1beta1.PatchTypeFromCompositeFieldPath,
FromFieldPath: pointer.String("spec.widgets"),
ToFieldPath: pointer.String("spec.watchers"),
FromFieldPath: ptr.To[string]("spec.widgets"),
ToFieldPath: ptr.To[string]("spec.watchers"),
Transforms: []v1beta1.Transform{
{
Type: v1beta1.TransformTypeConvert,
Expand All @@ -237,7 +237,7 @@ func TestRunFunction(t *testing.T) {
Type: v1beta1.TransformTypeMath,
Math: &v1beta1.MathTransform{
Type: v1beta1.MathTransformTypeMultiply,
Multiply: pointer.Int64(3),
Multiply: ptr.To[int64](3),
},
},
},
Expand Down Expand Up @@ -294,8 +294,8 @@ func TestRunFunction(t *testing.T) {
Patches: []v1beta1.Patch{
{
Type: v1beta1.PatchTypeFromCompositeFieldPath,
FromFieldPath: pointer.String("spec.widgets"),
ToFieldPath: pointer.String("spec.watchers"),
FromFieldPath: ptr.To[string]("spec.widgets"),
ToFieldPath: ptr.To[string]("spec.watchers"),
},
},
},
Expand Down Expand Up @@ -391,16 +391,16 @@ func TestRunFunction(t *testing.T) {
{
// This patch should work.
Type: v1beta1.PatchTypeFromCompositeFieldPath,
FromFieldPath: pointer.String("spec.widgets"),
ToFieldPath: pointer.String("spec.watchers"),
FromFieldPath: ptr.To[string]("spec.widgets"),
ToFieldPath: ptr.To[string]("spec.watchers"),
},
{
// This patch should return an error,
// because the required path does not
// exist.
Type: v1beta1.PatchTypeFromCompositeFieldPath,
FromFieldPath: pointer.String("spec.doesNotExist"),
ToFieldPath: pointer.String("spec.explode"),
FromFieldPath: ptr.To[string]("spec.doesNotExist"),
ToFieldPath: ptr.To[string]("spec.explode"),
Policy: &v1beta1.PatchPolicy{
FromFieldPath: func() *v1beta1.FromFieldPathPolicy {
r := v1beta1.FromFieldPathPolicyRequired
Expand Down Expand Up @@ -513,7 +513,7 @@ func TestRunFunction(t *testing.T) {
{
Type: v1beta1.ConnectionDetailTypeFromConnectionSecretKey,
Name: "very",
FromConnectionSecretKey: pointer.String("very"),
FromConnectionSecretKey: ptr.To[string]("very"),
},
},
},
Expand Down Expand Up @@ -575,8 +575,8 @@ func TestRunFunction(t *testing.T) {
Patches: []v1beta1.Patch{
{
Type: v1beta1.PatchTypeToCompositeFieldPath,
FromFieldPath: pointer.String("spec.widgets"),
ToFieldPath: pointer.String("spec.watchers"),
FromFieldPath: ptr.To[string]("spec.widgets"),
ToFieldPath: ptr.To[string]("spec.watchers"),
Transforms: []v1beta1.Transform{
{
Type: v1beta1.TransformTypeConvert,
Expand All @@ -588,7 +588,7 @@ func TestRunFunction(t *testing.T) {
Type: v1beta1.TransformTypeMath,
Math: &v1beta1.MathTransform{
Type: v1beta1.MathTransformTypeMultiply,
Multiply: pointer.Int64(3),
Multiply: ptr.To[int64](3),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
k8s.io/api v0.28.2
k8s.io/apiextensions-apiserver v0.27.3
k8s.io/apimachinery v0.28.2
k8s.io/utils v0.0.0-20230505201702-9f6742963106
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
sigs.k8s.io/controller-tools v0.12.1
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU=
k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down
Loading

0 comments on commit 11c8437

Please sign in to comment.