mirror of
https://github.com/containers/podman.git
synced 2025-10-25 18:25:59 +08:00
Spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
@ -28,7 +28,7 @@ func replaceNetNS(netNSPath string, ctr *Container, newState *ContainerState) er
|
||||
newState.NetNS = ns
|
||||
} else {
|
||||
if ctr.ensureState(define.ContainerStateRunning, define.ContainerStatePaused) {
|
||||
return errors.Wrapf(err, "error joning network namespace of container %s", ctr.ID())
|
||||
return errors.Wrapf(err, "error joining network namespace of container %s", ctr.ID())
|
||||
}
|
||||
|
||||
logrus.Errorf("error joining network namespace for container %s: %v", ctr.ID(), err)
|
||||
|
||||
@ -571,7 +571,7 @@ func (c *Container) Cleanup(ctx context.Context) error {
|
||||
|
||||
// Batch starts a batch operation on the given container
|
||||
// All commands in the passed function will execute under the same lock and
|
||||
// without syncronyzing state after each operation
|
||||
// without synchronizing state after each operation
|
||||
// This will result in substantial performance benefits when running numerous
|
||||
// commands on the same container
|
||||
// Note that the container passed into the Batch function cannot be removed
|
||||
|
||||
@ -151,7 +151,7 @@ type ContainerRootFSConfig struct {
|
||||
// ContainerSecurityConfig is an embedded sub-config providing security configuration
|
||||
// to the container.
|
||||
type ContainerSecurityConfig struct {
|
||||
// Pirivileged is whether the container is privileged. Privileged
|
||||
// Privileged is whether the container is privileged. Privileged
|
||||
// containers have lessened security and increased access to the system.
|
||||
// Note that this does NOT directly correspond to Podman's --privileged
|
||||
// flag - most of the work of that flag is done in creating the OCI spec
|
||||
|
||||
@ -884,9 +884,9 @@ func (c *Container) startDependencies(ctx context.Context) error {
|
||||
// getAllDependencies is a precursor to starting dependencies.
|
||||
// To start a container with all of its dependencies, we need to recursively find all dependencies
|
||||
// a container has, as well as each of those containers' dependencies, and so on
|
||||
// To do so, keep track of containers already visisted (so there aren't redundant state lookups),
|
||||
// To do so, keep track of containers already visited (so there aren't redundant state lookups),
|
||||
// and recursively search until we have reached the leafs of every dependency node.
|
||||
// Since we need to start all dependencies for our original container to successfully start, we propegate any errors
|
||||
// Since we need to start all dependencies for our original container to successfully start, we propagate any errors
|
||||
// in looking up dependencies.
|
||||
// Note: this function is currently meant as a robust solution to a narrow problem: start an infra-container when
|
||||
// a container in the pod is run. It has not been tested for performance past one level, so expansion of recursive start
|
||||
|
||||
@ -1659,7 +1659,7 @@ func (c *Container) getHosts() string {
|
||||
|
||||
// generateGroupEntry generates an entry or entries into /etc/group as
|
||||
// required by container configuration.
|
||||
// Generatlly speaking, we will make an entry under two circumstances:
|
||||
// Generally speaking, we will make an entry under two circumstances:
|
||||
// 1. The container is started as a specific user:group, and that group is both
|
||||
// numeric, and does not already exist in /etc/group.
|
||||
// 2. It is requested that Libpod add the group that launched Podman to
|
||||
@ -1937,7 +1937,7 @@ func (c *Container) generatePasswdAndGroup() (string, string, error) {
|
||||
needGroup = false
|
||||
}
|
||||
|
||||
// Next, check if we already made the files. If we didn, don't need to
|
||||
// Next, check if we already made the files. If we didn't, don't need to
|
||||
// do anything more.
|
||||
if needPasswd {
|
||||
passwdPath := filepath.Join(c.config.StaticDir, "passwd")
|
||||
|
||||
@ -23,7 +23,7 @@ func (r *Runtime) Log(ctx context.Context, containers []*Container, options *log
|
||||
return nil
|
||||
}
|
||||
|
||||
// ReadLog reads a containers log based on the input options and returns loglines over a channel.
|
||||
// ReadLog reads a containers log based on the input options and returns log lines over a channel.
|
||||
func (c *Container) ReadLog(ctx context.Context, options *logs.LogOptions, logChannel chan *logs.LogLine) error {
|
||||
switch c.LogDriver() {
|
||||
case define.NoLogging:
|
||||
|
||||
@ -14,7 +14,7 @@ func (c *Container) Top(descriptors []string) ([]string, error) {
|
||||
// the container. The output data can be controlled via the `descriptors`
|
||||
// argument which expects format descriptors and supports all AIXformat
|
||||
// descriptors of ps (1) plus some additional ones to for instance inspect the
|
||||
// set of effective capabilities. Eeach element in the returned string slice
|
||||
// set of effective capabilities. Each element in the returned string slice
|
||||
// is a tab-separated string.
|
||||
//
|
||||
// For more details, please refer to github.com/containers/psgo.
|
||||
|
||||
@ -88,7 +88,7 @@ func (c *Container) validate() error {
|
||||
return errors.Wrapf(define.ErrInvalidArg, "cannot add to /etc/hosts if using image's /etc/hosts")
|
||||
}
|
||||
|
||||
// Check named volume, overlay volume and image volume destination conflits
|
||||
// Check named volume, overlay volume and image volume destination conflist
|
||||
destinations := make(map[string]bool)
|
||||
for _, vol := range c.config.NamedVolumes {
|
||||
// Don't check if they already exist.
|
||||
|
||||
@ -157,7 +157,7 @@ type InspectMount struct {
|
||||
// "volume" and "bind".
|
||||
Type string `json:"Type"`
|
||||
// The name of the volume. Empty for bind mounts.
|
||||
Name string `json:"Name,omptempty"`
|
||||
Name string `json:"Name,omitempty"`
|
||||
// The source directory for the volume.
|
||||
Source string `json:"Source"`
|
||||
// The destination directory for the volume. Specified as a path within
|
||||
@ -552,7 +552,7 @@ type InspectBasicNetworkConfig struct {
|
||||
// GlobalIPv6PrefixLen is the length of the subnet mask of this network.
|
||||
GlobalIPv6PrefixLen int `json:"GlobalIPv6PrefixLen"`
|
||||
// SecondaryIPv6Addresses is a list of extra IPv6 Addresses that the
|
||||
// container has been assigned in this networ.
|
||||
// container has been assigned in this network.
|
||||
SecondaryIPv6Addresses []string `json:"SecondaryIPv6Addresses,omitempty"`
|
||||
// MacAddress is the MAC address for the interface in this network.
|
||||
MacAddress string `json:"MacAddress"`
|
||||
|
||||
@ -51,7 +51,7 @@ func (ir *Runtime) DiskUsage(ctx context.Context, images []*Image) ([]DiskUsageS
|
||||
return stats, nil
|
||||
}
|
||||
|
||||
// diskUsageForImage returns the disk-usage statistics for the spcified image.
|
||||
// diskUsageForImage returns the disk-usage statistics for the specified image.
|
||||
func diskUsageForImage(ctx context.Context, image *Image, tree *layerTree) (*DiskUsageStat, error) {
|
||||
stat := DiskUsageStat{
|
||||
ID: image.ID(),
|
||||
|
||||
@ -50,7 +50,7 @@ func decompose(input string) (imageParts, error) {
|
||||
|
||||
// suspiciousRefNameTagValuesForSearch returns a "tag" value used in a previous implementation.
|
||||
// This exists only to preserve existing behavior in heuristic code; it’s dubious that that behavior is correct,
|
||||
// gespecially for the tag value.
|
||||
// especially for the tag value.
|
||||
func (ip *imageParts) suspiciousRefNameTagValuesForSearch() (string, string, string) {
|
||||
registry := reference.Domain(ip.unnormalizedRef)
|
||||
imageName := reference.Path(ip.unnormalizedRef)
|
||||
|
||||
@ -26,7 +26,7 @@ const (
|
||||
type SearchResult struct {
|
||||
// Index is the image index (e.g., "docker.io" or "quay.io")
|
||||
Index string
|
||||
// Name is the canoncical name of the image (e.g., "docker.io/library/alpine").
|
||||
// Name is the canonical name of the image (e.g., "docker.io/library/alpine").
|
||||
Name string
|
||||
// Description of the image.
|
||||
Description string
|
||||
|
||||
@ -403,7 +403,7 @@ func libpodEnvVarsToKubeEnvVars(envs []string) ([]v1.EnvVar, error) {
|
||||
|
||||
// libpodMountsToKubeVolumeMounts converts the containers mounts to a struct kube understands
|
||||
func libpodMountsToKubeVolumeMounts(c *Container) ([]v1.VolumeMount, []v1.Volume, error) {
|
||||
// TjDO when named volumes are supported in play kube, also parse named volumes here
|
||||
// TODO when named volumes are supported in play kube, also parse named volumes here
|
||||
_, mounts := c.sortUserVolumes(c.config.Spec)
|
||||
vms := make([]v1.VolumeMount, 0, len(mounts))
|
||||
vos := make([]v1.Volume, 0, len(mounts))
|
||||
@ -524,7 +524,7 @@ func capAddDrop(caps *specs.LinuxCapabilities) (*v1.Capabilities, error) {
|
||||
defaultCaps = append(defaultCaps, g.Config.Process.Capabilities.Inheritable...)
|
||||
defaultCaps = append(defaultCaps, g.Config.Process.Capabilities.Permitted...)
|
||||
|
||||
// Combine all the container's capabilities into a slic
|
||||
// Combine all the container's capabilities into a slice
|
||||
containerCaps := append(caps.Ambient, caps.Bounding...)
|
||||
containerCaps = append(containerCaps, caps.Effective...)
|
||||
containerCaps = append(containerCaps, caps.Inheritable...)
|
||||
|
||||
@ -137,7 +137,7 @@ func getTailLog(path string, tail int) ([]*LogLine, error) {
|
||||
nllCounter++
|
||||
}
|
||||
}
|
||||
// if we have enough loglines, we can hangup
|
||||
// if we have enough log lines, we can hangup
|
||||
if nllCounter >= tail {
|
||||
break
|
||||
}
|
||||
@ -161,7 +161,7 @@ func getTailLog(path string, tail int) ([]*LogLine, error) {
|
||||
return tailLog, nil
|
||||
}
|
||||
|
||||
// String converts a logline to a string for output given whether a detail
|
||||
// String converts a log line to a string for output given whether a detail
|
||||
// bool is specified.
|
||||
func (l *LogLine) String(options *LogOptions) string {
|
||||
var out string
|
||||
|
||||
@ -61,7 +61,7 @@ func Test_validateBridgeOptions(t *testing.T) {
|
||||
isIPv6: true,
|
||||
},
|
||||
{
|
||||
name: "IPv6 subnet, range and gateway without IPv6 option (PODMAN SUPPORTS IT UNLIKE DOCKEr)",
|
||||
name: "IPv6 subnet, range and gateway without IPv6 option (PODMAN SUPPORTS IT UNLIKE DOCKER)",
|
||||
subnet: net.IPNet{IP: net.ParseIP("2001:DB8::"), Mask: net.IPMask(net.ParseIP("ffff:ffff:ffff::"))},
|
||||
ipRange: net.IPNet{IP: net.ParseIP("2001:DB8:0:0:1::"), Mask: net.IPMask(net.ParseIP("ffff:ffff:ffff:ffff::"))},
|
||||
gateway: net.ParseIP("2001:DB8::2"),
|
||||
|
||||
@ -60,7 +60,7 @@ func NewHostLocalBridge(name string, isGateWay, isDefaultGW, ipMasq bool, mtu in
|
||||
return &hostLocalBridge
|
||||
}
|
||||
|
||||
// NewIPAMHostLocalConf creates a new IPAMHostLocal configfuration
|
||||
// NewIPAMHostLocalConf creates a new IPAMHostLocal configuration
|
||||
func NewIPAMHostLocalConf(routes []IPAMRoute, ipamRanges [][]IPAMLocalHostRangeConf) (IPAMHostLocalConf, error) {
|
||||
ipamConf := IPAMHostLocalConf{
|
||||
PluginType: "host-local",
|
||||
|
||||
@ -1155,7 +1155,7 @@ func (c *Container) NetworkDisconnect(nameOrID, netName string, force bool) erro
|
||||
return c.save()
|
||||
}
|
||||
|
||||
// ConnnectNetwork connects a container to a given network
|
||||
// ConnectNetwork connects a container to a given network
|
||||
func (c *Container) NetworkConnect(nameOrID, netName string, aliases []string) error {
|
||||
networks, err := c.networksByNameIndex()
|
||||
if err != nil {
|
||||
|
||||
@ -56,7 +56,7 @@ type OCIRuntime interface {
|
||||
// a header prepended as follows: 1-byte STREAM (0, 1, 2 for STDIN,
|
||||
// STDOUT, STDERR), 3 null (0x00) bytes, 4-byte big endian length.
|
||||
// If a cancel channel is provided, it can be used to asynchronously
|
||||
// termninate the attach session. Detach keys, if given, will also cause
|
||||
// terminate the attach session. Detach keys, if given, will also cause
|
||||
// the attach session to be terminated if provided via the STDIN
|
||||
// channel. If they are not provided, the default detach keys will be
|
||||
// used instead. Detach keys of "" will disable detaching via keyboard.
|
||||
|
||||
@ -83,7 +83,7 @@ func (c *Container) attach(streams *define.AttachStreams, keys string, resize <-
|
||||
// Attach to the given container's exec session
|
||||
// attachFd and startFd must be open file descriptors
|
||||
// attachFd must be the output side of the fd. attachFd is used for two things:
|
||||
// conmon will first send a nonse value across the pipe indicating it has set up its side of the console socket
|
||||
// conmon will first send a nonce value across the pipe indicating it has set up its side of the console socket
|
||||
// this ensures attachToExec gets all of the output of the called process
|
||||
// conmon will then send the exit code of the exec process, or an error in the exec session
|
||||
// startFd must be the input side of the fd.
|
||||
|
||||
@ -47,7 +47,7 @@ import (
|
||||
|
||||
const (
|
||||
// This is Conmon's STDIO_BUF_SIZE. I don't believe we have access to it
|
||||
// directly from the Go cose, so const it here
|
||||
// directly from the Go code, so const it here
|
||||
bufferSize = conmonConfig.BufSize
|
||||
)
|
||||
|
||||
@ -1413,7 +1413,7 @@ func startCommandGivenSelinux(cmd *exec.Cmd) error {
|
||||
}
|
||||
|
||||
// moveConmonToCgroupAndSignal gets a container's cgroupParent and moves the conmon process to that cgroup
|
||||
// it then signals for conmon to start by sending nonse data down the start fd
|
||||
// it then signals for conmon to start by sending nonce data down the start fd
|
||||
func (r *ConmonOCIRuntime) moveConmonToCgroupAndSignal(ctr *Container, cmd *exec.Cmd, startFd *os.File) error {
|
||||
mustCreateCgroup := true
|
||||
|
||||
@ -1572,7 +1572,7 @@ func readConmonPipeData(pipe *os.File, ociLog string) (int, error) {
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// writeConmonPipeData writes nonse data to a pipe
|
||||
// writeConmonPipeData writes nonce data to a pipe
|
||||
func writeConmonPipeData(pipe *os.File) error {
|
||||
someData := []byte{0}
|
||||
_, err := pipe.Write(someData)
|
||||
|
||||
@ -751,7 +751,7 @@ func WithStopTimeout(timeout uint) CtrCreateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithIDMappings sets the idmappsings for the container
|
||||
// WithIDMappings sets the idmappings for the container
|
||||
func WithIDMappings(idmappings storage.IDMappingOptions) CtrCreateOption {
|
||||
return func(ctr *Container) error {
|
||||
if ctr.valid {
|
||||
|
||||
@ -15,7 +15,7 @@ import (
|
||||
// the pod. The output data can be controlled via the `descriptors`
|
||||
// argument which expects format descriptors and supports all AIXformat
|
||||
// descriptors of ps (1) plus some additional ones to for instance inspect the
|
||||
// set of effective capabilities. Eeach element in the returned string slice
|
||||
// set of effective capabilities. Each element in the returned string slice
|
||||
// is a tab-separated string.
|
||||
//
|
||||
// For more details, please refer to github.com/containers/psgo.
|
||||
|
||||
@ -100,7 +100,7 @@ func DeallocRootlessCNI(ctx context.Context, c *Container) error {
|
||||
}
|
||||
var errs *multierror.Error
|
||||
for _, nw := range networks {
|
||||
err := rootlessCNIInfraCallDelloc(infra, c.ID(), nw)
|
||||
err := rootlessCNIInfraCallDealloc(infra, c.ID(), nw)
|
||||
if err != nil {
|
||||
errs = multierror.Append(errs, err)
|
||||
}
|
||||
@ -154,7 +154,7 @@ func rootlessCNIInfraCallAlloc(infra *Container, id, nw, k8sPodName string) (*cn
|
||||
return &cniRes, nil
|
||||
}
|
||||
|
||||
func rootlessCNIInfraCallDelloc(infra *Container, id, nw string) error {
|
||||
func rootlessCNIInfraCallDealloc(infra *Container, id, nw string) error {
|
||||
logrus.Debugf("rootless CNI: dealloc %q, %q", id, nw)
|
||||
_, err := rootlessCNIInfraExec(infra, "dealloc", id, nw)
|
||||
return err
|
||||
|
||||
@ -230,7 +230,7 @@ func (r *Runtime) Import(ctx context.Context, source, reference, signaturePolicy
|
||||
return newImage.ID(), nil
|
||||
}
|
||||
|
||||
// donwloadFromURL downloads an image in the format "https:/example.com/myimage.tar"
|
||||
// downloadFromURL downloads an image in the format "https:/example.com/myimage.tar"
|
||||
// and temporarily saves in it $TMPDIR/importxyz, which is deleted after the image is imported
|
||||
func downloadFromURL(source string) (string, error) {
|
||||
fmt.Printf("Downloading from %q\n", source)
|
||||
|
||||
@ -882,7 +882,7 @@ func TestRemoveContainer(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestRemoveNonexistantContainerFails(t *testing.T) {
|
||||
func TestRemoveNonexistentContainerFails(t *testing.T) {
|
||||
runForAllStates(t, func(t *testing.T, state State, manager lock.Manager) {
|
||||
testCtr, err := getTestCtr1(manager)
|
||||
assert.NoError(t, err)
|
||||
@ -1513,7 +1513,7 @@ func TestGetNotExistPodWithPods(t *testing.T) {
|
||||
err = state.AddPod(testPod2)
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = state.Pod("notexist")
|
||||
_, err = state.Pod("nonexistent")
|
||||
assert.Error(t, err)
|
||||
})
|
||||
}
|
||||
@ -1748,7 +1748,7 @@ func TestHasPodEmptyIDErrors(t *testing.T) {
|
||||
|
||||
func TestHasPodNoSuchPod(t *testing.T) {
|
||||
runForAllStates(t, func(t *testing.T, state State, manager lock.Manager) {
|
||||
exist, err := state.HasPod("notexist")
|
||||
exist, err := state.HasPod("nonexistent")
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, exist)
|
||||
})
|
||||
|
||||
@ -280,7 +280,7 @@ func writeHijackHeader(r *http.Request, conn io.Writer) {
|
||||
fmt.Fprintf(conn,
|
||||
"HTTP/1.1 200 OK\r\nContent-Type: application/vnd.docker.raw-stream\r\n\r\n")
|
||||
} else {
|
||||
// Upraded
|
||||
// Upgraded
|
||||
fmt.Fprintf(conn,
|
||||
"HTTP/1.1 101 UPGRADED\r\nContent-Type: application/vnd.docker.raw-stream\r\nConnection: Upgrade\r\nUpgrade: %s\r\n\r\n",
|
||||
proto)
|
||||
|
||||
Reference in New Issue
Block a user