Skip to content

Commit d4e105f

Browse files
authored
chore(cat-gateway): rm auth k8s health check (#1747)
* refactor(rm auth): k8s health check * refactor(rm auth): k8s health check * refactor(rm auth): k8s health check * schema version check tmp removal * schema version check tmp removal
1 parent 0d795ac commit d4e105f

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

catalyst-gateway/bin/src/service/api/health/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Health Endpoints
22
use poem_openapi::{param::Query, OpenApi};
33

4-
use crate::service::common::{auth::api_key::InternalApiKeyAuthorization, tags::ApiTags};
4+
use crate::service::common::{auth::none::NoAuthorization, tags::ApiTags};
55

66
mod inspection_get;
77
mod live_get;
@@ -28,7 +28,7 @@ impl HealthApi {
2828
method = "get",
2929
operation_id = "healthStarted"
3030
)]
31-
async fn started_get(&self, _auth: InternalApiKeyAuthorization) -> started_get::AllResponses {
31+
async fn started_get(&self, _auth: NoAuthorization) -> started_get::AllResponses {
3232
started_get::endpoint().await
3333
}
3434

@@ -46,7 +46,7 @@ impl HealthApi {
4646
method = "get",
4747
operation_id = "healthReady"
4848
)]
49-
async fn ready_get(&self, _auth: InternalApiKeyAuthorization) -> ready_get::AllResponses {
49+
async fn ready_get(&self, _auth: NoAuthorization) -> ready_get::AllResponses {
5050
ready_get::endpoint().await
5151
}
5252

@@ -59,7 +59,7 @@ impl HealthApi {
5959
/// *This endpoint is for internal use of the service deployment infrastructure.
6060
/// It may not be exposed publicly. Refer to []*
6161
#[oai(path = "/v1/health/live", method = "get", operation_id = "healthLive")]
62-
async fn live_get(&self, _auth: InternalApiKeyAuthorization) -> live_get::AllResponses {
62+
async fn live_get(&self, _auth: NoAuthorization) -> live_get::AllResponses {
6363
live_get::endpoint().await
6464
}
6565

@@ -84,7 +84,7 @@ impl HealthApi {
8484
/// Enable or disable Verbose Query inspection in the logs. Used to find query
8585
/// performance issues.
8686
query_inspection: Query<Option<inspection_get::DeepQueryInspectionFlag>>,
87-
_auth: InternalApiKeyAuthorization,
87+
_auth: NoAuthorization,
8888
) -> inspection_get::AllResponses {
8989
inspection_get::endpoint(log_level.0, query_inspection.0).await
9090
}

catalyst-gateway/bin/src/service/api/health/ready_get.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
//! Implementation of the GET /health/ready endpoint
22
use poem_openapi::ApiResponse;
3-
use tracing::{debug, error};
43

5-
use crate::{
6-
db::event::{schema_check::MismatchedSchemaError, EventDB},
7-
service::common::responses::WithErrorResponses,
8-
};
4+
use crate::service::common::responses::WithErrorResponses;
95

106
/// Endpoint responses.
117
#[derive(ApiResponse)]
@@ -14,6 +10,7 @@ pub(crate) enum Responses {
1410
#[oai(status = 204)]
1511
NoContent,
1612
/// Service is not ready, do not send other requests.
13+
#[allow(dead_code)]
1714
#[oai(status = 503)]
1815
ServiceUnavailable,
1916
}
@@ -38,16 +35,19 @@ pub(crate) type AllResponses = WithErrorResponses<Responses>;
3835
/// and is not able to properly service requests while it is occurring.
3936
/// This would let the load balancer shift traffic to other instances of this
4037
/// service that are ready.
38+
#[allow(clippy::unused_async)]
4139
pub(crate) async fn endpoint() -> AllResponses {
42-
match EventDB::schema_version_check().await {
43-
Ok(_) => {
44-
debug!("DB schema version status ok");
45-
Responses::NoContent.into()
46-
},
47-
Err(err) if err.is::<MismatchedSchemaError>() => {
48-
error!(id="health_ready_mismatch_schema", error=?err, "DB schema version mismatch");
49-
Responses::ServiceUnavailable.into()
50-
},
51-
Err(err) => AllResponses::handle_error(&err),
52-
}
40+
// TODO: fix schema version check
41+
Responses::NoContent.into()
42+
// match EventDB::schema_version_check().await {
43+
// Ok(_) => {
44+
// debug!("DB schema version status ok");
45+
// Responses::NoContent.into()
46+
// },
47+
// Err(err) if err.is::<MismatchedSchemaError>() => {
48+
// error!(id="health_ready_mismatch_schema", error=?err, "DB schema version
49+
// mismatch"); Responses::ServiceUnavailable.into()
50+
// },
51+
// Err(err) => AllResponses::handle_error(&err),
52+
// }
5353
}

0 commit comments

Comments
 (0)