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

Go API: Resources.DiskMB does not populate when using event.Allocation() #15158

Open
albertollamaso opened this issue Nov 5, 2022 · 1 comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/api HTTP API and SDK issues theme/events Issues related to events type/bug

Comments

@albertollamaso
Copy link

albertollamaso commented Nov 5, 2022

Nomad version

1.2.12

Operating system and Environment details

Nomad running in Debian VM, go api client running on Ubuntu

Issue

The DiskMB value comes as nil when running event.Allocation()

Reproduction steps

with Nomad go api, listen to event stream

alloc, err := event.Allocation()
if err == nil {
	fmt.Println(alloc.Resources.DiskMB) // Sees as <nil>
        
        e := event.Payload["Allocation"]
        fmt.Println(e.(map[string]interface{})["Resources"].(map[string]interface{})["DiskMB"]) // Sees the value
}

Seems an issue with the mapstructure or pointer (mostly)

DiskMB *int `mapstructure:"disk" hcl:"disk,optional"`

``

Expected Result

Value would be the same and not coming as nil when using event.Allocation()

Actual Result

Value is always coming as nil

Job file (if appropriate)

Nomad Server logs (if appropriate)

Nomad Client logs (if appropriate)

@lgfa29
Copy link
Contributor

lgfa29 commented Nov 7, 2022

Thanks for the report @albertollamaso 🙂

I think that may be the same problem as #11044 that @pkazmierczak has been investigating. We don't have any estimate for a fix, but if #12916 works we may be able to apply a similar change to this struct as well.

@lgfa29 lgfa29 added theme/api HTTP API and SDK issues stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/events Issues related to events labels Nov 7, 2022
@tgross tgross added this to Needs Triage in Nomad - Community Issues Triage via automation Nov 18, 2022
@tgross tgross moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/api HTTP API and SDK issues theme/events Issues related to events type/bug
Projects
Status: Needs Roadmapping
Development

No branches or pull requests

2 participants