From d2e20d94526cbbdcc50c115fe36f2606cf8ceca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teo=20Klestrup=20R=C3=B6ijezon?= Date: Thu, 6 Oct 2022 13:54:20 +0200 Subject: [PATCH 1/3] Implement ClusterResource for ServiceAccount and RoleBinding --- src/cluster_resources.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cluster_resources.rs b/src/cluster_resources.rs index 35ffecfbf..5628b8d92 100644 --- a/src/cluster_resources.rs +++ b/src/cluster_resources.rs @@ -18,6 +18,7 @@ use crate::{ kube::{Resource, ResourceExt}, labels::{APP_INSTANCE_LABEL, APP_MANAGED_BY_LABEL, APP_NAME_LABEL}, }; +use k8s_openapi::api::{core::v1::ServiceAccount, rbac::v1::RoleBinding}; use kube::core::ErrorResponse; use serde::{de::DeserializeOwned, Serialize}; use tracing::{debug, info}; @@ -37,6 +38,8 @@ impl ClusterResource for ConfigMap {} impl ClusterResource for DaemonSet {} impl ClusterResource for Service {} impl ClusterResource for StatefulSet {} +impl ClusterResource for ServiceAccount {} +impl ClusterResource for RoleBinding {} /// A structure containing the cluster resources. /// @@ -280,6 +283,8 @@ impl ClusterResources { self.delete_orphaned_resources_of_kind::(client), self.delete_orphaned_resources_of_kind::(client), self.delete_orphaned_resources_of_kind::(client), + self.delete_orphaned_resources_of_kind::(client), + self.delete_orphaned_resources_of_kind::(client), )?; Ok(()) From f9fa12c1fbcd1855dadf2faecb787d7fa9f4493c Mon Sep 17 00:00:00 2001 From: maltesander Date: Fri, 7 Oct 2022 14:11:29 +0200 Subject: [PATCH 2/3] added Secret to cluster resources --- src/cluster_resources.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cluster_resources.rs b/src/cluster_resources.rs index 5628b8d92..185ecfc6e 100644 --- a/src/cluster_resources.rs +++ b/src/cluster_resources.rs @@ -18,7 +18,7 @@ use crate::{ kube::{Resource, ResourceExt}, labels::{APP_INSTANCE_LABEL, APP_MANAGED_BY_LABEL, APP_NAME_LABEL}, }; -use k8s_openapi::api::{core::v1::ServiceAccount, rbac::v1::RoleBinding}; +use k8s_openapi::api::{core::v1::Secret, core::v1::ServiceAccount, rbac::v1::RoleBinding}; use kube::core::ErrorResponse; use serde::{de::DeserializeOwned, Serialize}; use tracing::{debug, info}; @@ -40,6 +40,7 @@ impl ClusterResource for Service {} impl ClusterResource for StatefulSet {} impl ClusterResource for ServiceAccount {} impl ClusterResource for RoleBinding {} +impl ClusterResource for Secret {} /// A structure containing the cluster resources. /// @@ -285,6 +286,7 @@ impl ClusterResources { self.delete_orphaned_resources_of_kind::(client), self.delete_orphaned_resources_of_kind::(client), self.delete_orphaned_resources_of_kind::(client), + self.delete_orphaned_resources_of_kind::(client), )?; Ok(()) From 5563e70089a64e7fddb8978339c20e1ff0b70f57 Mon Sep 17 00:00:00 2001 From: maltesander Date: Fri, 7 Oct 2022 14:40:08 +0200 Subject: [PATCH 3/3] adapted changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99cb2eab5..24cbc8627 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- Extended `ClusterResource` with `Secret`, `ServiceAccount` and `RoleBinding` ([#485]). + +[#485]: https://github.com/stackabletech/operator-rs/pull/485 + ## [0.25.2] - 2022-09-27 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.