Skip to content

Commit

Permalink
v0.10.0 (#74)
Browse files Browse the repository at this point in the history
* Update kube to v0.75
* Update k8s-openapi to v0.16
* Update the examplar k8s API version to v1.25
* Update the devcontainer
  • Loading branch information
olix0r authored Sep 23, 2022
1 parent 728a148 commit dd9eeed
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "kubert",
"image": "ghcr.io/linkerd/dev:v30",
"image": "ghcr.io/linkerd/dev:v31",
"extensions": [
"kokakiwi.vscode-just",
"NathanRidley.autotrim",
"rust-lang.rust-analyzer",
"ms-kubernetes-tools.vscode-kubernetes-tools",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
matrix:
k8s:
- v1.21
- v1.24
- v1.25
timeout-minutes: 10
runs-on: ubuntu-latest
env:
Expand Down
26 changes: 13 additions & 13 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ release = false

[dev-dependencies]
anyhow = "1"
clap = { version = "3", default-features = false, features = ["derive", "env", "std"] }
futures = { version = "0.3", default-features = false }
k8s-openapi = { version = "0.15", default-features = false, features = ["v1_23"] }
regex = "1"
thiserror = "1"
tracing = "0.1"

[dev-dependencies.clap]
version = "3"
default-features = false
features = ["derive", "env", "std"]

[dev-dependencies.k8s-openapi]
version = "0.16"
default-features = false
features = ["v1_25"]

[dev-dependencies.kube]
version = "0.74"
version = "0.75"
default-features = false
features = [
"client",
"derive",
"native-tls",
"runtime",
]
features = ["client", "derive", "native-tls", "runtime"]

[dev-dependencies.kubert]
path = "../kubert"
default-features = false
features = [
"clap",
"runtime",
]
features = ["clap", "runtime"]

[dev-dependencies.tokio]
version = "1"
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ _ctx := "--context=k3d-" + test-cluster-name
test-cluster-create:
k3d cluster create {{ test-cluster-name }} \
--image=+{{ test-cluster-version }} \
--no-lb --k3s-arg "--no-deploy=local-storage,traefik,servicelb,metrics-server@server:*"
--no-lb --k3s-arg "--disable=local-storage,traefik,servicelb,metrics-server@server:*"
while [ $(kubectl {{ _ctx }} get po -n kube-system -l k8s-app=kube-dns -o json |jq '.items | length') = "0" ]; do sleep 1 ; done
kubectl {{ _ctx }} wait -n kube-system po -l k8s-app=kube-dns --for=condition=ready

Expand Down
24 changes: 13 additions & 11 deletions kubert/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kubert"
version = "0.9.1"
version = "0.10.0"
edition = "2021"
license = "Apache-2.0"
description = "Kubernetes runtime helpers. Based on kube-rs."
Expand Down Expand Up @@ -94,11 +94,11 @@ features = [
"runtime",
"server",
"shutdown",
"k8s-openapi/v1_23",
"k8s-openapi/v1_25",
]

[dependencies]
ahash = { version = "0.7", optional = true }
ahash = { version = "0.8", optional = true }
drain = { version = "0.1.1", optional = true, default-features = false }
futures-core = { version = "0.3", optional = true, default-features = false }
futures-util = { version = "0.3", optional = true, default-features = false }
Expand All @@ -123,23 +123,23 @@ features = ["derive", "std"]
# Not used directly, but required to ensure that the k8s-openapi dependency is considered part of
# the "deps" graph rather than just the "dev-deps" graph
[dependencies.k8s-openapi]
version = "0.15"
version = "0.16"
optional = true
default-features = false

[dependencies.kube-client]
version = "0.74"
version = "0.75"
optional = true
default-features = false
features = ["client", "config"]

[dependencies.kube-core]
version = "0.74"
version = "0.75"
optional = true
default-features = false

[dependencies.kube-runtime]
version = "0.74"
version = "0.75"
optional = true
default-features = false

Expand All @@ -150,14 +150,16 @@ default-features = false
features = ["env-filter", "fmt", "json", "smallvec", "tracing-log"]

[dev-dependencies]
kube = { version = "0.74", default-features = false, features = ["runtime"] }
k8s-openapi = { version = "0.15", default-features = false, features = [
"v1_23",
] }
kube = { version = "0.75", default-features = false, features = ["runtime"] }
tokio-stream = "0.1"
tokio-test = "0.4"
tracing-subscriber = { version = "0.3", features = ["ansi"] }

[dev-dependencies.k8s-openapi]
version = "0.16"
default-features = false
features = ["v1_25"]

[dev-dependencies.tokio]
version = "1.18"
default-features = false
Expand Down
2 changes: 1 addition & 1 deletion kubert/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl ClientArgs {
let client = match self.load_local_config().await {
Ok(client) => client,
Err(e) if self.is_customized() => return Err(e),
Err(_) => Config::from_cluster_env()?,
Err(_) => Config::incluster()?,
};

client.try_into().map_err(Into::into)
Expand Down
8 changes: 5 additions & 3 deletions kubert/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
shutdown, LogFilter, LogFormat, LogInitError,
};
use futures_core::Stream;
use kube_core::{params::ListParams, Resource};
use kube_core::{params::ListParams, NamespaceResourceScope, Resource};
use kube_runtime::{reflector, watcher};
use serde::de::DeserializeOwned;
use std::{fmt::Debug, hash::Hash, time::Duration};
Expand Down Expand Up @@ -324,7 +324,8 @@ impl<S> Runtime<S> {
params: ListParams,
) -> impl Stream<Item = watcher::Event<T>>
where
T: Resource + DeserializeOwned + Clone + Debug + Send + 'static,
T: Resource<Scope = NamespaceResourceScope>,
T: DeserializeOwned + Clone + Debug + Send + 'static,
T::DynamicType: Default,
{
let api = Api::namespaced(self.client(), ns.as_ref());
Expand Down Expand Up @@ -386,7 +387,8 @@ impl<S> Runtime<S> {
params: ListParams,
) -> (Store<T>, impl Stream<Item = watcher::Event<T>>)
where
T: Resource + DeserializeOwned + Clone + Debug + Send + 'static,
T: Resource<Scope = NamespaceResourceScope>,
T: DeserializeOwned + Clone + Debug + Send + 'static,
T::DynamicType: Clone + Default + Eq + Hash + Clone,
{
let api = Api::namespaced(self.client(), ns.as_ref());
Expand Down

0 comments on commit dd9eeed

Please sign in to comment.