Skip to content

Commit

Permalink
replace deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
m-terra committed Jan 16, 2024
1 parent feab745 commit 179419f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions apis/proxy/v1alpha1/instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ func (g *GlobalConfiguration) Model() (models.Global, error) {
if err != nil {
return global, err
}
ptr, err := configuration.ParseGlobalSection(p)
ptrr, err := configuration.ParseGlobalSection(p)
if err != nil {
return global, err
}
if ptr != nil {
global = *ptr
if ptrr != nil {
global = *ptrr
}
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/instance/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (r *Reconciler) createOrUpdateRouteForFrontend(ctx context.Context, instanc
}

route.Spec.Port = &routev1.RoutePort{
TargetPort: intstr.FromInt(int(bind.Port)),
TargetPort: intstr.FromInt32(int32(bind.Port)),
}

route.Spec.TLS = instance.Spec.Network.Route.TLS
Expand Down
6 changes: 3 additions & 3 deletions controllers/instance/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (r *Reconciler) reconcileService(ctx context.Context, instance *proxyv1alph
service.Spec.Ports = append(service.Spec.Ports, corev1.ServicePort{
Name: fmt.Sprintf("tcp-%d", bind.Port),
Port: int32(bind.Port),
TargetPort: intstr.FromInt(int(bind.Port)),
TargetPort: intstr.FromInt32(int32(bind.Port)),
Protocol: corev1.ProtocolTCP,
})
}
Expand All @@ -62,7 +62,7 @@ func (r *Reconciler) reconcileService(ctx context.Context, instance *proxyv1alph
service.Spec.Ports = append(service.Spec.Ports, corev1.ServicePort{
Name: fmt.Sprintf("tcp-%d", bind.Port),
Port: int32(bind.Port),
TargetPort: intstr.FromInt(int(bind.Port)),
TargetPort: intstr.FromInt32(int32(bind.Port)),
Protocol: corev1.ProtocolTCP,
})
}
Expand All @@ -72,7 +72,7 @@ func (r *Reconciler) reconcileService(ctx context.Context, instance *proxyv1alph
service.Spec.Ports = append(service.Spec.Ports, corev1.ServicePort{
Name: "metrics",
Port: int32(instance.Spec.Metrics.Port),
TargetPort: intstr.FromInt(int(instance.Spec.Metrics.Port)),
TargetPort: intstr.FromInt32(int32(instance.Spec.Metrics.Port)),
Protocol: corev1.ProtocolTCP,
})
}
Expand Down

0 comments on commit 179419f

Please sign in to comment.