File tree Expand file tree Collapse file tree
crates/stackable-operator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,13 +6,14 @@ All notable changes to this project will be documented in this file.
66
77### Changed
88
9- - BREAKING: ` PodSecurityContextBuilder::new ` was removed in favor of ` PodSecurityContextBuilder::with_stackable_defaults ` ([ #XXXX] ).
9+ - BREAKING: ` PodSecurityContextBuilder::new ` was removed in favor of ` PodSecurityContextBuilder::with_stackable_defaults `
10+ (same for ` SecurityContextBuilder ` ) ([ #1205 ] ).
1011 This function already sets up some defaults we want to use across the platform.
1112 Currently this is ` runAsNonRoot: true ` , which might cause product Pods to crash and require changes.
12- - BREAKING: ` PodSecurityContextBuilder::run_as_non_root ` now takes a ` bool ` instead of assuming consumers always want to set it to ` true ` ([ #XXXX ] ).
13+ - BREAKING: ` PodSecurityContextBuilder::run_as_non_root ` now takes a ` bool ` instead of assuming consumers always want to set it to ` true ` ([ #1205 ] ).
1314 This is needed to allow users setting it to ` false ` in case the new ` with_stackable_defaults ` functions set's it to ` true ` .
1415
15- [ #XXXX ] : https://github.com/stackabletech/operator-rs/pull/XXXX
16+ [ #1205 ] : https://github.com/stackabletech/operator-rs/pull/1205
1617
1718## [ 0.113.0] - 2026-06-22
1819
Original file line number Diff line number Diff line change @@ -10,16 +10,29 @@ pub struct SecurityContextBuilder {
1010}
1111
1212impl SecurityContextBuilder {
13- /// Convenience function for a wide use-case.
14- pub fn run_as_root ( ) -> SecurityContext {
15- SecurityContext {
16- run_as_user : Some ( 0 ) ,
17- ..SecurityContext :: default ( )
18- }
13+ /// Construct a new [`SecurityContextBuilder`] that is pre-filled with Stackable's defaults.
14+ ///
15+ /// Currently the defaults are:
16+ ///
17+ /// * `runAsNonRoot: true`
18+ pub fn with_stackable_defaults ( ) -> Self {
19+ // We are using the builder functions to ensure that builder functions exist to override these settings.
20+ let mut builder = Self {
21+ security_context : SecurityContext :: default ( ) ,
22+ } ;
23+
24+ // Reason: Running as root is bad
25+ builder. run_as_non_root ( true ) ;
26+
27+ builder
1928 }
2029
21- pub fn new ( ) -> Self {
22- Self :: default ( )
30+ /// Convenience function for a wide use-case.
31+ ///
32+ /// Please only use this is really needed.
33+ pub fn run_as_root ( & mut self ) {
34+ self . run_as_user ( 0 ) ;
35+ self . run_as_non_root ( false ) ;
2336 }
2437
2538 pub fn allow_privilege_escalation ( & mut self , value : bool ) -> & mut Self {
You can’t perform that action at this time.
0 commit comments