mirror of
https://github.com/containers/podman.git
synced 2025-05-20 08:36:23 +08:00
Merge pull request #14585 from Luap99/nolint
golangci-lint: enable nolintlint
This commit is contained in:
@ -13,7 +13,6 @@ linters:
|
|||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
# All these break for one reason or another
|
# All these break for one reason or another
|
||||||
- nolintlint # some linter must be disabled (see `nolint` in the code)
|
|
||||||
- tagliatelle # too many JSON keys cannot be changed due to compat
|
- tagliatelle # too many JSON keys cannot be changed due to compat
|
||||||
- gocognit
|
- gocognit
|
||||||
- testpackage
|
- testpackage
|
||||||
@ -64,3 +63,6 @@ linters-settings:
|
|||||||
errcheck:
|
errcheck:
|
||||||
check-blank: false
|
check-blank: false
|
||||||
ignore: fmt:.*
|
ignore: fmt:.*
|
||||||
|
nolintlint:
|
||||||
|
allow-leading-space: false
|
||||||
|
require-specific: true
|
||||||
|
@ -50,7 +50,7 @@ func (c *Car) Color() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This is for reflect testing required.
|
// This is for reflect testing required.
|
||||||
// nolint:unused
|
//nolint:unused
|
||||||
func (c Car) internal() int {
|
func (c Car) internal() int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,7 @@ func resolvePathOnDestinationContainer(container string, containerPath string, i
|
|||||||
containerInfo, err = registry.ContainerEngine().ContainerStat(registry.GetContext(), container, containerPath)
|
containerInfo, err = registry.ContainerEngine().ContainerStat(registry.GetContext(), container, containerPath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
baseName = filepath.Base(containerInfo.LinkTarget)
|
baseName = filepath.Base(containerInfo.LinkTarget)
|
||||||
return // nolint: nilerr
|
return //nolint: nilerr
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(containerPath, "/") {
|
if strings.HasSuffix(containerPath, "/") {
|
||||||
|
@ -244,10 +244,10 @@ func combineBytesValues(a, b uint64) string {
|
|||||||
|
|
||||||
func outputJSON(stats []containerStats) error {
|
func outputJSON(stats []containerStats) error {
|
||||||
type jstat struct {
|
type jstat struct {
|
||||||
Id string `json:"id"` // nolint
|
Id string `json:"id"` //nolint:revive,stylecheck
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
CPUTime string `json:"cpu_time"`
|
CPUTime string `json:"cpu_time"`
|
||||||
CpuPercent string `json:"cpu_percent"` // nolint
|
CpuPercent string `json:"cpu_percent"` //nolint:revive,stylecheck
|
||||||
AverageCPU string `json:"avg_cpu"`
|
AverageCPU string `json:"avg_cpu"`
|
||||||
MemUsage string `json:"mem_usage"`
|
MemUsage string `json:"mem_usage"`
|
||||||
MemPerc string `json:"mem_percent"`
|
MemPerc string `json:"mem_percent"`
|
||||||
|
@ -93,7 +93,7 @@ func newInspector(options entities.InspectOptions) (*inspector, error) {
|
|||||||
// inspect inspects the specified container/image names or IDs.
|
// inspect inspects the specified container/image names or IDs.
|
||||||
func (i *inspector) inspect(namesOrIDs []string) error {
|
func (i *inspector) inspect(namesOrIDs []string) error {
|
||||||
// data - dumping place for inspection results.
|
// data - dumping place for inspection results.
|
||||||
var data []interface{} // nolint
|
var data []interface{}
|
||||||
var errs []error
|
var errs []error
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ func printTmpl(typ, row string, data []interface{}) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *inspector) inspectAll(ctx context.Context, namesOrIDs []string) ([]interface{}, []error, error) {
|
func (i *inspector) inspectAll(ctx context.Context, namesOrIDs []string) ([]interface{}, []error, error) {
|
||||||
var data []interface{} // nolint
|
var data []interface{}
|
||||||
allErrs := []error{}
|
allErrs := []error{}
|
||||||
for _, name := range namesOrIDs {
|
for _, name := range namesOrIDs {
|
||||||
ctrData, errs, err := i.containerEngine.ContainerInspect(ctx, []string{name}, i.options)
|
ctrData, errs, err := i.containerEngine.ContainerInspect(ctx, []string{name}, i.options)
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// nolint
|
|
||||||
// most of these validate and parse functions have been taken from projectatomic/docker
|
// most of these validate and parse functions have been taken from projectatomic/docker
|
||||||
// and modified for cri-o
|
// and modified for cri-o
|
||||||
package parse
|
package parse
|
||||||
@ -16,26 +15,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Protocol_TCP Protocol = 0
|
LabelType string = "label"
|
||||||
Protocol_UDP Protocol = 1
|
ENVType string = "env"
|
||||||
LabelType string = "label"
|
|
||||||
ENVType string = "env"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Protocol int32
|
|
||||||
|
|
||||||
// PortMapping specifies the port mapping configurations of a sandbox.
|
|
||||||
type PortMapping struct {
|
|
||||||
// Protocol of the port mapping.
|
|
||||||
Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=runtime.Protocol" json:"protocol,omitempty"`
|
|
||||||
// Port number within the container. Default: 0 (not specified).
|
|
||||||
ContainerPort int32 `protobuf:"varint,2,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"`
|
|
||||||
// Port number on the host. Default: 0 (not specified).
|
|
||||||
HostPort int32 `protobuf:"varint,3,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"`
|
|
||||||
// Host IP.
|
|
||||||
HostIp string `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Note: for flags that are in the form <number><unit>, use the RAMInBytes function
|
// Note: for flags that are in the form <number><unit>, use the RAMInBytes function
|
||||||
// from the units package in docker/go-units/size.go
|
// from the units package in docker/go-units/size.go
|
||||||
|
|
||||||
@ -48,7 +31,7 @@ var (
|
|||||||
// validateExtraHost validates that the specified string is a valid extrahost and returns it.
|
// validateExtraHost validates that the specified string is a valid extrahost and returns it.
|
||||||
// ExtraHost is in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6).
|
// ExtraHost is in the form of name:ip where the ip has to be a valid ip (ipv4 or ipv6).
|
||||||
// for add-host flag
|
// for add-host flag
|
||||||
func ValidateExtraHost(val string) (string, error) { // nolint
|
func ValidateExtraHost(val string) (string, error) {
|
||||||
// allow for IPv6 addresses in extra hosts by only splitting on first ":"
|
// allow for IPv6 addresses in extra hosts by only splitting on first ":"
|
||||||
arr := strings.SplitN(val, ":", 2)
|
arr := strings.SplitN(val, ":", 2)
|
||||||
if len(arr) != 2 || len(arr[0]) == 0 {
|
if len(arr) != 2 || len(arr[0]) == 0 {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
// nolint
|
|
||||||
// most of these validate and parse functions have been taken from projectatomic/docker
|
// most of these validate and parse functions have been taken from projectatomic/docker
|
||||||
// and modified for cri-o
|
// and modified for cri-o
|
||||||
package parse
|
package parse
|
||||||
@ -23,7 +22,6 @@ func createTmpFile(content []byte) (string, error) {
|
|||||||
|
|
||||||
if _, err := tmpfile.Write(content); err != nil {
|
if _, err := tmpfile.Write(content); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
||||||
}
|
}
|
||||||
if err := tmpfile.Close(); err != nil {
|
if err := tmpfile.Close(); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -211,7 +211,7 @@ func (l ListPodReporter) ID() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Id returns the Pod id
|
// Id returns the Pod id
|
||||||
func (l ListPodReporter) Id() string { // nolint
|
func (l ListPodReporter) Id() string { //nolint:revive,stylecheck
|
||||||
if noTrunc {
|
if noTrunc {
|
||||||
return l.ListPodsReport.Id
|
return l.ListPodsReport.Id
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ func (l ListPodReporter) InfraID() string {
|
|||||||
|
|
||||||
// InfraId returns the infra container id for the pod
|
// InfraId returns the infra container id for the pod
|
||||||
// depending on trunc
|
// depending on trunc
|
||||||
func (l ListPodReporter) InfraId() string { // nolint
|
func (l ListPodReporter) InfraId() string { //nolint:revive,stylecheck
|
||||||
if len(l.ListPodsReport.InfraId) == 0 {
|
if len(l.ListPodsReport.InfraId) == 0 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ func printSummary(cmd *cobra.Command, reports *entities.SystemDfReport) error {
|
|||||||
return writeTemplate(rpt, hdrs, dfSummaries)
|
return writeTemplate(rpt, hdrs, dfSummaries)
|
||||||
}
|
}
|
||||||
|
|
||||||
func printVerbose(cmd *cobra.Command, reports *entities.SystemDfReport) error { // nolint:interfacer
|
func printVerbose(cmd *cobra.Command, reports *entities.SystemDfReport) error { //nolint:interfacer
|
||||||
rpt := report.New(os.Stdout, cmd.Name())
|
rpt := report.New(os.Stdout, cmd.Name())
|
||||||
defer rpt.Flush()
|
defer rpt.Flush()
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ func SubCommandExists(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
return errors.Errorf("unrecognized command `%[1]s %[2]s`\n\nDid you mean this?\n\t%[3]s\n\nTry '%[1]s --help' for more information", cmd.CommandPath(), args[0], strings.Join(suggestions, "\n\t"))
|
return errors.Errorf("unrecognized command `%[1]s %[2]s`\n\nDid you mean this?\n\t%[3]s\n\nTry '%[1]s --help' for more information", cmd.CommandPath(), args[0], strings.Join(suggestions, "\n\t"))
|
||||||
}
|
}
|
||||||
cmd.Help() // nolint: errcheck
|
cmd.Help() //nolint: errcheck
|
||||||
return errors.Errorf("missing command '%[1]s COMMAND'", cmd.CommandPath())
|
return errors.Errorf("missing command '%[1]s COMMAND'", cmd.CommandPath())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,8 +226,8 @@ outer:
|
|||||||
// https://github.com/containers/podman/issues/11248
|
// https://github.com/containers/podman/issues/11248
|
||||||
// Copy /dev/null to stdout and stderr to prevent SIGPIPE errors
|
// Copy /dev/null to stdout and stderr to prevent SIGPIPE errors
|
||||||
if f, err := os.OpenFile("/dev/null", os.O_WRONLY, 0755); err == nil {
|
if f, err := os.OpenFile("/dev/null", os.O_WRONLY, 0755); err == nil {
|
||||||
unix.Dup2(int(f.Fd()), 1) // nolint:errcheck
|
unix.Dup2(int(f.Fd()), 1) //nolint:errcheck
|
||||||
unix.Dup2(int(f.Fd()), 2) // nolint:errcheck
|
unix.Dup2(int(f.Fd()), 2) //nolint:errcheck
|
||||||
f.Close()
|
f.Close()
|
||||||
}
|
}
|
||||||
// write and close ReadyFD (convention is same as slirp4netns --ready-fd)
|
// write and close ReadyFD (convention is same as slirp4netns --ready-fd)
|
||||||
|
@ -20,7 +20,7 @@ type SpecData struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDualStackSplit(t *testing.T) {
|
func TestDualStackSplit(t *testing.T) {
|
||||||
//nolint
|
//nolint:revive,stylecheck
|
||||||
const (
|
const (
|
||||||
IP4_ALL = "0.0.0.0"
|
IP4_ALL = "0.0.0.0"
|
||||||
IP4__LO = "127.0.0.1"
|
IP4__LO = "127.0.0.1"
|
||||||
|
@ -79,11 +79,11 @@ type ExecConfig struct {
|
|||||||
type ExecSession struct {
|
type ExecSession struct {
|
||||||
// Id is the ID of the exec session.
|
// Id is the ID of the exec session.
|
||||||
// Named somewhat strangely to not conflict with ID().
|
// Named somewhat strangely to not conflict with ID().
|
||||||
// nolint:stylecheck,revive
|
//nolint:stylecheck,revive
|
||||||
Id string `json:"id"`
|
Id string `json:"id"`
|
||||||
// ContainerId is the ID of the container this exec session belongs to.
|
// ContainerId is the ID of the container this exec session belongs to.
|
||||||
// Named somewhat strangely to not conflict with ContainerID().
|
// Named somewhat strangely to not conflict with ContainerID().
|
||||||
// nolint:stylecheck,revive
|
//nolint:stylecheck,revive
|
||||||
ContainerId string `json:"containerId"`
|
ContainerId string `json:"containerId"`
|
||||||
|
|
||||||
// State is the state of the exec session.
|
// State is the state of the exec session.
|
||||||
|
@ -2643,7 +2643,7 @@ func (c *Container) generateUserGroupEntry(addedGID int) (string, error) {
|
|||||||
|
|
||||||
gid, err := strconv.ParseUint(group, 10, 32)
|
gid, err := strconv.ParseUint(group, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil // nolint: nilerr
|
return "", nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
|
|
||||||
if addedGID != 0 && addedGID == int(gid) {
|
if addedGID != 0 && addedGID == int(gid) {
|
||||||
@ -2799,7 +2799,7 @@ func (c *Container) generateUserPasswdEntry(addedUID int) (string, error) {
|
|||||||
// If a non numeric User, then don't generate passwd
|
// If a non numeric User, then don't generate passwd
|
||||||
uid, err := strconv.ParseUint(userspec, 10, 32)
|
uid, err := strconv.ParseUint(userspec, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", nil // nolint: nilerr
|
return "", nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
|
|
||||||
if addedUID != 0 && int(uid) == addedUID {
|
if addedUID != 0 && int(uid) == addedUID {
|
||||||
@ -3224,7 +3224,7 @@ func (c *Container) fixVolumePermissions(v *ContainerNamedVolume) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
stat := st.Sys().(*syscall.Stat_t)
|
stat := st.Sys().(*syscall.Stat_t)
|
||||||
atime := time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec)) // nolint: unconvert
|
atime := time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec)) //nolint: unconvert
|
||||||
if err := os.Chtimes(mountPoint, atime, st.ModTime()); err != nil {
|
if err := os.Chtimes(mountPoint, atime, st.ModTime()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -259,9 +259,7 @@ type HealthCheckLog struct {
|
|||||||
// as possible from the spec and container config.
|
// as possible from the spec and container config.
|
||||||
// Some things cannot be inferred. These will be populated by spec annotations
|
// Some things cannot be inferred. These will be populated by spec annotations
|
||||||
// (if available).
|
// (if available).
|
||||||
// Field names are fixed for compatibility and cannot be changed.
|
//nolint:revive,stylecheck // Field names are fixed for compatibility and cannot be changed.
|
||||||
// As such, silence lint warnings about them.
|
|
||||||
//nolint
|
|
||||||
type InspectContainerHostConfig struct {
|
type InspectContainerHostConfig struct {
|
||||||
// Binds contains an array of user-added mounts.
|
// Binds contains an array of user-added mounts.
|
||||||
// Both volume mounts and named volumes are included.
|
// Both volume mounts and named volumes are included.
|
||||||
|
@ -43,8 +43,8 @@ func GenerateForKube(ctx context.Context, ctrs []*Container) (*v1.Pod, error) {
|
|||||||
func (p *Pod) GenerateForKube(ctx context.Context) (*v1.Pod, []v1.ServicePort, error) {
|
func (p *Pod) GenerateForKube(ctx context.Context) (*v1.Pod, []v1.ServicePort, error) {
|
||||||
// Generate the v1.Pod yaml description
|
// Generate the v1.Pod yaml description
|
||||||
var (
|
var (
|
||||||
ports []v1.ContainerPort //nolint
|
ports []v1.ContainerPort
|
||||||
servicePorts []v1.ServicePort //nolint
|
servicePorts []v1.ServicePort
|
||||||
)
|
)
|
||||||
|
|
||||||
allContainers, err := p.allContainers()
|
allContainers, err := p.allContainers()
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
// FileLocks is a struct enabling POSIX lock locking in a shared memory
|
// FileLocks is a struct enabling POSIX lock locking in a shared memory
|
||||||
// segment.
|
// segment.
|
||||||
type FileLocks struct { // nolint
|
type FileLocks struct { //nolint:revive // struct name stutters
|
||||||
lockPath string
|
lockPath string
|
||||||
valid bool
|
valid bool
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ var (
|
|||||||
|
|
||||||
// SHMLocks is a struct enabling POSIX semaphore locking in a shared memory
|
// SHMLocks is a struct enabling POSIX semaphore locking in a shared memory
|
||||||
// segment.
|
// segment.
|
||||||
type SHMLocks struct { // nolint
|
type SHMLocks struct {
|
||||||
lockStruct *C.shm_struct_t
|
lockStruct *C.shm_struct_t
|
||||||
maxLocks uint32
|
maxLocks uint32
|
||||||
valid bool
|
valid bool
|
||||||
|
@ -1014,7 +1014,7 @@ func (r *ConmonOCIRuntime) getLogTag(ctr *Container) (string, error) {
|
|||||||
data, err := ctr.inspectLocked(false)
|
data, err := ctr.inspectLocked(false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// FIXME: this error should probably be returned
|
// FIXME: this error should probably be returned
|
||||||
return "", nil // nolint: nilerr
|
return "", nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
tmpl, err := template.New("container").Parse(logTag)
|
tmpl, err := template.New("container").Parse(logTag)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -35,8 +35,6 @@ var (
|
|||||||
hostVirtualPath = "/VolumeDriver.Path"
|
hostVirtualPath = "/VolumeDriver.Path"
|
||||||
mountPath = "/VolumeDriver.Mount"
|
mountPath = "/VolumeDriver.Mount"
|
||||||
unmountPath = "/VolumeDriver.Unmount"
|
unmountPath = "/VolumeDriver.Unmount"
|
||||||
// nolint
|
|
||||||
capabilitiesPath = "/VolumeDriver.Capabilities"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -165,7 +165,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
|
|||||||
utils.Error(w, http.StatusInternalServerError, errors.Wrapf(err, "CommitFailure"))
|
utils.Error(w, http.StatusInternalServerError, errors.Wrapf(err, "CommitFailure"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
utils.WriteResponse(w, http.StatusCreated, entities.IDResponse{ID: commitImage.ID()}) // nolint
|
utils.WriteResponse(w, http.StatusCreated, entities.IDResponse{ID: commitImage.ID()})
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateImageFromSrc(w http.ResponseWriter, r *http.Request) {
|
func CreateImageFromSrc(w http.ResponseWriter, r *http.Request) {
|
||||||
@ -237,7 +237,7 @@ func CreateImageFromSrc(w http.ResponseWriter, r *http.Request) {
|
|||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
Progress string `json:"progress"`
|
Progress string `json:"progress"`
|
||||||
ProgressDetail map[string]string `json:"progressDetail"`
|
ProgressDetail map[string]string `json:"progressDetail"`
|
||||||
Id string `json:"id"` // nolint
|
Id string `json:"id"` //nolint:revive,stylecheck
|
||||||
}{
|
}{
|
||||||
Status: report.Id,
|
Status: report.Id,
|
||||||
ProgressDetail: map[string]string{},
|
ProgressDetail: map[string]string{},
|
||||||
@ -333,7 +333,7 @@ loop: // break out of for/select infinite loop
|
|||||||
Total int64 `json:"total,omitempty"`
|
Total int64 `json:"total,omitempty"`
|
||||||
} `json:"progressDetail,omitempty"`
|
} `json:"progressDetail,omitempty"`
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
Id string `json:"id,omitempty"` // nolint
|
Id string `json:"id,omitempty"` //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case e := <-progress:
|
case e := <-progress:
|
||||||
|
@ -78,15 +78,15 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||||||
AppArmor string `schema:"apparmor"`
|
AppArmor string `schema:"apparmor"`
|
||||||
BuildArgs string `schema:"buildargs"`
|
BuildArgs string `schema:"buildargs"`
|
||||||
CacheFrom string `schema:"cachefrom"`
|
CacheFrom string `schema:"cachefrom"`
|
||||||
CgroupParent string `schema:"cgroupparent"` // nolint
|
CgroupParent string `schema:"cgroupparent"`
|
||||||
Compression uint64 `schema:"compression"`
|
Compression uint64 `schema:"compression"`
|
||||||
ConfigureNetwork string `schema:"networkmode"`
|
ConfigureNetwork string `schema:"networkmode"`
|
||||||
CPPFlags string `schema:"cppflags"`
|
CPPFlags string `schema:"cppflags"`
|
||||||
CpuPeriod uint64 `schema:"cpuperiod"` // nolint
|
CpuPeriod uint64 `schema:"cpuperiod"` //nolint:revive,stylecheck
|
||||||
CpuQuota int64 `schema:"cpuquota"` // nolint
|
CpuQuota int64 `schema:"cpuquota"` //nolint:revive,stylecheck
|
||||||
CpuSetCpus string `schema:"cpusetcpus"` // nolint
|
CpuSetCpus string `schema:"cpusetcpus"` //nolint:revive,stylecheck
|
||||||
CpuSetMems string `schema:"cpusetmems"` // nolint
|
CpuSetMems string `schema:"cpusetmems"` //nolint:revive,stylecheck
|
||||||
CpuShares uint64 `schema:"cpushares"` // nolint
|
CpuShares uint64 `schema:"cpushares"` //nolint:revive,stylecheck
|
||||||
DNSOptions string `schema:"dnsoptions"`
|
DNSOptions string `schema:"dnsoptions"`
|
||||||
DNSSearch string `schema:"dnssearch"`
|
DNSSearch string `schema:"dnssearch"`
|
||||||
DNSServers string `schema:"dnsservers"`
|
DNSServers string `schema:"dnsservers"`
|
||||||
@ -101,7 +101,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||||||
IdentityLabel bool `schema:"identitylabel"`
|
IdentityLabel bool `schema:"identitylabel"`
|
||||||
Ignore bool `schema:"ignore"`
|
Ignore bool `schema:"ignore"`
|
||||||
Isolation string `schema:"isolation"`
|
Isolation string `schema:"isolation"`
|
||||||
Jobs int `schema:"jobs"` // nolint
|
Jobs int `schema:"jobs"`
|
||||||
LabelOpts string `schema:"labelopts"`
|
LabelOpts string `schema:"labelopts"`
|
||||||
Labels string `schema:"labels"`
|
Labels string `schema:"labels"`
|
||||||
Layers bool `schema:"layers"`
|
Layers bool `schema:"layers"`
|
||||||
@ -367,7 +367,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var additionalTags []string // nolint
|
var additionalTags []string
|
||||||
for i := 1; i < len(tags); i++ {
|
for i := 1; i < len(tags); i++ {
|
||||||
possiblyNormalizedTag, err := utils.NormalizeToDockerHub(r, tags[i])
|
possiblyNormalizedTag, err := utils.NormalizeToDockerHub(r, tags[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -801,7 +801,7 @@ func parseNetworkConfigurationPolicy(network string) buildah.NetworkConfiguratio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseLibPodIsolation(isolation string) (buildah.Isolation, error) { // nolint
|
func parseLibPodIsolation(isolation string) (buildah.Isolation, error) {
|
||||||
if val, err := strconv.Atoi(isolation); err == nil {
|
if val, err := strconv.Atoi(isolation); err == nil {
|
||||||
return buildah.Isolation(val), nil
|
return buildah.Isolation(val), nil
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SaveFromBody(f *os.File, r *http.Request) error { // nolint
|
func SaveFromBody(f *os.File, r *http.Request) error {
|
||||||
if _, err := io.Copy(f, r.Body); err != nil {
|
if _, err := io.Copy(f, r.Body); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -562,7 +562,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
|
|||||||
utils.Error(w, http.StatusInternalServerError, errors.Wrapf(err, "CommitFailure"))
|
utils.Error(w, http.StatusInternalServerError, errors.Wrapf(err, "CommitFailure"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
utils.WriteResponse(w, http.StatusOK, entities.IDResponse{ID: commitImage.ID()}) // nolint
|
utils.WriteResponse(w, http.StatusOK, entities.IDResponse{ID: commitImage.ID()})
|
||||||
}
|
}
|
||||||
|
|
||||||
func UntagImage(w http.ResponseWriter, r *http.Request) {
|
func UntagImage(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -68,7 +68,7 @@ func IsRegistryReference(name string) error {
|
|||||||
imageRef, err := alltransports.ParseImageName(name)
|
imageRef, err := alltransports.ParseImageName(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// No supported transport -> assume a docker-stype reference.
|
// No supported transport -> assume a docker-stype reference.
|
||||||
return nil // nolint: nilerr
|
return nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
if imageRef.Transport().Name() == docker.Transport.Name() {
|
if imageRef.Transport().Name() == docker.Transport.Name() {
|
||||||
return nil
|
return nil
|
||||||
|
@ -148,7 +148,7 @@ func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.Ser
|
|||||||
if logrus.IsLevelEnabled(logrus.TraceLevel) {
|
if logrus.IsLevelEnabled(logrus.TraceLevel) {
|
||||||
// If in trace mode log request and response bodies
|
// If in trace mode log request and response bodies
|
||||||
router.Use(loggingHandler())
|
router.Use(loggingHandler())
|
||||||
router.Walk(func(route *mux.Route, r *mux.Router, ancestors []*mux.Route) error { // nolint
|
_ = router.Walk(func(route *mux.Route, r *mux.Router, ancestors []*mux.Route) error {
|
||||||
path, err := route.GetPathTemplate()
|
path, err := route.GetPathTemplate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
path = "<N/A>"
|
path = "<N/A>"
|
||||||
|
@ -315,7 +315,8 @@ func unixClient(_url *url.URL) Connection {
|
|||||||
return connection
|
return connection
|
||||||
}
|
}
|
||||||
|
|
||||||
// DoRequest assembles the http request and returns the response
|
// DoRequest assembles the http request and returns the response.
|
||||||
|
// The caller must close the response body.
|
||||||
func (c *Connection) DoRequest(ctx context.Context, httpBody io.Reader, httpMethod, endpoint string, queryParams url.Values, headers http.Header, pathValues ...string) (*APIResponse, error) {
|
func (c *Connection) DoRequest(ctx context.Context, httpBody io.Reader, httpMethod, endpoint string, queryParams url.Values, headers http.Header, pathValues ...string) (*APIResponse, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
@ -361,7 +362,7 @@ func (c *Connection) DoRequest(ctx context.Context, httpBody io.Reader, httpMeth
|
|||||||
|
|
||||||
// Give the Do three chances in the case of a comm/service hiccup
|
// Give the Do three chances in the case of a comm/service hiccup
|
||||||
for i := 1; i <= 3; i++ {
|
for i := 1; i <= 3; i++ {
|
||||||
response, err = c.Client.Do(req) // nolint
|
response, err = c.Client.Do(req) //nolint:bodyclose // The caller has to close the body.
|
||||||
if err == nil {
|
if err == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ var (
|
|||||||
// the most recent number of containers. The pod and size booleans indicate that pod information and rootfs
|
// the most recent number of containers. The pod and size booleans indicate that pod information and rootfs
|
||||||
// size information should also be included. Finally, the sync bool synchronizes the OCI runtime and
|
// size information should also be included. Finally, the sync bool synchronizes the OCI runtime and
|
||||||
// container state.
|
// container state.
|
||||||
func List(ctx context.Context, options *ListOptions) ([]entities.ListContainer, error) { // nolint:typecheck
|
func List(ctx context.Context, options *ListOptions) ([]entities.ListContainer, error) {
|
||||||
if options == nil {
|
if options == nil {
|
||||||
options = new(ListOptions)
|
options = new(ListOptions)
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@ func Unpause(ctx context.Context, nameOrID string, options *UnpauseOptions) erro
|
|||||||
// Wait blocks until the given container reaches a condition. If not provided, the condition will
|
// Wait blocks until the given container reaches a condition. If not provided, the condition will
|
||||||
// default to stopped. If the condition is stopped, an exit code for the container will be provided. The
|
// default to stopped. If the condition is stopped, an exit code for the container will be provided. The
|
||||||
// nameOrID can be a container name or a partial/full ID.
|
// nameOrID can be a container name or a partial/full ID.
|
||||||
func Wait(ctx context.Context, nameOrID string, options *WaitOptions) (int32, error) { // nolint
|
func Wait(ctx context.Context, nameOrID string, options *WaitOptions) (int32, error) {
|
||||||
if options == nil {
|
if options == nil {
|
||||||
options = new(WaitOptions)
|
options = new(WaitOptions)
|
||||||
}
|
}
|
||||||
|
@ -621,7 +621,7 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) {
|
|||||||
}
|
}
|
||||||
name := filepath.ToSlash(strings.TrimPrefix(path, s+string(filepath.Separator)))
|
name := filepath.ToSlash(strings.TrimPrefix(path, s+string(filepath.Separator)))
|
||||||
|
|
||||||
excluded, err := pm.Matches(name) // nolint:staticcheck
|
excluded, err := pm.Matches(name) //nolint:staticcheck
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrapf(err, "error checking if %q is excluded", name)
|
return errors.Wrapf(err, "error checking if %q is excluded", name)
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
func checkHardLink(fi os.FileInfo) (devino, bool) {
|
func checkHardLink(fi os.FileInfo) (devino, bool) {
|
||||||
st := fi.Sys().(*syscall.Stat_t)
|
st := fi.Sys().(*syscall.Stat_t)
|
||||||
return devino{
|
return devino{
|
||||||
Dev: uint64(st.Dev), // nolint: unconvert
|
Dev: uint64(st.Dev), //nolint: unconvert
|
||||||
Ino: st.Ino,
|
Ino: st.Ino,
|
||||||
}, st.Nlink > 1
|
}, st.Nlink > 1
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,6 @@ import (
|
|||||||
|
|
||||||
func created(fi os.FileInfo) time.Time {
|
func created(fi os.FileInfo) time.Time {
|
||||||
st := fi.Sys().(*syscall.Stat_t)
|
st := fi.Sys().(*syscall.Stat_t)
|
||||||
//nolint
|
//nolint:unconvert // need to type cast on some cpu architectures
|
||||||
return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec))
|
return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec))
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ type WaitOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type WaitReport struct {
|
type WaitReport struct {
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
Error error
|
Error error
|
||||||
ExitCode int32
|
ExitCode int32
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ type PauseUnPauseOptions struct {
|
|||||||
|
|
||||||
type PauseUnpauseReport struct {
|
type PauseUnpauseReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type StopOptions struct {
|
type StopOptions struct {
|
||||||
@ -88,7 +88,7 @@ type StopOptions struct {
|
|||||||
|
|
||||||
type StopReport struct {
|
type StopReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
RawInput string
|
RawInput string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ type KillOptions struct {
|
|||||||
|
|
||||||
type KillReport struct {
|
type KillReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
RawInput string
|
RawInput string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ type RestartOptions struct {
|
|||||||
|
|
||||||
type RestartReport struct {
|
type RestartReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type RmOptions struct {
|
type RmOptions struct {
|
||||||
@ -170,7 +170,7 @@ type CopyOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CommitReport struct {
|
type CommitReport struct {
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContainerExportOptions struct {
|
type ContainerExportOptions struct {
|
||||||
@ -196,7 +196,7 @@ type CheckpointOptions struct {
|
|||||||
|
|
||||||
type CheckpointReport struct {
|
type CheckpointReport struct {
|
||||||
Err error `json:"-"`
|
Err error `json:"-"`
|
||||||
Id string `json:"Id` //nolint
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
RuntimeDuration int64 `json:"runtime_checkpoint_duration"`
|
RuntimeDuration int64 `json:"runtime_checkpoint_duration"`
|
||||||
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
||||||
}
|
}
|
||||||
@ -222,13 +222,13 @@ type RestoreOptions struct {
|
|||||||
|
|
||||||
type RestoreReport struct {
|
type RestoreReport struct {
|
||||||
Err error `json:"-"`
|
Err error `json:"-"`
|
||||||
Id string `json:"Id` //nolint
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
RuntimeDuration int64 `json:"runtime_restore_duration"`
|
RuntimeDuration int64 `json:"runtime_restore_duration"`
|
||||||
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
CRIUStatistics *define.CRIUCheckpointRestoreStatistics `json:"criu_statistics"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ContainerCreateReport struct {
|
type ContainerCreateReport struct {
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// AttachOptions describes the cli and other values
|
// AttachOptions describes the cli and other values
|
||||||
@ -307,7 +307,7 @@ type ContainerStartOptions struct {
|
|||||||
// ContainerStartReport describes the response from starting
|
// ContainerStartReport describes the response from starting
|
||||||
// containers from the cli
|
// containers from the cli
|
||||||
type ContainerStartReport struct {
|
type ContainerStartReport struct {
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
RawInput string
|
RawInput string
|
||||||
Err error
|
Err error
|
||||||
ExitCode int
|
ExitCode int
|
||||||
@ -351,7 +351,7 @@ type ContainerRunOptions struct {
|
|||||||
// a container
|
// a container
|
||||||
type ContainerRunReport struct {
|
type ContainerRunReport struct {
|
||||||
ExitCode int
|
ExitCode int
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerCleanupOptions are the CLI values for the
|
// ContainerCleanupOptions are the CLI values for the
|
||||||
@ -368,7 +368,7 @@ type ContainerCleanupOptions struct {
|
|||||||
// container cleanup
|
// container cleanup
|
||||||
type ContainerCleanupReport struct {
|
type ContainerCleanupReport struct {
|
||||||
CleanErr error
|
CleanErr error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
RmErr error
|
RmErr error
|
||||||
RmiErr error
|
RmiErr error
|
||||||
}
|
}
|
||||||
@ -384,7 +384,7 @@ type ContainerInitOptions struct {
|
|||||||
// container init
|
// container init
|
||||||
type ContainerInitReport struct {
|
type ContainerInitReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerMountOptions describes the input values for mounting containers
|
// ContainerMountOptions describes the input values for mounting containers
|
||||||
@ -406,7 +406,7 @@ type ContainerUnmountOptions struct {
|
|||||||
// ContainerMountReport describes the response from container mount
|
// ContainerMountReport describes the response from container mount
|
||||||
type ContainerMountReport struct {
|
type ContainerMountReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
Name string
|
Name string
|
||||||
Path string
|
Path string
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ type ContainerMountReport struct {
|
|||||||
// ContainerUnmountReport describes the response from umounting a container
|
// ContainerUnmountReport describes the response from umounting a container
|
||||||
type ContainerUnmountReport struct {
|
type ContainerUnmountReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerPruneOptions describes the options needed
|
// ContainerPruneOptions describes the options needed
|
||||||
@ -433,7 +433,7 @@ type ContainerPortOptions struct {
|
|||||||
// ContainerPortReport describes the output needed for
|
// ContainerPortReport describes the output needed for
|
||||||
// the CLI to output ports
|
// the CLI to output ports
|
||||||
type ContainerPortReport struct {
|
type ContainerPortReport struct {
|
||||||
Id string //nolint
|
Id string //nolint:revive,stylecheck
|
||||||
Ports []nettypes.PortMapping
|
Ports []nettypes.PortMapping
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,14 +46,14 @@ type Image struct {
|
|||||||
HealthCheck *manifest.Schema2HealthConfig `json:",omitempty"`
|
HealthCheck *manifest.Schema2HealthConfig `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) Id() string { // nolint
|
func (i *Image) Id() string { //nolint:revive,stylecheck
|
||||||
return i.ID
|
return i.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
// swagger:model LibpodImageSummary
|
// swagger:model LibpodImageSummary
|
||||||
type ImageSummary struct {
|
type ImageSummary struct {
|
||||||
ID string `json:"Id"`
|
ID string `json:"Id"`
|
||||||
ParentId string // nolint
|
ParentId string //nolint:revive,stylecheck
|
||||||
RepoTags []string
|
RepoTags []string
|
||||||
RepoDigests []string
|
RepoDigests []string
|
||||||
Created int64
|
Created int64
|
||||||
@ -71,7 +71,7 @@ type ImageSummary struct {
|
|||||||
History []string `json:",omitempty"`
|
History []string `json:",omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *ImageSummary) Id() string { // nolint
|
func (i *ImageSummary) Id() string { //nolint:revive,stylecheck
|
||||||
return i.ID
|
return i.ID
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ type ImageImportOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ImageImportReport struct {
|
type ImageImportReport struct {
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageSaveOptions provide options for saving images.
|
// ImageSaveOptions provide options for saving images.
|
||||||
@ -397,7 +397,7 @@ type ImageUnmountOptions struct {
|
|||||||
|
|
||||||
// ImageMountReport describes the response from image mount
|
// ImageMountReport describes the response from image mount
|
||||||
type ImageMountReport struct {
|
type ImageMountReport struct {
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
Name string
|
Name string
|
||||||
Repositories []string
|
Repositories []string
|
||||||
Path string
|
Path string
|
||||||
@ -406,5 +406,5 @@ type ImageMountReport struct {
|
|||||||
// ImageUnmountReport describes the response from umounting an image
|
// ImageUnmountReport describes the response from umounting an image
|
||||||
type ImageUnmountReport struct {
|
type ImageUnmountReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ type NetworkReloadOptions struct {
|
|||||||
|
|
||||||
// NetworkReloadReport describes the results of reloading a container network.
|
// NetworkReloadReport describes the results of reloading a container network.
|
||||||
type NetworkReloadReport struct {
|
type NetworkReloadReport struct {
|
||||||
// nolint:stylecheck,revive
|
//nolint:stylecheck,revive
|
||||||
Id string
|
Id string
|
||||||
Err error
|
Err error
|
||||||
}
|
}
|
||||||
|
@ -20,15 +20,15 @@ type PodKillOptions struct {
|
|||||||
|
|
||||||
type PodKillReport struct {
|
type PodKillReport struct {
|
||||||
Errs []error
|
Errs []error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListPodsReport struct {
|
type ListPodsReport struct {
|
||||||
Cgroup string
|
Cgroup string
|
||||||
Containers []*ListPodContainer
|
Containers []*ListPodContainer
|
||||||
Created time.Time
|
Created time.Time
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
InfraId string // nolint
|
InfraId string //nolint:revive,stylecheck
|
||||||
Name string
|
Name string
|
||||||
Namespace string
|
Namespace string
|
||||||
// Network names connected to infra container
|
// Network names connected to infra container
|
||||||
@ -38,7 +38,7 @@ type ListPodsReport struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ListPodContainer struct {
|
type ListPodContainer struct {
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
Names string
|
Names string
|
||||||
Status string
|
Status string
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ type PodPauseOptions struct {
|
|||||||
|
|
||||||
type PodPauseReport struct {
|
type PodPauseReport struct {
|
||||||
Errs []error
|
Errs []error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type PodunpauseOptions struct {
|
type PodunpauseOptions struct {
|
||||||
@ -60,7 +60,7 @@ type PodunpauseOptions struct {
|
|||||||
|
|
||||||
type PodUnpauseReport struct {
|
type PodUnpauseReport struct {
|
||||||
Errs []error
|
Errs []error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type PodStopOptions struct {
|
type PodStopOptions struct {
|
||||||
@ -72,7 +72,7 @@ type PodStopOptions struct {
|
|||||||
|
|
||||||
type PodStopReport struct {
|
type PodStopReport struct {
|
||||||
Errs []error
|
Errs []error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type PodRestartOptions struct {
|
type PodRestartOptions struct {
|
||||||
@ -82,7 +82,7 @@ type PodRestartOptions struct {
|
|||||||
|
|
||||||
type PodRestartReport struct {
|
type PodRestartReport struct {
|
||||||
Errs []error
|
Errs []error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type PodStartOptions struct {
|
type PodStartOptions struct {
|
||||||
@ -92,7 +92,7 @@ type PodStartOptions struct {
|
|||||||
|
|
||||||
type PodStartReport struct {
|
type PodStartReport struct {
|
||||||
Errs []error
|
Errs []error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type PodRmOptions struct {
|
type PodRmOptions struct {
|
||||||
@ -105,7 +105,7 @@ type PodRmOptions struct {
|
|||||||
|
|
||||||
type PodRmReport struct {
|
type PodRmReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// PddSpec is an abstracted version of PodSpecGen designed to eventually accept options
|
// PddSpec is an abstracted version of PodSpecGen designed to eventually accept options
|
||||||
@ -287,7 +287,7 @@ func NewInfraContainerCreateOptions() ContainerCreateOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PodCreateReport struct {
|
type PodCreateReport struct {
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PodCreateOptions) CPULimits() *specs.LinuxCPU {
|
func (p *PodCreateOptions) CPULimits() *specs.LinuxCPU {
|
||||||
@ -389,7 +389,7 @@ type PodPruneOptions struct {
|
|||||||
|
|
||||||
type PodPruneReport struct {
|
type PodPruneReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type PodTopOptions struct {
|
type PodTopOptions struct {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package reports
|
package reports
|
||||||
|
|
||||||
type RmReport struct {
|
type RmReport struct {
|
||||||
Id string `json:"Id"` //nolint
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
Err error `json:"Err,omitempty"`
|
Err error `json:"Err,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package reports
|
package reports
|
||||||
|
|
||||||
type PruneReport struct {
|
type PruneReport struct {
|
||||||
Id string `json:"Id"` //nolint
|
Id string `json:"Id"` //nolint:revive,stylecheck
|
||||||
Err error `json:"Err,omitempty"`
|
Err error `json:"Err,omitempty"`
|
||||||
Size uint64 `json:"Size"`
|
Size uint64 `json:"Size"`
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ type Volume struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Report struct {
|
type Report struct {
|
||||||
Id []string // nolint
|
Id []string //nolint:revive,stylecheck
|
||||||
Err map[string]error
|
Err map[string]error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ type VolumeRmOptions struct {
|
|||||||
|
|
||||||
type VolumeRmReport struct {
|
type VolumeRmReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
type VolumeInspectReport struct {
|
type VolumeInspectReport struct {
|
||||||
@ -61,7 +61,7 @@ type VolumeListReport struct {
|
|||||||
// VolumeMountReport describes the response from volume mount
|
// VolumeMountReport describes the response from volume mount
|
||||||
type VolumeMountReport struct {
|
type VolumeMountReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
Name string
|
Name string
|
||||||
Path string
|
Path string
|
||||||
}
|
}
|
||||||
@ -69,5 +69,5 @@ type VolumeMountReport struct {
|
|||||||
// VolumeUnmountReport describes the response from umounting a volume
|
// VolumeUnmountReport describes the response from umounting a volume
|
||||||
type VolumeUnmountReport struct {
|
type VolumeUnmountReport struct {
|
||||||
Err error
|
Err error
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
@ -593,7 +593,7 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie
|
|||||||
|
|
||||||
rmErrors = libimageErrors
|
rmErrors = libimageErrors
|
||||||
|
|
||||||
return //nolint
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown Libpod engine
|
// Shutdown Libpod engine
|
||||||
|
@ -20,7 +20,7 @@ const signalBufferSize = 2048
|
|||||||
func ProxySignals(ctr *libpod.Container) {
|
func ProxySignals(ctr *libpod.Container) {
|
||||||
// Stop catching the shutdown signals (SIGINT, SIGTERM) - they're going
|
// Stop catching the shutdown signals (SIGINT, SIGTERM) - they're going
|
||||||
// to the container now.
|
// to the container now.
|
||||||
shutdown.Stop() // nolint: errcheck
|
shutdown.Stop() //nolint: errcheck
|
||||||
|
|
||||||
sigBuffer := make(chan os.Signal, signalBufferSize)
|
sigBuffer := make(chan os.Signal, signalBufferSize)
|
||||||
signal.CatchAll(sigBuffer)
|
signal.CatchAll(sigBuffer)
|
||||||
|
@ -172,7 +172,7 @@ func (ic *ContainerEngine) VolumeMounted(ctx context.Context, nameOrID string) (
|
|||||||
mountCount, err := vol.MountCount()
|
mountCount, err := vol.MountCount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// FIXME: this error should probably be returned
|
// FIXME: this error should probably be returned
|
||||||
return &entities.BoolReport{Value: false}, nil // nolint: nilerr
|
return &entities.BoolReport{Value: false}, nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
if mountCount > 0 {
|
if mountCount > 0 {
|
||||||
return &entities.BoolReport{Value: true}, nil
|
return &entities.BoolReport{Value: true}, nil
|
||||||
|
@ -570,7 +570,7 @@ func (ic *ContainerEngine) ContainerExecDetached(ctx context.Context, nameOrID s
|
|||||||
return sessionID, nil
|
return sessionID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func startAndAttach(ic *ContainerEngine, name string, detachKeys *string, input, output, errput *os.File) error { //nolint
|
func startAndAttach(ic *ContainerEngine, name string, detachKeys *string, input, output, errput *os.File) error {
|
||||||
attachErr := make(chan error)
|
attachErr := make(chan error)
|
||||||
attachReady := make(chan bool)
|
attachReady := make(chan bool)
|
||||||
options := new(containers.AttachOptions).WithStream(true)
|
options := new(containers.AttachOptions).WithStream(true)
|
||||||
@ -863,7 +863,7 @@ func (ic *ContainerEngine) ContainerRun(ctx context.Context, opts entities.Conta
|
|||||||
if eventsErr != nil || lastEvent == nil {
|
if eventsErr != nil || lastEvent == nil {
|
||||||
logrus.Errorf("Cannot get exit code: %v", err)
|
logrus.Errorf("Cannot get exit code: %v", err)
|
||||||
report.ExitCode = define.ExecErrorCodeNotFound
|
report.ExitCode = define.ExecErrorCodeNotFound
|
||||||
return &report, nil // nolint: nilerr
|
return &report, nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
|
|
||||||
report.ExitCode = lastEvent.ContainerExitCode
|
report.ExitCode = lastEvent.ContainerExitCode
|
||||||
|
@ -86,7 +86,7 @@ func Contains(err error, sub error) bool {
|
|||||||
// PodConflictErrorModel is used in remote connections with podman
|
// PodConflictErrorModel is used in remote connections with podman
|
||||||
type PodConflictErrorModel struct {
|
type PodConflictErrorModel struct {
|
||||||
Errs []string
|
Errs []string
|
||||||
Id string // nolint
|
Id string //nolint:revive,stylecheck
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorModel is used in remote connections with podman
|
// ErrorModel is used in remote connections with podman
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestRuntimeConfigFilter(t *testing.T) {
|
func TestRuntimeConfigFilter(t *testing.T) {
|
||||||
unexpectedEndOfJSONInput := json.Unmarshal([]byte("{\n"), nil) //nolint
|
unexpectedEndOfJSONInput := json.Unmarshal([]byte("{\n"), nil) //nolint:govet // this should force the error
|
||||||
fileMode := os.FileMode(0600)
|
fileMode := os.FileMode(0600)
|
||||||
rootUint32 := uint32(0)
|
rootUint32 := uint32(0)
|
||||||
binUser := int(1)
|
binUser := int(1)
|
||||||
|
@ -138,7 +138,6 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// Errors that could happen while parsing a string.
|
// Errors that could happen while parsing a string.
|
||||||
//nolint:revive
|
|
||||||
ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'")
|
ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'")
|
||||||
ErrNumeric = errors.New("unable to parse numeric part of quantity")
|
ErrNumeric = errors.New("unable to parse numeric part of quantity")
|
||||||
ErrSuffix = errors.New("unable to parse quantity's suffix")
|
ErrSuffix = errors.New("unable to parse quantity's suffix")
|
||||||
@ -258,7 +257,7 @@ Suffix:
|
|||||||
// we encountered a non decimal in the Suffix loop, but the last character
|
// we encountered a non decimal in the Suffix loop, but the last character
|
||||||
// was not a valid exponent
|
// was not a valid exponent
|
||||||
err = ErrFormatWrong
|
err = ErrFormatWrong
|
||||||
// nolint:nakedret
|
//nolint:nakedret
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,9 +578,9 @@ func (q Quantity) MarshalJSON() ([]byte, error) {
|
|||||||
// if CanonicalizeBytes needed more space than our slice provided, we may need to allocate again so use
|
// if CanonicalizeBytes needed more space than our slice provided, we may need to allocate again so use
|
||||||
// append
|
// append
|
||||||
result = result[:1]
|
result = result[:1]
|
||||||
result = append(result, number...) // nolint: makezero
|
result = append(result, number...) //nolint: makezero
|
||||||
result = append(result, suffix...) // nolint: makezero
|
result = append(result, suffix...) //nolint: makezero
|
||||||
result = append(result, '"') // nolint: makezero
|
result = append(result, '"') //nolint: makezero
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ func getStreamURL(streamType string) url2.URL {
|
|||||||
|
|
||||||
// This should get Exported and stay put as it will apply to all fcos downloads
|
// This should get Exported and stay put as it will apply to all fcos downloads
|
||||||
// getFCOS parses fedoraCoreOS's stream and returns the image download URL and the release version
|
// getFCOS parses fedoraCoreOS's stream and returns the image download URL and the release version
|
||||||
func GetFCOSDownload(imageStream string) (*FcosDownloadInfo, error) { //nolint:staticcheck
|
func GetFCOSDownload(imageStream string) (*FcosDownloadInfo, error) {
|
||||||
var (
|
var (
|
||||||
fcosstable stream.Stream
|
fcosstable stream.Stream
|
||||||
altMeta release.Release
|
altMeta release.Release
|
||||||
|
@ -770,7 +770,7 @@ func (v *MachineVM) Stop(_ string, _ machine.StopOptions) error {
|
|||||||
|
|
||||||
if err := qmpMonitor.Disconnect(); err != nil {
|
if err := qmpMonitor.Disconnect(); err != nil {
|
||||||
// FIXME: this error should probably be returned
|
// FIXME: this error should probably be returned
|
||||||
return nil // nolint: nilerr
|
return nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnected = true
|
disconnected = true
|
||||||
|
@ -50,7 +50,7 @@ func TryJoinPauseProcess(pausePidPath string) (bool, int, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
// It is still failing. We can safely remove it.
|
// It is still failing. We can safely remove it.
|
||||||
os.Remove(pausePidPath)
|
os.Remove(pausePidPath)
|
||||||
return false, -1, nil // nolint: nilerr
|
return false, -1, nil //nolint: nilerr
|
||||||
}
|
}
|
||||||
return became, ret, err
|
return became, ret, err
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ func addDevice(g *generate.Generator, device string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ParseDevice parses device mapping string to a src, dest & permissions string
|
// ParseDevice parses device mapping string to a src, dest & permissions string
|
||||||
func ParseDevice(device string) (string, string, string, error) { //nolint
|
func ParseDevice(device string) (string, string, string, error) {
|
||||||
var src string
|
var src string
|
||||||
var dst string
|
var dst string
|
||||||
permissions := "rwm"
|
permissions := "rwm"
|
||||||
|
@ -303,8 +303,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error {
|
|||||||
if err := unix.Stat(k, &statT); err != nil {
|
if err := unix.Stat(k, &statT); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
if s.ResourceLimits.BlockIO == nil {
|
if s.ResourceLimits.BlockIO == nil {
|
||||||
s.ResourceLimits.BlockIO = new(spec.LinuxBlockIO)
|
s.ResourceLimits.BlockIO = new(spec.LinuxBlockIO)
|
||||||
}
|
}
|
||||||
@ -317,8 +317,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error {
|
|||||||
if err := unix.Stat(k, &statT); err != nil {
|
if err := unix.Stat(k, &statT); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice, v)
|
s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteBpsDevice, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -328,8 +328,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error {
|
|||||||
if err := unix.Stat(k, &statT); err != nil {
|
if err := unix.Stat(k, &statT); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice, v)
|
s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleReadIOPSDevice, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -339,8 +339,8 @@ func FinishThrottleDevices(s *specgen.SpecGenerator) error {
|
|||||||
if err := unix.Stat(k, &statT); err != nil {
|
if err := unix.Stat(k, &statT); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Major = (int64(unix.Major(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) // nolint: unconvert
|
v.Minor = (int64(unix.Minor(uint64(statT.Rdev)))) //nolint: unconvert
|
||||||
s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice, v)
|
s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice = append(s.ResourceLimits.BlockIO.ThrottleWriteIOPSDevice, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,7 +371,7 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
|
|||||||
if err := unix.Stat(k, &statT); err != nil {
|
if err := unix.Stat(k, &statT); err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to inspect '%s' in --blkio-weight-device", k)
|
return nil, errors.Wrapf(err, "failed to inspect '%s' in --blkio-weight-device", k)
|
||||||
}
|
}
|
||||||
g.AddLinuxResourcesBlockIOWeightDevice((int64(unix.Major(uint64(statT.Rdev)))), (int64(unix.Minor(uint64(statT.Rdev)))), *v.Weight) // nolint: unconvert
|
g.AddLinuxResourcesBlockIOWeightDevice((int64(unix.Major(uint64(statT.Rdev)))), (int64(unix.Minor(uint64(statT.Rdev)))), *v.Weight) //nolint: unconvert
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockAccessToKernelFilesystems(s.Privileged, s.PidNS.IsHost(), s.Mask, s.Unmask, &g)
|
BlockAccessToKernelFilesystems(s.Privileged, s.PidNS.IsHost(), s.Mask, s.Unmask, &g)
|
||||||
|
@ -176,7 +176,7 @@ func DeviceFromPath(path string) (*spec.LinuxDevice, error) {
|
|||||||
var (
|
var (
|
||||||
devType string
|
devType string
|
||||||
mode = stat.Mode
|
mode = stat.Mode
|
||||||
devNumber = uint64(stat.Rdev) // nolint: unconvert
|
devNumber = uint64(stat.Rdev) //nolint: unconvert
|
||||||
m = os.FileMode(mode)
|
m = os.FileMode(mode)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ var (
|
|||||||
CGROUP_MANAGER = "systemd" //nolint:revive,stylecheck
|
CGROUP_MANAGER = "systemd" //nolint:revive,stylecheck
|
||||||
RESTORE_IMAGES = []string{ALPINE, BB, nginx} //nolint:revive,stylecheck
|
RESTORE_IMAGES = []string{ALPINE, BB, nginx} //nolint:revive,stylecheck
|
||||||
defaultWaitTimeout = 90
|
defaultWaitTimeout = 90
|
||||||
CGROUPSV2, _ = cgroups.IsCgroup2UnifiedMode() //nolint:revive,stylecheck
|
CGROUPSV2, _ = cgroups.IsCgroup2UnifiedMode()
|
||||||
)
|
)
|
||||||
|
|
||||||
// PodmanTestIntegration struct for command line options
|
// PodmanTestIntegration struct for command line options
|
||||||
|
Reference in New Issue
Block a user