Skip to content
Merged
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
445 changes: 243 additions & 202 deletions Cargo.lock

Large diffs are not rendered by default.

651 changes: 394 additions & 257 deletions Cargo.nix

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/opa-operator"

[workspace.dependencies]
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.94.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.95.0" }
krb5 = { git = "https://github.com/stackabletech/krb5-rs.git", tag = "v0.1.0" }


Expand Down
14 changes: 7 additions & 7 deletions crate-hashes.json

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

14 changes: 6 additions & 8 deletions rust/bundle-builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ async fn main() -> Result<(), StartupError> {
// - The console log level was set by `OPA_BUNDLE_BUILDER_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `OPA_BUNDLE_BUILDER_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `OPA_BUNDLE_BUILDER_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
let _tracing_guard =
Tracing::pre_configured(built_info::PKG_NAME, args.common.telemetry_arguments)
.init()
.context(TracingInitSnafu)?;
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, args.common.telemetry)
.init()
.context(TracingInitSnafu)?;

tracing::info!(
built_info.pkg_version = built_info::PKG_VERSION,
Expand All @@ -97,10 +96,9 @@ async fn main() -> Result<(), StartupError> {
"Starting bundle-builder",
);

let client =
stackable_operator::client::initialize_operator(None, &args.common.cluster_info_opts)
.await
.context(InitKubeSnafu)?;
let client = stackable_operator::client::initialize_operator(None, &args.common.cluster_info)
.await
.context(InitKubeSnafu)?;

let (store, store_w) = reflector::store();
let rebuild_bundle = || {
Expand Down
24 changes: 15 additions & 9 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use stackable_operator::{
},
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::{
product_image_selection::ResolvedProductImage,
product_image_selection::{self, ResolvedProductImage},
rbac::build_rbac_resources,
secret_class::{SecretClassVolume, SecretClassVolumeScope},
tls_verification::{TlsClientDetails, TlsClientDetailsError},
Expand Down Expand Up @@ -65,11 +65,11 @@ use stackable_operator::{
},
},
role_utils::RoleGroupRef,
shared::time::Duration,
status::condition::{
compute_conditions, daemonset::DaemonSetConditionBuilder,
operations::ClusterOperationsConditionBuilder,
},
time::Duration,
utils::{COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo},
};
use strum::{EnumDiscriminants, IntoStaticStr};
Expand Down Expand Up @@ -329,6 +329,11 @@ pub enum Error {
AddVolumeMount {
source: builder::pod::container::Error,
},

#[snafu(display("failed to resolve product image"))]
ResolveProductImage {
source: product_image_selection::Error,
},
}
type Result<T, E = Error> = std::result::Result<T, E>;

Expand Down Expand Up @@ -428,7 +433,8 @@ pub async fn reconcile_opa(
let resolved_product_image = opa
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
.context(ResolveProductImageSnafu)?;
let opa_role = v1alpha1::OpaRole::Server;

let mut cluster_resources = ClusterResources::new(
Expand Down Expand Up @@ -629,7 +635,7 @@ pub fn build_server_role_service(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&role_name,
"global",
))
Expand Down Expand Up @@ -669,7 +675,7 @@ fn build_rolegroup_headless_service(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -716,7 +722,7 @@ fn build_rolegroup_metrics_service(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -764,7 +770,7 @@ fn build_server_rolegroup_config_map(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -1009,7 +1015,7 @@ fn build_server_rolegroup_daemonset(
let pb_metadata = ObjectMetaBuilder::new()
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup_ref.role,
&rolegroup_ref.role_group,
))
Expand Down Expand Up @@ -1208,7 +1214,7 @@ fn build_server_rolegroup_daemonset(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup_ref.role,
&rolegroup_ref.role_group,
))
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use stackable_operator::{
EmptyRoleConfig, GenericProductSpecificCommonConfig, Role, RoleGroup, RoleGroupRef,
},
schemars::{self, JsonSchema},
shared::time::Duration,
status::condition::{ClusterCondition, HasStatusCondition},
time::Duration,
utils::cluster_info::KubernetesClusterInfo,
versioned::versioned,
};
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/crd/user_info_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use stackable_operator::{
tls_verification::{CaCert, Tls, TlsClientDetails, TlsServerVerification, TlsVerification},
},
schemars::{self, JsonSchema},
time::Duration,
shared::time::Duration,
versioned::versioned,
};

Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn build_discovery_configmap(
})?
.with_recommended_labels(build_recommended_labels(
opa,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&v1alpha1::OpaRole::Server.to_string(),
"discovery",
))
Expand Down
11 changes: 5 additions & 6 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ async fn main() -> anyhow::Result<()> {
ProductOperatorRun {
product_config,
watch_namespace,
telemetry_arguments,
cluster_info_opts,
operator_environment: _,
telemetry,
cluster_info,
},
}) => {
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
// - The console log level was set by `OPA_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `OPA_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `OPA_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
let _tracing_guard =
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;

tracing::info!(
built_info.pkg_version = built_info::PKG_VERSION,
Expand All @@ -99,8 +99,7 @@ async fn main() -> anyhow::Result<()> {
])?;

let client =
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info_opts)
.await?;
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info).await?;
let kubernetes_cluster_info = client.kubernetes_cluster_info.clone();
create_controller(
client,
Expand Down
7 changes: 3 additions & 4 deletions rust/user-info-fetcher/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ async fn main() -> Result<(), StartupError> {
// - The console log level was set by `OPA_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `OPA_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `OPA_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
let _tracing_guard =
Tracing::pre_configured(built_info::PKG_NAME, args.common.telemetry_arguments)
.init()
.context(TracingInitSnafu)?;
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, args.common.telemetry)
.init()
.context(TracingInitSnafu)?;

tracing::info!(
built_info.pkg_version = built_info::PKG_VERSION,
Expand Down
Loading