Skip to content

Commit

Permalink
Remove deprecated pointer
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Jan 7, 2024
1 parent 1c65997 commit 292cf22
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
14 changes: 14 additions & 0 deletions pkg/runner/metadata.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2024 The ingress-perf Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package runner

import (
Expand Down
16 changes: 8 additions & 8 deletions pkg/runner/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
rbac "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

const (
Expand Down Expand Up @@ -110,16 +110,16 @@ var server = appsv1.Deployment{
},
}},
Affinity: workerAffinity,
TerminationGracePeriodSeconds: pointer.Int64(0), // It helps to kill the pod inmediatly on GC
TerminationGracePeriodSeconds: ptr.To[int64](0), // It helps to kill the pod immediately on GC
Containers: []corev1.Container{
{
Name: serverName,
Image: serverImage,
ImagePullPolicy: corev1.PullIfNotPresent,
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: pointer.Bool(false),
AllowPrivilegeEscalation: ptr.To[bool](false),
Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}},
RunAsNonRoot: pointer.Bool(true),
RunAsNonRoot: ptr.To[bool](true),
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
},
Ports: []corev1.ContainerPort{{Name: "http", Protocol: corev1.ProtocolTCP, ContainerPort: 8080}},
Expand Down Expand Up @@ -171,7 +171,7 @@ var client = appsv1.Deployment{
},
}},
Affinity: workerAffinity,
TerminationGracePeriodSeconds: pointer.Int64(0),
TerminationGracePeriodSeconds: ptr.To[int64](0),
HostNetwork: true, // Enable hostNetwork in client pods
Containers: []corev1.Container{
{
Expand All @@ -180,9 +180,9 @@ var client = appsv1.Deployment{
Image: clientImage,
ImagePullPolicy: corev1.PullAlways,
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: pointer.Bool(false),
AllowPrivilegeEscalation: ptr.To[bool](false),
Capabilities: &corev1.Capabilities{Drop: []corev1.Capability{"ALL"}},
RunAsNonRoot: pointer.Bool(true),
RunAsNonRoot: ptr.To[bool](true),
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
},
},
Expand Down Expand Up @@ -322,7 +322,7 @@ var virtualService = v1networking.VirtualService{
Destination: &v1beta1.Destination{
Host: service.Name,
Port: &v1beta1.PortSelector{
Number: *pointer.Uint32(8080),
Number: 8080,
},
},
},
Expand Down

0 comments on commit 292cf22

Please sign in to comment.