Skip to content
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
the logger as well, because a logger discards records before any handler can filter them, so in
that direction the UI and the other destinations open up together and cannot be set apart
([#829]).
- Remove the `app.kubernetes.io/component` and `app.kubernetes.io/role-group` labels from the
resources they don't apply to (previously set to `none`) ([#838]).
- All product containers now run with `securityContext.runAsNonRoot` set to `true` to improve security ([#840]).

### Fixed
Expand All @@ -39,6 +41,7 @@
[#829]: https://github.com/stackabletech/airflow-operator/pull/829
[#834]: https://github.com/stackabletech/airflow-operator/pull/834
[#835]: https://github.com/stackabletech/airflow-operator/pull/835
[#838]: https://github.com/stackabletech/airflow-operator/pull/838
[#840]: https://github.com/stackabletech/airflow-operator/pull/840

## [26.7.0] - 2026-07-21
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

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

57 changes: 29 additions & 28 deletions Cargo.nix

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ tokio = { version = "1.53", features = ["full"] }
tracing = "0.1"

[patch."https://github.com/stackabletech/operator-rs.git"]
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/smooth-operator/recommended-labels" }
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }
18 changes: 9 additions & 9 deletions crate-hashes.json

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

10 changes: 5 additions & 5 deletions rust/operator-binary/src/controller/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use strum::{EnumDiscriminants, IntoStaticStr};

use crate::{
controller::{
Applied, KubernetesResources, Prepared, ValidatedCluster, controller_name, operator_name,
product_name,
Applied, CONTROLLER_NAME, KubernetesResources, OPERATOR_NAME, PRODUCT_NAME, Prepared,
ValidatedCluster,
},
crd::internal_secret::{
FERNET_KEY_SECRET_KEY, INTERNAL_SECRET_SECRET_KEY, JWT_SECRET_SECRET_KEY,
Expand Down Expand Up @@ -60,9 +60,9 @@ impl<'a> Applier<'a> {
object_overrides: &'a ObjectOverrides,
) -> Applier<'a> {
let cluster_resources = cluster_resources_new(
&product_name(),
&operator_name(),
&controller_name(),
&PRODUCT_NAME,
&OPERATOR_NAME,
&CONTROLLER_NAME,
&cluster.name,
&cluster.namespace,
&cluster.uid,
Expand Down
81 changes: 76 additions & 5 deletions rust/operator-binary/src/controller/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ use snafu::{ResultExt, Snafu};
use stackable_operator::{
builder::meta::ObjectMetaBuilder,
kvp::Labels,
v2::{builder::meta::ownerreference_from_resource, types::operator::RoleGroupName},
v2::{
builder::meta::ownerreference_from_resource,
types::operator::{RoleGroupName, RoleName},
},
};

use crate::{
controller::{
KubernetesResources, Prepared, ValidatedCluster,
CONTROLLER_NAME, KubernetesResources, OPERATOR_NAME, PRODUCT_NAME, Prepared,
ValidatedCluster,
build::resource::{
config_map::build_rolegroup_config_map,
executor::build_executor_template_config_map,
Expand Down Expand Up @@ -122,7 +126,7 @@ pub fn build(cluster: &ValidatedCluster) -> Result<KubernetesResources<Prepared>
config_maps.push(
build_rolegroup_config_map(
cluster,
&ValidatedCluster::role_name(role),
role,
role_group_name,
&rg_config.config_overrides,
logging,
Expand Down Expand Up @@ -178,6 +182,75 @@ pub(crate) fn object_meta(
builder
}

pub(crate) fn recommended_labels_for_cluster_resources(cluster: &ValidatedCluster) -> Labels {
stackable_operator::v2::kvp::label::recommended_labels_for_cluster_resources(
&cluster.name,
&PRODUCT_NAME,
&cluster.product_version,
&OPERATOR_NAME,
&CONTROLLER_NAME,
)
}

pub(crate) fn recommended_labels_for_role_resources(
cluster: &ValidatedCluster,
role_name: &RoleName,
) -> Labels {
stackable_operator::v2::kvp::label::recommended_labels_for_role_resources(
&cluster.name,
&PRODUCT_NAME,
&cluster.product_version,
&OPERATOR_NAME,
&CONTROLLER_NAME,
role_name,
)
}

pub(crate) fn recommended_labels_for_role_group_resources(
cluster: &ValidatedCluster,
role_name: &RoleName,
role_group_name: &RoleGroupName,
) -> Labels {
stackable_operator::v2::kvp::label::recommended_labels_for_role_group_resources(
&cluster.name,
&PRODUCT_NAME,
&cluster.product_version,
&OPERATOR_NAME,
&CONTROLLER_NAME,
role_name,
role_group_name,
)
}

pub(crate) fn recommended_labels_for_unversioned_role_group_resources(
cluster: &ValidatedCluster,
role_name: &RoleName,
role_group_name: &RoleGroupName,
) -> Labels {
stackable_operator::v2::kvp::label::recommended_labels_for_unversioned_role_group_resources(
&cluster.name,
&PRODUCT_NAME,
&OPERATOR_NAME,
&CONTROLLER_NAME,
role_name,
role_group_name,
)
}

/// Selector labels matching the pods of a role group.
pub(crate) fn role_group_selector(
cluster: &ValidatedCluster,
role_name: &RoleName,
role_group_name: &RoleGroupName,
) -> Labels {
stackable_operator::v2::kvp::label::role_group_selector(
&cluster.name,
&PRODUCT_NAME,
role_name,
role_group_name,
)
}

#[cfg(test)]
pub(crate) mod test_support {
use crate::{
Expand Down Expand Up @@ -475,14 +548,12 @@ mod tests {

let expected_labels = BTreeMap::from(
[
("app.kubernetes.io/component", "none"),
("app.kubernetes.io/instance", "my-airflow"),
(
"app.kubernetes.io/managed-by",
"airflow.stackable.tech_airflowcluster",
),
("app.kubernetes.io/name", "airflow"),
("app.kubernetes.io/role-group", "none"),
("app.kubernetes.io/version", &app_version_label("3.1.6")),
("stackable.tech/vendor", "Stackable"),
]
Expand Down
Loading
Loading