This repository was archived by the owner on Jan 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
src/main/java/com/nike/cerberus Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1616
1717group =com.nike
1818artifactId =cerberus-lifecycle-cli
19- version =4.7.0
19+ version =4.7.1
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public class UpdateCmsConfigCommand implements Command {
3737 public static final String COMMAND_NAME = "update-cms-config" ;
3838 public static final String OVERWRITE_LONG_ARG = "--overwrite" ;
3939 public static final String FORCE_ARG = "--force" ;
40+ public static final String IGNORE_DEFAULT_CONFIGURATIONS_ARGUMENT = "--ignore-default-configurations" ;
4041
4142 @ Parameter (names = CreateCmsConfigCommand .ADMIN_GROUP_LONG_ARG , description = "Group that has admin privileges in CMS." )
4243 private String adminGroup ;
@@ -50,6 +51,9 @@ public class UpdateCmsConfigCommand implements Command {
5051 @ Parameter (names = FORCE_ARG , description = "Force allow overwriting of system generated property. This may break your configuration." )
5152 private boolean force = false ;
5253
54+ @ Parameter (names = IGNORE_DEFAULT_CONFIGURATIONS_ARGUMENT , description = "Ignores default configurations of the CMS. " )
55+ private boolean ignoreDefaultConfigurations = false ;
56+
5357 public String getAdminGroup () {
5458 return adminGroup ;
5559 }
@@ -66,6 +70,10 @@ public boolean isForce() {
6670 return force ;
6771 }
6872
73+ public boolean isIgnoreDefaultConfigurations () {
74+ return ignoreDefaultConfigurations ;
75+ }
76+
6977 @ Override
7078 public String getCommandName () {
7179 return COMMAND_NAME ;
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public CreateCmsConfigOperation(final ConfigStore configStore) {
4444 @ Override
4545 public void run (final CreateCmsConfigCommand command ) {
4646 logger .info ("Retrieving configuration data from the configuration bucket." );
47- final Properties cmsConfigProperties = configStore .getCmsSystemProperties (false );
47+ final Properties cmsConfigProperties = configStore .getCmsSystemProperties (false , false );
4848
4949 cmsConfigProperties .put (CMS_ADMIN_GROUP_KEY , command .getAdminGroup ());
5050
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public void run(final UpdateCmsConfigCommand command) {
4949
5050 logger .debug ("Retrieving configuration data from the configuration bucket." );
5151
52- final Properties newProperties = configStore .getCmsSystemProperties (true );
52+ final Properties newProperties = configStore .getCmsSystemProperties (true , command . isIgnoreDefaultConfigurations () );
5353 final Properties existingCustomProperties = configStore .getExistingCmsUserProperties ();
5454 if (!command .getOverwrite ()) {
5555 // keep existing custom properties
Original file line number Diff line number Diff line change @@ -324,8 +324,7 @@ private Properties generateBaseCmsSystemProperties() {
324324 /**
325325 * System properties not set with -P param
326326 */
327- public Properties getCmsSystemProperties (boolean shouldLoadExistingProperties ) {
328-
327+ public Properties getCmsSystemProperties (boolean shouldLoadExistingProperties , boolean shouldIgnoreDefaultCmsProperties ) {
329328 Properties properties = new Properties ();
330329
331330 Properties existingProperties ;
@@ -339,8 +338,10 @@ public Properties getCmsSystemProperties(boolean shouldLoadExistingProperties) {
339338 });
340339 }
341340
342- // overwrite any of the automatically generated properties that may have changed
343- properties .putAll (generateBaseCmsSystemProperties ());
341+ if (!shouldIgnoreDefaultCmsProperties ) {
342+ // overwrite any of the automatically generated properties that may have changed
343+ properties .putAll (generateBaseCmsSystemProperties ());
344+ }
344345
345346 if (!properties .containsKey (HASH_SALT )) {
346347 properties .put (HASH_SALT , saltGenerator .generateSalt ());
You can’t perform that action at this time.
0 commit comments