-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/label-templates
- Loading branch information
Showing
21 changed files
with
740 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ rules: | |
- watch | ||
- create | ||
- patch | ||
- update | ||
- apiGroups: | ||
- "" | ||
resources: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "stackable-secret-operator-crd-utils" | ||
version.workspace = true | ||
authors.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
repository.workspace = true | ||
publish = false | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
serde.workspace = true | ||
stackable-operator.workspace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//! CRD types that are shared between secret-operator components, but aren't clearly owned by one of them. | ||
use std::fmt::Display; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
use stackable_operator::{ | ||
k8s_openapi::api::core::v1::Secret, | ||
kube::runtime::reflector::ObjectRef, | ||
schemars::{self, JsonSchema}, | ||
}; | ||
|
||
// Redefine SecretReference instead of reusing k8s-openapi's, in order to make name/namespace mandatory. | ||
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct SecretReference { | ||
/// Namespace of the Secret being referred to. | ||
pub namespace: String, | ||
/// Name of the Secret being referred to. | ||
pub name: String, | ||
} | ||
|
||
// Use ObjectRef for logging/errors | ||
impl Display for SecretReference { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
ObjectRef::<Secret>::from(self).fmt(f) | ||
} | ||
} | ||
impl From<SecretReference> for ObjectRef<Secret> { | ||
fn from(val: SecretReference) -> Self { | ||
ObjectRef::<Secret>::from(&val) | ||
} | ||
} | ||
impl From<&SecretReference> for ObjectRef<Secret> { | ||
fn from(val: &SecretReference) -> Self { | ||
ObjectRef::<Secret>::new(&val.name).within(&val.namespace) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.