Skip to content

Commit

Permalink
Default to available state if state is empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Oct 24, 2023
1 parent 913b178 commit 25d3091
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion metalCollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ func (collector *metalCollector) Collect(ch chan<- prometheus.Metric) {
hostname = "NOTALLOCATED"
clusterID = "NOTALLOCATED"
primaryASN = "NOTALLOCATED"
state = pointer.SafeDeref(pointer.SafeDeref(m.State).Value)
state = "AVAILABLE"
)

if m.State != nil && m.State.Value != nil && *m.State.Value != "" {
state = *m.State.Value
}

if m.Allocation != nil {
if m.Allocation.Role != nil {
role = *m.Allocation.Role
Expand Down

0 comments on commit 25d3091

Please sign in to comment.