Skip to content
Merged
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
68 changes: 61 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions deploy/helm/commons-operator/templates/roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-clusterrole
rules:
- apiGroups:
- ""
resources:
- pods
- configmaps
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- get
- list
- watch
- patch # We need to add a label to the StatefulSet
- apiGroups:
- events.k8s.io
resources:
- events
verbs:
- create
31 changes: 31 additions & 0 deletions deploy/manifests/roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: commons-operator-clusterrole
rules:
- apiGroups:
- ""
resources:
- pods
- configmaps
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- get
- list
- watch
- patch # We need to add a label to the StatefulSet
- apiGroups:
- events.k8s.io
resources:
- events
verbs:
- create
4 changes: 4 additions & 0 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ repository = "https://github.com/stackabletech/commons-operator"
[dependencies]
anyhow = "1.0"
clap = "3.1"
futures = { version = "0.3", features = ["compat"] }
serde = "1.0"
serde_json = "1.0"
serde_yaml = "0.8"
snafu = "0.7"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.15.0" }
stackable-commons-crd = { path = "../crd" }
strum = { version = "0.24", features = ["derive"] }
tokio = { version = "1.17", features = ["macros", "rt-multi-thread"] }

[build-dependencies]
Expand Down
18 changes: 17 additions & 1 deletion rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
mod restart_controller;

use stackable_operator::cli::Command;

use clap::Parser;
Expand All @@ -23,7 +25,21 @@ async fn main() -> anyhow::Result<()> {
match opts.cmd {
Command::Crd => println!("{}", serde_yaml::to_string(&AuthenticationClass::crd())?,),
Command::Run(_) => {
todo!();
stackable_operator::utils::print_startup_string(
built_info::PKG_DESCRIPTION,
built_info::PKG_VERSION,
built_info::GIT_VERSION,
built_info::TARGET,
built_info::BUILT_TIME_UTC,
built_info::RUSTC_VERSION,
);

let client = stackable_operator::client::create_client(Some(
"commons.stackable.tech".to_string(),
))
.await?;

restart_controller::start(&client).await?
}
}

Expand Down
Loading