Skip to content

Commit c96d6ba

Browse files
nightkrmaltesander
andcommitted
Implement ClusterResource for ServiceAccount and RoleBinding (#485)
## Description These are currently used by zookeeper-operator, so if we want to be consistent and deploy everything with clusterresources then we'll need to add support for them. Co-authored-by: Teo Klestrup Röijezon <[email protected]> Co-authored-by: maltesander <[email protected]>
1 parent ef41dc9 commit c96d6ba

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Extended `ClusterResource` with `Secret`, `ServiceAccount` and `RoleBinding` ([#485]).
10+
11+
[#485]: https://github.com/stackabletech/operator-rs/pull/485
12+
713
## [0.25.2] - 2022-09-27
814

915
This is a rerelease of 0.25.1 which some last-minute incompatible API changes to the additions that would have been released in 0.25.1.

src/cluster_resources.rs

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use crate::{
1818
kube::{Resource, ResourceExt},
1919
labels::{APP_INSTANCE_LABEL, APP_MANAGED_BY_LABEL, APP_NAME_LABEL},
2020
};
21+
use k8s_openapi::api::{core::v1::Secret, core::v1::ServiceAccount, rbac::v1::RoleBinding};
2122
use kube::core::ErrorResponse;
2223
use serde::{de::DeserializeOwned, Serialize};
2324
use tracing::{debug, info};
@@ -37,6 +38,9 @@ impl ClusterResource for ConfigMap {}
3738
impl ClusterResource for DaemonSet {}
3839
impl ClusterResource for Service {}
3940
impl ClusterResource for StatefulSet {}
41+
impl ClusterResource for ServiceAccount {}
42+
impl ClusterResource for RoleBinding {}
43+
impl ClusterResource for Secret {}
4044

4145
/// A structure containing the cluster resources.
4246
///
@@ -280,6 +284,9 @@ impl ClusterResources {
280284
self.delete_orphaned_resources_of_kind::<StatefulSet>(client),
281285
self.delete_orphaned_resources_of_kind::<DaemonSet>(client),
282286
self.delete_orphaned_resources_of_kind::<ConfigMap>(client),
287+
self.delete_orphaned_resources_of_kind::<ServiceAccount>(client),
288+
self.delete_orphaned_resources_of_kind::<RoleBinding>(client),
289+
self.delete_orphaned_resources_of_kind::<Secret>(client),
283290
)?;
284291

285292
Ok(())

0 commit comments

Comments
 (0)