From 7c0f26faa35b89eaf1c39e4d6a4f6b1664f1ae4c Mon Sep 17 00:00:00 2001 From: Kevin Flansburg Date: Tue, 1 Jun 2021 16:56:01 -0500 Subject: [PATCH] Remove Hardcoded k8s-openapi Version Feature (#13) --- docs/community/developers.md | 18 ++++++++++++++++++ krator/Cargo.toml | 10 +++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/community/developers.md b/docs/community/developers.md index 4ff7b50..a31dff5 100644 --- a/docs/community/developers.md +++ b/docs/community/developers.md @@ -23,6 +23,24 @@ We use `cargo` to build our programs: $ cargo build ``` +Krator is a library crate, meaning that you cannot run Krator +directly, but must import it into other "binary" crates which can +then be run. To see an example of using Krator in this way, +check out the [moose example](/krator/examples/moose.rs). + +Krator does not configure `k8s-openapi` to use a specific version of +Kubernetes. You will need to select a version and enable its feature +when building your application: + +``` +[dependencies.k8s-openapi] +version = "0.11" +default-features = false +features = ["v1_20"] +``` + +Krator is tested against Kubernetes v1.20. + ### Building without openssl If you are on a system that doesn't have OpenSSL (or has the incorrect version), diff --git a/krator/Cargo.toml b/krator/Cargo.toml index 93c5808..6864450 100644 --- a/krator/Cargo.toml +++ b/krator/Cargo.toml @@ -35,7 +35,6 @@ async-trait = "0.1" anyhow = "1.0" tokio = { version = "1.0", features = ["fs", "macros", "signal"] } tokio-stream = { version = "0.1", features = ['sync'] } -k8s-openapi = { version = "0.11", default-features = false, features = ["v1_20"] } kube = { version = "0.55", default-features = false } kube-runtime = { version = "0.55", default-features = false } serde = { version = "1.0", features = ["derive"] } @@ -49,6 +48,15 @@ tracing = { version = "0.1", features = ['log'] } tracing-futures = "0.2" rcgen = { version = "0.8.9", features = ["x509-parser", "pem"], optional = true } +[dependencies.k8s-openapi] +version = "0.11" +default-features = false + +[dev-dependencies.k8s-openapi] +version = "0.11" +default-features = false +features = ["v1_20"] + [dev-dependencies] kube-derive = "0.55" schemars = "0.8"