From 229764c48114172fc17327d6ad998ebd6d3df9dc Mon Sep 17 00:00:00 2001 From: Nathan Pierce Date: Fri, 26 Jul 2024 07:28:22 -0700 Subject: [PATCH 1/3] prevent panic: assignment to entry in nil map when no Arch for instance --- src/metrics/instance_state.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/metrics/instance_state.go b/src/metrics/instance_state.go index 34ef6e4..0e5323d 100644 --- a/src/metrics/instance_state.go +++ b/src/metrics/instance_state.go @@ -22,7 +22,9 @@ func (ism InstanceStateMetric) GetEventHandler() func(interface{}) error { } var archStateMap = intMapFromTwoStringSlices(types.Architectures, types.InstanceStates) for _, instance := range instances { - archStateMap[instance.Vm.Arch][instance.Vm.State] = archStateMap[instance.Vm.Arch][instance.Vm.State] + 1 + if instance.Vm.Arch != "" && instance.Vm.State != "" { // prevent panic: assignment to entry in nil map when no Arch for instance + archStateMap[instance.Vm.Arch][instance.Vm.State] = archStateMap[instance.Vm.Arch][instance.Vm.State] + 1 + } } for _, arch := range types.Architectures { for _, state := range types.InstanceStates { From 333524430d3114187c6630da0b52b5e2a80ec804 Mon Sep 17 00:00:00 2001 From: Nathan Pierce Date: Tue, 6 Aug 2024 17:13:33 -0500 Subject: [PATCH 2/3] quick fix --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 56fea8a..13d683c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 \ No newline at end of file +3.0.1 \ No newline at end of file From af8ac8ddbe4b8467d4e803499e5fcfcb653fe4a5 Mon Sep 17 00:00:00 2001 From: Nathan Pierce Date: Tue, 6 Aug 2024 18:02:38 -0500 Subject: [PATCH 3/3] quick fix --- .goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0b55a8c..caabd09 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,6 @@ # This is an example goreleaser.yaml file with some defaults. # Make sure to check the documentation at http://goreleaser.com -version: 2 +version: 1 env: - CGO_ENABLED=0 before: