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

[Merged by Bors] - Upgrade to operator-rs 0.22.0 #206

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ All notable changes to this project will be documented in this file.
### Changed

- Include chart name when installing with a custom release name ([#204], [#205]).
- `operator-rs` `0.21.1` -> `0.22.0` ([#206]).

[#204]: https://github.com/stackabletech/trino-operator/pull/204
[#205]: https://github.com/stackabletech/trino-operator/pull/205
[#206]: https://github.com/stackabletech/trino-operator/pull/206

## [0.6.0] - 2022-06-30

Expand Down
109 changes: 37 additions & 72 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ indoc = "1.0.6"
serde = "1.0"
serde_json = "1.0"
snafu = "0.7"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.21.1" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.22.0" }
strum = { version = "0.24", features = ["derive"] }
4 changes: 2 additions & 2 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ serde_json = "1.0"
serde_yaml = "0.8"
snafu = "0.7"
stackable-hive-crd = { path = "../crd" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.21.1" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.22.0" }
strum = { version = "0.24", features = ["derive"] }
tokio = { version = "1.19", features = ["full"] }
tracing = "0.1"

[build-dependencies]
built = { version = "0.5", features = ["chrono", "git2"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.21.1" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.22.0" }
stackable-hive-crd = { path = "../crd" }
24 changes: 10 additions & 14 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use stackable_hive_crd::{
HIVE_PORT, HIVE_PORT_NAME, HIVE_SITE_XML, LOG_4J_PROPERTIES, METRICS_PORT, METRICS_PORT_NAME,
STACKABLE_CONFIG_DIR, STACKABLE_RW_CONFIG_DIR,
};
use stackable_operator::builder::PodSecurityContextBuilder;
use stackable_operator::builder::SecretOperatorVolumeSourceBuilder;
use stackable_operator::commons::tls::TlsVerification;
use stackable_operator::{
builder::{ConfigMapBuilder, ContainerBuilder, ObjectMetaBuilder, PodBuilder, VolumeBuilder},
builder::{
ConfigMapBuilder, ContainerBuilder, ObjectMetaBuilder, PodBuilder,
PodSecurityContextBuilder, SecretOperatorVolumeSourceBuilder, VolumeBuilder,
},
commons::{
s3::{S3AccessStyle, S3ConnectionDef, S3ConnectionSpec},
tls::CaCert,
tls::{CaCert, TlsVerification},
},
k8s_openapi::{
api::{
Expand All @@ -32,11 +32,7 @@ use stackable_operator::{
api::resource::Quantity, apis::meta::v1::LabelSelector, util::intstr::IntOrString,
},
},
kube::{
api::ObjectMeta,
runtime::controller::{Action, Context},
ResourceExt,
},
kube::{api::ObjectMeta, runtime::controller::Action, ResourceExt},
labels::{role_group_selector_labels, role_selector_labels},
logging::controller::ReconcilerError,
product_config::{types::PropertyNameKind, ProductConfigManager},
Expand Down Expand Up @@ -147,9 +143,9 @@ impl ReconcilerError for Error {
}
}

pub async fn reconcile_hive(hive: Arc<HiveCluster>, ctx: Context<Ctx>) -> Result<Action> {
pub async fn reconcile_hive(hive: Arc<HiveCluster>, ctx: Arc<Ctx>) -> Result<Action> {
tracing::info!("Starting reconcile");
let client = &ctx.get_ref().client;
let client = &ctx.client;
let hive_version = hive_version(&hive)?;

let s3_connection_def: &Option<S3ConnectionDef> = &hive.spec.s3;
Expand Down Expand Up @@ -181,7 +177,7 @@ pub async fn reconcile_hive(hive: Arc<HiveCluster>, ctx: Context<Ctx>) -> Result
.into(),
)
.context(GenerateProductConfigSnafu)?,
&ctx.get_ref().product_config,
&ctx.product_config,
false,
false,
)
Expand Down Expand Up @@ -637,7 +633,7 @@ pub fn hive_version(hive: &HiveCluster) -> Result<&str> {
.context(ObjectHasNoVersionSnafu)
}

pub fn error_policy(_error: &Error, _ctx: Context<Ctx>) -> Action {
pub fn error_policy(_error: &Error, _ctx: Arc<Ctx>) -> Action {
Action::requeue(Duration::from_secs(5))
}

Expand Down
13 changes: 5 additions & 8 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,16 @@ mod discovery;
use clap::Parser;
use futures::stream::StreamExt;
use stackable_hive_crd::{HiveCluster, APP_NAME};
use stackable_operator::cli::{Command, ProductOperatorRun};
use stackable_operator::logging::controller::report_controller_reconciled;
use stackable_operator::{
cli::{Command, ProductOperatorRun},
k8s_openapi::api::{
apps::v1::StatefulSet,
core::v1::{ConfigMap, Service},
},
kube::{
api::ListParams,
runtime::{controller::Context, Controller},
CustomResourceExt,
},
kube::{api::ListParams, runtime::Controller, CustomResourceExt},
logging::controller::report_controller_reconciled,
};
use std::sync::Arc;

mod built_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
Expand Down Expand Up @@ -83,7 +80,7 @@ async fn main() -> anyhow::Result<()> {
.run(
controller::reconcile_hive,
controller::error_policy,
Context::new(controller::Ctx {
Arc::new(controller::Ctx {
client: client.clone(),
product_config,
}),
Expand Down