Skip to content

Commit

Permalink
applying gofmt linter
Browse files Browse the repository at this point in the history
  • Loading branch information
szelenka-cisco committed Nov 2, 2022
1 parent ed4f388 commit e3e8a89
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
22 changes: 11 additions & 11 deletions internal/controller/postgrescluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ func (r *Reconciler) generateClusterPrimaryService(
service.Spec.Selector = nil

service.Spec.Ports = []corev1.ServicePort{{
Name: naming.PortPostgreSQL,
Port: *cluster.Spec.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPostgreSQL),
Name: naming.PortPostgreSQL,
Port: *cluster.Spec.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPostgreSQL),
AppProtocol: initialize.String(postgres.IANAServiceName),
}}

Expand All @@ -160,9 +160,9 @@ func (r *Reconciler) generateClusterPrimaryService(
for _, sp := range service.Spec.Ports {
endpoints.Subsets[0].Ports = append(endpoints.Subsets[0].Ports,
corev1.EndpointPort{
Name: sp.Name,
Port: sp.Port,
Protocol: sp.Protocol,
Name: sp.Name,
Port: sp.Port,
Protocol: sp.Protocol,
AppProtocol: sp.AppProtocol,
})
}
Expand Down Expand Up @@ -224,10 +224,10 @@ func (r *Reconciler) generateClusterReplicaService(
// ContainerPort. This name allows the port number to differ between Pods,
// which can happen during a rolling update.
service.Spec.Ports = []corev1.ServicePort{{
Name: naming.PortPostgreSQL,
Port: *cluster.Spec.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPostgreSQL),
Name: naming.PortPostgreSQL,
Port: *cluster.Spec.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPostgreSQL),
AppProtocol: initialize.String(postgres.IANAServiceName),
}}

Expand Down
8 changes: 4 additions & 4 deletions internal/controller/postgrescluster/patroni.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ func (r *Reconciler) generatePatroniLeaderLeaseService(
// ContainerPort. This name allows the port number to differ between
// instances, which can happen during a rolling update.
servicePort := corev1.ServicePort{
Name: naming.PortPostgreSQL,
Port: *cluster.Spec.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPostgreSQL),
Name: naming.PortPostgreSQL,
Port: *cluster.Spec.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPostgreSQL),
AppProtocol: initialize.String(postgres.IANAServiceName),
}

Expand Down
8 changes: 4 additions & 4 deletions internal/controller/postgrescluster/pgadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ func (r *Reconciler) generatePGAdminService(
// TODO(tjmoore4): A custom service port is not currently supported as this
// requires updates to the pgAdmin service configuration.
servicePort := corev1.ServicePort{
Name: naming.PortPGAdmin,
Port: *initialize.Int32(5050),
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPGAdmin),
Name: naming.PortPGAdmin,
Port: *initialize.Int32(5050),
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPGAdmin),
AppProtocol: initialize.String(naming.AppProtocolHTTP),
}

Expand Down
8 changes: 4 additions & 4 deletions internal/controller/postgrescluster/pgbouncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ func (r *Reconciler) generatePGBouncerService(
// ContainerPort. This name allows the port number to differ between Pods,
// which can happen during a rolling update.
servicePort := corev1.ServicePort{
Name: naming.PortPGBouncer,
Port: *cluster.Spec.Proxy.PGBouncer.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPGBouncer),
Name: naming.PortPGBouncer,
Port: *cluster.Spec.Proxy.PGBouncer.Port,
Protocol: corev1.ProtocolTCP,
TargetPort: intstr.FromString(naming.PortPGBouncer),
AppProtocol: initialize.String(postgres.IANAServiceName),
}

Expand Down
6 changes: 3 additions & 3 deletions internal/patroni/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ func instanceEnvironment(
for _, cp := range podContainers[i].Ports {
if sp.TargetPort.StrVal == cp.Name {
ports = append(ports, corev1.EndpointPort{
Name: sp.Name,
Port: cp.ContainerPort,
Protocol: cp.Protocol,
Name: sp.Name,
Port: cp.ContainerPort,
Protocol: cp.Protocol,
AppProtocol: sp.AppProtocol,
})
}
Expand Down

0 comments on commit e3e8a89

Please sign in to comment.