diff --git a/crates/k8s-version/src/lib.rs b/crates/k8s-version/src/lib.rs index a384742f0..4491b9338 100644 --- a/crates/k8s-version/src/lib.rs +++ b/crates/k8s-version/src/lib.rs @@ -23,7 +23,7 @@ //! //! ### Constructing //! -//! Alternatively, they can be constructed programatically using the +//! Alternatively, they can be constructed programmatically using the //! [`ApiVersion::new()`] and [`ApiVersion::try_new()`] functions. //! //! ``` diff --git a/crates/stackable-certs/CHANGELOG.md b/crates/stackable-certs/CHANGELOG.md index 4fc800571..a4b667147 100644 --- a/crates/stackable-certs/CHANGELOG.md +++ b/crates/stackable-certs/CHANGELOG.md @@ -14,7 +14,7 @@ All notable changes to this project will be documented in this file. - BREAKING: The functions `generate_leaf_certificate`, `generate_rsa_leaf_certificate` and `generate_ecdsa_leaf_certificate` of `CertificateAuthority` accept an additional parameter - `subject_alterative_dns_names` ([#1057]). + `subject_alternative_dns_names` ([#1057]). - The passed SANs are added to the generated certificate, this is needed when the HTTPS server is accessible on multiple DNS names and/or IPs. - Pass an empty list (`[]`) to keep the existing behavior. diff --git a/crates/stackable-certs/src/ca/mod.rs b/crates/stackable-certs/src/ca/mod.rs index 7f7160f09..12952f27a 100644 --- a/crates/stackable-certs/src/ca/mod.rs +++ b/crates/stackable-certs/src/ca/mod.rs @@ -163,7 +163,7 @@ where } /// A certificate authority (CA) which is used to generate and sign -/// intermidiate or leaf certificates. +/// intermediate or leaf certificates. #[derive(Debug)] pub struct CertificateAuthority where @@ -298,7 +298,7 @@ where key_pair: T, name: &str, scope: &str, - subject_alterative_dns_names: impl IntoIterator + Debug, + subject_alternative_dns_names: impl IntoIterator + Debug, validity: Duration, ) -> Result> where @@ -353,7 +353,7 @@ where ])) .context(AddCertificateExtensionSnafu)?; - let sans = subject_alterative_dns_names + let sans = subject_alternative_dns_names .into_iter() .map(|dns_name| { let ia5_dns_name = @@ -385,11 +385,11 @@ where &mut self, name: &str, scope: &str, - subject_alterative_dns_names: impl IntoIterator + Debug, + subject_alternative_dns_names: impl IntoIterator + Debug, validity: Duration, ) -> Result> { let key = rsa::SigningKey::new().context(GenerateRsaSigningKeySnafu)?; - self.generate_leaf_certificate(key, name, scope, subject_alterative_dns_names, validity) + self.generate_leaf_certificate(key, name, scope, subject_alternative_dns_names, validity) } /// Generates an ECDSAasync -based leaf certificate which is signed by this CA. @@ -401,11 +401,11 @@ where &mut self, name: &str, scope: &str, - subject_alterative_dns_names: impl IntoIterator + Debug, + subject_alternative_dns_names: impl IntoIterator + Debug, validity: Duration, ) -> Result> { let key = ecdsa::SigningKey::new().context(GenerateEcdsaSigningKeySnafu)?; - self.generate_leaf_certificate(key, name, scope, subject_alterative_dns_names, validity) + self.generate_leaf_certificate(key, name, scope, subject_alternative_dns_names, validity) } /// Create a [`CertificateAuthority`] from a Kubernetes [`Secret`]. diff --git a/crates/stackable-certs/src/lib.rs b/crates/stackable-certs/src/lib.rs index 5b9c87327..80ed898d2 100644 --- a/crates/stackable-certs/src/lib.rs +++ b/crates/stackable-certs/src/lib.rs @@ -43,7 +43,7 @@ pub enum CertificatePairError where E: std::error::Error + 'static, { - #[snafu(display("failed to seralize certificate as {key_encoding}"))] + #[snafu(display("failed to serialize certificate as {key_encoding}"))] SerializeCertificate { source: x509_cert::der::Error, key_encoding: KeyEncoding, diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index eba31bcbb..b9fb62d3b 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -1501,7 +1501,7 @@ Only rust documentation was changed. - status::condition module to compute the cluster resource status ([#571]). - Helper function to build RBAC resources ([#572]). - Add `ClusterResourceApplyStrategy` to `ClusterResource` ([#573]). -- Add `ClusterOperation` common struct with `reconcilation_paused` and `stopped` flags ([#573]). +- Add `ClusterOperation` common struct with `reconciliation_paused` and `stopped` flags ([#573]). [#571]: https://github.com/stackabletech/operator-rs/pull/571 [#572]: https://github.com/stackabletech/operator-rs/pull/572 @@ -1846,7 +1846,7 @@ This is a rerelease of 0.25.1 which some last-minute incompatible API changes to ### Changed -- BREAKING: Removed `commons::s3::S3ConnectionImplementation`. `commons::s3::InlinedBucketSpec::endpoint()` doesn't take arguments since the protocol decision is now based on the existance of TLS configuration ([#390]). +- BREAKING: Removed `commons::s3::S3ConnectionImplementation`. `commons::s3::InlinedBucketSpec::endpoint()` doesn't take arguments since the protocol decision is now based on the existence of TLS configuration ([#390]). - BREAKING: Changes to resource requirements structs to enable deep merging ([#392]) - Changed fields in `Resources` to no longer be optional - Changed atomic fields in `MemoryLimits`, `JvmHeapLimits`, `CpuLimits` and `PvcConfig` to be optional @@ -1882,7 +1882,7 @@ This is a rerelease of 0.25.1 which some last-minute incompatible API changes to ### Added - Export logs to Jaeger ([#360]). -- Added common datastructures shared between all operators like `Tls` oder `AuthenticationClass` ([#366]). +- Added common datastructures shared between all operators like `Tls` or `AuthenticationClass` ([#366]). - Added helpers for env variables from Secrets or ConfigMaps ([#370]). ### Changed @@ -2096,7 +2096,7 @@ This is a rerelease of 0.25.1 which some last-minute incompatible API changes to ### Changed - BREAKING: In builder: `add_stackable_agent_tolerations` to `add_tolerations` ([#255]). -- Generic `VALUE` paramters to `impl Into<_>` arguments for consistency ([#253]). +- Generic `VALUE` parameters to `impl Into<_>` arguments for consistency ([#253]). ### Removed diff --git a/crates/stackable-operator/crds/DummyCluster.yaml b/crates/stackable-operator/crds/DummyCluster.yaml index 7f2e06039..18b0000f3 100644 --- a/crates/stackable-operator/crds/DummyCluster.yaml +++ b/crates/stackable-operator/crds/DummyCluster.yaml @@ -597,7 +597,7 @@ spec: type: object type: object enableVectorAgent: - description: Wether or not to deploy a container with the Vector log agent. + description: Whether or not to deploy a container with the Vector log agent. nullable: true type: boolean type: object @@ -1209,7 +1209,7 @@ spec: type: object type: object enableVectorAgent: - description: Wether or not to deploy a container with the Vector log agent. + description: Whether or not to deploy a container with the Vector log agent. nullable: true type: boolean type: object diff --git a/crates/stackable-operator/src/builder/pdb.rs b/crates/stackable-operator/src/builder/pdb.rs index 4232b2d78..e262863d3 100644 --- a/crates/stackable-operator/src/builder/pdb.rs +++ b/crates/stackable-operator/src/builder/pdb.rs @@ -45,7 +45,7 @@ pub enum Error { pub struct PodDisruptionBudgetBuilder { metadata: ObjectMeta, selector: LabelSelector, - /// Tracks wether either `maxUnavailable` or `minAvailable` is set. + /// Tracks whether either `maxUnavailable` or `minAvailable` is set. constraint: Option, } diff --git a/crates/stackable-operator/src/builder/pod/mod.rs b/crates/stackable-operator/src/builder/pod/mod.rs index 97b214c12..4ac14575c 100644 --- a/crates/stackable-operator/src/builder/pod/mod.rs +++ b/crates/stackable-operator/src/builder/pod/mod.rs @@ -667,7 +667,7 @@ mod tests { .build() } - /// A [`PodBuilder`] that already contains the minum setup to build a Pod (name and container). + /// A [`PodBuilder`] that already contains the minimum setup to build a Pod (name and container). #[fixture] fn pod_builder_with_name_and_container(dummy_container: Container) -> PodBuilder { let mut builder = PodBuilder::new(); diff --git a/crates/stackable-operator/src/client.rs b/crates/stackable-operator/src/client.rs index bb9ceb122..3c27863ba 100644 --- a/crates/stackable-operator/src/client.rs +++ b/crates/stackable-operator/src/client.rs @@ -590,7 +590,7 @@ impl Client { pub trait GetApi: Resource + Sized { /// The namespace type for `Self`'s scope. /// - /// This will be [`str`] for namespaced resource, and [`()`] for cluster-scoped resources. + /// This will be [`str`] for namespaced resource, and `()` for cluster-scoped resources. type Namespace: ?Sized; /// Get a [`kube::Api`] for `Self`'s native scope.. fn get_api(client: kube::Client, ns: &Self::Namespace) -> kube::Api diff --git a/crates/stackable-operator/src/commons/resources.rs b/crates/stackable-operator/src/commons/resources.rs index 98d9ac0d2..1eac198a9 100644 --- a/crates/stackable-operator/src/commons/resources.rs +++ b/crates/stackable-operator/src/commons/resources.rs @@ -381,7 +381,7 @@ pub enum ResourceRequirementsType { // We currently don't use claims in our container builder and thus also // do not support setting and validating them. When we do support claims // in the future, we can just remove the comment to get support for it - // immediatly. + // immediately. // Claims, } @@ -404,7 +404,7 @@ pub trait ResourceRequirementsExt { resource: &str, ) -> Result<()>; - /// Returns wether the implementor has a [`ResourceRequirementsType`] set + /// Returns whether the implementor has a [`ResourceRequirementsType`] set /// for a `resource`. fn has_resource_requirement(&self, rr_type: ResourceRequirementsType, resource: &str) -> bool { self.check_resource_requirement(rr_type, resource).is_ok() @@ -424,7 +424,7 @@ pub trait ResourceRequirementsExt { Ok(()) } - /// Returns wether the implementor has all [`ResourceRequirementsType`]s set + /// Returns whether the implementor has all [`ResourceRequirementsType`]s set /// for a `resource`. fn has_resource_requirements( &self, diff --git a/crates/stackable-operator/src/crd/git_sync/v1alpha1_impl.rs b/crates/stackable-operator/src/crd/git_sync/v1alpha1_impl.rs index 7395290e1..4654c1718 100644 --- a/crates/stackable-operator/src/crd/git_sync/v1alpha1_impl.rs +++ b/crates/stackable-operator/src/crd/git_sync/v1alpha1_impl.rs @@ -432,7 +432,7 @@ mod tests { let extra_env_vars = env_vars_from([ ("VAR1", "value1"), - ("GITSYNC_USERNAME", "overriden-username"), + ("GITSYNC_USERNAME", "overridden-username"), ]); let extra_volume_mounts = [VolumeMount { @@ -500,7 +500,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -574,7 +574,7 @@ env: key: password name: git-credentials - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -643,7 +643,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -682,7 +682,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -724,7 +724,7 @@ env: key: password name: git-credentials - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -761,7 +761,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest diff --git a/crates/stackable-operator/src/crd/git_sync/v1alpha2_impl.rs b/crates/stackable-operator/src/crd/git_sync/v1alpha2_impl.rs index 0538a03d3..fd3d3131b 100644 --- a/crates/stackable-operator/src/crd/git_sync/v1alpha2_impl.rs +++ b/crates/stackable-operator/src/crd/git_sync/v1alpha2_impl.rs @@ -477,7 +477,7 @@ mod tests { let extra_env_vars = env_vars_from([ ("VAR1", "value1"), - ("GITSYNC_USERNAME", "overriden-username"), + ("GITSYNC_USERNAME", "overridden-username"), ]); let extra_volume_mounts = [VolumeMount { @@ -545,7 +545,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -619,7 +619,7 @@ env: key: password name: git-credentials - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -688,7 +688,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -727,7 +727,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -769,7 +769,7 @@ env: key: password name: git-credentials - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest @@ -806,7 +806,7 @@ command: - -c env: - name: GITSYNC_USERNAME - value: overriden-username + value: overridden-username - name: VAR1 value: value1 image: oci.stackable.tech/sdp/product:latest diff --git a/crates/stackable-operator/src/kvp/consts/keys.rs b/crates/stackable-operator/src/kvp/consts/keys.rs index 905b3ab8a..8f0deac24 100644 --- a/crates/stackable-operator/src/kvp/consts/keys.rs +++ b/crates/stackable-operator/src/kvp/consts/keys.rs @@ -20,7 +20,7 @@ pub const K8S_APP_INSTANCE_KEY: &str = concatcp!(K8S_APP_KEY_PREFIX, "instance") pub const K8S_APP_VERSION_KEY: &str = concatcp!(K8S_APP_KEY_PREFIX, "version"); /// The well-known Kubernetes app component key `app.kubernetes.io/component`. -/// It is used to specify the compoent within the architecture, e.g. `database`. +/// It is used to specify the component within the architecture, e.g. `database`. pub const K8S_APP_COMPONENT_KEY: &str = concatcp!(K8S_APP_KEY_PREFIX, "component"); /// The well-known Kubernetes app part-of key `app.kubernetes.io/part-of`. It is @@ -33,7 +33,7 @@ pub const K8S_APP_PART_OF_KEY: &str = concatcp!(K8S_APP_KEY_PREFIX, "part-of"); /// an application, e.g. `helm`. pub const K8S_APP_MANAGED_BY_KEY: &str = concatcp!(K8S_APP_KEY_PREFIX, "managed-by"); -/// The well-kown Kubernetes app role-group key `app.kubernetes.io/role-group`. +/// The well-known Kubernetes app role-group key `app.kubernetes.io/role-group`. /// It is used to specify to which role group this application belongs to, e.g. /// `worker`. pub const K8S_APP_ROLE_GROUP_KEY: &str = concatcp!(K8S_APP_KEY_PREFIX, "role-group"); diff --git a/crates/stackable-operator/src/kvp/key.rs b/crates/stackable-operator/src/kvp/key.rs index 3bc75671d..6e2486f63 100644 --- a/crates/stackable-operator/src/kvp/key.rs +++ b/crates/stackable-operator/src/kvp/key.rs @@ -266,7 +266,7 @@ pub enum KeyNameError { #[snafu(display("name segment of key cannot be empty"))] NameEmpty, - /// Indicates that the key name sgement exceeds the maximum length of 63 + /// Indicates that the key name segment exceeds the maximum length of 63 /// ASCII characters. It additionally reports how many characters were /// encountered during parsing / validation. #[snafu(display( @@ -285,7 +285,7 @@ pub enum KeyNameError { NameInvalid, } -/// A validated name segement of a key. This part of the key is required. +/// A validated name segment of a key. This part of the key is required. /// /// Instances of this struct are always valid. It also implements [`Deref`], /// which enables read-only access to the inner value (a [`String`]). It, diff --git a/crates/stackable-operator/src/kvp/mod.rs b/crates/stackable-operator/src/kvp/mod.rs index 8aaee66be..a0f211997 100644 --- a/crates/stackable-operator/src/kvp/mod.rs +++ b/crates/stackable-operator/src/kvp/mod.rs @@ -175,7 +175,7 @@ pub enum KeyValuePairsError { /// # Note /// /// A [`BTreeSet`] is used as the inner collection to preserve order of items -/// which ultimately prevent unncessary reconciliations due to changes +/// which ultimately prevent unnecessary reconciliations due to changes /// in item order. #[derive(Clone, Debug, Default)] pub struct KeyValuePairs(BTreeMap); diff --git a/crates/stackable-operator/src/memory.rs b/crates/stackable-operator/src/memory.rs index 09226a9e7..26df0adcd 100644 --- a/crates/stackable-operator/src/memory.rs +++ b/crates/stackable-operator/src/memory.rs @@ -275,9 +275,9 @@ impl MemoryQuantity { /// Returns a value like '1355m' or '2g'. Always returns natural numbers with either 'k', 'm' or 'g', /// even if the values is multiple Terabytes or more. - /// The original quantity may be rounded down to achive a compact, natural number representation. + /// The original quantity may be rounded down to achieve a compact, natural number representation. /// This rounding may cause the quantity to shrink by up to 20MB. - /// Useful to set memory quantities as JVM paramters. + /// Useful to set memory quantities as JVM parameters. pub fn format_for_java(&self) -> Result { let m = self .scale_to_at_most_gb() // Java Heap only supports specifying kb, mb or gb diff --git a/crates/stackable-operator/src/product_config_utils.rs b/crates/stackable-operator/src/product_config_utils.rs index a95879c1a..bcf75572e 100644 --- a/crates/stackable-operator/src/product_config_utils.rs +++ b/crates/stackable-operator/src/product_config_utils.rs @@ -654,13 +654,13 @@ pub fn env_var_from_tuple(entry: (impl Into, impl Into)) -> EnvV /// use stackable_operator::product_config_utils::{env_vars_from, insert_or_update_env_vars}; /// /// let env_vars = env_vars_from([("VAR1", "original value 1"), ("VAR2", "original value 2")]); -/// let env_overrides = env_vars_from([("VAR2", "overriden value 2"), ("VAR3", "new value 3")]); +/// let env_overrides = env_vars_from([("VAR2", "overridden value 2"), ("VAR3", "new value 3")]); /// /// let combined_env_vars = insert_or_update_env_vars(&env_vars, &env_overrides); /// /// let expected_result = env_vars_from([ /// ("VAR1", "original value 1"), -/// ("VAR2", "overriden value 2"), +/// ("VAR2", "overridden value 2"), /// ("VAR3", "new value 3"), /// ]); /// diff --git a/crates/stackable-operator/src/product_logging/spec.rs b/crates/stackable-operator/src/product_logging/spec.rs index 0e0588174..0f6bf3f8e 100644 --- a/crates/stackable-operator/src/product_logging/spec.rs +++ b/crates/stackable-operator/src/product_logging/spec.rs @@ -69,7 +69,7 @@ pub struct Logging where T: Clone + Display + Ord, { - /// Wether or not to deploy a container with the Vector log agent. + /// Whether or not to deploy a container with the Vector log agent. pub enable_vector_agent: bool, /// Log configuration per container. diff --git a/crates/stackable-versioned-macros/src/codegen/changes.rs b/crates/stackable-versioned-macros/src/codegen/changes.rs index d1f9b28d0..b36efc6f7 100644 --- a/crates/stackable-versioned-macros/src/codegen/changes.rs +++ b/crates/stackable-versioned-macros/src/codegen/changes.rs @@ -222,8 +222,8 @@ mod test { #[case(4, (Some(&"test3"), None))] fn neighbors(#[case] key: i32, #[case] expected: (Option<&&str>, Option<&&str>)) { let map = BTreeMap::from([(1, "test1"), (3, "test3")]); - let neigbors = map.get_neighbors(&key); + let neighbors = map.get_neighbors(&key); - assert_eq!(neigbors, expected); + assert_eq!(neighbors, expected); } } diff --git a/crates/stackable-versioned-macros/tests/README.md b/crates/stackable-versioned-macros/tests/README.md index 7ecff1891..c90d6c4f6 100644 --- a/crates/stackable-versioned-macros/tests/README.md +++ b/crates/stackable-versioned-macros/tests/README.md @@ -13,10 +13,10 @@ feature to be enabled. These tests can be run with `cargo test --all-features`. > [!NOTE] > Please have `rust-src` installed, e.g. using `rustup component add rust-src`. > -> Also see the compile-fail tests, described [here](#compile-fail-testing). +> Also see the [compile-fail tests](#compile-fail-testing). -Snapshot testing is done using the [insta] crate. It provides a [CLI tool][insta-cli] calle - `cargo-insta` and a [VS Code extension][insta-ext]. +Snapshot testing is done using the [insta] crate. It provides a [CLI tool][insta-cli] called +`cargo-insta` and a [VS Code extension][insta-ext]. Test inputs and snapshots of the expected output are located in the `inputs` and `snapshots` folder respectively. Each Rust attribute macro expects two inputs as a token stream: @@ -81,13 +81,13 @@ accepted (ie: no `.new` files remaining), check in the files. ## Compile-Fail Testing > [!NOTE] -> Also see the snapshot tests, described [here](#snapshot-testing). +> Also see the [snapshot tests](#snapshot-testing). This type of testing is part of UI testing. These tests assert two things: First, some code should compile without errors and secondly other code should produce the expected rustc (compiler) error message. For this type of testing, we use the [`trybuild`][trybuild] crate. -Further information about the workflow are described [here][workflow]. +Further information about the workflow is described in the [trybuild workflow docs][workflow]. [rust-ref]: https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros [workflow]: https://docs.rs/trybuild/latest/trybuild/#workflow diff --git a/crates/stackable-versioned/tests/inputs/conversions/fail/unkown_current_version.json b/crates/stackable-versioned/tests/inputs/conversions/fail/unknown_current_version.json similarity index 100% rename from crates/stackable-versioned/tests/inputs/conversions/fail/unkown_current_version.json rename to crates/stackable-versioned/tests/inputs/conversions/fail/unknown_current_version.json diff --git a/crates/stackable-versioned/tests/inputs/conversions/fail/unkown_desired_version.json b/crates/stackable-versioned/tests/inputs/conversions/fail/unknown_desired_version.json similarity index 100% rename from crates/stackable-versioned/tests/inputs/conversions/fail/unkown_desired_version.json rename to crates/stackable-versioned/tests/inputs/conversions/fail/unknown_desired_version.json diff --git a/crates/stackable-versioned/tests/snapshots/conversions__fail@unkown_current_version.json.snap b/crates/stackable-versioned/tests/snapshots/conversions__fail@unknown_current_version.json.snap similarity index 100% rename from crates/stackable-versioned/tests/snapshots/conversions__fail@unkown_current_version.json.snap rename to crates/stackable-versioned/tests/snapshots/conversions__fail@unknown_current_version.json.snap diff --git a/crates/stackable-versioned/tests/snapshots/conversions__fail@unkown_desired_version.json.snap b/crates/stackable-versioned/tests/snapshots/conversions__fail@unknown_desired_version.json.snap similarity index 100% rename from crates/stackable-versioned/tests/snapshots/conversions__fail@unkown_desired_version.json.snap rename to crates/stackable-versioned/tests/snapshots/conversions__fail@unknown_desired_version.json.snap diff --git a/crates/stackable-webhook/CHANGELOG.md b/crates/stackable-webhook/CHANGELOG.md index 70105bb74..e12c034ab 100644 --- a/crates/stackable-webhook/CHANGELOG.md +++ b/crates/stackable-webhook/CHANGELOG.md @@ -154,7 +154,7 @@ All notable changes to this project will be documented in this file. ### Added - Instrument `WebhookServer` with `AxumTraceLayer`, add static healthcheck without instrumentation ([#758]). -- Add shutdown signal hander for the `WebhookServer` ([#767]). +- Add shutdown signal handler for the `WebhookServer` ([#767]). ### Changed diff --git a/crates/stackable-webhook/src/lib.rs b/crates/stackable-webhook/src/lib.rs index 4424d4a85..c74b9c73c 100644 --- a/crates/stackable-webhook/src/lib.rs +++ b/crates/stackable-webhook/src/lib.rs @@ -5,7 +5,7 @@ //! //! * [webhooks::ConversionWebhook] //! * [webhooks::MutatingWebhook] -//! * In the future validating webhooks wil be added +//! * In the future validating webhooks will be added //! //! This library is fully compatible with the [`tracing`] crate and emits debug level tracing data. //! diff --git a/crates/stackable-webhook/src/tls/cert_resolver.rs b/crates/stackable-webhook/src/tls/cert_resolver.rs index ac1cfecb9..632f13051 100644 --- a/crates/stackable-webhook/src/tls/cert_resolver.rs +++ b/crates/stackable-webhook/src/tls/cert_resolver.rs @@ -62,25 +62,25 @@ pub struct CertificateResolver { /// Used to detect clock drift between monotonic and wall-clock time. current_not_after: ArcSwap, - subject_alterative_dns_names: Arc>, + subject_alternative_dns_names: Arc>, certificate_tx: mpsc::Sender, } impl CertificateResolver { pub async fn new( - subject_alterative_dns_names: Vec, + subject_alternative_dns_names: Vec, certificate_tx: mpsc::Sender, ) -> Result { - let subject_alterative_dns_names = Arc::new(subject_alterative_dns_names); + let subject_alternative_dns_names = Arc::new(subject_alternative_dns_names); let (certified_key, not_after) = Self::generate_new_certificate_inner( - subject_alterative_dns_names.clone(), + subject_alternative_dns_names.clone(), &certificate_tx, ) .await?; Ok(Self { - subject_alterative_dns_names, + subject_alternative_dns_names, current_certified_key: ArcSwap::new(certified_key), current_not_after: ArcSwap::new(Arc::new(not_after)), certificate_tx, @@ -111,7 +111,7 @@ impl CertificateResolver { .unwrap_or(SystemTime::UNIX_EPOCH); tracing::debug!( - x509.subject_alterative_names = ?self.subject_alterative_dns_names, + x509.subject_alternative_names = ?self.subject_alternative_dns_names, x509.not_after = %humantime::format_rfc3339(not_after), deadline = %humantime::format_rfc3339(deadline), "checking if certificate needs rotation" @@ -121,8 +121,8 @@ impl CertificateResolver { } async fn generate_new_certificate(&self) -> Result<(Arc, SystemTime)> { - let subject_alterative_dns_names = self.subject_alterative_dns_names.clone(); - Self::generate_new_certificate_inner(subject_alterative_dns_names, &self.certificate_tx) + let subject_alternative_dns_names = self.subject_alternative_dns_names.clone(); + Self::generate_new_certificate_inner(subject_alternative_dns_names, &self.certificate_tx) .await } @@ -134,7 +134,7 @@ impl CertificateResolver { /// This needs some changes in stackable-certs though. /// See [the relevant decision](https://github.com/stackabletech/decisions/issues/56) async fn generate_new_certificate_inner( - subject_alterative_dns_names: Arc>, + subject_alternative_dns_names: Arc>, certificate_tx: &mpsc::Sender, ) -> Result<(Arc, SystemTime)> { // The certificate generations can take a while, so we use `spawn_blocking` @@ -151,7 +151,7 @@ impl CertificateResolver { .generate_ecdsa_leaf_certificate( "Leaf", "webhook", - subject_alterative_dns_names.iter().map(|san| san.as_str()), + subject_alternative_dns_names.iter().map(|san| san.as_str()), WEBHOOK_CERTIFICATE_LIFETIME, ) .context(GenerateLeafCertificateSnafu)?; diff --git a/crates/stackable-webhook/src/tls/mod.rs b/crates/stackable-webhook/src/tls/mod.rs index 20d12a1fc..a905203a1 100644 --- a/crates/stackable-webhook/src/tls/mod.rs +++ b/crates/stackable-webhook/src/tls/mod.rs @@ -102,7 +102,7 @@ impl TlsServer { /// Create a new [`TlsServer`]. /// /// This internally creates a `CertificateResolver` with the provided - /// `subject_alterative_dns_names`, which takes care of the certificate rotation. Afterwards it + /// `subject_alternative_dns_names`, which takes care of the certificate rotation. Afterwards it /// creates the [`ServerConfig`], which let's the `CertificateResolver` provide the needed /// certificates. #[instrument(name = "create_tls_server", skip(router))] @@ -122,10 +122,10 @@ impl TlsServer { // AFAIK we can not influence this, so this is the only SAN entry needed. // TODO (@Techassi): The cluster domain should be included here, so that (non Kubernetes) // HTTP clients can use the FQDN of the service for testing or user use-cases. - let subject_alterative_dns_names = + let subject_alternative_dns_names = vec![format!("{webhook_service_name}.{webhook_namespace}.svc")]; - let cert_resolver = CertificateResolver::new(subject_alterative_dns_names, certificate_tx) + let cert_resolver = CertificateResolver::new(subject_alternative_dns_names, certificate_tx) .await .context(CreateCertificateResolverSnafu)?; let cert_resolver = Arc::new(cert_resolver); diff --git a/crates/stackable-webhook/src/webhooks/mod.rs b/crates/stackable-webhook/src/webhooks/mod.rs index ac165efac..47125a3f0 100644 --- a/crates/stackable-webhook/src/webhooks/mod.rs +++ b/crates/stackable-webhook/src/webhooks/mod.rs @@ -38,7 +38,7 @@ pub trait Webhook { /// resulting [`Router`]. fn register_routes(&self, router: Router) -> Router; - /// Wether the [`Self::handle_certificate_rotation`] function should be called or not + /// Whether the [`Self::handle_certificate_rotation`] function should be called or not fn ignore_certificate_rotation(&self) -> bool; /// The HTTPS server periodically rotates it's certificate.