mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Merge pull request #120631 from liyuerich/ptrderef
Drop deprecated pointer package
This commit is contained in:
commit
fb1aea9a28
@ -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))
|
||||
|
@ -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,
|
||||
|
@ -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))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user