Skip to content

Commit

Permalink
pr: get UDP addresses in controller
Browse files Browse the repository at this point in the history
  • Loading branch information
rainest committed Jan 13, 2023
1 parent fd9b5f7 commit 3aade6e
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 119 deletions.
6 changes: 6 additions & 0 deletions hack/generators/controllers/networking/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ var inputControllersNeeded = &typesNeeded{
Package: kongv1beta1,
Plural: "udpingresses",
CacheType: "UDPIngress",
IsUDP: true,
NeedsStatusPermissions: true,
CapableOfStatusUpdates: true,
AcceptsIngressClassNameAnnotation: true,
Expand Down Expand Up @@ -333,6 +334,7 @@ type typeNeeded struct {
Plural string
CacheType string
RBACVerbs []string
IsUDP bool

// AcceptsIngressClassNameAnnotation indicates that the object accepts (and the controller will listen to)
// the "kubernetes.io/ingress.class" annotation to decide whether or not the object is supported.
Expand Down Expand Up @@ -627,7 +629,11 @@ func (r *{{.PackageAlias}}{{.Kind}}Reconciler) Reconcile(ctx context.Context, re
}
log.V(util.DebugLevel).Info("determining gateway addresses for object status updates", "namespace", req.Namespace, "name", req.Name)
{{- if .IsUDP }}
addrs, err := r.DataplaneAddressFinder.GetUDPLoadBalancerAddresses()
{{- else }}
addrs, err := r.DataplaneAddressFinder.GetLoadBalancerAddresses()
{{- end }}
if err != nil {
return ctrl.Result{}, err
}
Expand Down
Loading

0 comments on commit 3aade6e

Please sign in to comment.