Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Zahari Dichev <[email protected]>
  • Loading branch information
zaharidichev committed Nov 20, 2024
1 parent 429db57 commit 203bf0e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
42 changes: 21 additions & 21 deletions policy-test/tests/outbound_api_tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,11 @@ async fn parent_with_tcp_routes_with_backend(
ns: &str,
) {
let backends = [rule_backend.clone()];
let route = mk_tcp_route(&ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(&client, route.build()).await;
await_tcp_route_status(&client, &ns, "foo-route").await;
let route = mk_tcp_route(ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(client, route.build()).await;
await_tcp_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
Expand All @@ -491,11 +491,11 @@ async fn parent_with_tcp_routes_with_invalid_backend(
ns: &str,
) {
let backends = [backend];
let route = mk_tcp_route(&ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(&client, route.build()).await;
await_tcp_route_status(&client, &ns, "foo-route").await;
let route = mk_tcp_route(ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(client, route.build()).await;
await_tcp_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()
Expand All @@ -517,15 +517,15 @@ async fn parent_with_multiple_tcp_routes(parent: Resource, client: &kube::Client
// name. To ensure that this test isn't timing dependant, routes should
// be created in alphabetical order.
let _a_route = create(
&client,
mk_tcp_route(&ns, "a-route", &parent, Some(4191))
client,
mk_tcp_route(ns, "a-route", &parent, Some(4191))
.with_backends(&[parent.clone()])
.build(),
)
.await;
await_tcp_route_status(&client, &ns, "a-route").await;
await_tcp_route_status(client, ns, "a-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;

// First route update.
let config = rx
Expand All @@ -538,13 +538,13 @@ async fn parent_with_multiple_tcp_routes(parent: Resource, client: &kube::Client
assert_resource_meta(&config.metadata, &parent, 4191);

let _b_route = create(
&client,
mk_tcp_route(&ns, "b-route", &parent, Some(4191))
client,
mk_tcp_route(ns, "b-route", &parent, Some(4191))
.with_backends(&[parent.clone()])
.build(),
)
.await;
await_tcp_route_status(&client, &ns, "b-route").await;
await_tcp_route_status(client, ns, "b-route").await;

// Second route update.
let config = rx
Expand All @@ -563,15 +563,15 @@ async fn parent_with_multiple_tcp_routes(parent: Resource, client: &kube::Client

async fn tcp_route_reattachment(parent: Resource, client: &kube::Client, ns: &str) {
let mut route = create(
&client,
mk_tcp_route(&ns, "foo-route", &parent, Some(4191))
client,
mk_tcp_route(ns, "foo-route", &parent, Some(4191))
.with_backends(&[parent.clone()])
.build(),
)
.await;
await_tcp_route_status(&client, &ns, "foo-route").await;
await_tcp_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
Expand All @@ -595,7 +595,7 @@ async fn tcp_route_reattachment(parent: Resource, client: &kube::Client, ns: &st
.first_mut()
.unwrap()
.name = "other".to_string();
update(&client, route.clone()).await;
update(client, route.clone()).await;

let config = rx
.next()
Expand All @@ -621,7 +621,7 @@ async fn tcp_route_reattachment(parent: Resource, client: &kube::Client, ns: &st
.first_mut()
.unwrap()
.name = parent.name();
update(&client, route).await;
update(client, route).await;

let config = rx
.next()
Expand Down
42 changes: 21 additions & 21 deletions policy-test/tests/outbound_api_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,11 @@ async fn parent_with_tls_routes_with_backend(
ns: &str,
) {
let backends = [rule_backend.clone()];
let route = mk_tls_route(&ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(&client, route.build()).await;
await_tls_route_status(&client, &ns, "foo-route").await;
let route = mk_tls_route(ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(client, route.build()).await;
await_tls_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
Expand All @@ -492,11 +492,11 @@ async fn parent_with_tls_routes_with_invalid_backend(
ns: &str,
) {
let backends = [backend];
let route = mk_tls_route(&ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(&client, route.build()).await;
await_tls_route_status(&client, &ns, "foo-route").await;
let route = mk_tls_route(ns, "foo-route", &parent, Some(4191)).with_backends(&backends);
let _route = create(client, route.build()).await;
await_tls_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()
Expand All @@ -518,15 +518,15 @@ async fn parent_with_multiple_tls_routes(parent: Resource, client: &kube::Client
// name. To ensure that this test isn't timing dependant, routes should
// be created in alphabetical order.
let _a_route = create(
&client,
mk_tls_route(&ns, "a-route", &parent, Some(4191))
client,
mk_tls_route(ns, "a-route", &parent, Some(4191))
.with_backends(&[parent.clone()])
.build(),
)
.await;
await_tls_route_status(&client, &ns, "a-route").await;
await_tls_route_status(client, ns, "a-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;

// First route update.
let config = rx
Expand All @@ -539,13 +539,13 @@ async fn parent_with_multiple_tls_routes(parent: Resource, client: &kube::Client
assert_resource_meta(&config.metadata, &parent, 4191);

let _b_route = create(
&client,
mk_tls_route(&ns, "b-route", &parent, Some(4191))
client,
mk_tls_route(ns, "b-route", &parent, Some(4191))
.with_backends(&[parent.clone()])
.build(),
)
.await;
await_tls_route_status(&client, &ns, "b-route").await;
await_tls_route_status(client, ns, "b-route").await;

// Second route update.
let config = rx
Expand All @@ -569,15 +569,15 @@ async fn parent_with_multiple_tls_routes(parent: Resource, client: &kube::Client

async fn tls_route_reattachment(parent: Resource, client: &kube::Client, ns: &str) {
let mut route = create(
&client,
mk_tls_route(&ns, "foo-route", &parent, Some(4191))
client,
mk_tls_route(ns, "foo-route", &parent, Some(4191))
.with_backends(&[parent.clone()])
.build(),
)
.await;
await_tls_route_status(&client, &ns, "foo-route").await;
await_tls_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
Expand All @@ -601,7 +601,7 @@ async fn tls_route_reattachment(parent: Resource, client: &kube::Client, ns: &st
.first_mut()
.unwrap()
.name = "other".to_string();
update(&client, route.clone()).await;
update(client, route.clone()).await;

let config = rx
.next()
Expand All @@ -627,7 +627,7 @@ async fn tls_route_reattachment(parent: Resource, client: &kube::Client, ns: &st
.first_mut()
.unwrap()
.name = parent.name();
update(&client, route).await;
update(client, route).await;

let config = rx
.next()
Expand Down

0 comments on commit 203bf0e

Please sign in to comment.