Merge pull request #125439 from Octopusjust/k8s-pr22
pkg/printers: drop deprecated pointer package
This commit is contained in:
		@@ -50,7 +50,6 @@ import (
 | 
				
			|||||||
	"k8s.io/kubernetes/pkg/apis/storage"
 | 
						"k8s.io/kubernetes/pkg/apis/storage"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/apis/storagemigration"
 | 
						"k8s.io/kubernetes/pkg/apis/storagemigration"
 | 
				
			||||||
	"k8s.io/kubernetes/pkg/printers"
 | 
						"k8s.io/kubernetes/pkg/printers"
 | 
				
			||||||
	utilpointer "k8s.io/utils/pointer"
 | 
					 | 
				
			||||||
	"k8s.io/utils/ptr"
 | 
						"k8s.io/utils/ptr"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -973,7 +972,7 @@ func TestPrintIngress(t *testing.T) {
 | 
				
			|||||||
			CreationTimestamp: metav1.Time{Time: time.Now().Add(time.Duration(-10 * 365 * 24 * time.Hour))},
 | 
								CreationTimestamp: metav1.Time{Time: time.Now().Add(time.Duration(-10 * 365 * 24 * time.Hour))},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		Spec: networking.IngressSpec{
 | 
							Spec: networking.IngressSpec{
 | 
				
			||||||
			IngressClassName: utilpointer.StringPtr("foo"),
 | 
								IngressClassName: ptr.To("foo"),
 | 
				
			||||||
			DefaultBackend: &networking.IngressBackend{
 | 
								DefaultBackend: &networking.IngressBackend{
 | 
				
			||||||
				Service: &networking.IngressServiceBackend{
 | 
									Service: &networking.IngressServiceBackend{
 | 
				
			||||||
					Name: "default-backend",
 | 
										Name: "default-backend",
 | 
				
			||||||
@@ -1036,7 +1035,7 @@ func TestPrintIngressClass(t *testing.T) {
 | 
				
			|||||||
			Spec: networking.IngressClassSpec{
 | 
								Spec: networking.IngressClassSpec{
 | 
				
			||||||
				Controller: "example.com/controller",
 | 
									Controller: "example.com/controller",
 | 
				
			||||||
				Parameters: &networking.IngressClassParametersReference{
 | 
									Parameters: &networking.IngressClassParametersReference{
 | 
				
			||||||
					APIGroup: utilpointer.StringPtr("example.com"),
 | 
										APIGroup: ptr.To("example.com"),
 | 
				
			||||||
					Kind:     "customgroup",
 | 
										Kind:     "customgroup",
 | 
				
			||||||
					Name:     "example",
 | 
										Name:     "example",
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
@@ -1647,14 +1646,14 @@ func TestPrintPodWithRestartableInitContainer(t *testing.T) {
 | 
				
			|||||||
							Ready:                false,
 | 
												Ready:                false,
 | 
				
			||||||
							RestartCount:         3,
 | 
												RestartCount:         3,
 | 
				
			||||||
							State:                api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
												State:                api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
				
			||||||
							Started:              utilpointer.Bool(false),
 | 
												Started:              ptr.To(false),
 | 
				
			||||||
							LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
												LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							Name:    "restartable-init-2",
 | 
												Name:    "restartable-init-2",
 | 
				
			||||||
							Ready:   false,
 | 
												Ready:   false,
 | 
				
			||||||
							State:   api.ContainerState{Waiting: &api.ContainerStateWaiting{}},
 | 
												State:   api.ContainerState{Waiting: &api.ContainerStateWaiting{}},
 | 
				
			||||||
							Started: utilpointer.Bool(false),
 | 
												Started: ptr.To(false),
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					ContainerStatuses: []api.ContainerStatus{
 | 
										ContainerStatuses: []api.ContainerStatus{
 | 
				
			||||||
@@ -1688,14 +1687,14 @@ func TestPrintPodWithRestartableInitContainer(t *testing.T) {
 | 
				
			|||||||
							Ready:                false,
 | 
												Ready:                false,
 | 
				
			||||||
							RestartCount:         3,
 | 
												RestartCount:         3,
 | 
				
			||||||
							State:                api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
												State:                api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
				
			||||||
							Started:              utilpointer.Bool(true),
 | 
												Started:              ptr.To(true),
 | 
				
			||||||
							LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
												LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							Name:    "restartable-init-2",
 | 
												Name:    "restartable-init-2",
 | 
				
			||||||
							Ready:   false,
 | 
												Ready:   false,
 | 
				
			||||||
							State:   api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
												State:   api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
				
			||||||
							Started: utilpointer.Bool(false),
 | 
												Started: ptr.To(false),
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					ContainerStatuses: []api.ContainerStatus{
 | 
										ContainerStatuses: []api.ContainerStatus{
 | 
				
			||||||
@@ -1729,14 +1728,14 @@ func TestPrintPodWithRestartableInitContainer(t *testing.T) {
 | 
				
			|||||||
							Ready:                false,
 | 
												Ready:                false,
 | 
				
			||||||
							RestartCount:         3,
 | 
												RestartCount:         3,
 | 
				
			||||||
							State:                api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
												State:                api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
				
			||||||
							Started:              utilpointer.Bool(true),
 | 
												Started:              ptr.To(true),
 | 
				
			||||||
							LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
												LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							Name:    "restartable-init-2",
 | 
												Name:    "restartable-init-2",
 | 
				
			||||||
							Ready:   false,
 | 
												Ready:   false,
 | 
				
			||||||
							State:   api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
												State:   api.ContainerState{Running: &api.ContainerStateRunning{}},
 | 
				
			||||||
							Started: utilpointer.Bool(true),
 | 
												Started: ptr.To(true),
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					ContainerStatuses: []api.ContainerStatus{
 | 
										ContainerStatuses: []api.ContainerStatus{
 | 
				
			||||||
@@ -1771,14 +1770,14 @@ func TestPrintPodWithRestartableInitContainer(t *testing.T) {
 | 
				
			|||||||
							Ready:                false,
 | 
												Ready:                false,
 | 
				
			||||||
							RestartCount:         3,
 | 
												RestartCount:         3,
 | 
				
			||||||
							State:                api.ContainerState{Terminated: &api.ContainerStateTerminated{Reason: "Error", ExitCode: 137}},
 | 
												State:                api.ContainerState{Terminated: &api.ContainerStateTerminated{Reason: "Error", ExitCode: 137}},
 | 
				
			||||||
							Started:              utilpointer.Bool(false),
 | 
												Started:              ptr.To(false),
 | 
				
			||||||
							LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
												LastTerminationState: api.ContainerState{Terminated: &api.ContainerStateTerminated{FinishedAt: metav1.NewTime(time.Now().Add(-10 * time.Second))}},
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
						{
 | 
											{
 | 
				
			||||||
							Name:    "restartable-init-2",
 | 
												Name:    "restartable-init-2",
 | 
				
			||||||
							Ready:   false,
 | 
												Ready:   false,
 | 
				
			||||||
							State:   api.ContainerState{Terminated: &api.ContainerStateTerminated{Reason: "Error", ExitCode: 137}},
 | 
												State:   api.ContainerState{Terminated: &api.ContainerStateTerminated{Reason: "Error", ExitCode: 137}},
 | 
				
			||||||
							Started: utilpointer.Bool(false),
 | 
												Started: ptr.To(false),
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
					ContainerStatuses: []api.ContainerStatus{
 | 
										ContainerStatuses: []api.ContainerStatus{
 | 
				
			||||||
@@ -5963,8 +5962,8 @@ func TestPrintEndpointSlice(t *testing.T) {
 | 
				
			|||||||
				},
 | 
									},
 | 
				
			||||||
				AddressType: discovery.AddressTypeIPv4,
 | 
									AddressType: discovery.AddressTypeIPv4,
 | 
				
			||||||
				Ports: []discovery.EndpointPort{{
 | 
									Ports: []discovery.EndpointPort{{
 | 
				
			||||||
					Name:     utilpointer.StringPtr("http"),
 | 
										Name:     ptr.To("http"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(80),
 | 
										Port:     ptr.To[int32](80),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}},
 | 
									}},
 | 
				
			||||||
				Endpoints: []discovery.Endpoint{{
 | 
									Endpoints: []discovery.Endpoint{{
 | 
				
			||||||
@@ -5981,12 +5980,12 @@ func TestPrintEndpointSlice(t *testing.T) {
 | 
				
			|||||||
				},
 | 
									},
 | 
				
			||||||
				AddressType: discovery.AddressTypeIPv6,
 | 
									AddressType: discovery.AddressTypeIPv6,
 | 
				
			||||||
				Ports: []discovery.EndpointPort{{
 | 
									Ports: []discovery.EndpointPort{{
 | 
				
			||||||
					Name:     utilpointer.StringPtr("http"),
 | 
										Name:     ptr.To("http"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(80),
 | 
										Port:     ptr.To[int32](80),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}, {
 | 
									}, {
 | 
				
			||||||
					Name:     utilpointer.StringPtr("https"),
 | 
										Name:     ptr.To("https"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(443),
 | 
										Port:     ptr.To[int32](443),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}},
 | 
									}},
 | 
				
			||||||
				Endpoints: []discovery.Endpoint{{
 | 
									Endpoints: []discovery.Endpoint{{
 | 
				
			||||||
@@ -6005,20 +6004,20 @@ func TestPrintEndpointSlice(t *testing.T) {
 | 
				
			|||||||
				},
 | 
									},
 | 
				
			||||||
				AddressType: discovery.AddressTypeIPv4,
 | 
									AddressType: discovery.AddressTypeIPv4,
 | 
				
			||||||
				Ports: []discovery.EndpointPort{{
 | 
									Ports: []discovery.EndpointPort{{
 | 
				
			||||||
					Name:     utilpointer.StringPtr("http"),
 | 
										Name:     ptr.To("http"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(80),
 | 
										Port:     ptr.To[int32](80),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}, {
 | 
									}, {
 | 
				
			||||||
					Name:     utilpointer.StringPtr("https"),
 | 
										Name:     ptr.To("https"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(443),
 | 
										Port:     ptr.To[int32](443),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}, {
 | 
									}, {
 | 
				
			||||||
					Name:     utilpointer.StringPtr("extra1"),
 | 
										Name:     ptr.To("extra1"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(3000),
 | 
										Port:     ptr.To[int32](3000),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}, {
 | 
									}, {
 | 
				
			||||||
					Name:     utilpointer.StringPtr("extra2"),
 | 
										Name:     ptr.To("extra2"),
 | 
				
			||||||
					Port:     utilpointer.Int32Ptr(3001),
 | 
										Port:     ptr.To[int32](3001),
 | 
				
			||||||
					Protocol: &tcpProtocol,
 | 
										Protocol: &tcpProtocol,
 | 
				
			||||||
				}},
 | 
									}},
 | 
				
			||||||
				Endpoints: []discovery.Endpoint{{
 | 
									Endpoints: []discovery.Endpoint{{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user