Skip to content

Commit ade4a1b

Browse files
committed
Rename operator to webhook
1 parent 516f94d commit ade4a1b

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

crates/stackable-webhook/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ pub enum WebhookServerError {
5454
///
5555
/// let webhook_options = WebhookServerOptions {
5656
/// socket_addr: WebhookServer::DEFAULT_SOCKET_ADDRESS,
57-
/// operator_namespace: "my-namespace".to_owned(),
58-
/// operator_service_name: "my-operator".to_owned(),
57+
/// webhook_namespace: "my-namespace".to_owned(),
58+
/// webhook_service_name: "my-operator".to_owned(),
5959
/// };
6060
/// let webhook_server = WebhookServer::new(webhook_options, webhooks).await.unwrap();
6161
/// # }
@@ -72,11 +72,11 @@ pub struct WebhookServerOptions {
7272
/// The HTTPS socket address the [`TcpListener`][tokio::net::TcpListener] binds to.
7373
pub socket_addr: SocketAddr,
7474

75-
/// The namespace the operator/webhook is running in.
76-
pub operator_namespace: String,
75+
/// The namespace the webhook is running in.
76+
pub webhook_namespace: String,
7777

78-
/// The name of the Kubernetes service which points to the operator/webhook.
79-
pub operator_service_name: String,
78+
/// The name of the Kubernetes service which points to the webhook.
79+
pub webhook_service_name: String,
8080
}
8181

8282
impl WebhookServer {

crates/stackable-webhook/src/servers/conversion_webhook.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ where
130130
conversion_review_versions: vec!["v1".to_owned()],
131131
client_config: Some(WebhookClientConfig {
132132
service: Some(ServiceReference {
133-
name: options.operator_service_name.to_owned(),
134-
namespace: options.operator_namespace.to_owned(),
133+
name: options.webhook_service_name.to_owned(),
134+
namespace: options.webhook_namespace.to_owned(),
135135
path: Some(format!("/convert/{crd_name}")),
136136
port: Some(options.socket_addr.port().into()),
137137
}),

crates/stackable-webhook/src/servers/mutating_webhook.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ where
198198
// We know how we can be called (and with what certificate), so we can always set that
199199
webhook.client_config = WebhookClientConfig {
200200
service: Some(ServiceReference {
201-
name: options.operator_service_name.to_owned(),
202-
namespace: options.operator_namespace.to_owned(),
201+
name: options.webhook_service_name.to_owned(),
202+
namespace: options.webhook_namespace.to_owned(),
203203
path: Some(self.http_path()),
204204
port: Some(options.socket_addr.port().into()),
205205
}),

crates/stackable-webhook/src/tls/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ impl TlsServer {
9292

9393
let WebhookServerOptions {
9494
socket_addr,
95-
operator_namespace,
96-
operator_service_name,
95+
webhook_namespace,
96+
webhook_service_name,
9797
} = options;
9898

9999
// This is how Kubernetes calls us, so it decides about the naming.
100100
// AFAIK we can not influence this, so this is the only SAN entry needed.
101101
// TODO (@Techassi): The cluster domain should be included here, so that (non Kubernetes)
102102
// HTTP clients can use the FQDN of the service for testing or user use-cases.
103103
let subject_alterative_dns_names =
104-
vec![format!("{operator_service_name}.{operator_namespace}.svc")];
104+
vec![format!("{webhook_service_name}.{webhook_namespace}.svc")];
105105

106106
let cert_resolver = CertificateResolver::new(subject_alterative_dns_names, certificate_tx)
107107
.await

0 commit comments

Comments
 (0)