Skip to content

[Merged by Bors] - Implement ClusterResource for ServiceAccount and RoleBinding #485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions src/cluster_resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::Secret, core::v1::ServiceAccount, rbac::v1::RoleBinding};
use kube::core::ErrorResponse;
use serde::{de::DeserializeOwned, Serialize};
use tracing::{debug, info};
Expand All @@ -37,6 +38,9 @@ impl ClusterResource for ConfigMap {}
impl ClusterResource for DaemonSet {}
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.
///
Expand Down Expand Up @@ -280,6 +284,9 @@ impl ClusterResources {
self.delete_orphaned_resources_of_kind::<StatefulSet>(client),
self.delete_orphaned_resources_of_kind::<DaemonSet>(client),
self.delete_orphaned_resources_of_kind::<ConfigMap>(client),
self.delete_orphaned_resources_of_kind::<ServiceAccount>(client),
self.delete_orphaned_resources_of_kind::<RoleBinding>(client),
self.delete_orphaned_resources_of_kind::<Secret>(client),
)?;

Ok(())
Expand Down