Skip to content

Commit

Permalink
[YBA CLI]Fix create universe error when gflags are not passed
Browse files Browse the repository at this point in the history
Summary: Empty map needs to be initialised in Specific Gflags if master and tserver gflags are empty

Test Plan: Manually test

Reviewers: skurapati

Reviewed By: skurapati

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D40765
  • Loading branch information
Deepti-yb committed Dec 18, 2024
1 parent e320bf2 commit 2c5c8bd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions managed/yba-cli/cmd/universe/build_universe.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,14 @@ func buildClusters(
InheritFromPrimary: util.GetBoolPointer(false),
PerProcessFlags: &ybaclient.PerProcessFlags{
Value: map[string]map[string]string{
util.MasterServerType: masterGFlags,
util.MasterServerType: {},
util.TserverServerType: {},
},
},
}
if len(masterGFlags) != 0 {
specificGFlags.PerProcessFlags.Value[util.MasterServerType] = masterGFlags
}
specificGFlagsList[i] = specificGFlags
}

Expand All @@ -544,7 +548,9 @@ func buildClusters(
tserverGFlagsList[0] = v
perProcessFlags := specificGFlagsList[0].GetPerProcessFlags()
value := perProcessFlags.GetValue()
value[util.TserverServerType] = v
if len(v) != 0 {
value[util.TserverServerType] = v
}
perProcessFlags.SetValue(value)
specificGFlagsList[0].SetPerProcessFlags(perProcessFlags)
} else if strings.Compare(
Expand All @@ -553,7 +559,9 @@ func buildClusters(
tserverGFlagsList[1] = v
perProcessFlags := specificGFlagsList[1].GetPerProcessFlags()
value := perProcessFlags.GetValue()
value[util.TserverServerType] = v
if len(v) != 0 {
value[util.TserverServerType] = v
}
perProcessFlags.SetValue(value)
specificGFlagsList[1].SetPerProcessFlags(perProcessFlags)
specificGFlagsList[1].SetInheritFromPrimary(false)
Expand Down

0 comments on commit 2c5c8bd

Please sign in to comment.