8000 feat: CollectDiagnosticData by joeyberkovitz · Pull Request #2 · coreweave/gofish · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: CollectDiagnosticData #2

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

Merged
merged 22 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4b51c15
Add Oem property to Status (#411)
mwieczorek Mar 7, 2025
2ba9731
Add Metrics to MemorySummary (#417)
mwieczorek Apr 11, 2025
ef6ca28
Add Oem property to Processor (#416)
mwieczorek Apr 11, 2025
e1360b5
Add CacheMemory to Processor resource (#413)
mwieczorek Apr 11, 2025
4bfa995
Use float64 for Sensor.ReadingRangeMin (#420)
mwieczorek Apr 29, 2025
d956dbe
redfish/virtualmedia: Return Task if Link present in Insert response …
mmlb May 5, 2025
82a759e
Bump golangci/golangci-lint-action from 6 to 8 (#421)
dependabot[bot] May 5, 2025
c0952d5
Update SMC OEM readwrite field values to match SMC documentation. (#424)
arossbell May 16, 2025
a910d5a
Strip omitempty when formulating object update (#432)
stmcginnis Jun 15, 2025
a445b31
add support for logservice CollectDiagnosticData (#430)
joeyberkovitz Jun 16, 2025
eb2c32e
adjust update_gofish to support pr branches
joeyberkovitz Jun 16, 2025
71f27da
auto configure remotes in update_gofish
joeyberkovitz Jun 17, 2025
108f196
Reapply patch for LocationIndicatorActive change
jplimack Mar 7, 2025
acf4aff
patcher
jplimack Mar 7, 2025
2a36d4b
patcher
jplimack Mar 7, 2025
65b28f3
tracker
jplimack Mar 7, 2025
b34b330
20250307
jplimack Mar 7, 2025
651643a
3way
jplimack Mar 7, 2025
f58e684
20250307
jplimack Mar 7, 2025
b6e918d
adjust update_gofish to support pr branches
joeyberkovitz Jun 16, 2025
fff6384
auto configure remotes in update_gofish
joeyberkovitz Jun 17, 2025
90696fd
Merge branch 'main' into feat/collect-diagnostic
joeyberkovitz Jun 17, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ jobs:
go-version: '1.21'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v8
with:
version: v1.59.1
version: v2.1.6
184 changes: 94 additions & 90 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,61 +1,6 @@
linters-settings:
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax # allow unless explicitly denied
files:
- $all
- "!$test"
allow:
- $gostd
deny:
- pkg: io/ioutil
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
dupl:
threshold: 200
funlen:
lines: 100
statements: 50
goheader:
values:
const:
LICENSE: BSD-3-Clause
template: |-
SPDX-License-Identifier: {{ LICENSE }}
goconst:
min-len: 2
min-occurrences: 5
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- deprecatedComment
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
< 8000 /td> - octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 30
goimports:
local-prefixes: github.com/stmcginnis
govet:
enable-all: true
disable:
- fieldalignment
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped

version: "2"
linters:
disable-all: true
default: none
enable:
- bodyclose
- depguard
Expand All @@ -67,10 +12,8 @@ linters:
- gocritic
- gocyclo
- goheader
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- misspell
Expand All @@ -80,38 +23,99 @@ linters:
- revive
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace

# don't enable:
# - asciicheck
# - exhaustive
# - gochecknoinits
# - gochecknoglobals
# - gocognit
# - godot
# - godox
# - goerr113
# - interfacer
# - lll
# - nestif
# - prealloc
# - testpackage
# - revive
# - scopelint
# - wsl

issues:
exclude:
- 'declaration of "(err|ctx)" shadows declaration at'
- "G402: TLS InsecureSkipVerify may be true"
- "`(F|f)ibre` is a misspelling"
- "`(C|c)ancell.*` is a misspelling"
- "Error return value of `original.UnmarshalJSON` is not checked"
exclude-dirs:
- examples
- tools
settings:
depguard:
rules:
prevent_unmaintained_packages:
list-mode: lax
files:
- $all
- '!$test'
allow:
- $gostd
deny:
- pkg: io/ioutil
desc: 'replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil'
dupl:
threshold: 200
funlen:
lines: 100
statements: 50
goconst:
min-len: 2
min-occurrences: 5
gocritic:
disabled-checks:
- deprecatedComment
- dupImport
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 30
goheader:
values:
const:
LICENSE: BSD-3-Clause
template: 'SPDX-License-Identifier: {{ LICENSE }}'
govet:
disable:
- fieldalignment
enable-all: true
misspell:
locale: US
nolintlint:
require-explanation: false
require-specific: false
allow-unused: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: (.+)\.go$
text: declaration of "(err|ctx)" shadows declaration at
- path: (.+)\.go$
text: 'G402: TLS InsecureSkipVerify may be true'
- path: (.+)\.go$
text: '`(F|f)ibre` is a misspelling'
- path: (.+)\.go$
text: '`(C|c)ancell.*` is a misspelling'
- path: (.+)\.go$
text: Error return value of `original.UnmarshalJSON` is not checked
paths:
- examples
- tools
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- goimports
settings:
goimports:
local-prefixes:
- github.com/stmcginnis
exclusions:
generated: lax
paths:
- examples
- tools
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

PKGS := $(shell go list ./... | grep -v example | grep -v tools)
ROOT_DIR := $(shell git rev-parse --show-toplevel)
GOLANGCI_VERSION := "v1.59.1"
GOLANGCI_VERSION := "v2.1.6"

all: lint build test

Expand Down
32 changes: 10 additions & 22 deletions common/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,7 @@ func (e *Entity) Get(c Client, uri string, payload interface{}) error {

// Patch performs a Patch request against the Redfish service with etag
func (e *Entity) Patch(uri string, payload interface{}) error {
header := make(map[string]string)
if e.etag != "" && !e.disableEtagMatch {
if e.stripEtagQuotes {
e.etag = strings.Trim(e.etag, "\"")
}

header["If-Match"] = e.etag
}

resp, err := e.client.PatchWithHeaders(uri, payload, header)
resp, err := e.client.PatchWithHeaders(uri, payload, e.headers())
if err == nil {
return resp.Body.Close()
}
Expand All @@ -131,26 +122,22 @@ func (e *Entity) Patch(uri string, payload interface{}) error {

// Post performs a Post request against the Redfish service with etag
func (e *Entity) Post(uri string, payload interface{}) error {
header := make(map[string]string)
if e.etag != "" && !e.disableEtagMatch {
if e.stripEtagQuotes {
e.etag = strings.Trim(e.etag, "\"")
}

header["If-Match"] = e.etag
}

resp, err := e.client.PostWithHeaders(uri, payload, header)
resp, err := e.PostWithResponse(uri, payload)
if err == nil {
return resp.Body.Close()
}

return err
}

// PostWithResponse performs a Post request against the Redfish service with etag,
// returning the response from the service.
// Callers should make sure to call `resp.Body.Close()` when done with the response.
func (e *Entity) PostWithResponse(uri string, payload interface{}) (*http.Response, error) {
return e.client.PostWithHeaders(uri, payload, e.headers())
}

func (e *Entity) headers() map[string]string {
header := make(map[string]string)
if e.etag != "" && !e.disableEtagMatch {
if e.stripEtagQuotes {
Expand All @@ -159,8 +146,7 @@ func (e *Entity) PostWithResponse(uri string, payload interface{}) (*http.Respon

header["If-Match"] = e.etag
}

return e.client.PostWithHeaders(uri, payload, header)
return header
}

type Filter string
Expand Down Expand Up @@ -208,6 +194,8 @@ func getPatchPayloadFromUpdate(originalEntity, updatedEntity reflect.Value) (pay
}
fieldName := field.Name
jsonName := field.Tag.Get("json")
// Strip out marshaling directives
jsonName = strings.ReplaceAll(jsonName, ",omitempty", "")
if jsonName == "-" {
continue
}
Expand Down
3 changes: 2 additions & 1 deletion common/entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ type nestedStruct struct {
X bool `json:"x"`
Y []string
}

type F struct {
Field string
Field string `json:",omitempty"`
}

type testStruct struct {
Expand Down
9 changes: 5 additions & 4 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ type Condition struct {

// Status describes the status and health of a resource and its children.
type Status struct {
Health Health `json:"Health"`
HealthRollup Health `json:"HealthRollup"`
State State `json:"State"`
Conditions []Condition `json:"Conditions"`
Health Health `json:"Health"`
HealthRollup Health `json:"HealthRollup"`
State State `json:"State"`
Conditions []Condition `json:"Conditions"`
OEM json.RawMessage `json:"Oem"`
}

// LocationType shall name the type of location in use.
Expand Down
1 change: 1 addition & 0 deletions oem/smc/ikvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (i *IKVM) Update() error {

readWriteFields := []string{
"CurrentInterface",
"Current Interface",
}

originalElement := reflect.ValueOf(orig).Elem()
Expand Down
1 change: 1 addition & 0 deletions oem/smc/ipaccesscontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (i *IPAccessControl) Update() error {

readWriteFields := []string{
"Enabled",
"ServiceEnabled",
}

originalElement := reflect.ValueOf(orig).Elem()
Expand Down
1 change: 1 addition & 0 deletions oem/smc/lldp.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (i *LLDP) Update() error {

readWriteFields := []string{
"Enabled",
"LLDPEnabled",
}

originalElement := reflect.ValueOf(orig).Elem()
Expand Down
1 change: 1 addition & 0 deletions oem/smc/memoryhealthcomp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (i *MemoryHealthComp) Update() error {

readWriteFields := []string{
"Next",
"MemoryHealthCompNext",
}

originalElement := reflect.ValueOf(orig).Elem()
Expand Down
1 change: 1 addition & 0 deletions oem/smc/memorypfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (i *MemoryPFA) Update() error {

readWriteFields := []string{
"Next",
"MemoryPfaNext",
"AlertID",
}

Expand Down
3 changes: 3 additions & 0 deletions oem/smc/ntp.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ func (r *NTP) Update() error {

readWriteFields := []string{
"Enabled",
"NTPEnable",
"PrimaryServer",
"PrimaryNTPServer",
"SecondaryServer",
"SecondaryNTPServer",
"DaylightSavingTime",
}

Expand Down
4 changes: 4 additions & 0 deletions oem/smc/radius.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ func (r *RADIUS) Update() error {

readWriteFields := []string{
"Enabled",
"RadiusEnabled",
"ServerIP",
"RadiusServerIP",
"PortNumber",
"RadiusPortNumber",
"Secret",
"RadiusSecret",
}

originalElement := reflect.ValueOf(rad).Elem()
Expand Down
1 change: 1 addition & 0 deletions oem/smc/syslockdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (i *SysLockdown) Update() error {

readWriteFields := []string{
"Enabled",
"SysLockdownEnabled",
}

originalElement := reflect.ValueOf(orig).Elem()
Expand Down
Loading
0