-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update matcher #431
Merged
Merged
Update matcher #431
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6b5f9b1
Update matcher.
EvanHStanton 426cc47
Update ingress matcher and manager app_name.
EvanHStanton ecaefae
Update crd.
EvanHStanton 480be66
Update integration_tests.rs assertion.
EvanHStanton eb64062
Fix matcher format
ianstanton 77d5339
Fix test
ianstanton 82b9bfb
Merge branch 'main' into update-matcher
ChuckHend 240ffd6
Format.
EvanHStanton 5f35318
Merge branch 'main' into update-matcher
ChuckHend File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,7 +269,7 @@ pub fn generate_ingress_tcp_routes( | |
continue; | ||
} | ||
|
||
let matcher = format!("{host_matcher} && PathPrefix(`{}`)", path); | ||
let matcher = format!("HostSNI(`{}`)", host_matcher); | ||
let middlewares: Option<Vec<IngressRouteTCPRoutesMiddlewares>> = | ||
route.middlewares.clone().map(|names| { | ||
names | ||
|
@@ -398,9 +398,10 @@ pub async fn reconcile_ingress_tcp( | |
desired_routes: Vec<IngressRouteTCPRoutes>, | ||
desired_middlewares: Vec<Middleware>, | ||
entry_points_tcp: Vec<String>, | ||
app_name: &str, | ||
) -> Result<(), kube::Error> { | ||
let ingress_api: Api<IngressRouteTCP> = Api::namespaced(client.clone(), ns); | ||
let name = format!("{}-apps", coredb_name); | ||
let name = format!("{}-{}", coredb_name, app_name); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👌 |
||
|
||
let middleware_api: Api<TraefikMiddleware> = Api::namespaced(client.clone(), ns); | ||
let desired_middlewares = generate_middlewares(&name, ns, oref.clone(), desired_middlewares); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -633,6 +633,9 @@ pub async fn reconcile_app_services(cdb: &CoreDB, ctx: Arc<Context>) -> Result<( | |
"localhost".to_string() | ||
} | ||
}; | ||
|
||
// Iterate over each AppService and process routes | ||
|
||
let resources: Vec<AppServiceResources> = appsvcs | ||
.iter() | ||
.map(|appsvc| generate_resource(appsvc, &coredb_name, &ns, oref.clone(), domain.to_owned())) | ||
|
@@ -692,29 +695,33 @@ pub async fn reconcile_app_services(cdb: &CoreDB, ctx: Arc<Context>) -> Result<( | |
} | ||
} | ||
|
||
match reconcile_ingress_tcp( | ||
client.clone(), | ||
&coredb_name, | ||
&ns, | ||
oref.clone(), | ||
desired_tcp_routes, | ||
desired_middlewares, | ||
desired_entry_points_tcp, | ||
) | ||
.await | ||
{ | ||
Ok(_) => { | ||
debug!("Updated/applied IngressRouteTCP for {}.{}", ns, coredb_name,); | ||
} | ||
Err(e) => { | ||
error!( | ||
"Failed to update/apply IngressRouteTCP {}.{}: {}", | ||
ns, coredb_name, e | ||
); | ||
has_errors = true; | ||
for appsvc in appsvcs.iter() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a follow-up, let's make sure the expected |
||
let app_name = appsvc.name.clone(); | ||
|
||
match reconcile_ingress_tcp( | ||
client.clone(), | ||
&coredb_name, | ||
&ns, | ||
oref.clone(), | ||
desired_tcp_routes.clone(), | ||
desired_middlewares.clone(), | ||
desired_entry_points_tcp.clone(), | ||
&app_name, | ||
) | ||
.await | ||
{ | ||
Ok(_) => { | ||
debug!("Updated/applied IngressRouteTCP for {}.{}", ns, coredb_name,); | ||
} | ||
Err(e) => { | ||
error!( | ||
"Failed to update/apply IngressRouteTCP {}.{}: {}", | ||
ns, coredb_name, e | ||
); | ||
has_errors = true; | ||
} | ||
} | ||
} | ||
|
||
if has_errors || apply_errored { | ||
return Err(Action::requeue(Duration::from_secs(300))); | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to update some assertions in the
functional_test_app_service
integration test