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

Add GetPodStats to varlink #1319

Closed
wants to merge 2 commits into from

Conversation

haircommander
Copy link
Collaborator

Signed-off-by: haircommander pehunt@redhat.com

@haircommander
Copy link
Collaborator Author

@baude @jwhonce PTAL

pod, err := i.Runtime.LookupPod(name)
if err != nil {
return call.ReplyPodNotFound(name)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be vetting that the container is running?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently GetContainerStats doesn't. If you think it should, both should be updated. WDYT

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the container isn't running it just returns all 0s. I'm thinking filtering on running is probably best for both.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@TomSweeneyRedHat
Copy link
Member

bot, retest this please

1 similar comment
@rhatdan
Copy link
Member

rhatdan commented Aug 22, 2018

bot, retest this please

Signed-off-by: haircommander <pehunt@redhat.com>
@@ -441,7 +441,7 @@ method ExportContainer(name: string, path: string) -> (tarfile: string)

# GetContainerStats takes the name or ID of a container and returns a single ContainerStats structure which
# contains attributes like memory and cpu usage. If the container cannot be found, a
# [ContainerNotFound](#ContainerNotFound) error will be returned.
# [ContainerNotFound](#ContainerNotFound) error will be returned. If the container is not running, an error will be returned.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to document which error was returned if container is not running.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@haircommander haircommander force-pushed the pod-varlink-3 branch 2 times, most recently from a1ea209 to 0e4b75a Compare August 22, 2018 19:04
This results in some functionality changes:

If a ErrCtrStateInvalid is returned to GetPodStats, the container is ommitted from the stats.
As such, if an empty slice of Container stats are returned to GetPodStats in varlink, an error will occur.
GetContainerStats will return the ErrCtrStateInvalid as well.
Finally, if ErrCtrStateInvalid is returned to the podman stats call, the container will be ommitted from the stats.

Signed-off-by: haircommander <pehunt@redhat.com>
@haircommander
Copy link
Collaborator Author

haircommander commented Aug 23, 2018

Happy tests and comments addressed. @mheon @baude @TomSweeneyRedHat @jwhonce @rhatdan @umohnani8 PTAL :)

@mheon
Copy link
Member

mheon commented Aug 23, 2018

Code LGTM. I'll let @jwhonce and @baude ack that the varlink API looks fine.

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jwhonce
Copy link
Member

jwhonce commented Aug 23, 2018

LGTM

@mheon
Copy link
Member

mheon commented Aug 23, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

📌 Commit b7a9bf4 has been approved by mheon

@baude
Copy link
Member

baude commented Aug 23, 2018

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Collaborator

💡 This pull request was already approved, no need to approve it again.

@rh-atomic-bot
Copy link
Collaborator

📌 Commit b7a9bf4 has been approved by baude

@rh-atomic-bot
Copy link
Collaborator

⌛ Testing commit b7a9bf4 with merge 63dd200...

rh-atomic-bot pushed a commit that referenced this pull request Aug 23, 2018
This results in some functionality changes:

If a ErrCtrStateInvalid is returned to GetPodStats, the container is ommitted from the stats.
As such, if an empty slice of Container stats are returned to GetPodStats in varlink, an error will occur.
GetContainerStats will return the ErrCtrStateInvalid as well.
Finally, if ErrCtrStateInvalid is returned to the podman stats call, the container will be ommitted from the stats.

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1319
Approved by: baude
@rh-atomic-bot
Copy link
Collaborator

☀️ Test successful - status-papr
Approved by: baude
Pushing 63dd200 to master...

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Aug 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants