Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump openssl-src from 111.22.0+1.1.1q to 111.25.0+1.1.1t #34

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
731 changes: 403 additions & 328 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ categories = ["command-line-utilities"]
[dependencies]
anyhow = "1.0"
app_dirs2 = "2.3"
base64 = "0.13"
base64 = "0.21"
bytes = "1.0"
camino = "1.0"
clap = { version = "3.2", features = ["derive"] }
clap = { version = "4.1", features = ["derive"] }
crossbeam = "0.8"
flate2 = { version = "1.0", default-features = false, features = [
"rust_backend",
] }
futures = "0.3"
graphql_client = "0.11"
graphql_client = "0.12"
http = "0.2"
lru_time_cache = "0.11"
openssl = { version = "0.10", features = ["vendored"] }
Expand All @@ -35,7 +35,7 @@ serde_json = "1.0"
serde_yaml = "0.9"
tar = "0.4"
toml = "0.5"
tame-oauth = { version = "0.7", features = ["gcp"] }
tame-oauth = { version = "0.8", features = ["gcp"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
twox-hash = { version = "1.6", default-features = false }
Expand All @@ -46,5 +46,5 @@ version = "1.0"
features = ["rt-multi-thread", "macros", "time"]

[dependencies.k8s-openapi]
version = "0.15"
version = "0.17"
features = ["v1_23"]
13 changes: 9 additions & 4 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ targets = [{ triple = "x86_64-unknown-linux-musl" }]
unmaintained = "deny"
yanked = "deny"
unsound = "allow"
ignore = [
"RUSTSEC-2021-0139",
]
ignore = []

[licenses]
# The lint level for crates which do not have a detectable license
Expand All @@ -21,7 +19,9 @@ exceptions = [
{ allow = [
"ISC",
], name = "untrusted" },
{ allow = ["Unicode-DFS-2016"], name = "unicode-ident" },
{ allow = [
"Unicode-DFS-2016",
], name = "unicode-ident" },
]

[[licenses.clarify]]
Expand All @@ -45,6 +45,11 @@ license-files = [{ path = "COPYRIGHT", hash = 0x39f8ad31 }]
multiple-versions = "deny"
deny = []
skip = [
# ugh
{ name = "base64", version = "0.13.1" },
{ name = "base64", version = "0.20.0" },
# Used by a ton of crates still
{ name = "syn", version = "1.0" },
]
skip-tree = []

Expand Down
80 changes: 40 additions & 40 deletions src/jobifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,22 @@ async fn get_jobify_config<'a>(
continue;
}

match files.get(path) {
Some(cfg) => {
let spec: batch::Job = serde_yaml::from_str(cfg).map_err(|e| {
anyhow::anyhow!(
"failed to deserialize job spec for in {}: {}",
path.display(),
e
)
})?;

specs.insert(path.clone(), spec);
}
None => warn!(
if let Some(cfg) = files.get(path) {
let spec: batch::Job = serde_yaml::from_str(cfg).map_err(|e| {
anyhow::anyhow!(
"failed to deserialize job spec for in {}: {}",
path.display(),
e
)
})?;

specs.insert(path.clone(), spec);
} else {
warn!(
"agent {} points to missing k8s config {}",
name,
path.display()
),
);
}
}

Expand Down Expand Up @@ -239,39 +238,40 @@ async fn spawn_job<'a>(
}

if let Some(env) = container.env.as_mut() {
let tags = match env.iter().position(|e| e.name == "BUILDKITE_AGENT_TAGS") {
Some(i) => &mut env[i],
None => {
env.push(core::EnvVar {
name: "BUILDKITE_AGENT_TAGS".to_owned(),
value: None,
value_from: None,
});

let i = env.len() - 1;
&mut env[i]
}
let tags = if let Some(i) =
env.iter().position(|e| e.name == "BUILDKITE_AGENT_TAGS")
{
&mut env[i]
} else {
env.push(core::EnvVar {
name: "BUILDKITE_AGENT_TAGS".to_owned(),
value: None,
value_from: None,
});

let i = env.len() - 1;
&mut env[i]
};

// Make a single value for the env var, eg "somekey=somevalue,otherkey=othervalue"
tags.value = Some(nfo.agent.tags());

// Make the agent name the same as the k8s Job name, so that we can pair
// the job to it correctly
let agent_name_var =
match env.iter().position(|e| e.name == "BUILDKITE_AGENT_NAME") {
Some(i) => &mut env[i],
None => {
env.push(core::EnvVar {
name: "BUILDKITE_AGENT_NAME".to_owned(),
value: None,
value_from: None,
});

let i = env.len() - 1;
&mut env[i]
}
};
let agent_name_var = if let Some(i) =
env.iter().position(|e| e.name == "BUILDKITE_AGENT_NAME")
{
&mut env[i]
} else {
env.push(core::EnvVar {
name: "BUILDKITE_AGENT_NAME".to_owned(),
value: None,
value_from: None,
});

let i = env.len() - 1;
&mut env[i]
};

agent_name_var.value = Some(agent_name.clone());
}
Expand Down
5 changes: 3 additions & 2 deletions src/k8s/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ pub fn load_kube_config() -> Result<Configuration, Error> {
(_, (Some(u), Some(p))) => {
let mut headers = header::HeaderMap::new();

let encoded = base64::encode(&format!("{}:{}", u, p));
let hv = header::HeaderValue::from_str(&format!("Basic {}", encoded))?;
use base64::Engine;
let encoded = base64::engine::general_purpose::STANDARD.encode(format!("{u}:{p}"));
let hv = header::HeaderValue::from_str(&format!("Basic {encoded}"))?;

headers.insert(header::AUTHORIZATION, hv);

Expand Down
5 changes: 4 additions & 1 deletion src/k8s/config/kube_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ impl KubeConfigLoader {
let pkey = PKey::private_key_from_pem(client_key)?;

Pkcs12::builder()
.build(password, "kubeconfig", &pkey, &x509)
.name("kubeconfig")
.pkey(&pkey)
.cert(&x509)
.build2(password)
.map_err(Error::from)
}

Expand Down
7 changes: 6 additions & 1 deletion src/k8s/config/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ pub fn data_or_file_with_base64<P: AsRef<Path>>(
file: &Option<P>,
) -> Result<Vec<u8>, Error> {
match (data, file) {
(Some(d), _) => base64::decode(&d).map_err(Error::from),
(Some(d), _) => {
use base64::Engine;
base64::engine::general_purpose::STANDARD
.decode(d)
.map_err(Error::from)
}
(_, Some(f)) => Ok(std::fs::read(f)?),
_ => anyhow::bail!("Failed to get data/file with base64 format"),
}
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async fn real_main() -> Result<(), Error> {
let get_cfg = || {
let mut cfg: Config = match args.config {
Some(ref path) => {
let contents = std::fs::read_to_string(&path)
let contents = std::fs::read_to_string(path)
.map_err(|e| anyhow!("failed to read configuration from {path}: {e}"))?;

toml::from_str(&contents)
Expand Down Expand Up @@ -171,7 +171,7 @@ async fn main() {
match real_main().await {
Ok(_) => {}
Err(e) => {
tracing::error!("{:#}", e);
tracing::error!("{e:#}");
#[allow(clippy::exit)]
std::process::exit(1);
}
Expand Down