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

cib: expose crm_config as well #190

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions collector/pacemaker/cib/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_

type Root struct {
Configuration struct {
CrmConfig struct {
ClusterProperties []Attribute `xml:"cluster_property_set>nvpair"`
} `xml:"crm_config"`
Nodes []struct {
Id string `xml:"id,attr"`
Uname string `xml:"uname,attr"`
Expand Down
2 changes: 2 additions & 0 deletions collector/pacemaker/cib/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ func TestParse(t *testing.T) {
data, err := p.Parse()
assert.NoError(t, err)
assert.Equal(t, 2, len(data.Configuration.Nodes))
assert.Equal(t, "cib-bootstrap-options-cluster-name", data.Configuration.CrmConfig.ClusterProperties[3].Id)
assert.Equal(t, "hana_cluster", data.Configuration.CrmConfig.ClusterProperties[3].Value)
assert.Equal(t, "node01", data.Configuration.Nodes[0].Uname)
assert.Equal(t, "node02", data.Configuration.Nodes[1].Uname)
assert.Equal(t, 4, len(data.Configuration.Resources.Primitives))
Expand Down