Skip to content

Commit

Permalink
bumped kube version (#3067)
Browse files Browse the repository at this point in the history
* bumped kube version

* fixed test code to use new library

* fixed typo in test code

* hopefully working impl, it passed locally

Co-authored-by: Dimitri Laloue <dlaloue@dlaloue-a01.vmware.com>
  • Loading branch information
dlaloue-vmware and Dimitri Laloue committed Jul 2, 2021
1 parent 55bbc98 commit bd8c00c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 41 deletions.
67 changes: 35 additions & 32 deletions cmd/pinniped-proxy/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions cmd/pinniped-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ anyhow = "1.0"
base64 = "0.13"
hyper = { version = "0.14", features = ["server"] }
hyper-tls = "0.5"
kube = { version = "0.55.0" }
kube = { version = "0.57.0" }
# We explicitly import kube-derive without the schema option to avoid
# requiring the jsonschema for CRDs until
# https://github.com/Arnavion/k8s-openapi/issues/86
# is sorted. AFAICT, the openapi json schema is only required when creating a
# CRD (which we're not).
kube-derive = { version = "0.55.0", default-features = false}
kube-runtime = "0.55.0"
k8s-openapi = { version = "0.11.0", default-features = false, features = ["v1_17"] }
kube-derive = { version = "0.57.0", default-features = false}
kube-runtime = "0.57.0"
k8s-openapi = { version = "0.12.0", default-features = false, features = ["v1_20"] }
log = "0.4"
native-tls = "0.2"
openssl = "0.10"
Expand All @@ -36,6 +36,7 @@ thiserror = "1.0"
tokio = { version = "1", features = ["full"] }
tokio-native-tls = "0.3"
url = "2.2"
http = "0.2.4"

[dev-dependencies]
tokio-test = "0.4"
Expand Down
10 changes: 5 additions & 5 deletions cmd/pinniped-proxy/src/pinniped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use openssl::{pkcs12::Pkcs12, pkey::PKey, x509::X509};
use serde::{Deserialize, Serialize};
use serde_json;
use thiserror::Error;
use url::Url;
use http::Uri;

const DEFAULT_PINNIPED_API_SUFFIX: &str = "DEFAULT_PINNIPED_API_SUFFIX";
const DEFAULT_PINNIPED_NAMESPACE: &str = "DEFAULT_PINNIPED_NAMESPACE";
Expand Down Expand Up @@ -224,8 +224,8 @@ fn get_client_config(
pinniped_namespace: String,
) -> Result<kube::Client> {
let mut config =
Config::new(Url::parse(k8s_api_server_url).context("Failed parsing url for exchange")?);
config.default_ns = pinniped_namespace.clone();
Config::new(k8s_api_server_url.parse::<Uri>().context("Failed parsing url for exchange")?);
config.default_namespace = pinniped_namespace.clone();
let x509 = X509::from_pem(k8s_api_ca_cert_data).context("error creating x509 from pem")?;
let der = x509.to_der().context("error creating der from x509")?;
config.root_cert = Some(vec![der]);
Expand Down Expand Up @@ -383,10 +383,10 @@ mod tests {
Ok(_) => anyhow::bail!("expected error"),
Err(e) => {
assert!(
e.is::<url::ParseError>(),
e.is::<http::uri::InvalidUri>(),
"got: {:#?}, want: {}",
e,
url::ParseError::InvalidDomainCharacter
"InvalidUri.InvalidUriChar"
);
Ok(())
}
Expand Down

0 comments on commit bd8c00c

Please sign in to comment.