diff --git a/pkg/api/job/warnings.go b/pkg/api/job/warnings.go index e04a4939be5..1c7ddc8b507 100644 --- a/pkg/api/job/warnings.go +++ b/pkg/api/job/warnings.go @@ -24,7 +24,7 @@ import ( "k8s.io/kubernetes/pkg/api/pod" "k8s.io/kubernetes/pkg/apis/batch" "k8s.io/kubernetes/pkg/apis/core" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) const ( @@ -36,8 +36,8 @@ const ( func WarningsForJobSpec(ctx context.Context, path *field.Path, spec, oldSpec *batch.JobSpec) []string { var warnings []string if spec.CompletionMode != nil && *spec.CompletionMode == batch.IndexedCompletion { - completions := pointer.Int32Deref(spec.Completions, 0) - parallelism := pointer.Int32Deref(spec.Parallelism, 0) + completions := ptr.Deref(spec.Completions, 0) + parallelism := ptr.Deref(spec.Parallelism, 0) if completions > completionsSoftLimit && parallelism > parallelismSoftLimitForUnlimitedCompletions { msg := "In Indexed Jobs with a number of completions higher than 10^5 and a parallelism higher than 10^4, Kubernetes might not be able to track completedIndexes when a big number of indexes fail" warnings = append(warnings, fmt.Sprintf("%s: %s", path, msg)) diff --git a/pkg/apis/networking/validation/validation.go b/pkg/apis/networking/validation/validation.go index 1f7df28cee7..7df3b56328d 100644 --- a/pkg/apis/networking/validation/validation.go +++ b/pkg/apis/networking/validation/validation.go @@ -32,7 +32,7 @@ import ( apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" "k8s.io/kubernetes/pkg/apis/networking" netutils "k8s.io/utils/net" - utilpointer "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) const ( @@ -593,7 +593,7 @@ func validateIngressClassParametersReference(params *networking.IngressClassPara return allErrs } - scope := utilpointer.StringDeref(params.Scope, "") + scope := ptr.Deref(params.Scope, "") if !supportedIngressClassParametersReferenceScopes.Has(scope) { allErrs = append(allErrs, field.NotSupported(fldPath.Child("scope"), scope, diff --git a/staging/src/k8s.io/apiserver/pkg/registry/rest/delete_test.go b/staging/src/k8s.io/apiserver/pkg/registry/rest/delete_test.go index 622a1765f54..2aaf2501fe5 100644 --- a/staging/src/k8s.io/apiserver/pkg/registry/rest/delete_test.go +++ b/staging/src/k8s.io/apiserver/pkg/registry/rest/delete_test.go @@ -25,6 +25,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" utilpointer "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) type mockStrategy struct { @@ -295,10 +296,10 @@ func TestBeforeDelete(t *testing.T) { t.Errorf("BeforeDelete() gotGracefulPending = %v, want %v", gotGracefulPending, tt.wantGracefulPending) } if !utilpointer.Int64Equal(tt.args.pod.DeletionGracePeriodSeconds, tt.wantDeletionGracePeriodSeconds) { - t.Errorf("metadata.DeletionGracePeriodSeconds = %v, want %v", utilpointer.Int64Deref(tt.args.pod.DeletionGracePeriodSeconds, 0), utilpointer.Int64Deref(tt.wantDeletionGracePeriodSeconds, 0)) + t.Errorf("metadata.DeletionGracePeriodSeconds = %v, want %v", ptr.Deref(tt.args.pod.DeletionGracePeriodSeconds, 0), ptr.Deref(tt.wantDeletionGracePeriodSeconds, 0)) } if !utilpointer.Int64Equal(tt.args.options.GracePeriodSeconds, tt.wantGracePeriodSeconds) { - t.Errorf("options.GracePeriodSeconds = %v, want %v", utilpointer.Int64Deref(tt.args.options.GracePeriodSeconds, 0), utilpointer.Int64Deref(tt.wantGracePeriodSeconds, 0)) + t.Errorf("options.GracePeriodSeconds = %v, want %v", ptr.Deref(tt.args.options.GracePeriodSeconds, 0), ptr.Deref(tt.wantGracePeriodSeconds, 0)) } }) }