From a5c5e85f2a130b686dbe3f987d7b136b2aae7728 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 18 Oct 2020 00:06:40 -0700 Subject: [PATCH] simplify --- controllers/controller_filer_service.go | 42 ++++++++++++------------ controllers/controller_master_service.go | 12 +++---- controllers/controller_volume_service.go | 12 +++---- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/controllers/controller_filer_service.go b/controllers/controller_filer_service.go index 93b03e5..1a27bb2 100644 --- a/controllers/controller_filer_service.go +++ b/controllers/controller_filer_service.go @@ -25,21 +25,21 @@ func (r *SeaweedReconciler) createFilerHeadlessService(m *seaweedv1.Seaweed) *co PublishNotReadyAddresses: true, Ports: []corev1.ServicePort{ { - Name: "swfs-filer", - Protocol: corev1.Protocol("TCP"), - Port: 8888, + Name: "swfs-filer", + Protocol: corev1.Protocol("TCP"), + Port: 8888, TargetPort: intstr.FromInt(8888), }, { - Name: "swfs-filer-grpc", - Protocol: corev1.Protocol("TCP"), - Port: 18888, + Name: "swfs-filer-grpc", + Protocol: corev1.Protocol("TCP"), + Port: 18888, TargetPort: intstr.FromInt(18888), }, { - Name: "swfs-s3", - Protocol: corev1.Protocol("TCP"), - Port: 8333, + Name: "swfs-s3", + Protocol: corev1.Protocol("TCP"), + Port: 8333, TargetPort: intstr.FromInt(8333), }, }, @@ -66,25 +66,25 @@ func (r *SeaweedReconciler) createFilerNodePortService(m *seaweedv1.Seaweed) *co PublishNotReadyAddresses: true, Ports: []corev1.ServicePort{ { - Name: "swfs-filer", - Protocol: corev1.Protocol("TCP"), - Port: 8888, + Name: "swfs-filer", + Protocol: corev1.Protocol("TCP"), + Port: 8888, TargetPort: intstr.FromInt(8888), - NodePort: 30888, + NodePort: 30888, }, { - Name: "swfs-filer-grpc", - Protocol: corev1.Protocol("TCP"), - Port: 18888, + Name: "swfs-filer-grpc", + Protocol: corev1.Protocol("TCP"), + Port: 18888, TargetPort: intstr.FromInt(18888), - NodePort: 31888, + NodePort: 31888, }, { - Name: "swfs-s3", - Protocol: corev1.Protocol("TCP"), - Port: 8333, + Name: "swfs-s3", + Protocol: corev1.Protocol("TCP"), + Port: 8333, TargetPort: intstr.FromInt(8333), - NodePort: 30833, + NodePort: 30833, }, }, Selector: labels, diff --git a/controllers/controller_master_service.go b/controllers/controller_master_service.go index 42d24bf..6cf1561 100644 --- a/controllers/controller_master_service.go +++ b/controllers/controller_master_service.go @@ -25,15 +25,15 @@ func (r *SeaweedReconciler) createMasterService(m *seaweedv1.Seaweed) *corev1.Se PublishNotReadyAddresses: true, Ports: []corev1.ServicePort{ { - Name: "swfs-master", - Protocol: corev1.Protocol("TCP"), - Port: 9333, + Name: "swfs-master", + Protocol: corev1.Protocol("TCP"), + Port: 9333, TargetPort: intstr.FromInt(9333), }, { - Name: "swfs-master-grpc", - Protocol: corev1.Protocol("TCP"), - Port: 19333, + Name: "swfs-master-grpc", + Protocol: corev1.Protocol("TCP"), + Port: 19333, TargetPort: intstr.FromInt(19333), }, }, diff --git a/controllers/controller_volume_service.go b/controllers/controller_volume_service.go index f8e9a9f..c78ac6f 100644 --- a/controllers/controller_volume_service.go +++ b/controllers/controller_volume_service.go @@ -25,15 +25,15 @@ func (r *SeaweedReconciler) createVolumeServerService(m *seaweedv1.Seaweed) *cor PublishNotReadyAddresses: true, Ports: []corev1.ServicePort{ { - Name: "swfs-volume", - Protocol: corev1.Protocol("TCP"), - Port: 8444, + Name: "swfs-volume", + Protocol: corev1.Protocol("TCP"), + Port: 8444, TargetPort: intstr.FromInt(8444), }, { - Name: "swfs-volume-grpc", - Protocol: corev1.Protocol("TCP"), - Port: 18444, + Name: "swfs-volume-grpc", + Protocol: corev1.Protocol("TCP"), + Port: 18444, TargetPort: intstr.FromInt(18444), }, },