hashicorp / nomad-driver-podman

A nomad task driver plugin for sandboxing workloads in podman containers
https://developer.hashicorp.com/nomad/plugins/drivers/podman
Mozilla Public License 2.0
224 stars 61 forks source link

Adjust `ContainerStats` for Podmod 4.6.0 responses #278

Closed sushain97 closed 10 months ago

sushain97 commented 11 months ago

Fixes https://github.com/hashicorp/nomad-driver-podman/issues/277

hashicorp-cla commented 11 months ago

CLA assistant check
All committers have signed the CLA.

Procsiab commented 11 months ago

I can report that this PR fixes #277 in my environment, on both x86_64 and aarch64 Nomad 1.6.1 clients with Podman 4.6.0-1. Thanks for your quick response @sushain97 :muscle:

shoenig commented 11 months ago

@sushain97 check the linter failure

==> Linting source code ...
Error: api/container_stats.go:52:5: shadow: declaration of "err" shadows declaration at line 22 (govet)
    if err := json.Unmarshal(body, &errResponse); err == nil && errResponse.Cause == "container is stopped" {
       ^
make: *** [GNUmakefile:32: check] Error 1
sushain97 commented 11 months ago

@shoenig fixed

sushain97 commented 11 months ago

@lgfa29 does this look good?

shoenig commented 10 months ago

@sushain97 I think your fix has a compilation bug:

if _ := json.Unmarshal(body, &errResponse); ...{

needs to be

if _ = json.Unmarshal(body, &errResponse); ... {
sushain97 commented 10 months ago

@shoenig fixed - the suggestion wasn't quite right.

Would be helpful to have workflows approved for the entire branch/PR :)

sushain97 commented 10 months ago

No problem! Would it be possible to cut a 0.5.1 release with this fix?