@@ -542,6 +542,44 @@ pub async fn discover_namespaces_with_flux_resources(client: &Client) -> Result<
542542mod tests {
543543 use super :: * ;
544544
545+ /// Build a client from a config that routes through the given proxy URL.
546+ /// `Client::try_from` is where kube rejects proxy schemes whose cargo
547+ /// feature is not compiled in — no network I/O happens here (a runtime is
548+ /// still required because the client spawns its buffer task).
549+ fn client_with_proxy ( proxy_url : & str ) -> kube:: Result < Client > {
550+ let mut config = kube:: Config :: new ( "https://kubernetes.example.com" . parse ( ) . unwrap ( ) ) ;
551+ config. proxy_url = Some ( proxy_url. parse ( ) . unwrap ( ) ) ;
552+ Client :: try_from ( config)
553+ }
554+
555+ /// Regression test for #202: the `kube/socks5` cargo feature was dropped
556+ /// in a dependency cleanup (it looks unused — no code references it), and
557+ /// every cluster with `proxy-url: socks5://…` in its kubeconfig failed at
558+ /// startup with: configured proxy … requires the disabled feature
559+ /// "kube/socks5". This fails at compile-config time if the feature is
560+ /// ever removed again.
561+ #[ tokio:: test]
562+ async fn test_client_supports_socks5_proxy ( ) {
563+ let result = client_with_proxy ( "socks5://127.0.0.1:3129" ) ;
564+ assert ! (
565+ result. is_ok( ) ,
566+ "socks5 proxy-url must be supported (kube/socks5 feature): {:?}" ,
567+ result. err( )
568+ ) ;
569+ }
570+
571+ /// Companion guard for the `kube/http-proxy` feature (same failure mode
572+ /// as #202 for `proxy-url: http://…` kubeconfigs).
573+ #[ tokio:: test]
574+ async fn test_client_supports_http_proxy ( ) {
575+ let result = client_with_proxy ( "http://127.0.0.1:3128" ) ;
576+ assert ! (
577+ result. is_ok( ) ,
578+ "http proxy-url must be supported (kube/http-proxy feature): {:?}" ,
579+ result. err( )
580+ ) ;
581+ }
582+
545583 #[ test]
546584 fn test_is_internal_host_private_ips ( ) {
547585 assert ! ( is_internal_host( "10.0.0.1" ) ) ;
0 commit comments