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

[Merged by Bors] - Rafctoring names. #252

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ All notable changes to this project will be documented in this file.
- Bundle builder side car container that generates bundles from
`ConfigMap` objects ([#244])
- The command line argument `--opa-builder-clusterrole` for the `run`
subcommand or the environment variable `OPA_BUILDER_CLUSTERROLE` to set up
a service account for the OPA pods. ([#244])
subcommand or the environment variable `OPA_BUNDLE_BUILDER_CLUSTERROLE` to set up
a service account for the OPA pods. ([#244]) and ([#252])
razvan marked this conversation as resolved.
Show resolved Hide resolved
- The command line argument `--watch-namespace` for the `run` subcommand or
the environment variable `WATCH_NAMESPACE` can be used to instruct the
operator to watch a particular namespace. ([#244])
Expand All @@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file.

[#241]: https://github.com/stackabletech/opa-operator/pull/241
[#244]: https://github.com/stackabletech/opa-operator/pull/244
[#252]: https://github.com/stackabletech/opa-operator/pull/252

## [0.8.0] - 2022-02-14

Expand Down
4 changes: 2 additions & 2 deletions deploy/helm/opa-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ spec:
- mountPath: /etc/stackable/{{ include "operator.appname" . }}/config-spec
name: config-spec
env:
- name: OPA_BUILDER_CLUSTERROLE
value: {{ .Release.Name }}-opa-builder-clusterrole
- name: OPA_BUNDLE_BUILDER_CLUSTERROLE
value: {{ .Release.Name }}-opa-bundle-builder-clusterrole
volumes:
- name: config-spec
configMap:
Expand Down
4 changes: 2 additions & 2 deletions deploy/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ spec:
- mountPath: /etc/stackable/opa-operator/config-spec
name: config-spec
env:
- name: OPA_BUILDER_CLUSTERROLE
value: opa-operator-opa-builder-clusterrole
- name: OPA_BUNDLE_BUILDER_CLUSTERROLE
value: opa-operator-opa-bundle-builder-clusterrole
volumes:
- name: config-spec
configMap:
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/commandline_args.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ The operator will **only** watch for resources in the provided namespace `test`:
cargo run -- run --watch-namespace test
----

=== run --opa-builder-clusterrole
=== opa-bundle-builder-clusterrole

*Default value*: `None`. A value is generated automatically by Helm.

*Required*: false. When not specified, the environment variable `OPA_BUILDER_CLUSTERROLE` must be present.
*Required*: false. When not specified, the environment variable `OPA_BUNDLE_BUILDER_CLUSTERROLE` must be present.
razvan marked this conversation as resolved.
Show resolved Hide resolved

*Multiple values:* false

Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub const BUNDLE_BUILDER_PORT: i32 = 3030;
pub struct Ctx {
pub client: stackable_operator::client::Client,
pub product_config: ProductConfigManager,
pub opa_builder_clusterrole: String,
pub opa_bundle_builder_clusterrole: String,
}

#[derive(Snafu, Debug, EnumDiscriminants)]
Expand Down Expand Up @@ -168,7 +168,7 @@ pub async fn reconcile_opa(opa: Arc<OpaCluster>, ctx: Context<Ctx>) -> Result<Re
.context(ApplyRoleServiceSnafu)?;

let (opa_builder_role_serviceaccount, opa_builder_role_rolebinding) =
build_opa_builder_serviceaccount(&opa, &ctx.get_ref().opa_builder_clusterrole)?;
build_opa_builder_serviceaccount(&opa, &ctx.get_ref().opa_bundle_builder_clusterrole)?;

client
.apply_patch(
Expand Down
8 changes: 4 additions & 4 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct Opts {
#[derive(clap::Parser)]
struct OpaRun {
#[clap(long, env)]
opa_builder_clusterrole: String,
opa_bundle_builder_clusterrole: String,
#[clap(flatten)]
common: ProductOperatorRun,
}
Expand All @@ -52,7 +52,7 @@ async fn main() -> Result<(), error::Error> {
match opts.cmd {
Command::Crd => println!("{}", serde_yaml::to_string(&OpaCluster::crd())?),
Command::Run(OpaRun {
opa_builder_clusterrole,
opa_bundle_builder_clusterrole: opa_builder_clusterrole,
common:
ProductOperatorRun {
product_config,
Expand Down Expand Up @@ -92,7 +92,7 @@ async fn create_controller(
client: Client,
product_config: ProductConfigManager,
watch_namespace: WatchNamespace,
opa_builder_clusterrole: String,
opa_bundle_builder_clusterrole: String,
) -> OperatorResult<()> {
let opa_api: Api<OpaCluster> = watch_namespace.get_api(&client);
let daemonsets_api: Api<DaemonSet> = watch_namespace.get_api(&client);
Expand All @@ -111,7 +111,7 @@ async fn create_controller(
Context::new(controller::Ctx {
client: client.clone(),
product_config,
opa_builder_clusterrole,
opa_bundle_builder_clusterrole,
}),
)
.map(|res| {
Expand Down