Skip to content

Commit f62de16

Browse files
committed
chore: Bump to operator-rs 0.113.0
1 parent fa7e6cc commit f62de16

14 files changed

Lines changed: 761 additions & 711 deletions

File tree

Cargo.lock

Lines changed: 694 additions & 681 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2021"
1111
repository = "https://github.com/stackabletech/secret-operator"
1212

1313
[workspace.dependencies]
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.108.0", features = ["time", "crds", "webhook"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.113.0", features = ["time", "crds", "webhook"] }
1515
krb5 = { git = "https://github.com/stackabletech/krb5-rs.git", tag = "v0.1.0" }
1616

1717
anyhow = "1.0"
@@ -29,9 +29,7 @@ hex = "0.4"
2929
# unstable features.
3030
# This version needs to match the kube version that is re-exported by stackable-operator, so that
3131
# the feature unification works!
32-
kube-runtime = { git = "https://github.com/kube-rs/kube-rs", rev = "fe69cc486ff8e62a7da61d64ec3ebbd9e64c43b5", default-features = false, features = ["unstable-runtime-stream-control"] }
33-
# Hopefully soon we can switch to
34-
# kube-runtime = { version = "*", default-features = false, features = ["unstable-runtime-stream-control"] }
32+
kube-runtime = { version = "*", default-features = false, features = ["unstable-runtime-stream-control"] }
3533
ldap3 = { version = "0.12", default-features = false, features = ["gssapi", "tls"] }
3634
libc = "0.2"
3735
native-tls = "0.2"

rust/cert-tools/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub enum CertInput {
107107
}
108108

109109
impl CertInput {
110-
pub fn from_file(&self) -> Result<Vec<X509>, CertInputError> {
110+
pub fn read_certificates(&self) -> Result<Vec<X509>, CertInputError> {
111111
let read_file_fn = |path| fs::read(path).context(ReadFileSnafu { path });
112112

113113
match self {

rust/cert-tools/src/cmds/pkcs12.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn generate_truststore(args: GeneratePkcs12TruststoreArguments) -> Result<()
4444
let certificate_sources = certificate_sources
4545
.iter()
4646
.map(|source| {
47-
let certificates_list = source.from_file().context(ReadCertificateSnafu {
47+
let certificates_list = source.read_certificates().context(ReadCertificateSnafu {
4848
path: source.path(),
4949
})?;
5050

rust/cert-tools/src/parsers/pkcs12.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub fn parse_file_workaround(
9393
password: &str,
9494
) -> Result<Vec<X509>, WorkaroundError> {
9595
let mut child = Command::new("openssl")
96-
.args(&[
96+
.args([
9797
"pkcs12",
9898
"-nokeys",
9999
"-password",

rust/krb5-provision-keytab/src/active_directory.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use crate::credential_cache::{self, CredentialCache};
2222
pub enum Error {
2323
#[snafu(display("failed to retrieve LDAP TLS CA {ca_ref}"))]
2424
GetLdapTlsCa {
25-
source: kube::Error,
25+
#[snafu(source(from(kube::Error, Box::new)))]
26+
source: Box<kube::Error>,
2627
ca_ref: ObjectRef<Secret>,
2728
},
2829

@@ -33,7 +34,10 @@ pub enum Error {
3334
ParseLdapTlsCa { source: native_tls::Error },
3435

3536
#[snafu(display("password cache error"))]
36-
PasswordCache { source: credential_cache::Error },
37+
PasswordCache {
38+
#[snafu(source(from(credential_cache::Error, Box::new)))]
39+
source: Box<credential_cache::Error>,
40+
},
3741

3842
#[snafu(display("failed to configure LDAP TLS"))]
3943
ConfigureLdapTls { source: native_tls::Error },
@@ -58,7 +62,8 @@ pub enum Error {
5862
link = "https://docs.stackable.tech/home/nightly/secret-operator/troubleshooting.html#active-directory-ldap-user-conflict"
5963
))]
6064
CreateLdapUserConflict {
61-
source: ldap3::LdapError,
65+
#[snafu(source(from(ldap3::LdapError, Box::new)))]
66+
source: Box<ldap3::LdapError>,
6267
password_cache_ref: ObjectRef<Secret>,
6368
},
6469

rust/krb5-provision-keytab/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ enum Error {
6969

7070
enum AdminConnection<'a> {
7171
Mit(mit::MitAdmin<'a>),
72-
ActiveDirectory(active_directory::AdAdmin<'a>),
72+
ActiveDirectory(Box<active_directory::AdAdmin<'a>>),
7373
}
7474

7575
async fn run() -> Result<Response, Error> {
@@ -95,7 +95,7 @@ async fn run() -> Result<Response, Error> {
9595
user_distinguished_name,
9696
schema_distinguished_name,
9797
generate_sam_account_name,
98-
} => AdminConnection::ActiveDirectory(
98+
} => AdminConnection::ActiveDirectory(Box::new(
9999
active_directory::AdAdmin::connect(
100100
&ldap_server,
101101
&krb,
@@ -107,7 +107,7 @@ async fn run() -> Result<Response, Error> {
107107
)
108108
.await
109109
.context(ActiveDirectoryInitSnafu)?,
110-
),
110+
)),
111111
};
112112
let mut kt = Keytab::resolve(
113113
&krb,

rust/olm-deployer/src/data.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
use stackable_operator::kube::{ResourceExt, api::DynamicObject};
22

3-
pub fn containers<'a>(
4-
target: &'a mut DynamicObject,
5-
) -> anyhow::Result<&'a mut Vec<serde_json::Value>> {
3+
pub fn containers(target: &mut DynamicObject) -> anyhow::Result<&mut Vec<serde_json::Value>> {
64
let tname = target.name_any();
75
let path = "template/spec/containers".split("/");
86
match get_or_create(target.data.pointer_mut("/spec").unwrap(), path)? {

rust/olm-deployer/src/env/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ fn deployer_env_var(deployment: &Deployment) -> Option<&Vec<EnvVar>> {
6161
.map(|ts| ts.containers.iter())
6262
.into_iter()
6363
.flatten()
64-
.filter(|c| c.name == "secret-operator-deployer")
65-
.last()
64+
.rfind(|c| c.name == "secret-operator-deployer")
6665
.and_then(|c| c.env.as_ref())
6766
}
6867

rust/olm-deployer/src/resources/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ fn deployment_resources(deployment: &Deployment) -> Option<&ResourceRequirements
4343
.map(|ts| ts.containers.iter())
4444
.into_iter()
4545
.flatten()
46-
.filter(|c| c.name == "secret-operator-deployer")
47-
.last()
46+
.rfind(|c| c.name == "secret-operator-deployer")
4847
.and_then(|c| c.resources.as_ref())
4948
}
5049

0 commit comments

Comments
 (0)