Skip to content

Commit

Permalink
added owner name cli param
Browse files Browse the repository at this point in the history
  • Loading branch information
razvan committed Jan 20, 2025
1 parent 5736913 commit 4d3b7e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust/olm-deployer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ struct Opts {

#[derive(clap::Parser)]
struct OlmDeployerRun {
/// Name of the cluster role to use as owner for cluster wide resources.
#[arg(long, short)]
owner: String,
#[arg(long, short)]
namespace: String,
#[arg(long, short)]
Expand All @@ -51,6 +54,7 @@ struct OlmDeployerRun {
async fn main() -> Result<()> {
let opts = Opts::parse();
if let Command::Run(OlmDeployerRun {
owner,
namespace,
dir,
tracing_target,
Expand All @@ -74,7 +78,7 @@ async fn main() -> Result<()> {
let deployment: Deployment = deployment_api.get("secret-operator-deployer").await?;

let cluster_role_api = client.get_all_api::<ClusterRole>();
let cluster_role: ClusterRole = cluster_role_api.get("secret-operator-clusterrole").await?;
let cluster_role: ClusterRole = cluster_role_api.get(&owner).await?;

let kube_client = client.as_kube_client();
// discovery (to be able to infer apis from kind/plural only)
Expand Down

0 comments on commit 4d3b7e7

Please sign in to comment.