mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
Fix typos
Software version used https://github.com/crate-ci/typos/releases/tag/v1.13.10 The binary was downloaded from https://github.com/crate-ci/typos/releases/download/v1.13.10/typos-v1.13.10-x86_64-unknown-linux-musl.tar.gz Command that was run: typos --write-changes docs cmd cni contrib dependencies docs hack libpod pkg utils False positives were manually removed. A few marshaling/existant typos were manually fixed. Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
This commit is contained in:
@ -17,8 +17,8 @@ const sizeWithUnitFormat = "(format: `<number>[<unit>]`, where unit = b (bytes),
|
|||||||
var podmanConfig = registry.PodmanConfig()
|
var podmanConfig = registry.PodmanConfig()
|
||||||
|
|
||||||
// ContainerToPodOptions takes the Container and Pod Create options, assigning the matching values back to podCreate for the purpose of the libpod API
|
// ContainerToPodOptions takes the Container and Pod Create options, assigning the matching values back to podCreate for the purpose of the libpod API
|
||||||
// For this function to succeed, the JSON tags in PodCreateOptions and ContainerCreateOptions need to match due to the Marshaling and Unmarshaling done.
|
// For this function to succeed, the JSON tags in PodCreateOptions and ContainerCreateOptions need to match due to the Marshalling and Unmarshalling done.
|
||||||
// The types of the options also need to match or else the unmarshaling will fail even if the tags match
|
// The types of the options also need to match or else the unmarshalling will fail even if the tags match
|
||||||
func ContainerToPodOptions(containerCreate *entities.ContainerCreateOptions, podCreate *entities.PodCreateOptions) error {
|
func ContainerToPodOptions(containerCreate *entities.ContainerCreateOptions, podCreate *entities.PodCreateOptions) error {
|
||||||
contMarshal, err := json.Marshal(containerCreate)
|
contMarshal, err := json.Marshal(containerCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -780,15 +780,15 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
|
|||||||
)
|
)
|
||||||
_ = cmd.RegisterFlagCompletionFunc(pidFlagName, AutocompleteNamespace)
|
_ = cmd.RegisterFlagCompletionFunc(pidFlagName, AutocompleteNamespace)
|
||||||
|
|
||||||
volumeDesciption := "Bind mount a volume into the container"
|
volumeDescription := "Bind mount a volume into the container"
|
||||||
if registry.IsRemote() {
|
if registry.IsRemote() {
|
||||||
volumeDesciption = "Bind mount a volume into the container. Volume source will be on the server machine, not the client"
|
volumeDescription = "Bind mount a volume into the container. Volume source will be on the server machine, not the client"
|
||||||
}
|
}
|
||||||
volumeFlagName := "volume"
|
volumeFlagName := "volume"
|
||||||
createFlags.StringArrayVarP(
|
createFlags.StringArrayVarP(
|
||||||
&cf.Volume,
|
&cf.Volume,
|
||||||
volumeFlagName, "v", cf.Volume,
|
volumeFlagName, "v", cf.Volume,
|
||||||
volumeDesciption,
|
volumeDescription,
|
||||||
)
|
)
|
||||||
_ = cmd.RegisterFlagCompletionFunc(volumeFlagName, AutocompleteVolumeFlag)
|
_ = cmd.RegisterFlagCompletionFunc(volumeFlagName, AutocompleteVolumeFlag)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
generateOptions = entities.GenerateKubeOptions{}
|
generateOptions = entities.GenerateKubeOptions{}
|
||||||
generateFile = ""
|
generateFile = ""
|
||||||
generateDescription = `Command generates Kubernetes Pod, Service or PersistenVolumeClaim YAML (v1 specification) from Podman containers, pods or volumes.
|
generateDescription = `Command generates Kubernetes Pod, Service or PersistentVolumeClaim YAML (v1 specification) from Podman containers, pods or volumes.
|
||||||
|
|
||||||
Whether the input is for a container or pod, Podman will always generate the specification as a pod.`
|
Whether the input is for a container or pod, Podman will always generate the specification as a pod.`
|
||||||
|
|
||||||
|
@ -281,7 +281,7 @@ func isUnambiguousName(imageName string) bool {
|
|||||||
//
|
//
|
||||||
// We implement a simple version of this from scratch here to avoid
|
// We implement a simple version of this from scratch here to avoid
|
||||||
// a huge dependency in the generator just for a warning.
|
// a huge dependency in the generator just for a warning.
|
||||||
func warnIfAmbigiousName(container *parser.UnitFile) {
|
func warnIfAmbiguousName(container *parser.UnitFile) {
|
||||||
imageName, ok := container.Lookup(quadlet.ContainerGroup, quadlet.KeyImage)
|
imageName, ok := container.Lookup(quadlet.ContainerGroup, quadlet.KeyImage)
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
@ -347,7 +347,7 @@ func main() {
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case strings.HasSuffix(name, ".container"):
|
case strings.HasSuffix(name, ".container"):
|
||||||
warnIfAmbigiousName(unit)
|
warnIfAmbiguousName(unit)
|
||||||
service, err = quadlet.ConvertContainer(unit, isUser)
|
service, err = quadlet.ConvertContainer(unit, isUser)
|
||||||
case strings.HasSuffix(name, ".volume"):
|
case strings.HasSuffix(name, ".volume"):
|
||||||
service, err = quadlet.ConvertVolume(unit, name)
|
service, err = quadlet.ConvertVolume(unit, name)
|
||||||
|
@ -297,7 +297,7 @@ $SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP}
|
|||||||
[+0248s] test_list_container (compat.test_containers.TestContainers) ... ok
|
[+0248s] test_list_container (compat.test_containers.TestContainers) ... ok
|
||||||
[+0252s] test_mount_preexisting_dir (compat.test_containers.TestContainers) ... ok
|
[+0252s] test_mount_preexisting_dir (compat.test_containers.TestContainers) ... ok
|
||||||
[+0253s] test_mount_rw_by_default (compat.test_containers.TestContainers) ... ok
|
[+0253s] test_mount_rw_by_default (compat.test_containers.TestContainers) ... ok
|
||||||
[+0257s] test_non_existant_workdir (compat.test_containers.TestContainers) ... ok
|
[+0257s] test_non_existent_workdir (compat.test_containers.TestContainers) ... ok
|
||||||
[+0258s] test_pause_container (compat.test_containers.TestContainers) ... ok
|
[+0258s] test_pause_container (compat.test_containers.TestContainers) ... ok
|
||||||
[+0260s] test_pause_stopped_container (compat.test_containers.TestContainers) ... ok
|
[+0260s] test_pause_stopped_container (compat.test_containers.TestContainers) ... ok
|
||||||
[+0261s] test_remove_container (compat.test_containers.TestContainers) ... ok
|
[+0261s] test_remove_container (compat.test_containers.TestContainers) ... ok
|
||||||
@ -366,7 +366,7 @@ $SCRIPT_BASE/integration_test.sh |& ${TIMESTAMP}
|
|||||||
<span class="timestamp">[+0248s] </span><span class='bats-passed'>test_list_container (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0248s] </span><span class='bats-passed'>test_list_container (compat.test_containers.TestContainers) ... ok</span>
|
||||||
<span class="timestamp">[+0252s] </span><span class='bats-passed'>test_mount_preexisting_dir (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0252s] </span><span class='bats-passed'>test_mount_preexisting_dir (compat.test_containers.TestContainers) ... ok</span>
|
||||||
<span class="timestamp">[+0253s] </span><span class='bats-passed'>test_mount_rw_by_default (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0253s] </span><span class='bats-passed'>test_mount_rw_by_default (compat.test_containers.TestContainers) ... ok</span>
|
||||||
<span class="timestamp">[+0257s] </span><span class='bats-passed'>test_non_existant_workdir (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0257s] </span><span class='bats-passed'>test_non_existent_workdir (compat.test_containers.TestContainers) ... ok</span>
|
||||||
<span class="timestamp">[+0258s] </span><span class='bats-passed'>test_pause_container (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0258s] </span><span class='bats-passed'>test_pause_container (compat.test_containers.TestContainers) ... ok</span>
|
||||||
<span class="timestamp">[+0260s] </span><span class='bats-passed'>test_pause_stopped_container (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0260s] </span><span class='bats-passed'>test_pause_stopped_container (compat.test_containers.TestContainers) ... ok</span>
|
||||||
<span class="timestamp">[+0261s] </span><span class='bats-passed'>test_remove_container (compat.test_containers.TestContainers) ... ok</span>
|
<span class="timestamp">[+0261s] </span><span class='bats-passed'>test_remove_container (compat.test_containers.TestContainers) ... ok</span>
|
||||||
|
@ -61,7 +61,7 @@ while ($ljob.HasMoreData) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($pjob.State -eq 'Failed') {
|
if ($pjob.State -eq 'Failed') {
|
||||||
Write-Output "Failure occured, see above. Extra info:"
|
Write-Output "Failure occurred, see above. Extra info:"
|
||||||
Receive-Job $pjob
|
Receive-Job $pjob
|
||||||
throw "wsl task failed on us!"
|
throw "wsl task failed on us!"
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ so networks have to be created again after a backend change.
|
|||||||
| prune | [podman-network-prune(1)](podman-network-prune.1.md) | Remove all unused networks |
|
| prune | [podman-network-prune(1)](podman-network-prune.1.md) | Remove all unused networks |
|
||||||
| reload | [podman-network-reload(1)](podman-network-reload.1.md) | Reload network configuration for containers |
|
| reload | [podman-network-reload(1)](podman-network-reload.1.md) | Reload network configuration for containers |
|
||||||
| rm | [podman-network-rm(1)](podman-network-rm.1.md) | Remove one or more networks |
|
| rm | [podman-network-rm(1)](podman-network-rm.1.md) | Remove one or more networks |
|
||||||
| update | [podman-network-upate(1)](podman-network-update.1.md) | Update an existing Podman network |
|
| update | [podman-network-update(1)](podman-network-update.1.md) | Update an existing Podman network |
|
||||||
|
|
||||||
## SEE ALSO
|
## SEE ALSO
|
||||||
**[podman(1)](podman.1.md)**, **[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)**
|
**[podman(1)](podman.1.md)**, **[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)**
|
||||||
|
@ -590,7 +590,7 @@ Valid options for `[Volume]` are listed below:
|
|||||||
| ----------------- | ------------------ |
|
| ----------------- | ------------------ |
|
||||||
| Device=tmpfs | --opt device=tmpfs |
|
| Device=tmpfs | --opt device=tmpfs |
|
||||||
| Copy=true | --opt copy |
|
| Copy=true | --opt copy |
|
||||||
| Groupt=192 | --opt group=192 |
|
| Group=192 | --opt group=192 |
|
||||||
| Label="foo=bar" | --label "foo=bar" |
|
| Label="foo=bar" | --label "foo=bar" |
|
||||||
| Options=XYZ | --opt XYZ |
|
| Options=XYZ | --opt XYZ |
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Generate ssh keys with an empty passphrase
|
|||||||
|
|
||||||
ssh-keygen -t ed25519 -f C:\qemu-remote\remote
|
ssh-keygen -t ed25519 -f C:\qemu-remote\remote
|
||||||
|
|
||||||
### Ingition for FCOS
|
### Ignition for FCOS
|
||||||
|
|
||||||
Create ignition file C:\qemu-remote\remote.ign with the content of
|
Create ignition file C:\qemu-remote\remote.ign with the content of
|
||||||
```
|
```
|
||||||
|
@ -72,7 +72,7 @@ type BoltState struct {
|
|||||||
// for the exit file to be written and another process removes it along with
|
// for the exit file to be written and another process removes it along with
|
||||||
// the container during auto-removal. The same race would happen trying to
|
// the container during auto-removal. The same race would happen trying to
|
||||||
// read the exit code from the containers bucket. Hence, exit codes go into
|
// read the exit code from the containers bucket. Hence, exit codes go into
|
||||||
// their own bucket. To avoid the rather expensive JSON (un)marshaling, we
|
// their own bucket. To avoid the rather expensive JSON (un)marshalling, we
|
||||||
// have two buckets: one for the exit codes, the other for the timestamps.
|
// have two buckets: one for the exit codes, the other for the timestamps.
|
||||||
|
|
||||||
// NewBoltState creates a new bolt-backed state database
|
// NewBoltState creates a new bolt-backed state database
|
||||||
@ -1383,7 +1383,7 @@ func (s *BoltState) AddContainerExitCode(id string, exitCode int32) error {
|
|||||||
rawExitCode := []byte(strconv.Itoa(int(exitCode)))
|
rawExitCode := []byte(strconv.Itoa(int(exitCode)))
|
||||||
rawTimeStamp, err := time.Now().MarshalText()
|
rawTimeStamp, err := time.Now().MarshalText()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("marshaling exit-code time stamp: %w", err)
|
return fmt.Errorf("marshalling exit-code time stamp: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return db.Update(func(tx *bolt.Tx) error {
|
return db.Update(func(tx *bolt.Tx) error {
|
||||||
|
@ -1911,7 +1911,7 @@ func WithInfraConfig(compatibleOptions InfraInherit) CtrCreateOption {
|
|||||||
|
|
||||||
err = json.Unmarshal(compatMarshal, ctr.config)
|
err = json.Unmarshal(compatMarshal, ctr.config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("could not unmarshal compatible options into contrainer config")
|
return errors.New("could not unmarshal compatible options into container config")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -238,8 +238,8 @@ func (s *APIServer) registerNetworkHandlers(r *mux.Router) error {
|
|||||||
// ---
|
// ---
|
||||||
// tags:
|
// tags:
|
||||||
// - networks
|
// - networks
|
||||||
// summary: Update exisiting podman network
|
// summary: Update existing podman network
|
||||||
// description: Update exisiting podman network
|
// description: Update existing podman network
|
||||||
// produces:
|
// produces:
|
||||||
// - application/json
|
// - application/json
|
||||||
// parameters:
|
// parameters:
|
||||||
|
@ -15,7 +15,7 @@ var (
|
|||||||
|
|
||||||
func handleError(data []byte, unmarshalErrorInto interface{}) error {
|
func handleError(data []byte, unmarshalErrorInto interface{}) error {
|
||||||
if err := json.Unmarshal(data, unmarshalErrorInto); err != nil {
|
if err := json.Unmarshal(data, unmarshalErrorInto); err != nil {
|
||||||
return fmt.Errorf("unmarshaling error into %#v, data %q: %w", unmarshalErrorInto, string(data), err)
|
return fmt.Errorf("unmarshalling error into %#v, data %q: %w", unmarshalErrorInto, string(data), err)
|
||||||
}
|
}
|
||||||
return unmarshalErrorInto.(error)
|
return unmarshalErrorInto.(error)
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ func (h APIResponse) ProcessWithError(unmarshalInto interface{}, unmarshalErrorI
|
|||||||
if h.IsSuccess() || h.IsRedirection() {
|
if h.IsSuccess() || h.IsRedirection() {
|
||||||
if unmarshalInto != nil {
|
if unmarshalInto != nil {
|
||||||
if err := json.Unmarshal(data, unmarshalInto); err != nil {
|
if err := json.Unmarshal(data, unmarshalInto); err != nil {
|
||||||
return fmt.Errorf("unmarshaling into %#v, data %q: %w", unmarshalInto, string(data), err)
|
return fmt.Errorf("unmarshalling into %#v, data %q: %w", unmarshalInto, string(data), err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ func RemoteArgLength(input string, side int) int {
|
|||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSerivceInformation takes the parsed list of hosts to connect to and validates the information
|
// GetServiceInformation takes the parsed list of hosts to connect to and validates the information
|
||||||
func GetServiceInformation(sshInfo *entities.ImageScpConnections, cliConnections []string, cfg *config.Config) (map[string]config.Destination, error) {
|
func GetServiceInformation(sshInfo *entities.ImageScpConnections, cliConnections []string, cfg *config.Config) (map[string]config.Destination, error) {
|
||||||
var serv map[string]config.Destination
|
var serv map[string]config.Destination
|
||||||
var urlS string
|
var urlS string
|
||||||
|
@ -77,7 +77,7 @@ func CloseQuiet(f *os.File) {
|
|||||||
|
|
||||||
// Contains checks if err's message contains sub's message. Contains should be
|
// Contains checks if err's message contains sub's message. Contains should be
|
||||||
// used iff either err or sub has lost type information (e.g., due to
|
// used iff either err or sub has lost type information (e.g., due to
|
||||||
// marshaling). For typed errors, please use `errors.Contains(...)` or `Is()`
|
// marshalling). For typed errors, please use `errors.Contains(...)` or `Is()`
|
||||||
// in recent version of Go.
|
// in recent version of Go.
|
||||||
func Contains(err error, sub error) bool {
|
func Contains(err error, sub error) bool {
|
||||||
return strings.Contains(err.Error(), sub.Error())
|
return strings.Contains(err.Error(), sub.Error())
|
||||||
|
@ -29,7 +29,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Quantity is a fixed-point representation of a number.
|
// Quantity is a fixed-point representation of a number.
|
||||||
// It provides convenient marshaling/unmarshaling in JSON and YAML,
|
// It provides convenient marshalling/unmarshalling in JSON and YAML,
|
||||||
// in addition to String() and AsInt64() accessors.
|
// in addition to String() and AsInt64() accessors.
|
||||||
//
|
//
|
||||||
// The serialization format is:
|
// The serialization format is:
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Duration is a wrapper around time.Duration which supports correct
|
// Duration is a wrapper around time.Duration which supports correct
|
||||||
// marshaling to YAML and JSON. In particular, it marshals into strings, which
|
// marshalling to YAML and JSON. In particular, it marshals into strings, which
|
||||||
// can be used as map keys in json.
|
// can be used as map keys in json.
|
||||||
type Duration struct {
|
type Duration struct {
|
||||||
time.Duration
|
time.Duration
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Time is a wrapper around time.Time which supports correct
|
// Time is a wrapper around time.Time which supports correct
|
||||||
// marshaling to YAML and JSON. Wrappers are provided for many
|
// marshalling to YAML and JSON. Wrappers are provided for many
|
||||||
// of the factory methods that the time package offers.
|
// of the factory methods that the time package offers.
|
||||||
//
|
//
|
||||||
// +protobuf.options.marshal=false
|
// +protobuf.options.marshal=false
|
||||||
|
@ -25,7 +25,7 @@ func (s *sshMachine) withUsername(name string) *sshMachine { //nolint:unused
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sshMachine) withSSHComand(sshCommand []string) *sshMachine {
|
func (s *sshMachine) withSSHCommand(sshCommand []string) *sshMachine {
|
||||||
s.sshCommand = sshCommand
|
s.sshCommand = sshCommand
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
@ -109,19 +109,19 @@ var _ = Describe("podman machine init", func() {
|
|||||||
Expect(startSession).To(Exit(0))
|
Expect(startSession).To(Exit(0))
|
||||||
|
|
||||||
sshCPU := sshMachine{}
|
sshCPU := sshMachine{}
|
||||||
CPUsession, err := mb.setName(name).setCmd(sshCPU.withSSHComand([]string{"lscpu", "|", "grep", "\"CPU(s):\"", "|", "head", "-1"})).run()
|
CPUsession, err := mb.setName(name).setCmd(sshCPU.withSSHCommand([]string{"lscpu", "|", "grep", "\"CPU(s):\"", "|", "head", "-1"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(CPUsession).To(Exit(0))
|
Expect(CPUsession).To(Exit(0))
|
||||||
Expect(CPUsession.outputToString()).To(ContainSubstring("2"))
|
Expect(CPUsession.outputToString()).To(ContainSubstring("2"))
|
||||||
|
|
||||||
sshDisk := sshMachine{}
|
sshDisk := sshMachine{}
|
||||||
diskSession, err := mb.setName(name).setCmd(sshDisk.withSSHComand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
|
diskSession, err := mb.setName(name).setCmd(sshDisk.withSSHCommand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(diskSession).To(Exit(0))
|
Expect(diskSession).To(Exit(0))
|
||||||
Expect(diskSession.outputToString()).To(ContainSubstring("102 GiB"))
|
Expect(diskSession.outputToString()).To(ContainSubstring("102 GiB"))
|
||||||
|
|
||||||
sshMemory := sshMachine{}
|
sshMemory := sshMachine{}
|
||||||
memorySession, err := mb.setName(name).setCmd(sshMemory.withSSHComand([]string{"cat", "/proc/meminfo", "|", "grep", "-i", "'memtotal'", "|", "grep", "-o", "'[[:digit:]]*'"})).run()
|
memorySession, err := mb.setName(name).setCmd(sshMemory.withSSHCommand([]string{"cat", "/proc/meminfo", "|", "grep", "-i", "'memtotal'", "|", "grep", "-o", "'[[:digit:]]*'"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(memorySession).To(Exit(0))
|
Expect(memorySession).To(Exit(0))
|
||||||
foundMemory, err := strconv.Atoi(memorySession.outputToString())
|
foundMemory, err := strconv.Atoi(memorySession.outputToString())
|
||||||
@ -130,7 +130,7 @@ var _ = Describe("podman machine init", func() {
|
|||||||
Expect(foundMemory).To(BeNumerically("<", 4200000))
|
Expect(foundMemory).To(BeNumerically("<", 4200000))
|
||||||
|
|
||||||
sshTimezone := sshMachine{}
|
sshTimezone := sshMachine{}
|
||||||
timezoneSession, err := mb.setName(name).setCmd(sshTimezone.withSSHComand([]string{"date"})).run()
|
timezoneSession, err := mb.setName(name).setCmd(sshTimezone.withSSHCommand([]string{"date"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(timezoneSession).To(Exit(0))
|
Expect(timezoneSession).To(Exit(0))
|
||||||
Expect(timezoneSession.outputToString()).To(ContainSubstring("HST"))
|
Expect(timezoneSession.outputToString()).To(ContainSubstring("HST"))
|
||||||
@ -156,7 +156,7 @@ var _ = Describe("podman machine init", func() {
|
|||||||
Expect(startSession).To(Exit(0))
|
Expect(startSession).To(Exit(0))
|
||||||
|
|
||||||
ssh2 := sshMachine{}
|
ssh2 := sshMachine{}
|
||||||
sshSession2, err := mb.setName(name).setCmd(ssh2.withSSHComand([]string{"ls /testmountdir"})).run()
|
sshSession2, err := mb.setName(name).setCmd(ssh2.withSSHCommand([]string{"ls /testmountdir"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(sshSession2).To(Exit(0))
|
Expect(sshSession2).To(Exit(0))
|
||||||
Expect(sshSession2.outputToString()).To(ContainSubstring("example"))
|
Expect(sshSession2.outputToString()).To(ContainSubstring("example"))
|
||||||
|
@ -44,19 +44,19 @@ var _ = Describe("podman machine set", func() {
|
|||||||
Expect(startSession).To(Exit(0))
|
Expect(startSession).To(Exit(0))
|
||||||
|
|
||||||
sshCPU := sshMachine{}
|
sshCPU := sshMachine{}
|
||||||
CPUsession, err := mb.setName(name).setCmd(sshCPU.withSSHComand([]string{"lscpu", "|", "grep", "\"CPU(s):\"", "|", "head", "-1"})).run()
|
CPUsession, err := mb.setName(name).setCmd(sshCPU.withSSHCommand([]string{"lscpu", "|", "grep", "\"CPU(s):\"", "|", "head", "-1"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(CPUsession).To(Exit(0))
|
Expect(CPUsession).To(Exit(0))
|
||||||
Expect(CPUsession.outputToString()).To(ContainSubstring("2"))
|
Expect(CPUsession.outputToString()).To(ContainSubstring("2"))
|
||||||
|
|
||||||
sshDisk := sshMachine{}
|
sshDisk := sshMachine{}
|
||||||
diskSession, err := mb.setName(name).setCmd(sshDisk.withSSHComand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
|
diskSession, err := mb.setName(name).setCmd(sshDisk.withSSHCommand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(diskSession).To(Exit(0))
|
Expect(diskSession).To(Exit(0))
|
||||||
Expect(diskSession.outputToString()).To(ContainSubstring("102 GiB"))
|
Expect(diskSession.outputToString()).To(ContainSubstring("102 GiB"))
|
||||||
|
|
||||||
sshMemory := sshMachine{}
|
sshMemory := sshMachine{}
|
||||||
memorySession, err := mb.setName(name).setCmd(sshMemory.withSSHComand([]string{"cat", "/proc/meminfo", "|", "grep", "-i", "'memtotal'", "|", "grep", "-o", "'[[:digit:]]*'"})).run()
|
memorySession, err := mb.setName(name).setCmd(sshMemory.withSSHCommand([]string{"cat", "/proc/meminfo", "|", "grep", "-i", "'memtotal'", "|", "grep", "-o", "'[[:digit:]]*'"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(memorySession).To(Exit(0))
|
Expect(memorySession).To(Exit(0))
|
||||||
foundMemory, err := strconv.Atoi(memorySession.outputToString())
|
foundMemory, err := strconv.Atoi(memorySession.outputToString())
|
||||||
@ -88,13 +88,13 @@ var _ = Describe("podman machine set", func() {
|
|||||||
Expect(startSession).To(Exit(0))
|
Expect(startSession).To(Exit(0))
|
||||||
|
|
||||||
ssh2 := sshMachine{}
|
ssh2 := sshMachine{}
|
||||||
sshSession2, err := mb.setName(name).setCmd(ssh2.withSSHComand([]string{"lscpu", "|", "grep", "\"CPU(s):\"", "|", "head", "-1"})).run()
|
sshSession2, err := mb.setName(name).setCmd(ssh2.withSSHCommand([]string{"lscpu", "|", "grep", "\"CPU(s):\"", "|", "head", "-1"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(sshSession2).To(Exit(0))
|
Expect(sshSession2).To(Exit(0))
|
||||||
Expect(sshSession2.outputToString()).To(ContainSubstring("1"))
|
Expect(sshSession2.outputToString()).To(ContainSubstring("1"))
|
||||||
|
|
||||||
ssh3 := sshMachine{}
|
ssh3 := sshMachine{}
|
||||||
sshSession3, err := mb.setName(name).setCmd(ssh3.withSSHComand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
|
sshSession3, err := mb.setName(name).setCmd(ssh3.withSSHCommand([]string{"sudo", "fdisk", "-l", "|", "grep", "Disk"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(sshSession3).To(Exit(0))
|
Expect(sshSession3).To(Exit(0))
|
||||||
Expect(sshSession3.outputToString()).To(ContainSubstring("100 GiB"))
|
Expect(sshSession3.outputToString()).To(ContainSubstring("100 GiB"))
|
||||||
|
@ -50,13 +50,13 @@ var _ = Describe("podman machine ssh", func() {
|
|||||||
Expect(session).To(Exit(0))
|
Expect(session).To(Exit(0))
|
||||||
|
|
||||||
ssh := sshMachine{}
|
ssh := sshMachine{}
|
||||||
sshSession, err := mb.setName(name).setCmd(ssh.withSSHComand([]string{"cat", "/etc/os-release"})).run()
|
sshSession, err := mb.setName(name).setCmd(ssh.withSSHCommand([]string{"cat", "/etc/os-release"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(sshSession).To(Exit(0))
|
Expect(sshSession).To(Exit(0))
|
||||||
Expect(sshSession.outputToString()).To(ContainSubstring("Fedora CoreOS"))
|
Expect(sshSession.outputToString()).To(ContainSubstring("Fedora CoreOS"))
|
||||||
|
|
||||||
// keep exit code
|
// keep exit code
|
||||||
sshSession, err = mb.setName(name).setCmd(ssh.withSSHComand([]string{"false"})).run()
|
sshSession, err = mb.setName(name).setCmd(ssh.withSSHCommand([]string{"false"})).run()
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(sshSession).To(Exit(1))
|
Expect(sshSession).To(Exit(1))
|
||||||
Expect(sshSession.outputToString()).To(Equal(""))
|
Expect(sshSession.outputToString()).To(Equal(""))
|
||||||
|
@ -307,8 +307,8 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ConfigToSpec takes a completed container config and converts it back into a specgenerator for purposes of cloning an existing container
|
// ConfigToSpec takes a completed container config and converts it back into a specgenerator for purposes of cloning an existing container
|
||||||
func ConfigToSpec(rt *libpod.Runtime, specg *specgen.SpecGenerator, contaierID string) (*libpod.Container, *libpod.InfraInherit, error) {
|
func ConfigToSpec(rt *libpod.Runtime, specg *specgen.SpecGenerator, containerID string) (*libpod.Container, *libpod.InfraInherit, error) {
|
||||||
c, err := rt.LookupContainer(contaierID)
|
c, err := rt.LookupContainer(containerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ func canMountSys(isRootless, isNewUserns bool, s *specgen.SpecGenerator) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCgroupPermissons(unmask []string) string {
|
func getCgroupPermissions(unmask []string) string {
|
||||||
ro := "ro"
|
ro := "ro"
|
||||||
rw := "rw"
|
rw := "rw"
|
||||||
cgroup := "/sys/fs/cgroup"
|
cgroup := "/sys/fs/cgroup"
|
||||||
@ -71,7 +71,7 @@ func getCgroupPermissons(unmask []string) string {
|
|||||||
|
|
||||||
// SpecGenToOCI returns the base configuration for the container.
|
// SpecGenToOCI returns the base configuration for the container.
|
||||||
func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error) {
|
func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runtime, rtc *config.Config, newImage *libimage.Image, mounts []spec.Mount, pod *libpod.Pod, finalCmd []string, compatibleOptions *libpod.InfraInherit) (*spec.Spec, error) {
|
||||||
cgroupPerm := getCgroupPermissons(s.Unmask)
|
cgroupPerm := getCgroupPermissions(s.Unmask)
|
||||||
|
|
||||||
g, err := generate.New("linux")
|
g, err := generate.New("linux")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -27,9 +27,9 @@ go get github.com/fatih/camelcase
|
|||||||
## Usage and examples
|
## Usage and examples
|
||||||
|
|
||||||
```go
|
```go
|
||||||
splitted := camelcase.Split("GolangPackage")
|
split := camelcase.Split("GolangPackage")
|
||||||
|
|
||||||
fmt.Println(splitted[0], splitted[1]) // prints: "Golang", "Package"
|
fmt.Println(split[0], split[1]) // prints: "Golang", "Package"
|
||||||
```
|
```
|
||||||
|
|
||||||
Both lower camel case and upper camel case are supported. For more info please
|
Both lower camel case and upper camel case are supported. For more info please
|
||||||
|
@ -220,7 +220,7 @@ class TestContainers(common.DockerTestCase):
|
|||||||
_, out = ctr.exec_run(["stat", "-c", "%u:%g", "/workspace"])
|
_, out = ctr.exec_run(["stat", "-c", "%u:%g", "/workspace"])
|
||||||
self.assertEqual(out.rstrip(), b"1042:1043", "UID/GID set in dockerfile")
|
self.assertEqual(out.rstrip(), b"1042:1043", "UID/GID set in dockerfile")
|
||||||
|
|
||||||
def test_non_existant_workdir(self):
|
def test_non_existent_workdir(self):
|
||||||
dockerfile = (
|
dockerfile = (
|
||||||
b"FROM quay.io/libpod/alpine:latest\n"
|
b"FROM quay.io/libpod/alpine:latest\n"
|
||||||
b"USER root\n"
|
b"USER root\n"
|
||||||
@ -233,7 +233,7 @@ class TestContainers(common.DockerTestCase):
|
|||||||
image=img.id,
|
image=img.id,
|
||||||
detach=True,
|
detach=True,
|
||||||
command="top",
|
command="top",
|
||||||
volumes=["test_non_existant_workdir:/workspace"],
|
volumes=["test_non_existent_workdir:/workspace"],
|
||||||
)
|
)
|
||||||
ctr.start()
|
ctr.start()
|
||||||
ret, _ = ctr.exec_run(["stat", "/workspace/scratch/test"])
|
ret, _ = ctr.exec_run(["stat", "/workspace/scratch/test"])
|
||||||
|
Reference in New Issue
Block a user