Skip to content

refactor: Build RBAC with recommended labels#731

Open
adwk67 wants to merge 8 commits into
mainfrom
feat/smooth-operator/build-rbac
Open

refactor: Build RBAC with recommended labels#731
adwk67 wants to merge 8 commits into
mainfrom
feat/smooth-operator/build-rbac

Conversation

@adwk67

@adwk67 adwk67 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Description

Part of: stackabletech/issues#869

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

  • Changes are OpenShift compatible
  • CRD changes approved
  • CRD documentation for all fields, following the style guide.
  • Helm chart can be installed and deployed operator works
  • Integration tests passed (for non trivial changes)
  • Changes need to be "offline" compatible
  • Links to generated (nightly) docs added
  • Release note snippet added

Reviewer

  • Code contains useful comments
  • (Integration-)Test cases added
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Acceptance

  • Feature Tracker has been updated
  • Proper release label has been added
  • Links to generated (nightly) docs added
  • Release note snippet added
  • Add type/deprecation label & add to the deprecation schedule
  • Add type/experimental label & add to the experimental features tracker

Base automatically changed from feat/smooth-operator/introduce-builder to main July 21, 2026 15:15
@adwk67
adwk67 force-pushed the feat/smooth-operator/build-rbac branch from 809f790 to 1bb0927 Compare July 22, 2026 09:15
@adwk67 adwk67 closed this Jul 23, 2026
@adwk67 adwk67 reopened this Jul 23, 2026
@adwk67

adwk67 commented Jul 23, 2026

Copy link
Copy Markdown
Member Author
--- PASS: kuttl (503.38s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/smoke_postgres-12.5.6_hive-4.2.0_opa-latest-1.16.2_openshift-false_s3-use-tls-true_opa-use-tls-false (503.37s)
PASS

/// regression fails here, with a validate-shaped message, instead of surfacing as a confusing
/// build-test failure downstream.
#[test]
fn validate_ok_derives_expected_values() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case tests the "happy path". Why are exactly name, namespace, product_version and role group names tested and not other properties of ValidatedCluster?

Comment on lines +340 to +349
#[test]
fn validate_rejects_missing_metastore_role() {
let yaml = DERBY_YAML
.split("metastore:")
.next()
.expect("the fixture contains a metastore role");

let error = expect_validate_err(yaml);
assert!(matches!(error, Error::NoMetaStoreRole));
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split is a fragile choice. But more important: metastore is required but it is defined as optional for no good reason (see #707 (comment)). I would just fix it instead of adding further code.

If it will be fixed in the future, chances are that this code is forgotten to be removed.


#[test]
fn validate_rejects_invalid_role_group_name() {
let yaml = DERBY_YAML.replace("default:", "Invalid_RG:");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to duplicate the YAML instead of using string manipulation. It is not obvious what the test input is.

Comment thread rust/operator-binary/src/controller/validate.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants