mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
Merge pull request #28585 from jaitjacob/gofix/pkg-machine
cleanup: run go fix on pkg/machine for windows
This commit is contained in:
commit
2be2e05d7c
4 changed files with 4 additions and 9 deletions
|
|
@ -174,7 +174,7 @@ var _ = Describe("podman machine init - windows only", func() {
|
||||||
newFileServerVsocks, err := vsock.LoadAllHVSockRegistryEntriesByPurpose(vsock.Fileserver)
|
newFileServerVsocks, err := vsock.LoadAllHVSockRegistryEntriesByPurpose(vsock.Fileserver)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(newFileServerVsocks).To(HaveLen(countFileServerVsocks))
|
Expect(newFileServerVsocks).To(HaveLen(countFileServerVsocks))
|
||||||
for i := 0; i < countFileServerVsocks; i++ {
|
for i := range countFileServerVsocks {
|
||||||
Expect(newFileServerVsocks[i].Port).To(Equal(fileServerVsocks[i].Port))
|
Expect(newFileServerVsocks[i].Port).To(Equal(fileServerVsocks[i].Port))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ func (hv *HVSockRegistryEntry) exists() (bool, error) {
|
||||||
// already being used by another hvsock in the Windows registry.
|
// already being used by another hvsock in the Windows registry.
|
||||||
func findOpenHVSockPort() (uint64, error) {
|
func findOpenHVSockPort() (uint64, error) {
|
||||||
// If we cannot find a free port in 10 attempts, something is wrong
|
// If we cannot find a free port in 10 attempts, something is wrong
|
||||||
for i := 0; i < 10; i++ {
|
for range 10 {
|
||||||
port, err := utils.GetRandomPort()
|
port, err := utils.GetRandomPort()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ func PipeNameAvailable(pipeName string, maxWait time.Duration) bool {
|
||||||
|
|
||||||
func WaitPipeExists(pipeName string, retries int, checkFailure func() error) error {
|
func WaitPipeExists(pipeName string, retries int, checkFailure func() error) error {
|
||||||
var err error
|
var err error
|
||||||
for i := 0; i < retries; i++ {
|
for range retries {
|
||||||
err = fileutils.Exists(`\\.\pipe\` + pipeName)
|
err = fileutils.Exists(`\\.\pipe\` + pipeName)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
break
|
break
|
||||||
|
|
|
||||||
|
|
@ -210,12 +210,7 @@ func wrapMaybef(err error, format string, args ...any) error {
|
||||||
|
|
||||||
// IsReExecuting checks if the current process was re-executed with --reexec flag
|
// IsReExecuting checks if the current process was re-executed with --reexec flag
|
||||||
func IsReExecuting() bool {
|
func IsReExecuting() bool {
|
||||||
for _, arg := range os.Args {
|
return slices.Contains(os.Args, "--reexec")
|
||||||
if arg == "--reexec" {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateOrTruncateElevatedOutputFile() error {
|
func CreateOrTruncateElevatedOutputFile() error {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue