fix: use pods bindings API and update documentation

Address PR review feedback:
- Replace CLI execution with Podman REST API bindings for ListPods
- Update CLAUDE.md to document pod support architecture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
christophe-duc 2026-01-07 18:21:16 -04:00
parent e5c209de93
commit 0e0a67aef9
21 changed files with 810 additions and 31 deletions

View file

@ -55,11 +55,13 @@ pkg/
- `pkg/commands/runtime_socket.go` - Socket mode implementation using Podman REST API bindings - `pkg/commands/runtime_socket.go` - Socket mode implementation using Podman REST API bindings
- `pkg/commands/runtime_libpod.go` - Direct libpod implementation (Linux+CGO only) - `pkg/commands/runtime_libpod.go` - Direct libpod implementation (Linux+CGO only)
- `pkg/commands/runtime_libpod_stub.go` - Stub for non-Linux platforms - `pkg/commands/runtime_libpod_stub.go` - Stub for non-Linux platforms
- `pkg/commands/runtime_types.go` - Custom types (ContainerSummary, ImageSummary, etc.) - `pkg/commands/runtime_types.go` - Custom types (ContainerSummary, ImageSummary, PodSummary, etc.)
**Podman integration:** **Podman integration:**
- `pkg/commands/podman.go` - Main client connection, auto-detection, and initialization - `pkg/commands/podman.go` - Main client connection, auto-detection, and initialization
- `pkg/commands/container.go` - Container wrapper operations - `pkg/commands/container.go` - Container wrapper operations
- `pkg/commands/pod.go` - Pod wrapper with state and container count methods
- `pkg/commands/container_list_item.go` - Unified wrapper for pods/containers in list view
- `pkg/commands/image.go` - Image wrapper operations - `pkg/commands/image.go` - Image wrapper operations
- `pkg/commands/volume.go` - Volume wrapper operations - `pkg/commands/volume.go` - Volume wrapper operations
- `pkg/commands/network.go` - Network wrapper operations - `pkg/commands/network.go` - Network wrapper operations
@ -102,6 +104,9 @@ ListContainers() / InspectContainer() / ContainerStats()
StartContainer() / StopContainer() / PauseContainer() / UnpauseContainer() StartContainer() / StopContainer() / PauseContainer() / UnpauseContainer()
RestartContainer() / RemoveContainer() / PruneContainers() / ContainerTop() RestartContainer() / RemoveContainer() / PruneContainers() / ContainerTop()
// Pod operations
ListPods() - Returns all pods with their metadata
// Image operations // Image operations
ListImages() / InspectImage() / ImageHistory() / RemoveImage() / PruneImages() ListImages() / InspectImage() / ImageHistory() / RemoveImage() / PruneImages()

4
go.mod
View file

