You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Ignore invalid SQLPAGE_PORT values from Kubernetes service environment variables
Co-authored-by: contact <contact@ophir.dev>
* Use custom visitor for port deserialization instead of serde_json::Value
Co-authored-by: contact <contact@ophir.dev>
* Fix clippy warnings about uninlined format args
Co-authored-by: contact <contact@ophir.dev>
* Add robust port deserialization for Kubernetes
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
// deserializes both 8080 and "tcp://1.1.1.1:9090"
450
+
#[derive(Deserialize)]
451
+
#[serde(untagged)]
452
+
enumPortOrUrl{
453
+
Port(u16),
454
+
Url(String),
455
+
}
456
+
let port_or_url:Option<PortOrUrl> = Deserialize::deserialize(deserializer)?;
457
+
match port_or_url {
458
+
Some(PortOrUrl::Port(p)) => Ok(Some(p)),
459
+
Some(PortOrUrl::Url(u)) => {
460
+
ifletOk(u) = Uri::from_str(&u){
461
+
log::warn!("{u} is not a valid value for the SQLPage port number. Ignoring this error since kubernetes may set the SQLPAGE_PORT env variable to a service URI when there is a service named sqlpage. Rename your service to avoid this warning.");
462
+
Ok(None)
463
+
}else{
464
+
Err(D::Error::custom(format!(
465
+
"Invalid port number: {u}. Expected a number between {} and {}",
0 commit comments