You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'ensure_crd_created' method retries on failure. (#79)
* The 'ensure_crd_created' method retries on failure.
* Docs + properly recognized restarted state in wait_ready
* Add test for wait_ready method. Make default namespace from kubeconfig accessible.
* Do not panic on Applied event, as pod status might change.
* Test wait_created timeout on nonexisting resource
* Cargo fmt after merge with main
* Reword wait_created documentation and add an example
* Used stream approach for resource waiting
* Kubernetes-dependent tests ignored by default. CONTRIBUTING guide.
* Run all tests, not only ignored
* Renamed wait_ready to wait_created in crd.rs
* Removed explicit timeout on 'ensure_crd_created' function in crd.rs
Contributions in any form are welcome and appreciated. The recommended approach for code contributions is to fork this repository and create a pull request.
4
+
5
+
== CODE
6
+
7
+
* Use the *stable* branch of Rust, not nightly.
8
+
* Code must be formatted with https://github.com/rust-lang/rustfmt[rustfmt]. Easiest way to install `rustfmt` is to to invoke `cargo install rustfmt` and then format the project with `cargo fmt`.
9
+
* Rustdoc: Structs, functions and all other elements are documented. In general, documentation style follows the https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html[Rustdoc] guide.
10
+
* Tests dependent on Kubernetes runtime are prefixed with `k8s_test_` and ignored.
11
+
12
+
13
+
== TESTS
14
+
15
+
Tests requiring Kubernetes are *disabled* by default, yet enabled in link:.github/workflows/rust.yml[rust.yml] workflow. All others tests are *enabled* by default. This implies `cargo test` won't run Kubernetes-dependent tests by default. To run ignored test(s), invoke `cargo test -- --ignored`.
16
+
17
+
Kubernetes tests require a `KUBECONFIG` environment variable pointing to a valid kubeconfig file. The kubeconfig must:
18
+
19
+
* Point to a reachable Kubernetes cluster,
20
+
* Use account with enough permissions to run the tests,
21
+
* Be readable by the user running the tests.
22
+
23
+
On Linux, a convenient way to install local Kubernetes cluster is https://k3s.io/:[K3S.io]. Invoking `curl -sfL https://get.k3s.io | sh -` installs latest version of K3S and exports a `KUBECONFIG` at `/etc/rancher/k3s/k3s.yaml`. To run Kubernetes-dependent tests with K3S, set the `KUBECONFIG` environment variable using `export KUBECONFIG=/etc/rancher/k3s/k3s.yaml`. Make sure it is readable by user invoking the tests by using `chown`/`chmod`. Running the `cargo test -- --ignored` command afterwards runs all tests, including Kubernetes tests. K3S is also leveraged in link:.github/workflows/rust.yml[rust.yml] workflow.
This is a simple library that includes all kinds of helper methods, structs and enums that can be used to write a Kubernetes Controller/Operator with the https://github.com/clux/kube-rs[kube-rs] crate.
4
4
5
-
WARNING: This is very new, undocumented and untested!
5
+
WARNING: This is very new, undocumented and partially tested (see the link:CONTRIBUTING.adoc[contributing guide])!
6
+
7
+
8
+
== CONTRIBUTING
9
+
10
+
Contributions are much welcome. A detailed guide on contributing, development and testing is to be found at link:CONTRIBUTING.adoc[CONTRIBUTING].
0 commit comments