@ -7,7 +7,6 @@ require (
github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1 github.com/boz/go-throttle v0.0.0-20160922054636-fdc4eab740c1
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/containers/podman/v5 v5.7.1 github.com/containers/podman/v5 v5.7.1
github.com/docker/docker v28.5.1+incompatible
github.com/fatih/color v1.15.0 github.com/fatih/color v1.15.0
github.com/go-errors/errors v1.5.1 github.com/go-errors/errors v1.5.1
github.com/gookit/color v1.5.0 github.com/gookit/color v1.5.0
@ -27,6 +26,7 @@ require (
github.com/sirupsen/logrus v1.9.3 github.com/sirupsen/logrus v1.9.3
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad
github.com/stretchr/testify v1.11.1 github.com/stretchr/testify v1.11.1
go.podman.io/common v0.66.1
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
) )
@ -63,6 +63,7 @@ require (
github.com/disiqueira/gotree/v3 v3.0.2 // indirect github.com/disiqueira/gotree/v3 v3.0.2 // indirect
github.com/distribution/reference v0.6.0 // indirect github.com/distribution/reference v0.6.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v28.5.1+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.4 // indirect github.com/docker/docker-credential-helpers v0.9.4 // indirect
github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-connections v0.6.0 // indirect
github.com/docker/go-plugins-helpers v0.0.0-20240701071450-45e2431495c8 // indirect github.com/docker/go-plugins-helpers v0.0.0-20240701071450-45e2431495c8 // indirect
@ -155,7 +156,6 @@ require (
go.opentelemetry.io/otel v1.36.0 // indirect go.opentelemetry.io/otel v1.36.0 // indirect
go.opentelemetry.io/otel/metric v1.36.0 // indirect go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect go.opentelemetry.io/otel/trace v1.36.0 // indirect
go.podman.io/common v0.66.1 // indirect
go.podman.io/image/v5 v5.38.0 // indirect go.podman.io/image/v5 v5.38.0 // indirect
go.podman.io/storage v1.61.0 // indirect go.podman.io/storage v1.61.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect

View file

@ -323,9 +323,9 @@ func (r *LibpodRuntime) ListPods(ctx context.Context) ([]PodSummary, error) {
if err != nil { if err != nil {
status = "unknown" status = "unknown"
} }
config := pod.Config() config, configErr := pod.Config()
infraID := "" infraID := ""
if config != nil { if configErr == nil && config != nil {
infraID = config.InfraContainerID infraID = config.InfraContainerID
} }
result[i] = PodSummary{ result[i] = PodSummary{

View file

@ -3,7 +3,6 @@ package commands
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"os/exec"
"strings" "strings"
"time" "time"
@ -12,6 +11,7 @@ import (
"github.com/containers/podman/v5/pkg/bindings/containers" "github.com/containers/podman/v5/pkg/bindings/containers"
"github.com/containers/podman/v5/pkg/bindings/images" "github.com/containers/podman/v5/pkg/bindings/images"
"github.com/containers/podman/v5/pkg/bindings/network" "github.com/containers/podman/v5/pkg/bindings/network"
"github.com/containers/podman/v5/pkg/bindings/pods"
"github.com/containers/podman/v5/pkg/bindings/system" "github.com/containers/podman/v5/pkg/bindings/system"
"github.com/containers/podman/v5/pkg/bindings/volumes" "github.com/containers/podman/v5/pkg/bindings/volumes"
"github.com/containers/podman/v5/pkg/domain/entities" "github.com/containers/podman/v5/pkg/domain/entities"
@ -276,39 +276,21 @@ func (r *SocketRuntime) PruneNetworks(ctx context.Context) error {
return err return err
} }
// podPsJSON represents the JSON output of `podman pod ps --format json` // ListPods returns all pods using the pods bindings API.
type podPsJSON struct {
ID string `json:"Id"`
Name string `json:"Name"`
Status string `json:"Status"`
Created string `json:"Created"`
InfraID string `json:"InfraId"`
Labels map[string]string `json:"Labels"`
}
// ListPods returns all pods.
func (r *SocketRuntime) ListPods(ctx context.Context) ([]PodSummary, error) { func (r *SocketRuntime) ListPods(ctx context.Context) ([]PodSummary, error) {
// Use podman CLI since there's no pods binding package podList, err := pods.List(r.conn, nil)
cmd := exec.CommandContext(ctx, "podman", "pod", "ps", "--format", "json")
output, err := cmd.Output()
if err != nil { if err != nil {
return nil, err return nil, err
} }
var pods []podPsJSON result := make([]PodSummary, len(podList))
if err := json.Unmarshal(output, &pods); err != nil { for i, p := range podList {
return nil, err
}
result := make([]PodSummary, len(pods))
for i, p := range pods {
created, _ := time.Parse(time.RFC3339, p.Created)
result[i] = PodSummary{ result[i] = PodSummary{
ID: p.ID, ID: p.Id,
Name: p.Name, Name: p.Name,
Status: p.Status, Status: p.Status,
Created: created, Created: p.Created,
InfraID: p.InfraID, InfraID: p.InfraId,
Labels: p.Labels, Labels: p.Labels,
} }
} }

View file

@ -0,0 +1,342 @@
package pods
import (
"context"
"net/http"
"net/url"
"strings"
"github.com/containers/podman/v5/pkg/api/handlers"
"github.com/containers/podman/v5/pkg/bindings"
entitiesTypes "github.com/containers/podman/v5/pkg/domain/entities/types"
"github.com/containers/podman/v5/pkg/errorhandling"
jsoniter "github.com/json-iterator/go"
)
func CreatePodFromSpec(ctx context.Context, spec *entitiesTypes.PodSpec) (*entitiesTypes.PodCreateReport, error) {
var pcr entitiesTypes.PodCreateReport
if spec == nil {
spec = new(entitiesTypes.PodSpec)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
specString, err := jsoniter.MarshalToString(spec.PodSpecGen)
if err != nil {
return nil, err
}
stringReader := strings.NewReader(specString)
response, err := conn.DoRequest(ctx, stringReader, http.MethodPost, "/pods/create", nil, nil)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &pcr, response.Process(&pcr)
}
// Exists is a lightweight method to determine if a pod exists in local storage
func Exists(ctx context.Context, nameOrID string, _ *ExistsOptions) (bool, error) {
conn, err := bindings.GetClient(ctx)
if err != nil {
return false, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodGet, "/pods/%s/exists", nil, nil, nameOrID)
if err != nil {
return false, err
}
defer response.Body.Close()
return response.IsSuccess(), nil
}
// Inspect returns low-level information about the given pod.
func Inspect(ctx context.Context, nameOrID string, options *InspectOptions) (*entitiesTypes.PodInspectReport, error) {
var report entitiesTypes.PodInspectReport
if options == nil {
options = new(InspectOptions)
}
_ = options
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodGet, "/pods/%s/json", nil, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &report, response.Process(&report)
}
// Kill sends a SIGTERM to all the containers in a pod. The optional signal parameter
// can be used to override SIGTERM.
func Kill(ctx context.Context, nameOrID string, options *KillOptions) (*entitiesTypes.PodKillReport, error) {
var report entitiesTypes.PodKillReport
if options == nil {
options = new(KillOptions)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
params, err := options.ToParams()
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/%s/kill", params, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &report, response.ProcessWithError(&report, &errorhandling.PodConflictErrorModel{})
}
// Pause pauses all running containers in a given pod.
func Pause(ctx context.Context, nameOrID string, options *PauseOptions) (*entitiesTypes.PodPauseReport, error) {
var report entitiesTypes.PodPauseReport
if options == nil {
options = new(PauseOptions)
}
_ = options
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/%s/pause", nil, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &report, response.ProcessWithError(&report, &errorhandling.PodConflictErrorModel{})
}
// Prune by default removes all non-running pods in local storage.
// And with force set true removes all pods.
func Prune(ctx context.Context, options *PruneOptions) ([]*entitiesTypes.PodPruneReport, error) {
var reports []*entitiesTypes.PodPruneReport
if options == nil {
options = new(PruneOptions)
}
_ = options
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/prune", nil, nil)
if err != nil {
return nil, err
}
defer response.Body.Close()
return reports, response.Process(&reports)
}
// List returns all pods in local storage. The optional filters parameter can
// be used to refine which pods should be listed.
func List(ctx context.Context, options *ListOptions) ([]*entitiesTypes.ListPodsReport, error) {
var podsReports []*entitiesTypes.ListPodsReport
if options == nil {
options = new(ListOptions)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
params, err := options.ToParams()
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodGet, "/pods/json", params, nil)
if err != nil {
return podsReports, err
}
defer response.Body.Close()
return podsReports, response.Process(&podsReports)
}
// Restart restarts all containers in a pod.
func Restart(ctx context.Context, nameOrID string, options *RestartOptions) (*entitiesTypes.PodRestartReport, error) {
var report entitiesTypes.PodRestartReport
if options == nil {
options = new(RestartOptions)
}
_ = options
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/%s/restart", nil, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &report, response.ProcessWithError(&report, &errorhandling.PodConflictErrorModel{})
}
// Remove deletes a Pod from local storage. The optional force parameter denotes
// that the Pod can be removed even if in a running state.
func Remove(ctx context.Context, nameOrID string, options *RemoveOptions) (*entitiesTypes.PodRmReport, error) {
var report entitiesTypes.PodRmReport
if options == nil {
options = new(RemoveOptions)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
params, err := options.ToParams()
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodDelete, "/pods/%s", params, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &report, response.Process(&report)
}
// Start starts all containers in a pod.
func Start(ctx context.Context, nameOrID string, options *StartOptions) (*entitiesTypes.PodStartReport, error) {
var report entitiesTypes.PodStartReport
if options == nil {
options = new(StartOptions)
}
_ = options
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/%s/start", nil, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
if response.StatusCode == http.StatusNotModified {
report.Id = nameOrID
report.RawInput = nameOrID
return &report, nil
}
return &report, response.ProcessWithError(&report, &errorhandling.PodConflictErrorModel{})
}
// Stop stops all containers in a Pod. The optional timeout parameter can be
// used to override the timeout before the container is killed.
func Stop(ctx context.Context, nameOrID string, options *StopOptions) (*entitiesTypes.PodStopReport, error) {
var report entitiesTypes.PodStopReport
if options == nil {
options = new(StopOptions)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
params, err := options.ToParams()
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/%s/stop", params, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
if response.StatusCode == http.StatusNotModified {
report.Id = nameOrID
return &report, nil
}
return &report, response.ProcessWithError(&report, &errorhandling.PodConflictErrorModel{})
}
// Top gathers statistics about the running processes in a pod. The nameOrID can be a pod name
// or a partial/full ID. The descriptors allow for specifying which data to collect from each process.
func Top(ctx context.Context, nameOrID string, options *TopOptions) ([]string, error) {
if options == nil {
options = new(TopOptions)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
params := url.Values{}
if descriptors := options.GetDescriptors(); len(descriptors) > 0 {
params.Set("ps_args", strings.Join(descriptors, ","))
}
response, err := conn.DoRequest(ctx, nil, http.MethodGet, "/pods/%s/top", params, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
body := handlers.PodTopOKBody{}
if err = response.Process(&body); err != nil {
return nil, err
}
// handlers.PodTopOKBody{} returns a slice of slices where each cell in the top table is an item.
// In libpod land, we're just using a slice with cells being split by tabs, which allows for an idiomatic
// usage of the tabwriter.
topOutput := []string{strings.Join(body.Titles, "\t")}
for _, out := range body.Processes {
topOutput = append(topOutput, strings.Join(out, "\t"))
}
return topOutput, err
}
// Unpause unpauses all paused containers in a Pod.
func Unpause(ctx context.Context, nameOrID string, options *UnpauseOptions) (*entitiesTypes.PodUnpauseReport, error) {
if options == nil {
options = new(UnpauseOptions)
}
_ = options
var report entitiesTypes.PodUnpauseReport
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
response, err := conn.DoRequest(ctx, nil, http.MethodPost, "/pods/%s/unpause", nil, nil, nameOrID)
if err != nil {
return nil, err
}
defer response.Body.Close()
return &report, response.ProcessWithError(&report, &errorhandling.PodConflictErrorModel{})
}
// Stats display resource-usage statistics of one or more pods.
func Stats(ctx context.Context, namesOrIDs []string, options *StatsOptions) ([]*entitiesTypes.PodStatsReport, error) {
if options == nil {
options = new(StatsOptions)
}
conn, err := bindings.GetClient(ctx)
if err != nil {
return nil, err
}
params, err := options.ToParams()
if err != nil {
return nil, err
}
for _, i := range namesOrIDs {
params.Add("namesOrIDs", i)
}
var reports []*entitiesTypes.PodStatsReport
response, err := conn.DoRequest(ctx, nil, http.MethodGet, "/pods/stats", params, nil)
if err != nil {
return nil, err
}
defer response.Body.Close()
return reports, response.Process(&reports)
}

View file

@ -0,0 +1,92 @@
package pods
// CreateOptions are optional options for creating pods
//
//go:generate go run ../generator/generator.go CreateOptions
type CreateOptions struct {
}
// InspectOptions are optional options for inspecting pods
//
//go:generate go run ../generator/generator.go InspectOptions
type InspectOptions struct {
}
// KillOptions are optional options for killing pods
//
//go:generate go run ../generator/generator.go KillOptions
type KillOptions struct {
Signal *string
}
// PauseOptions are optional options for pausing pods
//
//go:generate go run ../generator/generator.go PauseOptions
type PauseOptions struct {
}
// PruneOptions are optional options for pruning pods
//
//go:generate go run ../generator/generator.go PruneOptions
type PruneOptions struct {
}
// ListOptions are optional options for listing pods
//
//go:generate go run ../generator/generator.go ListOptions
type ListOptions struct {
Filters map[string][]string
}
// RestartOptions are optional options for restarting pods
//
//go:generate go run ../generator/generator.go RestartOptions
type RestartOptions struct {
}
// StartOptions are optional options for starting pods
//
//go:generate go run ../generator/generator.go StartOptions
type StartOptions struct {
}
// StopOptions are optional options for stopping pods
//
//go:generate go run ../generator/generator.go StopOptions
type StopOptions struct {
Timeout *int
}
// TopOptions are optional options for getting top on pods
//
//go:generate go run ../generator/generator.go TopOptions
type TopOptions struct {
Descriptors []string
}
// UnpauseOptions are optional options for unpausinging pods
//
//go:generate go run ../generator/generator.go UnpauseOptions
type UnpauseOptions struct {
}
// StatsOptions are optional options for getting stats of pods
//
//go:generate go run ../generator/generator.go StatsOptions
type StatsOptions struct {
All *bool
}
// RemoveOptions are optional options for removing pods
//
//go:generate go run ../generator/generator.go RemoveOptions
type RemoveOptions struct {
Force *bool
Timeout *uint
}
// ExistsOptions are optional options for checking if a pod exists
//
//go:generate go run ../generator/generator.go ExistsOptions
type ExistsOptions struct {
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *CreateOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *CreateOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *ExistsOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *ExistsOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *InspectOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *InspectOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,33 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *KillOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *KillOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
// WithSignal set field Signal to given value
func (o *KillOptions) WithSignal(value string) *KillOptions {
o.Signal = &value
return o
}
// GetSignal returns value of field Signal
func (o *KillOptions) GetSignal() string {
if o.Signal == nil {
var z string
return z
}
return *o.Signal
}

View file

@ -0,0 +1,33 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *ListOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *ListOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
// WithFilters set field Filters to given value
func (o *ListOptions) WithFilters(value map[string][]string) *ListOptions {
o.Filters = value
return o
}
// GetFilters returns value of field Filters
func (o *ListOptions) GetFilters() map[string][]string {
if o.Filters == nil {
var z map[string][]string
return z
}
return o.Filters
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *PauseOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *PauseOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *PruneOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *PruneOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,48 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *RemoveOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *RemoveOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
// WithForce set field Force to given value
func (o *RemoveOptions) WithForce(value bool) *RemoveOptions {
o.Force = &value
return o
}
// GetForce returns value of field Force
func (o *RemoveOptions) GetForce() bool {
if o.Force == nil {
var z bool
return z
}
return *o.Force
}
// WithTimeout set field Timeout to given value
func (o *RemoveOptions) WithTimeout(value uint) *RemoveOptions {
o.Timeout = &value
return o
}
// GetTimeout returns value of field Timeout
func (o *RemoveOptions) GetTimeout() uint {
if o.Timeout == nil {
var z uint
return z
}
return *o.Timeout
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *RestartOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *RestartOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *StartOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *StartOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

View file

@ -0,0 +1,33 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *StatsOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *StatsOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
// WithAll set field All to given value
func (o *StatsOptions) WithAll(value bool) *StatsOptions {
o.All = &value
return o
}
// GetAll returns value of field All
func (o *StatsOptions) GetAll() bool {
if o.All == nil {
var z bool
return z
}
return *o.All
}

View file

@ -0,0 +1,33 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *StopOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *StopOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
// WithTimeout set field Timeout to given value
func (o *StopOptions) WithTimeout(value int) *StopOptions {
o.Timeout = &value
return o
}
// GetTimeout returns value of field Timeout
func (o *StopOptions) GetTimeout() int {
if o.Timeout == nil {
var z int
return z
}
return *o.Timeout
}

View file

@ -0,0 +1,33 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *TopOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *TopOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}
// WithDescriptors set field Descriptors to given value
func (o *TopOptions) WithDescriptors(value []string) *TopOptions {
o.Descriptors = value
return o
}
// GetDescriptors returns value of field Descriptors
func (o *TopOptions) GetDescriptors() []string {
if o.Descriptors == nil {
var z []string
return z
}
return o.Descriptors
}

View file

@ -0,0 +1,18 @@
// Code generated by go generate; DO NOT EDIT.
package pods
import (
"net/url"
"github.com/containers/podman/v5/pkg/bindings/internal/util"
)
// Changed returns true if named field has been set
func (o *UnpauseOptions) Changed(fieldName string) bool {
return util.Changed(o, fieldName)
}
// ToParams formats struct fields to be passed to API service
func (o *UnpauseOptions) ToParams() (url.Values, error) {
return util.ToParams(o)
}

1
vendor/modules.txt vendored
View file

@ -165,6 +165,7 @@ github.com/containers/podman/v5/pkg/bindings/containers
github.com/containers/podman/v5/pkg/bindings/images github.com/containers/podman/v5/pkg/bindings/images
github.com/containers/podman/v5/pkg/bindings/internal/util github.com/containers/podman/v5/pkg/bindings/internal/util
github.com/containers/podman/v5/pkg/bindings/network github.com/containers/podman/v5/pkg/bindings/network
github.com/containers/podman/v5/pkg/bindings/pods
github.com/containers/podman/v5/pkg/bindings/system github.com/containers/podman/v5/pkg/bindings/system
github.com/containers/podman/v5/pkg/bindings/volumes github.com/containers/podman/v5/pkg/bindings/volumes
github.com/containers/podman/v5/pkg/checkpoint/crutils github.com/containers/podman/v5/pkg/checkpoint/crutils