mirror of
https://github.com/containers/podman.git
synced 2025-07-02 08:47:43 +08:00
set !remote build tags where needed
The new golangci-lint version 1.60.1 has problems with typecheck when linting remote files. We have certain pakcages that should never be inlcuded in remote but the typecheck tries to compile all of them but this never works and it seems to ignore the exclude files we gave it. To fix this the proper way is to mark all packages we only use locally with !remote tags. This is a bit ugly but more correct. I also moved the DecodeChanges() code around as it is called from the client so the handles package which should only be remote doesn't really fit anyway. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build linux && !remote
|
||||
// +build linux,!remote
|
||||
|
||||
package main
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
//go:build !linux || remote
|
||||
// +build !linux remote
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/containers/podman/v5/pkg/domain/entities"
|
||||
|
||||
const engineMode = entities.TunnelMode
|
||||
|
||||
func storeBefore() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func storeAfter() error {
|
||||
return nil
|
||||
}
|
@ -9,7 +9,6 @@ import (
|
||||
"github.com/containers/common/pkg/completion"
|
||||
"github.com/containers/podman/v5/cmd/podman/common"
|
||||
"github.com/containers/podman/v5/cmd/podman/registry"
|
||||
"github.com/containers/podman/v5/pkg/api/handlers"
|
||||
"github.com/containers/podman/v5/pkg/domain/entities"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@ -105,9 +104,6 @@ func commit(cmd *cobra.Command, args []string) error {
|
||||
if !commitOptions.Quiet {
|
||||
commitOptions.Writer = os.Stderr
|
||||
}
|
||||
if len(commitOptions.Changes) > 0 {
|
||||
commitOptions.Changes = handlers.DecodeChanges(commitOptions.Changes)
|
||||
}
|
||||
if len(configFile) > 0 {
|
||||
cfg, err := os.ReadFile(configFile)
|
||||
if err != nil {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package entities
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package entities
|
||||
|
||||
type CreateStorageLayerOptions struct {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package abi
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package abi
|
||||
|
||||
import "github.com/containers/podman/v5/internal/domain/entities"
|
||||
|
@ -1,25 +0,0 @@
|
||||
//go:build remote
|
||||
|
||||
package infra
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
ientities "github.com/containers/podman/v5/internal/domain/entities"
|
||||
"github.com/containers/podman/v5/internal/domain/infra/tunnel"
|
||||
"github.com/containers/podman/v5/pkg/bindings"
|
||||
"github.com/containers/podman/v5/pkg/domain/entities"
|
||||
)
|
||||
|
||||
// NewTestingEngine factory provides a libpod runtime for testing-specific operations
|
||||
func NewTestingEngine(facts *entities.PodmanConfig) (ientities.TestingEngine, error) {
|
||||
switch facts.EngineMode {
|
||||
case entities.ABIMode:
|
||||
return nil, fmt.Errorf("direct image runtime not supported")
|
||||
case entities.TunnelMode:
|
||||
ctx, err := bindings.NewConnectionWithIdentity(context.Background(), facts.URI, facts.Identity, facts.MachineMode)
|
||||
return &tunnel.TestingEngine{ClientCtx: ctx}, err
|
||||
}
|
||||
return nil, fmt.Errorf("runtime mode '%v' is not supported", facts.EngineMode)
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package tunnel
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package tunnel
|
||||
|
||||
import "github.com/containers/podman/v5/internal/domain/entities"
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
@ -137,7 +139,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
|
||||
options.Author = query.Author
|
||||
options.Pause = query.Pause
|
||||
options.Squash = query.Squash
|
||||
options.Changes = handlers.DecodeChanges(query.Changes)
|
||||
options.Changes = util.DecodeChanges(query.Changes)
|
||||
if r.Body != nil {
|
||||
defer r.Body.Close()
|
||||
if options.CommitOptions.OverrideConfig, err = abi.DecodeOverrideConfig(r.Body); err != nil {
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package compat
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package handlers
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
@ -499,7 +501,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) {
|
||||
options.Author = query.Author
|
||||
options.Pause = query.Pause
|
||||
options.Squash = query.Squash
|
||||
options.Changes = handlers.DecodeChanges(query.Changes)
|
||||
options.Changes = util.DecodeChanges(query.Changes)
|
||||
ctr, err := runtime.LookupContainer(query.Container)
|
||||
if err != nil {
|
||||
utils.Error(w, http.StatusNotFound, err)
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package libpod
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
// Package swagger defines the payloads used by the Podman API
|
||||
//
|
||||
// - errors.go: declares the errors used in the API. By embedding errors.ErrorModel, more meaningful
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
//nolint:unused // these types are used to wire generated swagger to API code
|
||||
package swagger
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
//nolint:unused // these types are used to wire generated swagger to API code
|
||||
package swagger
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
//nolint:unused // these types are used to wire generated swagger to API code
|
||||
package swagger
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package apiutil
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package apiutil
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
// Package server supports a RESTful API for the Libpod library
|
||||
//
|
||||
// This documentation describes the Podman v2.x+ RESTful API. It consists of a Docker-compatible
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package idle
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
@ -1,3 +1,5 @@
|
||||
//go:build !remote
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user