Skip to content

Commit

Permalink
Backout backout 2021 (#667)
Browse files Browse the repository at this point in the history
* Revert "Backout 2021 (#666)"

This reverts commit 11559f7.

Signed-off-by: Teo Klestrup Röijezon <teo@nullable.se>

* Lock down K8s version to verify against when compiling

This should fix our issues building with resolver 2.0 (and thus, Rust 2021)

Signed-off-by: Teo Klestrup Röijezon <teo@nullable.se>

* note on how to continue publishing on resolver 2

Signed-off-by: clux <sszynrae@gmail.com>

Co-authored-by: Eirik A <sszynrae@gmail.com>
  • Loading branch information
nightkr and clux authored Oct 24, 2021
1 parent c28a38f commit aa35854
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
UNRELEASED
===================
* see https://github.com/kube-rs/kube-rs/compare/0.62.0...master
* rust `edition` bumped to `2021` - #664

0.62.0 / 2021-10-22
===================
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[workspace]
default-members = ["kube"]
resolver = "1"
members = [
"kube",
"kube-client",
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ clippy:

fmt:
#rustup component add rustfmt --toolchain nightly
rustfmt +nightly --edition 2018 $$(find . -type f -iname *.rs)
rustfmt +nightly --edition 2021 $$(find . -type f -iname *.rs)

doc:
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --workspace --features=derive,ws,oauth,jsonpatch,client,derive,runtime,admission --open
Expand All @@ -22,7 +22,7 @@ test:
cd kube && cargo test --lib --features=derive

readme:
rustdoc README.md --test --edition=2018
rustdoc README.md --test --edition=2021

kind-create:
kind create cluster
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [
"kazk <kazk.dev@gmail.com>",
]
publish = false
edition = "2018"
edition = "2021"
license = "Apache-2.0"

[package.metadata.release]
Expand Down
5 changes: 1 addition & 4 deletions examples/admission_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use kube::core::{
admission::{AdmissionRequest, AdmissionResponse, AdmissionReview},
DynamicObject, ResourceExt,
};
use std::{
convert::{Infallible, TryInto},
error::Error,
};
use std::{convert::Infallible, error::Error};
#[macro_use] extern crate log;
use warp::{reply, Filter, Reply};

Expand Down
2 changes: 1 addition & 1 deletion kube-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/kube-rs/kube-rs"
readme = "../README.md"
keywords = ["kubernetes", "client",]
categories = ["web-programming::http-client"]
edition = "2018"
edition = "2021"

[features]
default = ["client", "native-tls"]
Expand Down
2 changes: 1 addition & 1 deletion kube-client/src/client/auth/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{convert::TryFrom, process::Command, sync::Arc};
use std::{process::Command, sync::Arc};

use chrono::{DateTime, Duration, Utc};
use http::HeaderValue;
Expand Down
2 changes: 0 additions & 2 deletions kube-client/src/client/config_ext.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryFrom;

use tower::util::Either;

#[cfg(any(feature = "native-tls", feature = "rustls-tls"))] use super::tls;
Expand Down
2 changes: 1 addition & 1 deletion kube-client/src/client/middleware/refresh_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ where
mod tests {
use super::*;

use std::{convert::TryFrom, matches, sync::Arc};
use std::{matches, sync::Arc};

use chrono::{Duration, Utc};
use futures::pin_mut;
Expand Down
3 changes: 0 additions & 3 deletions kube-client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
//!
//! The [`Client`] can also be used with [`Discovery`](crate::Discovery) to dynamically
//! retrieve the resources served by the kubernetes API.
use std::convert::TryFrom;

use bytes::Bytes;
use either::{Either, Left, Right};
use futures::{self, Stream, StreamExt, TryStream, TryStreamExt};
Expand Down
2 changes: 1 addition & 1 deletion kube-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
"clux <sszynrae@gmail.com>",
"kazk <kazk.dev@gmail.com>",
]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/kube-rs/kube-rs"
readme = "../README.md"
Expand Down
6 changes: 1 addition & 5 deletions kube-core/src/admission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
Error, Result,
};

use std::{collections::HashMap, convert::TryInto};
use std::collections::HashMap;

use k8s_openapi::{
api::authentication::v1::UserInfo,
Expand Down Expand Up @@ -64,7 +64,6 @@ impl<T: Resource> TryInto<AdmissionRequest<T>> for AdmissionReview<T> {
/// An incoming [`AdmissionReview`] request.
/// ```ignore
/// use kube::api::{admission::{AdmissionRequest, AdmissionReview}, DynamicObject};
/// use std::convert::TryInto;
///
/// // The incoming AdmissionReview received by the controller.
/// let body: AdmissionReview<DynamicObject>;
Expand Down Expand Up @@ -187,7 +186,6 @@ pub enum Operation {
/// admission::{AdmissionRequest, AdmissionResponse, AdmissionReview},
/// DynamicObject,
/// };
/// use std::convert::TryInto;
///
/// // The incoming AdmissionReview received by the controller.
/// let body: AdmissionReview<DynamicObject>;
Expand Down Expand Up @@ -335,8 +333,6 @@ pub enum PatchType {
mod test {
const WEBHOOK_BODY: &str = r#"{"kind":"AdmissionReview","apiVersion":"admission.k8s.io/v1","request":{"uid":"0c9a8d74-9cb7-44dd-b98e-09fd62def2f4","kind":{"group":"","version":"v1","kind":"Pod"},"resource":{"group":"","version":"v1","resource":"pods"},"requestKind":{"group":"","version":"v1","kind":"Pod"},"requestResource":{"group":"","version":"v1","resource":"pods"},"name":"echo-pod","namespace":"colin-coder","operation":"CREATE","userInfo":{"username":"colin@coder.com","groups":["system:authenticated"],"extra":{"iam.gke.io/user-assertion":["REDACTED"],"user-assertion.cloud.google.com":["REDACTED"]}},"object":{"kind":"Pod","apiVersion":"v1","metadata":{"name":"echo-pod","namespace":"colin-coder","creationTimestamp":null,"labels":{"app":"echo-server"},"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"annotations\":{},\"labels\":{\"app\":\"echo-server\"},\"name\":\"echo-pod\",\"namespace\":\"colin-coder\"},\"spec\":{\"containers\":[{\"image\":\"jmalloc/echo-server\",\"name\":\"echo-server\",\"ports\":[{\"containerPort\":8080,\"name\":\"http-port\"}]}]}}\n"},"managedFields":[{"manager":"kubectl","operation":"Update","apiVersion":"v1","time":"2021-03-29T23:02:16Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:app":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"echo-server\"}":{".":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:ports":{".":{},"k:{\"containerPort\":8080,\"protocol\":\"TCP\"}":{".":{},"f:containerPort":{},"f:name":{},"f:protocol":{}}},"f:resources":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSeconds":{}}}}]},"spec":{"volumes":[{"name":"default-token-rxbqq","secret":{"secretName":"default-token-rxbqq"}}],"containers":[{"name":"echo-server","image":"jmalloc/echo-server","ports":[{"name":"http-port","containerPort":8080,"protocol":"TCP"}],"resources":{},"volumeMounts":[{"name":"default-token-rxbqq","readOnly":true,"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","securityContext":{},"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true},"status":{}},"oldObject":null,"dryRun":false,"options":{"kind":"CreateOptions","apiVersion":"meta.k8s.io/v1"}}}"#;

use std::convert::TryInto;

use crate::{
admission::{AdmissionResponse, AdmissionReview},
DynamicObject, Result,
Expand Down
2 changes: 1 addition & 1 deletion kube-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
"clux <sszynrae@gmail.com>",
"kazk <kazk.dev@gmail.com>",
]
edition = "2018"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/kube-rs/kube-rs"
readme = "../README.md"
Expand Down
2 changes: 1 addition & 1 deletion kube-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "Apache-2.0"
repository = "https://github.com/kube-rs/kube-rs"
keywords = ["kubernetes", "runtime", "reflector", "watcher", "controller"]
categories = ["web-programming::http-client"]
edition = "2018"
edition = "2021"

[dependencies]
futures = "0.3.17"
Expand Down
2 changes: 1 addition & 1 deletion kube/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/kube-rs/kube-rs"
readme = "../README.md"
keywords = ["kubernetes", "client", "runtime"]
categories = ["web-programming::http-client"]
edition = "2018"
edition = "2021"

[features]
default = ["client", "native-tls"]
Expand Down
5 changes: 4 additions & 1 deletion release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# 0. (optional) cargo release minor ; verify readme + changelog bumped; then git reset --hard
# 1. PUBLISH_GRACE_SLEEP=20 cargo release minor --execute
# 1X. - on failure: follow plan manually, cd into next dir to publish and run cargo publish
# 1X. - on failure: follow plan manually, cd into next dirs and publish insequence with cargo publish --features=k8s-openapi/v1_22
# 2. check consolidated commit
# 2X. - on failure: git commit --amend and insert version
# 3. ./scripts/release-post.sh
Expand All @@ -18,3 +18,6 @@ pre-release-commit-message = "release {{version}}"
# leave tagging + pushing to postrelease script (due to potential failures in 1 and 2)
push = false
tag = false
# A Kubernetes version is normally supplied by the application consuming the library in the end.
# Since we don't have that when verifying, supply one ourselves.
enable-features = ["k8s-openapi/v1_22"]
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "tests"
version = "0.1.0"
authors = ["clux <sszynrae@gmail.com>"]
publish = false
edition = "2018"
edition = "2021"
license = "Apache-2.0"

[package.metadata.release]
Expand Down

0 comments on commit aa35854

Please sign in to comment.