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

Fixes #24086: You can create a static group which depends on a dynamic one #5353

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -468,20 +468,22 @@ class NodeGroupForm(
)

/*
* - If a group changes from dynamic to static, we must ensure that it does not refer
* - If a group changes from dynamic to static, or is static, we must ensure that it does not refer
* any dynamic subgroup, else raise an error
* See https://issues.rudder.io/issues/18952
*/
if (savedGroup.isDynamic == true && newGroup.isDynamic == false) {
if (newGroup.isDynamic == false) {
hasDynamicSubgroups(newGroup.query).either.runNow match {
case Left(err) =>
formTracker.addFormError(Text("Error when saving group"))
logger.error(
s"Error when getting group information for consistency check on static change status: ${err.fullMsg}"
)
case Right(Some(msg)) =>
val m = s"Error when getting group information for consistency check on static change status: you can't change " +
s"the nature of current group to static because it uses following dynamic groups as a subgroup criteria: ${msg}"
val m = {
s"Error when getting group information for consistency check on static/dynamic status:" +
s"current group can not be static because it uses following dynamic groups as a subgroup criteria: ${msg}"
}
formTracker.addFormError(Text(m))
logger.error(m)
case Right(None) => // ok
Expand Down