mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 14:14:52 +00:00
chore: validate unsupported tcp/udp protocols for ingress port
This commit is contained in:
1 parent
e130d803e4
commit
efe646f54c
1 file changed
+7
-1
@@ -38,8 +38,14 @@ func (s *ServiceSpec) Validate() error {
|
|||||||
return fmt.Errorf("invalid mode: %q", s.Mode)
|
return fmt.Errorf("invalid mode: %q", s.Mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, p := range s.Ports {
|
||||||
|
if (p.Mode == "" || p.Mode == PortModeIngress) &&
|
||||||
|
p.Protocol != ProtocolHTTP && p.Protocol != ProtocolHTTPS {
|
||||||
|
return fmt.Errorf("unsupported protocol for ingress port %d: %s", p.ContainerPort, p.Protocol)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: validate there is no conflict between ports.
|
// TODO: validate there is no conflict between ports.
|
||||||
// TODO: return error if there are non-HTTP/HTTPS ingress ports that we don't support yet.
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user