mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-27 21:26:03 +00:00
This commit does two things in pkg package:
1. Remove unused ptr functions. 2. Replace ptr functions with k8s.io/utils/pointer
This commit is contained in:
@@ -55,6 +55,7 @@ go_test(
|
||||
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||
"//staging/src/k8s.io/client-go/tools/record:go_default_library",
|
||||
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
@@ -28,10 +28,9 @@ import (
|
||||
"k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
func boolptr(b bool) *bool { return &b }
|
||||
|
||||
func TestGetJobFromTemplate(t *testing.T) {
|
||||
// getJobFromTemplate() needs to take the job template and copy the labels and annotations
|
||||
// and other fields, and add a created-by reference.
|
||||
@@ -134,7 +133,7 @@ func TestGetParentUIDFromJob(t *testing.T) {
|
||||
{
|
||||
Kind: "CronJob",
|
||||
UID: types.UID("5ef034e0-1890-11e6-8935-42010af0003e"),
|
||||
Controller: boolptr(true),
|
||||
Controller: utilpointer.BoolPtr(true),
|
||||
},
|
||||
})
|
||||
|
||||
@@ -158,19 +157,19 @@ func TestGroupJobsByParent(t *testing.T) {
|
||||
ownerReference1 := metav1.OwnerReference{
|
||||
Kind: "CronJob",
|
||||
UID: uid1,
|
||||
Controller: boolptr(true),
|
||||
Controller: utilpointer.BoolPtr(true),
|
||||
}
|
||||
|
||||
ownerReference2 := metav1.OwnerReference{
|
||||
Kind: "CronJob",
|
||||
UID: uid2,
|
||||
Controller: boolptr(true),
|
||||
Controller: utilpointer.BoolPtr(true),
|
||||
}
|
||||
|
||||
ownerReference3 := metav1.OwnerReference{
|
||||
Kind: "CronJob",
|
||||
UID: uid3,
|
||||
Controller: boolptr(true),
|
||||
Controller: utilpointer.BoolPtr(true),
|
||||
}
|
||||
|
||||
{
|
||||
|
Reference in New Issue
Block a user