From afe7c33d399da31a003889c5ddee6b674a6c4126 Mon Sep 17 00:00:00 2001 From: Zahari Dichev Date: Wed, 20 Nov 2024 10:46:01 +0000 Subject: [PATCH] clippy Signed-off-by: Zahari Dichev --- .../k8s/index/src/outbound/index.rs | 2 +- policy-test/tests/e2e_egress_network.rs | 53 --------- policy-test/tests/outbound_api_gateway.rs | 110 ++++++++---------- policy-test/tests/outbound_api_grpc.rs | 28 ++--- policy-test/tests/outbound_api_linkerd.rs | 106 ++++++++--------- 5 files changed, 119 insertions(+), 180 deletions(-) delete mode 100644 policy-test/tests/e2e_egress_network.rs diff --git a/policy-controller/k8s/index/src/outbound/index.rs b/policy-controller/k8s/index/src/outbound/index.rs index 98f5945abc61a..4a8f53c17b238 100644 --- a/policy-controller/k8s/index/src/outbound/index.rs +++ b/policy-controller/k8s/index/src/outbound/index.rs @@ -654,7 +654,7 @@ impl Index { fn reinitialize_egress_watches(&mut self, namespace: &str) { for ns in self.namespaces.by_ns.values_mut() { - if namespace == &*self.global_egress_network_namespace || namespace == &*ns.namespace { + if namespace == *self.global_egress_network_namespace || namespace == *ns.namespace { ns.reinitialize_egress_watches() } } diff --git a/policy-test/tests/e2e_egress_network.rs b/policy-test/tests/e2e_egress_network.rs deleted file mode 100644 index 2bb240b529065..0000000000000 --- a/policy-test/tests/e2e_egress_network.rs +++ /dev/null @@ -1,53 +0,0 @@ -use linkerd_policy_controller_k8s_api as k8s; -use linkerd_policy_test::{ - await_condition, create, create_ready_pod, curl, endpoints_ready, update, web, with_temp_ns, - LinkerdInject, -}; - -#[tokio::test(flavor = "current_thread")] -async fn default_traffic_policy() { - with_temp_ns(|client, ns| async move { - let mut egress_net = create( - &client, - k8s::policy::EgressNetwork { - metadata: k8s::ObjectMeta { - namespace: Some(ns.clone()), - name: Some("all-egress".to_string()), - ..Default::default() - }, - spec: k8s::policy::EgressNetworkSpec { - networks: None, - traffic_policy: k8s::policy::TrafficPolicy::Allow, - }, - status: None, - }, - ) - .await; - - let curl = curl::Runner::init(&client, &ns).await; - - let allowed = curl - .run( - "curl-allowed", - "http://httpbin.org/get", - LinkerdInject::Enabled, - ) - .await; - let allowed_status = allowed.http_status_code().await; - assert_eq!(allowed_status, 200, "request must be allowed"); - - egress_net.spec.traffic_policy = k8s::policy::TrafficPolicy::Deny; - update(&client, egress_net).await; - - let not_allowed = curl - .run( - "curl-not-allowed", - "http://httpbin.org/get", - LinkerdInject::Enabled, - ) - .await; - let not_allowed_status = not_allowed.http_status_code().await; - assert_eq!(not_allowed_status, 403, "request must be blocked"); - }) - .await; -} diff --git a/policy-test/tests/outbound_api_gateway.rs b/policy-test/tests/outbound_api_gateway.rs index 05c28ce577231..e466a83088bb2 100644 --- a/policy-test/tests/outbound_api_gateway.rs +++ b/policy-test/tests/outbound_api_gateway.rs @@ -1179,7 +1179,7 @@ fn mk_empty_http_route( } async fn parent_with_no_http_routes(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1197,7 +1197,7 @@ async fn parent_with_no_http_routes(parent: Resource, client: &kube::Client, ns: } async fn parent_with_http_route_without_rules(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1213,12 +1213,8 @@ async fn parent_with_http_route_without_rules(parent: Resource, client: &kube::C assert_route_is_default(route, &parent, 4191); }); - let _route = create( - &client, - mk_empty_http_route(&ns, "foo-route", &parent, 4191), - ) - .await; - await_gateway_route_status(&client, &ns, "foo-route").await; + let _route = create(client, mk_empty_http_route(ns, "foo-route", &parent, 4191)).await; + await_gateway_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1241,7 +1237,7 @@ async fn parent_with_http_routes_without_backends( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1258,11 +1254,11 @@ async fn parent_with_http_routes_without_backends( }); let _route = create( - &client, - mk_http_route(&ns, "foo-route", &parent, Some(4191)).build(), + client, + mk_http_route(ns, "foo-route", &parent, Some(4191)).build(), ) .await; - await_gateway_route_status(&client, &ns, "foo-route").await; + await_gateway_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1288,7 +1284,7 @@ async fn parent_with_http_routes_with_backend( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1305,13 +1301,13 @@ async fn parent_with_http_routes_with_backend( }); let backends = [rule_backend.clone()]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)).with_backends( + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)).with_backends( Some(&backends), None, None, ); - let _route = create(&client, route.build()).await; - await_gateway_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_gateway_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1339,7 +1335,7 @@ async fn parent_with_http_routes_with_invalid_backend( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1356,13 +1352,13 @@ async fn parent_with_http_routes_with_invalid_backend( }); let backends = [backend]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)).with_backends( + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)).with_backends( Some(&backends), None, None, ); - let _route = create(&client, route.build()).await; - await_gateway_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_gateway_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1383,7 +1379,7 @@ async fn parent_with_http_routes_with_invalid_backend( } async fn parent_with_multiple_http_routes(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1403,11 +1399,11 @@ async fn parent_with_multiple_http_routes(parent: Resource, client: &kube::Clien // name. To ensure that this test isn't timing dependant, routes should // be created in alphabetical order. let _a_route = create( - &client, - mk_http_route(&ns, "a-route", &parent, Some(4191)).build(), + client, + mk_http_route(ns, "a-route", &parent, Some(4191)).build(), ) .await; - await_gateway_route_status(&client, &ns, "a-route").await; + await_gateway_route_status(client, ns, "a-route").await; // First route update. let config = rx @@ -1420,11 +1416,11 @@ async fn parent_with_multiple_http_routes(parent: Resource, client: &kube::Clien assert_resource_meta(&config.metadata, &parent, 4191); let _b_route = create( - &client, - mk_http_route(&ns, "b-route", &parent, Some(4191)).build(), + client, + mk_http_route(ns, "b-route", &parent, Some(4191)).build(), ) .await; - await_gateway_route_status(&client, &ns, "b-route").await; + await_gateway_route_status(client, ns, "b-route").await; // Second route update. let config = rx @@ -1452,7 +1448,7 @@ async fn parent_with_consecutive_failure_accrual( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1482,7 +1478,7 @@ async fn parent_with_consecutive_failure_accrual_defaults_no_config( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1506,7 +1502,7 @@ async fn parent_with_consecutive_failure_accrual_defaults_max_fails( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1530,7 +1526,7 @@ async fn parent_with_consecutive_failure_accrual_defaults_max_jitter( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1562,7 +1558,7 @@ async fn parent_with_default_failure_accrual( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent_default_config, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent_default_config, 4191).await; let config = rx .next() .await @@ -1578,7 +1574,7 @@ async fn parent_with_default_failure_accrual( ); }); - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent_max_failures, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent_max_failures, 4191).await; let config = rx .next() .await @@ -1596,7 +1592,7 @@ async fn parent_with_default_failure_accrual( } async fn opaque_parent(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1612,7 +1608,7 @@ async fn opaque_parent(parent: Resource, client: &kube::Client, ns: &str) { } async fn route_with_filters(parent: Resource, backend: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1627,7 +1623,7 @@ async fn route_with_filters(parent: Resource, backend: Resource, client: &kube:: }); let backends = [backend.clone()]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)) + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)) .with_backends(Some(&backends), None, None) .with_filters(Some(vec![ k8s_gateway_api::HttpRouteFilter::RequestHeaderModifier { @@ -1655,8 +1651,8 @@ async fn route_with_filters(parent: Resource, backend: Resource, client: &kube:: }, }, ])); - let _route = create(&client, route.build()).await; - await_gateway_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_gateway_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1726,7 +1722,7 @@ async fn backend_with_filters( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1741,7 +1737,7 @@ async fn backend_with_filters( }); let backends = [backend_for_parent.clone()]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)).with_backends( + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)).with_backends( Some(&backends), None, Some(vec![ @@ -1771,8 +1767,8 @@ async fn backend_with_filters( }, ]), ); - let _route = create(&client, route.build()).await; - await_gateway_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_gateway_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1842,8 +1838,8 @@ async fn backend_with_filters( async fn http_route_retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) { let _route = create( - &client, - mk_http_route(&ns, "foo-route", &parent, Some(4191)) + client, + mk_http_route(ns, "foo-route", &parent, Some(4191)) .with_annotations( vec![ ("retry.linkerd.io/http".to_string(), "5xx".to_string()), @@ -1856,9 +1852,9 @@ async fn http_route_retries_and_timeouts(parent: Resource, client: &kube::Client ) .await; - await_gateway_route_status(&client, &ns, "foo-route").await; + await_gateway_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1892,8 +1888,8 @@ async fn http_route_retries_and_timeouts(parent: Resource, client: &kube::Client async fn retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) { let _route = create( - &client, - mk_http_route(&ns, "foo-route", &parent, Some(4191)) + client, + mk_http_route(ns, "foo-route", &parent, Some(4191)) .with_annotations( vec![ // Route annotations override the timeout config specified @@ -1906,9 +1902,9 @@ async fn retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) .build(), ) .await; - await_gateway_route_status(&client, &ns, "foo-route").await; + await_gateway_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1939,14 +1935,10 @@ async fn retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) } async fn http_route_reattachment(parent: Resource, client: &kube::Client, ns: &str) { - let mut route = create( - &client, - mk_empty_http_route(&ns, "foo-route", &parent, 4191), - ) - .await; - await_gateway_route_status(&client, &ns, "foo-route").await; + let mut route = create(client, mk_empty_http_route(ns, "foo-route", &parent, 4191)).await; + await_gateway_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1971,7 +1963,7 @@ async fn http_route_reattachment(parent: Resource, client: &kube::Client, ns: &s .first_mut() .unwrap() .name = "other".to_string(); - update(&client, route.clone()).await; + update(client, route.clone()).await; let config = rx .next() @@ -1997,7 +1989,7 @@ async fn http_route_reattachment(parent: Resource, client: &kube::Client, ns: &s .first_mut() .unwrap() .name = parent.name(); - update(&client, route).await; + update(client, route).await; let config = rx .next() diff --git a/policy-test/tests/outbound_api_grpc.rs b/policy-test/tests/outbound_api_grpc.rs index 08c59d89d6d31..5f31f30d13047 100644 --- a/policy-test/tests/outbound_api_grpc.rs +++ b/policy-test/tests/outbound_api_grpc.rs @@ -140,13 +140,13 @@ impl GrpcRouteBuilder { async fn grpc_route_reattachment(parent: Resource, client: &kube::Client, ns: &str) { let mut route = create( - &client, - mk_grpc_route(&ns, "foo-route", &parent, Some(4191)).build(), + client, + mk_grpc_route(ns, "foo-route", &parent, Some(4191)).build(), ) .await; - await_grpc_route_status(&client, &ns, "foo-route").await; + await_grpc_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -172,7 +172,7 @@ async fn grpc_route_reattachment(parent: Resource, client: &kube::Client, ns: &s .first_mut() .unwrap() .name = "other".to_string(); - update(&client, route.clone()).await; + update(client, route.clone()).await; let config = rx .next() @@ -199,7 +199,7 @@ async fn grpc_route_reattachment(parent: Resource, client: &kube::Client, ns: &s .first_mut() .unwrap() .name = parent.name(); - update(&client, route).await; + update(client, route).await; let config = rx .next() @@ -221,8 +221,8 @@ async fn grpc_route_reattachment(parent: Resource, client: &kube::Client, ns: &s async fn grpc_route_retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) { let _route = create( - &client, - mk_grpc_route(&ns, "foo-route", &parent, Some(4191)) + client, + mk_grpc_route(ns, "foo-route", &parent, Some(4191)) .with_annotations( vec![ ("retry.linkerd.io/grpc".to_string(), "internal".to_string()), @@ -234,9 +234,9 @@ async fn grpc_route_retries_and_timeouts(parent: Resource, client: &kube::Client .build(), ) .await; - await_grpc_route_status(&client, &ns, "foo-route").await; + await_grpc_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -267,8 +267,8 @@ async fn grpc_route_retries_and_timeouts(parent: Resource, client: &kube::Client async fn parent_retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) { let _route = create( - &client, - mk_grpc_route(&ns, "foo-route", &parent, Some(4191)) + client, + mk_grpc_route(ns, "foo-route", &parent, Some(4191)) .with_annotations( vec![ // Route annotations override the timeout config specified @@ -281,9 +281,9 @@ async fn parent_retries_and_timeouts(parent: Resource, client: &kube::Client, ns .build(), ) .await; - await_grpc_route_status(&client, &ns, "foo-route").await; + await_grpc_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await diff --git a/policy-test/tests/outbound_api_linkerd.rs b/policy-test/tests/outbound_api_linkerd.rs index 7e76a1398b4d2..230c3506de4ca 100644 --- a/policy-test/tests/outbound_api_linkerd.rs +++ b/policy-test/tests/outbound_api_linkerd.rs @@ -1181,7 +1181,7 @@ fn mk_empty_http_route( } async fn parent_with_no_http_routes(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1199,7 +1199,7 @@ async fn parent_with_no_http_routes(parent: Resource, client: &kube::Client, ns: } async fn parent_with_http_route_without_rules(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1216,11 +1216,11 @@ async fn parent_with_http_route_without_rules(parent: Resource, client: &kube::C }); let _route = create( - &client, - mk_empty_http_route(&ns, "foo-route", &parent, 4191), + client, + mk_empty_http_route(ns, "foo-route", &parent, 4191), ) .await; - await_route_status(&client, &ns, "foo-route").await; + await_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1243,7 +1243,7 @@ async fn parent_with_http_routes_without_backends( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1260,11 +1260,11 @@ async fn parent_with_http_routes_without_backends( }); let _route = create( - &client, - mk_http_route(&ns, "foo-route", &parent, Some(4191)).build(), + client, + mk_http_route(ns, "foo-route", &parent, Some(4191)).build(), ) .await; - await_route_status(&client, &ns, "foo-route").await; + await_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1290,7 +1290,7 @@ async fn parent_with_http_routes_with_backend( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1307,13 +1307,13 @@ async fn parent_with_http_routes_with_backend( }); let backends = [rule_backend.clone()]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)).with_backends( + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)).with_backends( Some(&backends), None, None, ); - let _route = create(&client, route.build()).await; - await_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1341,7 +1341,7 @@ async fn parent_with_http_routes_with_invalid_backend( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1358,13 +1358,13 @@ async fn parent_with_http_routes_with_invalid_backend( }); let backends = [backend]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)).with_backends( + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)).with_backends( Some(&backends), None, None, ); - let _route = create(&client, route.build()).await; - await_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1385,7 +1385,7 @@ async fn parent_with_http_routes_with_invalid_backend( } async fn parent_with_multiple_http_routes(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1405,11 +1405,11 @@ async fn parent_with_multiple_http_routes(parent: Resource, client: &kube::Clien // name. To ensure that this test isn't timing dependant, routes should // be created in alphabetical order. let _a_route = create( - &client, - mk_http_route(&ns, "a-route", &parent, Some(4191)).build(), + client, + mk_http_route(ns, "a-route", &parent, Some(4191)).build(), ) .await; - await_route_status(&client, &ns, "a-route").await; + await_route_status(client, ns, "a-route").await; // First route update. let config = rx @@ -1422,11 +1422,11 @@ async fn parent_with_multiple_http_routes(parent: Resource, client: &kube::Clien assert_resource_meta(&config.metadata, &parent, 4191); let _b_route = create( - &client, - mk_http_route(&ns, "b-route", &parent, Some(4191)).build(), + client, + mk_http_route(ns, "b-route", &parent, Some(4191)).build(), ) .await; - await_route_status(&client, &ns, "b-route").await; + await_route_status(client, ns, "b-route").await; // Second route update. let config = rx @@ -1454,7 +1454,7 @@ async fn parent_with_consecutive_failure_accrual( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1484,7 +1484,7 @@ async fn parent_with_consecutive_failure_accrual_defaults_no_config( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1508,7 +1508,7 @@ async fn parent_with_consecutive_failure_accrual_defaults_max_fails( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1532,7 +1532,7 @@ async fn parent_with_consecutive_failure_accrual_defaults_max_jitter( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1564,7 +1564,7 @@ async fn parent_with_default_failure_accrual( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent_default_config, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent_default_config, 4191).await; let config = rx .next() .await @@ -1580,7 +1580,7 @@ async fn parent_with_default_failure_accrual( ); }); - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent_max_failures, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent_max_failures, 4191).await; let config = rx .next() .await @@ -1598,7 +1598,7 @@ async fn parent_with_default_failure_accrual( } async fn opaque_parent(parent: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1614,7 +1614,7 @@ async fn opaque_parent(parent: Resource, client: &kube::Client, ns: &str) { } async fn route_with_filters(parent: Resource, backend: Resource, client: &kube::Client, ns: &str) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1629,7 +1629,7 @@ async fn route_with_filters(parent: Resource, backend: Resource, client: &kube:: }); let backends = [backend.clone()]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)) + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)) .with_backends(Some(&backends), None, None) .with_filters(Some(vec![ k8s::policy::httproute::HttpRouteFilter::RequestHeaderModifier { @@ -1657,8 +1657,8 @@ async fn route_with_filters(parent: Resource, backend: Resource, client: &kube:: }, }, ])); - let _route = create(&client, route.build()).await; - await_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1728,7 +1728,7 @@ async fn backend_with_filters( client: &kube::Client, ns: &str, ) { - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1743,7 +1743,7 @@ async fn backend_with_filters( }); let backends = [backend_for_parent.clone()]; - let route = mk_http_route(&ns, "foo-route", &parent, Some(4191)).with_backends( + let route = mk_http_route(ns, "foo-route", &parent, Some(4191)).with_backends( Some(&backends), None, Some(vec![ @@ -1773,8 +1773,8 @@ async fn backend_with_filters( }, ]), ); - let _route = create(&client, route.build()).await; - await_route_status(&client, &ns, "foo-route").await; + let _route = create(client, route.build()).await; + await_route_status(client, ns, "foo-route").await; let config = rx .next() @@ -1844,8 +1844,8 @@ async fn backend_with_filters( async fn http_route_retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) { let _route = create( - &client, - mk_http_route(&ns, "foo-route", &parent, Some(4191)) + client, + mk_http_route(ns, "foo-route", &parent, Some(4191)) .with_annotations( vec![ ("retry.linkerd.io/http".to_string(), "5xx".to_string()), @@ -1858,9 +1858,9 @@ async fn http_route_retries_and_timeouts(parent: Resource, client: &kube::Client ) .await; - await_route_status(&client, &ns, "foo-route").await; + await_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1894,8 +1894,8 @@ async fn http_route_retries_and_timeouts(parent: Resource, client: &kube::Client async fn retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) { let _route = create( - &client, - mk_http_route(&ns, "foo-route", &parent, Some(4191)) + client, + mk_http_route(ns, "foo-route", &parent, Some(4191)) .with_annotations( vec![ // Route annotations override the timeout config specified @@ -1908,9 +1908,9 @@ async fn retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) .build(), ) .await; - await_route_status(&client, &ns, "foo-route").await; + await_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1942,13 +1942,13 @@ async fn retries_and_timeouts(parent: Resource, client: &kube::Client, ns: &str) async fn http_route_reattachment(parent: Resource, client: &kube::Client, ns: &str) { let mut route = create( - &client, - mk_empty_http_route(&ns, "foo-route", &parent, 4191), + client, + mk_empty_http_route(ns, "foo-route", &parent, 4191), ) .await; - await_route_status(&client, &ns, "foo-route").await; + await_route_status(client, ns, "foo-route").await; - let mut rx = retry_watch_outbound_policy(&client, &ns, &parent, 4191).await; + let mut rx = retry_watch_outbound_policy(client, ns, &parent, 4191).await; let config = rx .next() .await @@ -1973,7 +1973,7 @@ async fn http_route_reattachment(parent: Resource, client: &kube::Client, ns: &s .first_mut() .unwrap() .name = "other".to_string(); - update(&client, route.clone()).await; + update(client, route.clone()).await; let config = rx .next() @@ -1999,7 +1999,7 @@ async fn http_route_reattachment(parent: Resource, client: &kube::Client, ns: &s .first_mut() .unwrap() .name = parent.name(); - update(&client, route).await; + update(client, route).await; let config = rx .next()