From 4a602931823fef028d49dab66ff3db0b93ae99fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:33:52 +0000 Subject: [PATCH] go.mod: bump github.com/atc0005/go-nagios from 0.16.0 to 0.16.1 Bumps [github.com/atc0005/go-nagios](https://github.com/atc0005/go-nagios) from 0.16.0 to 0.16.1. - [Release notes](https://github.com/atc0005/go-nagios/releases) - [Changelog](https://github.com/atc0005/go-nagios/blob/master/CHANGELOG.md) - [Commits](https://github.com/atc0005/go-nagios/compare/v0.16.0...v0.16.1) --- updated-dependencies: - dependency-name: github.com/atc0005/go-nagios dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +-- .../github.com/atc0005/go-nagios/CHANGELOG.md | 28 ++++++++++++++++++- vendor/github.com/atc0005/go-nagios/nagios.go | 3 ++ vendor/github.com/atc0005/go-nagios/range.go | 17 +++++++++-- vendor/modules.txt | 2 +- 6 files changed, 48 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 61ababc6..f640f3f0 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ module github.com/atc0005/check-vmware go 1.20 require ( - github.com/atc0005/go-nagios v0.16.0 + github.com/atc0005/go-nagios v0.16.1 github.com/google/go-cmp v0.6.0 github.com/rs/zerolog v1.31.0 github.com/vmware/govmomi v0.34.2 diff --git a/go.sum b/go.sum index 428fe80e..db94e7f0 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/atc0005/go-nagios v0.16.0 h1:fOcUBcYY6la+lkg4cOGL/ExDNM1HOiHnXG0np8IyJ+Y= -github.com/atc0005/go-nagios v0.16.0/go.mod h1:TlE2JBMuI64lM01MqobahTA94hgtVefvEzyKtvIHToo= +github.com/atc0005/go-nagios v0.16.1 h1:ef0AWjY9sqWq6dhfJuXtASe7dCkVDonoZhtYvNYWBlo= +github.com/atc0005/go-nagios v0.16.1/go.mod h1:NSm1HeneeyBe27BYzhC7FMx4gg3x8PddeZIMX9YZj5M= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= diff --git a/vendor/github.com/atc0005/go-nagios/CHANGELOG.md b/vendor/github.com/atc0005/go-nagios/CHANGELOG.md index 38ca539b..1419ee5b 100644 --- a/vendor/github.com/atc0005/go-nagios/CHANGELOG.md +++ b/vendor/github.com/atc0005/go-nagios/CHANGELOG.md @@ -26,6 +26,31 @@ The following types of changes will be recorded in this file: - placeholder +## [v0.16.1] - 2024-01-25 + +### Added + +- (GH-220) Add initial automated release notes config +- (GH-221) Add initial automated release build workflow + +### Changed + +#### Dependency Updates + +- (GH-222) Update Dependabot config to monitor both branches +- (GH-225) ghaw: bump actions/checkout from 3 to 4 +- (GH-227) go.mod: bump github.com/google/go-cmp from 0.5.9 to 0.6.0 +- (GH-232) ghaw: bump github/codeql-action from 2 to 3 + +### Fixed + +- (GH-219) Disable unsupported build opts in monthly workflow +- (GH-230) Hotfix goconst linting errors for test cases +- (GH-236) Fix panic if ParseRangeCheck returns nil + - credit: [@Tommi2Day](https://github.com/Tommi2Day) +- (GH-237) Update Range Check regexp + - credit: [@Tommi2Day](https://github.com/Tommi2Day) + ## [v0.16.0] - 2023-06-23 ### Added @@ -496,7 +521,8 @@ Initial package state - Nagios state map -[Unreleased]: https://github.com/atc0005/go-nagios/compare/v0.16.0...HEAD +[Unreleased]: https://github.com/atc0005/go-nagios/compare/v0.16.1...HEAD +[v0.16.1]: https://github.com/atc0005/go-nagios/releases/tag/v0.16.1 [v0.16.0]: https://github.com/atc0005/go-nagios/releases/tag/v0.16.0 [v0.15.0]: https://github.com/atc0005/go-nagios/releases/tag/v0.15.0 [v0.14.0]: https://github.com/atc0005/go-nagios/releases/tag/v0.14.0 diff --git a/vendor/github.com/atc0005/go-nagios/nagios.go b/vendor/github.com/atc0005/go-nagios/nagios.go index b4741afe..dce167ce 100644 --- a/vendor/github.com/atc0005/go-nagios/nagios.go +++ b/vendor/github.com/atc0005/go-nagios/nagios.go @@ -96,6 +96,9 @@ var ( // metric is not in a supported format. ErrInvalidPerformanceDataFormat = errors.New("invalid performance data format") + // ErrInvalidRangeThreshold indicates that a given range threshold is not in a supported format. + ErrInvalidRangeThreshold = errors.New("invalid range threshold") + // TODO: Should we use field-specific errors or is the more general // ErrInvalidPerformanceDataFormat "good enough" ? Wrapped versions of // that error will likely already indicate which field is a problem, but diff --git a/vendor/github.com/atc0005/go-nagios/range.go b/vendor/github.com/atc0005/go-nagios/range.go index 845fb495..76d5879e 100644 --- a/vendor/github.com/atc0005/go-nagios/range.go +++ b/vendor/github.com/atc0005/go-nagios/range.go @@ -9,6 +9,7 @@ package nagios import ( + "fmt" "regexp" "strconv" "strings" @@ -79,9 +80,9 @@ func ParseRangeString(input string) *Range { r := Range{} digitOrInfinity := regexp.MustCompile(`[\d~]`) - optionalInvertAndRange := regexp.MustCompile(`^\@?((?:[-+]?[\d\.]+)(?:e(?:[-+]?[\d\.]+))?|~)?(:((?:[-+]?[\d\.]+)(?:e(?:[-+]?[\d\.]+))?)?)?$`) - firstHalfOfRange := regexp.MustCompile(`^((?:[-+]?[\d\.]+)(?:e(?:[-+]?[\d\.]+))?)?:`) - endOfRange := regexp.MustCompile(`^(?:[-+]?[\d\.]+)(?:e(?:[-+]?[\d\.]+))?$`) + optionalInvertAndRange := regexp.MustCompile(`^@?([-+]?[\d.]+(?:e[-+]?[\d.]+)?|~)?(:([-+]?[\d.]+(?:e[-+]?[\d.]+)?)?)?$`) + firstHalfOfRange := regexp.MustCompile(`^([-+]?[\d.]+(?:e[-+]?[\d.]+)?)?:`) + endOfRange := regexp.MustCompile(`^[-+]?[\d.]+(?:e[-+]?[\d.]+)?$`) r.Start = 0 r.StartInfinity = false @@ -149,6 +150,11 @@ func (p *Plugin) EvaluateThreshold(perfData ...PerformanceData) error { if perfData[i].Crit != "" { CriticalThresholdObject := ParseRangeString(perfData[i].Crit) + if CriticalThresholdObject == nil { + err := fmt.Errorf("failed to parse critical range string %s: %w ", perfData[i].Crit, ErrInvalidRangeThreshold) + p.ExitStatusCode = StateUNKNOWNExitCode + return err + } if CriticalThresholdObject.CheckRange(perfData[i].Value) { p.ExitStatusCode = StateCRITICALExitCode @@ -158,6 +164,11 @@ func (p *Plugin) EvaluateThreshold(perfData ...PerformanceData) error { if perfData[i].Warn != "" { warningThresholdObject := ParseRangeString(perfData[i].Warn) + if warningThresholdObject == nil { + err := fmt.Errorf("failed to parse warning range string %s: %w ", perfData[i].Warn, ErrInvalidRangeThreshold) + p.ExitStatusCode = StateUNKNOWNExitCode + return err + } if warningThresholdObject.CheckRange(perfData[i].Value) { p.ExitStatusCode = StateWARNINGExitCode diff --git a/vendor/modules.txt b/vendor/modules.txt index 66fc069c..e21f1d5f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/atc0005/go-nagios v0.16.0 +# github.com/atc0005/go-nagios v0.16.1 ## explicit; go 1.19 github.com/atc0005/go-nagios # github.com/google/go-cmp v0.6.0