Skip to content
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

feat: Add Pdb struct and PdbBuilder #653

Merged
merged 25 commits into from
Sep 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
impl ClusterResource for PodDisruptionBudget
  • Loading branch information
sbernauer committed Sep 19, 2023
commit 6a26d81767d53d47a31a80e39977cc18624e2f25
32 changes: 16 additions & 16 deletions src/cluster_resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@ use crate::{
},
},
error::{Error, OperatorResult},
k8s_openapi::{
api::{
apps::v1::{DaemonSet, DaemonSetSpec, StatefulSet, StatefulSetSpec},
batch::v1::Job,
core::v1::{
ConfigMap, ObjectReference, PodSpec, PodTemplateSpec, Secret, Service,
ServiceAccount,
},
rbac::v1::RoleBinding,
},
apimachinery::pkg::apis::meta::v1::{LabelSelector, LabelSelectorRequirement},
NamespaceResourceScope,
},
kube::{Resource, ResourceExt},
labels::{APP_INSTANCE_LABEL, APP_MANAGED_BY_LABEL, APP_NAME_LABEL},
utils::format_full_controller_name,
};

use kube::core::ErrorResponse;
use k8s_openapi::{
api::{
apps::v1::{DaemonSet, DaemonSetSpec, StatefulSet, StatefulSetSpec},
batch::v1::Job,
core::v1::{
ConfigMap, ObjectReference, PodSpec, PodTemplateSpec, Secret, Service, ServiceAccount,
},
policy::v1::PodDisruptionBudget,
rbac::v1::RoleBinding,
},
apimachinery::pkg::apis::meta::v1::{LabelSelector, LabelSelectorRequirement},
NamespaceResourceScope,
};
use kube::{core::ErrorResponse, Resource, ResourceExt};
use serde::{de::DeserializeOwned, Serialize};
use std::{
collections::{BTreeMap, HashSet},
Expand Down Expand Up @@ -161,10 +160,11 @@ impl ClusterResourceApplyStrategy {
}

impl ClusterResource for ConfigMap {}
impl ClusterResource for Secret {}
impl ClusterResource for Service {}
impl ClusterResource for ServiceAccount {}
impl ClusterResource for RoleBinding {}
impl ClusterResource for Secret {}
impl ClusterResource for PodDisruptionBudget {}

impl ClusterResource for Job {
fn pod_spec(&self) -> Option<&PodSpec> {
Expand Down