Skip to content

Commit 4a7b646

Browse files
Merge branch 'main' into update-release-branch
2 parents 249dca5 + 91ff36f commit 4a7b646

File tree

9 files changed

+31
-46
lines changed

9 files changed

+31
-46
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ All notable changes to this project will be documented in this file.
2424
### Fixed
2525

2626
- Failing to parse one `ZookeeperCluster`/`ZookeeperZnode` should no longer cause the whole operator to stop functioning ([#872]).
27+
- BREAKING: Use distinct ServiceAccounts for the Stacklets, so that multiple Stacklets can be deployed in one namespace. Existing Stacklets will use the newly created ServiceAccounts after restart ([#889]).
2728

2829
[#853]: https://github.com/stackabletech/zookeeper-operator/pull/853
2930
[#857]: https://github.com/stackabletech/zookeeper-operator/pull/857
3031
[#870]: https://github.com/stackabletech/zookeeper-operator/pull/870
3132
[#872]: https://github.com/stackabletech/zookeeper-operator/pull/872
33+
[#889]: https://github.com/stackabletech/zookeeper-operator/pull/889
3234

3335
## [24.7.0] - 2024-07-24
3436

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
2323
serde_yaml = "0.9"
2424
snafu = "0.8"
25-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.80.0" }
25+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.82.0" }
2626
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
2727
strum = { version = "0.26", features = ["derive"] }
2828
tokio = { version = "1.40", features = ["full"] }

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ SHELL=/usr/bin/env bash -euo pipefail
2929
render-readme:
3030
scripts/render_readme.sh
3131

32+
render-docs:
33+
scripts/docs_templating.sh
34+
3235
## Docker related targets
3336
docker-build:
3437
docker build --force-rm --build-arg VERSION=${VERSION} -t "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}-${ARCH}" -f docker/Dockerfile .

crate-hashes.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/modules/zookeeper/examples/getting_started/code/getting_started.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
set -euo pipefail
33

44
# DO NOT EDIT THE SCRIPT
5-
# Instead, update the j2 template, and regenerate it for dev:
6-
# cat <<EOF | jinja2 --format yaml getting_started.sh.j2 -o getting_started.sh
7-
# helm:
8-
# repo_name: stackable-dev
9-
# repo_url: https://repo.stackable.tech/repository/helm-dev/
10-
# versions:
11-
# commons: 0.0.0-dev
12-
# listener: 0.0.0-dev
13-
# secret: 0.0.0-dev
14-
# zookeeper: 0.0.0-dev
15-
# EOF
5+
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
166

177
# This script contains all the code snippets from the guide, as well as some assert tests
188
# to test if the instructions in the guide work. The user *could* use it, but it is intended

docs/modules/zookeeper/examples/getting_started/code/getting_started.sh.j2

+1-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
set -euo pipefail
33

44
# DO NOT EDIT THE SCRIPT
5-
# Instead, update the j2 template, and regenerate it for dev:
6-
# cat <<EOF | jinja2 --format yaml getting_started.sh.j2 -o getting_started.sh
7-
# helm:
8-
# repo_name: stackable-dev
9-
# repo_url: https://repo.stackable.tech/repository/helm-dev/
10-
# versions:
11-
# commons: 0.0.0-dev
12-
# listener: 0.0.0-dev
13-
# secret: 0.0.0-dev
14-
# zookeeper: 0.0.0-dev
15-
# EOF
5+
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
166

177
# This script contains all the code snippets from the guide, as well as some assert tests
188
# to test if the instructions in the guide work. The user *could* use it, but it is intended

rust/operator-binary/src/zk_controller.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ use stackable_operator::{
2323
pod::{container::ContainerBuilder, resources::ResourceRequirementsBuilder, PodBuilder},
2424
},
2525
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
26-
commons::{
27-
product_image_selection::ResolvedProductImage,
28-
rbac::{build_rbac_resources, service_account_name},
29-
},
26+
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
3027
k8s_openapi::{
3128
api::{
3229
apps::v1::{StatefulSet, StatefulSetSpec},
3330
core::v1::{
3431
ConfigMap, ConfigMapVolumeSource, EmptyDirVolumeSource, EnvVar, EnvVarSource,
35-
ExecAction, ObjectFieldSelector, PodSecurityContext, Probe, Service, ServicePort,
36-
ServiceSpec, Volume,
32+
ExecAction, ObjectFieldSelector, PodSecurityContext, Probe, Service,
33+
ServiceAccount, ServicePort, ServiceSpec, Volume,
3734
},
3835
},
3936
apimachinery::pkg::apis::meta::v1::LabelSelector,
@@ -43,7 +40,7 @@ use stackable_operator::{
4340
api::DynamicObject,
4441
core::{error_boundary, DeserializeGuard},
4542
runtime::controller,
46-
Resource,
43+
Resource, ResourceExt,
4744
},
4845
kvp::{Label, LabelError, Labels},
4946
logging::controller::ReconcilerError,
@@ -395,7 +392,7 @@ pub async fn reconcile_zk(
395392
.context(BuildRbacResourcesSnafu)?;
396393

397394
cluster_resources
398-
.add(client, rbac_sa)
395+
.add(client, rbac_sa.clone())
399396
.await
400397
.context(ApplyServiceAccountSnafu)?;
401398

@@ -444,6 +441,7 @@ pub async fn reconcile_zk(
444441
&zookeeper_security,
445442
&resolved_product_image,
446443
&merged_config,
444+
&rbac_sa,
447445
)?;
448446
cluster_resources
449447
.add(client, rg_service)
@@ -749,6 +747,7 @@ fn build_server_rolegroup_service(
749747
/// The rolegroup [`StatefulSet`] runs the rolegroup, as configured by the administrator.
750748
///
751749
/// The [`Pod`](`stackable_operator::k8s_openapi::api::core::v1::Pod`)s are accessible through the corresponding [`Service`] (from [`build_server_rolegroup_service`]).
750+
#[allow(clippy::too_many_arguments)]
752751
fn build_server_rolegroup_statefulset(
753752
zk: &ZookeeperCluster,
754753
zk_role: &ZookeeperRole,
@@ -757,6 +756,7 @@ fn build_server_rolegroup_statefulset(
757756
zookeeper_security: &ZookeeperSecurity,
758757
resolved_product_image: &ResolvedProductImage,
759758
config: &ZookeeperConfig,
759+
service_account: &ServiceAccount,
760760
) -> Result<StatefulSet> {
761761
let role = zk.role(zk_role).context(InternalOperatorFailureSnafu)?;
762762
let rolegroup = zk
@@ -964,7 +964,7 @@ fn build_server_rolegroup_statefulset(
964964
fs_group: Some(1000),
965965
..PodSecurityContext::default()
966966
})
967-
.service_account_name(service_account_name(APP_NAME));
967+
.service_account_name(service_account.name_any());
968968

969969
if let Some(ContainerLogConfig {
970970
choice:

0 commit comments

Comments
 (0)