From 8c246952f89e1e0c7eb9e1dbb97249201b5a13b2 Mon Sep 17 00:00:00 2001 From: Maksim An Date: Thu, 31 Mar 2022 00:24:35 -0700 Subject: [PATCH 1/7] Fix dm-verity target naming format in linux guest (#1338) When adding layer integrity checking feature for SCSI devices, the dm-verity device format naming was inconsistent with the already existing pmem based verity target. Make the naming consistent by changing `verity-scsi-...` to `dm-verity-scsi-...`. Signed-off-by: Maksim An --- internal/guest/storage/scsi/scsi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/guest/storage/scsi/scsi.go b/internal/guest/storage/scsi/scsi.go index 7af2db325d..8484f79ddb 100644 --- a/internal/guest/storage/scsi/scsi.go +++ b/internal/guest/storage/scsi/scsi.go @@ -45,7 +45,7 @@ var ( const ( scsiDevicesPath = "/sys/bus/scsi/devices" vmbusDevicesPath = "/sys/bus/vmbus/devices" - verityDeviceFmt = "verity-scsi-contr%d-lun%d-%s" + verityDeviceFmt = "dm-verity-scsi-contr%d-lun%d-%s" ) // fetchActualControllerNumber retrieves the actual controller number assigned to a SCSI controller From bedca7475220426727ba4a0d11f042de6b8e73cc Mon Sep 17 00:00:00 2001 From: Danny Canter <36526702+dcantah@users.noreply.github.com> Date: Mon, 4 Apr 2022 13:18:41 -0700 Subject: [PATCH 2/7] Add Go bindflt/silo definitions (#1331) * Add Go bindflt/silo definitions This change adds a couple Go bindings for calls and constants from bindfltapi.dll as well as some silo flags for job objects. Together these allow file bindings (think bind mounts on Linux) to be performed for a specific job object. The bindings are only viewable from processes within that specific job. This additionally adds a couple unit tests for this behavior. Signed-off-by: Daniel Canter --- internal/exec/exec_test.go | 2 +- internal/jobobject/jobobject.go | 118 +++++++++++++++++- internal/jobobject/jobobject_test.go | 69 ++++++++++ internal/winapi/bindflt.go | 20 +++ internal/winapi/jobobject.go | 1 + internal/winapi/winapi.go | 2 +- internal/winapi/zsyscall_windows.go | 30 +++-- .../hcsshim/internal/winapi/bindflt.go | 20 +++ .../hcsshim/internal/winapi/jobobject.go | 1 + .../hcsshim/internal/winapi/winapi.go | 2 +- .../internal/winapi/zsyscall_windows.go | 30 +++-- 11 files changed, 277 insertions(+), 18 deletions(-) create mode 100644 internal/winapi/bindflt.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/winapi/bindflt.go diff --git a/internal/exec/exec_test.go b/internal/exec/exec_test.go index 3ad62a791e..80e5eb4012 100644 --- a/internal/exec/exec_test.go +++ b/internal/exec/exec_test.go @@ -176,7 +176,7 @@ func TestExecsWithJob(t *testing.T) { } if len(pids) != 2 { - t.Fatalf("should be two pids in job object, got: %d", len(pids)) + t.Fatalf("should be two pids in job object, got: %d. Pids: %+v", len(pids), pids) } for _, pid := range pids { diff --git a/internal/jobobject/jobobject.go b/internal/jobobject/jobobject.go index b8d586b204..a0257b39cd 100644 --- a/internal/jobobject/jobobject.go +++ b/internal/jobobject/jobobject.go @@ -3,7 +3,10 @@ package jobobject import ( "context" "fmt" + "os" + "path/filepath" "sync" + "sync/atomic" "unsafe" "github.com/Microsoft/hcsshim/internal/queue" @@ -24,7 +27,10 @@ import ( // the job, a queue to receive iocp notifications about the lifecycle // of the job and a mutex for synchronized handle access. type JobObject struct { - handle windows.Handle + handle windows.Handle + // All accesses to this MUST be done atomically. 1 signifies that this + // job is currently a silo. + isAppSilo uint32 mq *queue.MessageQueue handleLock sync.RWMutex } @@ -56,6 +62,7 @@ const ( var ( ErrAlreadyClosed = errors.New("the handle has already been closed") ErrNotRegistered = errors.New("job is not registered to receive notifications") + ErrNotSilo = errors.New("job is not a silo") ) // Options represents the set of configurable options when making or opening a job object. @@ -68,6 +75,9 @@ type Options struct { // `UseNTVariant` specifies if we should use the `Nt` variant of Open/CreateJobObject. // Defaults to false. UseNTVariant bool + // `Silo` specifies to promote the job to a silo. This additionally sets the flag + // JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE as it is required for the upgrade to complete. + Silo bool } // Create creates a job object. @@ -134,6 +144,16 @@ func Create(ctx context.Context, options *Options) (_ *JobObject, err error) { job.mq = mq } + if options.Silo { + // This is a required setting for upgrading to a silo. + if err := job.SetTerminateOnLastHandleClose(); err != nil { + return nil, err + } + if err := job.PromoteToSilo(); err != nil { + return nil, err + } + } + return job, nil } @@ -436,3 +456,99 @@ func (job *JobObject) QueryStorageStats() (*winapi.JOBOBJECT_BASIC_AND_IO_ACCOUN } return &info, nil } + +// ApplyFileBinding makes a file binding using the Bind Filter from target to root. If the job has +// not been upgraded to a silo this call will fail. The binding is only applied and visible for processes +// running in the job, any processes on the host or in another job will not be able to see the binding. +func (job *JobObject) ApplyFileBinding(root, target string, merged bool) error { + job.handleLock.RLock() + defer job.handleLock.RUnlock() + + if job.handle == 0 { + return ErrAlreadyClosed + } + + if !job.isSilo() { + return ErrNotSilo + } + + // The parent directory needs to exist for the bind to work. + if _, err := os.Stat(filepath.Dir(root)); err != nil { + if !os.IsNotExist(err) { + return err + } + if err := os.MkdirAll(filepath.Dir(root), 0); err != nil { + return err + } + } + + rootPtr, err := windows.UTF16PtrFromString(root) + if err != nil { + return err + } + + targetPtr, err := windows.UTF16PtrFromString(target) + if err != nil { + return err + } + + flags := winapi.BINDFLT_FLAG_USE_CURRENT_SILO_MAPPING + if merged { + flags |= winapi.BINDFLT_FLAG_MERGED_BIND_MAPPING + } + + if err := winapi.BfSetupFilterEx( + flags, + job.handle, + nil, + rootPtr, + targetPtr, + nil, + 0, + ); err != nil { + return fmt.Errorf("failed to bind target %q to root %q for job object: %w", target, root, err) + } + return nil +} + +// PromoteToSilo promotes a job object to a silo. There must be no running processess +// in the job for this to succeed. If the job is already a silo this is a no-op. +func (job *JobObject) PromoteToSilo() error { + job.handleLock.RLock() + defer job.handleLock.RUnlock() + + if job.handle == 0 { + return ErrAlreadyClosed + } + + if job.isSilo() { + return nil + } + + pids, err := job.Pids() + if err != nil { + return err + } + + if len(pids) != 0 { + return fmt.Errorf("job cannot have running processes to be promoted to a silo, found %d running processes", len(pids)) + } + + _, err = windows.SetInformationJobObject( + job.handle, + winapi.JobObjectCreateSilo, + 0, + 0, + ) + if err != nil { + return fmt.Errorf("failed to promote job to silo: %w", err) + } + + atomic.StoreUint32(&job.isAppSilo, 1) + return nil +} + +// isSilo returns if the job object is a silo. +func (job *JobObject) isSilo() bool { + return atomic.LoadUint32(&job.isAppSilo) == 1 +} diff --git a/internal/jobobject/jobobject_test.go b/internal/jobobject/jobobject_test.go index 68257c790b..a4877d4bdd 100644 --- a/internal/jobobject/jobobject_test.go +++ b/internal/jobobject/jobobject_test.go @@ -2,7 +2,9 @@ package jobobject import ( "context" + "os" "os/exec" + "path/filepath" "syscall" "testing" "time" @@ -281,3 +283,70 @@ func TestVerifyPidCount(t *testing.T) { t.Fatal(err) } } + +func TestSilo(t *testing.T) { + // Test asking for a silo in the options. + options := &Options{ + Silo: true, + } + job, err := Create(context.Background(), options) + if err != nil { + t.Fatal(err) + } + defer job.Close() +} + +func TestSiloFileBinding(t *testing.T) { + // Can't use osversion as the binary needs to be manifested for it to work. + // Just stat for the bindflt dll. + if _, err := os.Stat(`C:\windows\system32\bindfltapi.dll`); err != nil { + t.Skip("Bindflt not present on RS5 or lower, skipping.") + } + // Test upgrading to a silo and binding a file only the silo can see. + options := &Options{ + Silo: true, + } + job, err := Create(context.Background(), options) + if err != nil { + t.Fatal(err) + } + defer job.Close() + + target := t.TempDir() + hostPath := filepath.Join(target, "bind-test.txt") + f, err := os.Create(hostPath) + if err != nil { + t.Fatal(err) + } + defer f.Close() + + root := t.TempDir() + siloPath := filepath.Join(root, "silo-path.txt") + if err := job.ApplyFileBinding(siloPath, hostPath, false); err != nil { + t.Fatal(err) + } + + // First check that we can't see the file on the host. + if _, err := os.Stat(siloPath); err == nil { + t.Fatalf("expected to not be able to see %q on the host", siloPath) + } + + // Now check that we can see it in the silo. Couple second timeout (ping something) so + // we can be relatively sure the process has been assigned to the job before we go to check + // on the file. Unfortunately we can't use our internal/exec package that has support for + // assigning a process to a job at creation time as it causes a cyclical import. + cmd := exec.Command("cmd", "/c", "ping", "localhost", "&&", "dir", siloPath) + if err := cmd.Start(); err != nil { + t.Fatal(err) + } + + if err := job.Assign(uint32(cmd.Process.Pid)); err != nil { + t.Fatal(err) + } + + // Process will have an exit code of 1 if dir couldn't find the file; if we get + // no error here we should be A-OK. + if err := cmd.Wait(); err != nil { + t.Fatal(err) + } +} diff --git a/internal/winapi/bindflt.go b/internal/winapi/bindflt.go new file mode 100644 index 0000000000..ab434a75b5 --- /dev/null +++ b/internal/winapi/bindflt.go @@ -0,0 +1,20 @@ +package winapi + +const ( + BINDFLT_FLAG_READ_ONLY_MAPPING uint32 = 0x00000001 + BINDFLT_FLAG_MERGED_BIND_MAPPING uint32 = 0x00000002 + BINDFLT_FLAG_USE_CURRENT_SILO_MAPPING uint32 = 0x00000004 +) + +// HRESULT +// BfSetupFilterEx( +// _In_ ULONG Flags, +// _In_opt_ HANDLE JobHandle, +// _In_opt_ PSID Sid, +// _In_ LPCWSTR VirtualizationRootPath, +// _In_ LPCWSTR VirtualizationTargetPath, +// _In_reads_opt_( VirtualizationExceptionPathCount ) LPCWSTR* VirtualizationExceptionPaths, +// _In_opt_ ULONG VirtualizationExceptionPathCount +// ); +// +//sys BfSetupFilterEx(flags uint32, jobHandle windows.Handle, sid *windows.SID, virtRootPath *uint16, virtTargetPath *uint16, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) = bindfltapi.BfSetupFilterEx? diff --git a/internal/winapi/jobobject.go b/internal/winapi/jobobject.go index b2ca47c02b..44371b3886 100644 --- a/internal/winapi/jobobject.go +++ b/internal/winapi/jobobject.go @@ -52,6 +52,7 @@ const ( JobObjectLimitViolationInformation uint32 = 13 JobObjectMemoryUsageInformation uint32 = 28 JobObjectNotificationLimitInformation2 uint32 = 33 + JobObjectCreateSilo uint32 = 35 JobObjectIoAttribution uint32 = 42 ) diff --git a/internal/winapi/winapi.go b/internal/winapi/winapi.go index d2cc9d9fba..298ff838ac 100644 --- a/internal/winapi/winapi.go +++ b/internal/winapi/winapi.go @@ -2,4 +2,4 @@ // be thought of as an extension to golang.org/x/sys/windows. package winapi -//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go +//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go bindflt.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/internal/winapi/zsyscall_windows.go b/internal/winapi/zsyscall_windows.go index fc2732a64a..935219b063 100644 --- a/internal/winapi/zsyscall_windows.go +++ b/internal/winapi/zsyscall_windows.go @@ -37,13 +37,15 @@ func errnoErr(e syscall.Errno) error { } var ( - modnetapi32 = windows.NewLazySystemDLL("netapi32.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - modntdll = windows.NewLazySystemDLL("ntdll.dll") - modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll") - modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") - modcfgmgr32 = windows.NewLazySystemDLL("cfgmgr32.dll") - + modbindfltapi = windows.NewLazySystemDLL("bindfltapi.dll") + modnetapi32 = windows.NewLazySystemDLL("netapi32.dll") + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") + modntdll = windows.NewLazySystemDLL("ntdll.dll") + modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll") + modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") + modcfgmgr32 = windows.NewLazySystemDLL("cfgmgr32.dll") + + procBfSetupFilterEx = modbindfltapi.NewProc("BfSetupFilterEx") procNetLocalGroupGetInfo = modnetapi32.NewProc("NetLocalGroupGetInfo") procNetUserAdd = modnetapi32.NewProc("NetUserAdd") procNetUserDel = modnetapi32.NewProc("NetUserDel") @@ -77,6 +79,20 @@ var ( procRtlNtStatusToDosError = modntdll.NewProc("RtlNtStatusToDosError") ) +func BfSetupFilterEx(flags uint32, jobHandle windows.Handle, sid *windows.SID, virtRootPath *uint16, virtTargetPath *uint16, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) { + if hr = procBfSetupFilterEx.Find(); hr != nil { + return + } + r0, _, _ := syscall.Syscall9(procBfSetupFilterEx.Addr(), 7, uintptr(flags), uintptr(jobHandle), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(virtRootPath)), uintptr(unsafe.Pointer(virtTargetPath)), uintptr(unsafe.Pointer(virtExceptions)), uintptr(virtExceptionPathCount), 0, 0) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func netLocalGroupGetInfo(serverName *uint16, groupName *uint16, level uint32, bufptr **byte) (status error) { r0, _, _ := syscall.Syscall6(procNetLocalGroupGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(groupName)), uintptr(level), uintptr(unsafe.Pointer(bufptr)), 0, 0) if r0 != 0 { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/bindflt.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/bindflt.go new file mode 100644 index 0000000000..ab434a75b5 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/bindflt.go @@ -0,0 +1,20 @@ +package winapi + +const ( + BINDFLT_FLAG_READ_ONLY_MAPPING uint32 = 0x00000001 + BINDFLT_FLAG_MERGED_BIND_MAPPING uint32 = 0x00000002 + BINDFLT_FLAG_USE_CURRENT_SILO_MAPPING uint32 = 0x00000004 +) + +// HRESULT +// BfSetupFilterEx( +// _In_ ULONG Flags, +// _In_opt_ HANDLE JobHandle, +// _In_opt_ PSID Sid, +// _In_ LPCWSTR VirtualizationRootPath, +// _In_ LPCWSTR VirtualizationTargetPath, +// _In_reads_opt_( VirtualizationExceptionPathCount ) LPCWSTR* VirtualizationExceptionPaths, +// _In_opt_ ULONG VirtualizationExceptionPathCount +// ); +// +//sys BfSetupFilterEx(flags uint32, jobHandle windows.Handle, sid *windows.SID, virtRootPath *uint16, virtTargetPath *uint16, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) = bindfltapi.BfSetupFilterEx? diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go index b2ca47c02b..44371b3886 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go @@ -52,6 +52,7 @@ const ( JobObjectLimitViolationInformation uint32 = 13 JobObjectMemoryUsageInformation uint32 = 28 JobObjectNotificationLimitInformation2 uint32 = 33 + JobObjectCreateSilo uint32 = 35 JobObjectIoAttribution uint32 = 42 ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go index d2cc9d9fba..298ff838ac 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go @@ -2,4 +2,4 @@ // be thought of as an extension to golang.org/x/sys/windows. package winapi -//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go +//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go bindflt.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go index fc2732a64a..935219b063 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/zsyscall_windows.go @@ -37,13 +37,15 @@ func errnoErr(e syscall.Errno) error { } var ( - modnetapi32 = windows.NewLazySystemDLL("netapi32.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - modntdll = windows.NewLazySystemDLL("ntdll.dll") - modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll") - modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") - modcfgmgr32 = windows.NewLazySystemDLL("cfgmgr32.dll") - + modbindfltapi = windows.NewLazySystemDLL("bindfltapi.dll") + modnetapi32 = windows.NewLazySystemDLL("netapi32.dll") + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") + modntdll = windows.NewLazySystemDLL("ntdll.dll") + modiphlpapi = windows.NewLazySystemDLL("iphlpapi.dll") + modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") + modcfgmgr32 = windows.NewLazySystemDLL("cfgmgr32.dll") + + procBfSetupFilterEx = modbindfltapi.NewProc("BfSetupFilterEx") procNetLocalGroupGetInfo = modnetapi32.NewProc("NetLocalGroupGetInfo") procNetUserAdd = modnetapi32.NewProc("NetUserAdd") procNetUserDel = modnetapi32.NewProc("NetUserDel") @@ -77,6 +79,20 @@ var ( procRtlNtStatusToDosError = modntdll.NewProc("RtlNtStatusToDosError") ) +func BfSetupFilterEx(flags uint32, jobHandle windows.Handle, sid *windows.SID, virtRootPath *uint16, virtTargetPath *uint16, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) { + if hr = procBfSetupFilterEx.Find(); hr != nil { + return + } + r0, _, _ := syscall.Syscall9(procBfSetupFilterEx.Addr(), 7, uintptr(flags), uintptr(jobHandle), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(virtRootPath)), uintptr(unsafe.Pointer(virtTargetPath)), uintptr(unsafe.Pointer(virtExceptions)), uintptr(virtExceptionPathCount), 0, 0) + if int32(r0) < 0 { + if r0&0x1fff0000 == 0x00070000 { + r0 &= 0xffff + } + hr = syscall.Errno(r0) + } + return +} + func netLocalGroupGetInfo(serverName *uint16, groupName *uint16, level uint32, bufptr **byte) (status error) { r0, _, _ := syscall.Syscall6(procNetLocalGroupGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(groupName)), uintptr(level), uintptr(unsafe.Pointer(bufptr)), 0, 0) if r0 != 0 { From 949e46a1260a6aca39c1b813a1ead2344ffe6199 Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy <84944216+helsaawy@users.noreply.github.com> Date: Tue, 5 Apr 2022 01:07:45 -0400 Subject: [PATCH 3/7] Adding build constraints (#1340) * Adding build constraints Adding windows build constraints to code to allow tests and benchmarks to be run on Linux. Added doc.go to modules (with doc string, where appropriate) to prevent compiler/linter errors about broken imports. In some cases (ie, winapi and wclayer), the package already had an OS-agnostic file of the same name, along with a doc string. A doc.go file was added to preempt situations where windows-specific code is added to that file in the future. Signed-off-by: Hamza El-Saawy * Renaming test files Renaming files in `test\cri-containerd` to end with `_test.go` so they can include variables and functions defined in other `_test.go`. For example, `gmsa.go` imports `gmsaAccount`, which is defined in `main_test.go`. Signed-off-by: Hamza El-Saawy --- .gitignore | 5 ++++- Makefile | 2 +- cmd/containerd-shim-runhcs-v1/clone.go | 2 ++ cmd/containerd-shim-runhcs-v1/delete.go | 2 ++ cmd/containerd-shim-runhcs-v1/events.go | 2 ++ cmd/containerd-shim-runhcs-v1/events_test.go | 2 ++ cmd/containerd-shim-runhcs-v1/exec.go | 2 ++ cmd/containerd-shim-runhcs-v1/exec_clone.go | 2 ++ cmd/containerd-shim-runhcs-v1/exec_hcs.go | 2 ++ cmd/containerd-shim-runhcs-v1/exec_test.go | 2 ++ .../exec_wcow_podsandbox.go | 2 ++ .../exec_wcow_podsandbox_test.go | 2 ++ cmd/containerd-shim-runhcs-v1/main.go | 2 ++ cmd/containerd-shim-runhcs-v1/pod.go | 2 ++ cmd/containerd-shim-runhcs-v1/pod_test.go | 2 ++ cmd/containerd-shim-runhcs-v1/serve.go | 2 ++ cmd/containerd-shim-runhcs-v1/service.go | 2 ++ cmd/containerd-shim-runhcs-v1/service_internal.go | 2 ++ .../service_internal_podshim_test.go | 2 ++ .../service_internal_taskshim_test.go | 4 +++- .../service_internal_test.go | 2 ++ cmd/containerd-shim-runhcs-v1/start.go | 2 ++ cmd/containerd-shim-runhcs-v1/task.go | 2 ++ cmd/containerd-shim-runhcs-v1/task_hcs.go | 2 ++ cmd/containerd-shim-runhcs-v1/task_hcs_test.go | 2 ++ cmd/containerd-shim-runhcs-v1/task_test.go | 2 ++ .../task_wcow_podsandbox.go | 2 ++ cmd/device-util/main.go | 2 ++ cmd/jobobject-util/main.go | 2 ++ cmd/ncproxy/computeagent_cache.go | 3 ++- cmd/ncproxy/config.go | 2 ++ cmd/ncproxy/hcn.go | 2 ++ cmd/ncproxy/hcn_networking_test.go | 2 ++ cmd/ncproxy/main.go | 2 ++ cmd/ncproxy/ncproxy.go | 3 ++- cmd/ncproxy/ncproxy_networking_test.go | 2 ++ cmd/ncproxy/run.go | 2 ++ cmd/ncproxy/server.go | 2 ++ cmd/ncproxy/server_test.go | 2 ++ cmd/ncproxy/service.go | 2 ++ cmd/ncproxy/utilities_test.go | 2 -- cmd/runhcs/container.go | 8 +++++--- cmd/runhcs/create-scratch.go | 2 ++ cmd/runhcs/create.go | 2 ++ cmd/runhcs/delete.go | 2 ++ cmd/runhcs/exec.go | 2 ++ cmd/runhcs/kill.go | 2 ++ cmd/runhcs/list.go | 2 ++ cmd/runhcs/main.go | 2 ++ cmd/runhcs/pause.go | 2 ++ cmd/runhcs/prepare-disk.go | 2 ++ cmd/runhcs/ps.go | 2 ++ cmd/runhcs/run.go | 2 ++ cmd/runhcs/shim.go | 2 ++ cmd/runhcs/spec.go | 2 ++ cmd/runhcs/start.go | 2 ++ cmd/runhcs/state.go | 2 ++ cmd/runhcs/tty.go | 2 ++ cmd/runhcs/utils.go | 2 ++ cmd/runhcs/utils_test.go | 2 ++ cmd/runhcs/vm.go | 2 ++ cmd/shimdiag/exec.go | 2 ++ cmd/shimdiag/list.go | 2 ++ cmd/shimdiag/share.go | 2 ++ cmd/shimdiag/shimdiag.go | 2 ++ cmd/shimdiag/stacks.go | 2 ++ cmd/wclayer/create.go | 2 ++ cmd/wclayer/export.go | 2 ++ cmd/wclayer/import.go | 2 ++ cmd/wclayer/mount.go | 2 ++ cmd/wclayer/remove.go | 2 ++ cmd/wclayer/volumemountutils.go | 2 ++ cmd/wclayer/wclayer.go | 2 ++ computestorage/attach.go | 2 ++ computestorage/destroy.go | 2 ++ computestorage/detach.go | 2 ++ computestorage/export.go | 2 ++ computestorage/format.go | 2 ++ computestorage/helpers.go | 2 ++ computestorage/import.go | 2 ++ computestorage/initialize.go | 2 ++ computestorage/mount.go | 2 ++ computestorage/setup.go | 2 ++ container.go | 2 ++ errors.go | 2 ++ ext4/internal/compactext4/verify_linux_test.go | 2 ++ hcn/doc.go | 3 +++ hcn/hcn.go | 4 ++-- hcn/hcnendpoint.go | 2 ++ hcn/hcnendpoint_test.go | 4 ++-- hcn/hcnerrors.go | 6 +++--- hcn/hcnerrors_test.go | 4 ++-- hcn/hcnglobals.go | 2 ++ hcn/hcnloadbalancer.go | 2 ++ hcn/hcnloadbalancer_test.go | 4 ++-- hcn/hcnnamespace.go | 2 ++ hcn/hcnnamespace_test.go | 4 ++-- hcn/hcnnetwork.go | 2 ++ hcn/hcnnetwork_test.go | 4 ++-- hcn/hcnpolicy.go | 2 ++ hcn/hcnroute.go | 2 ++ hcn/hcnroute_test.go | 4 ++-- hcn/hcnsupport.go | 2 ++ hcn/hcnsupport_test.go | 4 ++-- hcn/hcnutils_test.go | 4 ++-- hcn/hcnv1schema_test.go | 4 ++-- hcn/hnsv1_test.go | 4 ++-- hcsshim.go | 2 ++ hnsendpoint.go | 2 ++ hnsglobals.go | 2 ++ hnsnetwork.go | 2 ++ hnspolicylist.go | 2 ++ hnssupport.go | 2 ++ interface.go | 2 ++ internal/clone/doc.go | 1 + internal/clone/registry.go | 2 ++ internal/cmd/cmd.go | 4 ++-- internal/cmd/cmd_test.go | 3 ++- internal/cmd/diag.go | 2 ++ internal/cmd/doc.go | 3 +++ internal/cmd/io.go | 2 ++ internal/cmd/io_binary.go | 2 ++ internal/cmd/io_binary_test.go | 2 ++ internal/cmd/io_npipe.go | 4 +++- internal/cni/doc.go | 1 + internal/cni/registry.go | 2 ++ internal/cni/registry_test.go | 2 ++ internal/computeagent/doc.go | 1 - internal/conpty/conpty.go | 2 ++ internal/conpty/doc.go | 1 + internal/copyfile/copyfile.go | 2 ++ internal/copyfile/doc.go | 1 + internal/cow/cow.go | 2 ++ internal/cpugroup/cpugroup.go | 2 ++ internal/cpugroup/cpugroup_test.go | 2 ++ internal/cpugroup/doc.go | 1 + internal/credentials/credentials.go | 3 --- internal/credentials/doc.go | 4 ++++ internal/devices/doc.go | 1 + internal/exec/doc.go | 3 +++ internal/exec/exec.go | 4 ++-- internal/exec/exec_test.go | 2 ++ internal/exec/options.go | 2 ++ internal/gcs/bridge.go | 2 ++ internal/gcs/bridge_test.go | 2 ++ internal/gcs/container.go | 2 ++ internal/gcs/doc.go | 1 + internal/gcs/guestconnection.go | 2 ++ internal/gcs/guestconnection_test.go | 2 ++ internal/gcs/iochannel_test.go | 2 ++ internal/gcs/process.go | 2 ++ internal/gcs/protocol.go | 2 ++ internal/guest/bridge/bridge.go | 2 -- internal/guest/bridge/doc.go | 3 +++ internal/guest/kmsg/doc.go | 8 ++++++++ internal/guest/kmsg/kmsg.go | 9 ++------- internal/guest/network/doc.go | 1 + internal/guest/prot/protocol.go | 8 ++++---- internal/guest/runtime/doc.go | 3 +++ internal/guest/runtime/hcsv2/doc.go | 1 + internal/guest/runtime/runc/doc.go | 3 +++ internal/guest/runtime/runc/runc.go | 2 -- internal/guest/runtime/runtime.go | 2 -- internal/guest/stdio/doc.go | 1 + internal/guest/storage/crypt/doc.go | 1 + internal/guest/storage/devicemapper/doc.go | 1 + internal/guest/storage/doc.go | 1 + internal/guest/storage/overlay/doc.go | 1 + internal/guest/storage/pci/doc.go | 1 + internal/guest/storage/plan9/doc.go | 1 + internal/guest/storage/pmem/doc.go | 1 + internal/guest/storage/scsi/doc.go | 1 + internal/guest/transport/doc.go | 3 +++ internal/guest/transport/transport.go | 2 -- internal/hcs/callback.go | 2 ++ internal/hcs/doc.go | 1 + internal/hcs/errors.go | 2 ++ internal/hcs/process.go | 5 +++-- internal/hcs/schema1/schema1.go | 4 +++- internal/hcs/service.go | 2 ++ internal/hcs/system.go | 4 +++- internal/hcs/utils.go | 2 ++ internal/hcs/waithelper.go | 2 ++ internal/hcserror/doc.go | 1 + internal/hcserror/hcserror.go | 2 ++ internal/hcsoci/create.go | 1 - internal/hcsoci/devices.go | 4 ++-- internal/hcsoci/doc.go | 1 + internal/hcsoci/hcsdoc_wcow.go | 1 - internal/hcsoci/network.go | 2 ++ internal/hns/doc.go | 1 + internal/hns/hnsendpoint.go | 4 ++-- internal/hns/hnsfuncs.go | 2 ++ internal/hns/hnsglobals.go | 2 ++ internal/hns/hnsnetwork.go | 9 ++++++--- internal/hns/hnspolicylist.go | 2 ++ internal/hns/hnssupport.go | 2 ++ internal/hns/namespace.go | 2 ++ internal/interop/doc.go | 1 + internal/interop/interop.go | 2 ++ internal/jobcontainers/cpurate_test.go | 2 ++ internal/jobcontainers/doc.go | 1 + internal/jobcontainers/env.go | 2 ++ internal/jobcontainers/jobcontainer.go | 4 +++- internal/jobcontainers/logon.go | 2 ++ internal/jobcontainers/mounts.go | 2 ++ internal/jobcontainers/mounts_test.go | 2 ++ internal/jobcontainers/oci.go | 2 ++ internal/jobcontainers/path.go | 4 +++- internal/jobcontainers/path_test.go | 2 ++ internal/jobcontainers/process.go | 2 ++ internal/jobcontainers/storage.go | 2 ++ internal/jobcontainers/system_test.go | 2 ++ internal/jobobject/doc.go | 8 ++++++++ internal/jobobject/iocp.go | 2 ++ internal/jobobject/jobobject.go | 10 ++-------- internal/jobobject/jobobject_test.go | 2 ++ internal/jobobject/limits.go | 2 ++ internal/layers/doc.go | 2 ++ internal/layers/layers.go | 1 - internal/lcow/common.go | 2 ++ internal/lcow/disk.go | 2 ++ internal/lcow/doc.go | 1 + internal/lcow/scratch.go | 2 ++ internal/oci/sandbox.go | 1 + internal/oci/uvm.go | 4 +++- internal/oci/uvm_test.go | 5 ++--- internal/processorinfo/doc.go | 1 + internal/processorinfo/host_information.go | 2 ++ internal/processorinfo/processor_count.go | 2 ++ internal/regstate/doc.go | 1 + internal/regstate/regstate.go | 2 ++ internal/regstate/regstate_test.go | 2 ++ internal/resources/doc.go | 3 +++ internal/resources/resources.go | 4 ++-- internal/runhcs/container.go | 2 ++ internal/runhcs/vm.go | 2 ++ internal/safefile/do.go | 1 + internal/safefile/safeopen.go | 3 ++- internal/safefile/safeopen_admin_test.go | 4 ++-- internal/safefile/safeopen_test.go | 2 ++ internal/schemaversion/doc.go | 1 + internal/shimdiag/shimdiag.go | 2 ++ internal/tools/extendedtask/extendedtask.go | 2 ++ internal/tools/grantvmgroupaccess/main.go | 2 ++ internal/tools/networkagent/defs.go | 2 ++ internal/tools/networkagent/main.go | 5 ++--- internal/tools/uvmboot/lcow.go | 2 ++ internal/tools/uvmboot/main.go | 2 ++ internal/tools/uvmboot/wcow.go | 2 ++ internal/tools/zapdir/main.go | 2 ++ internal/uvm/capabilities.go | 2 ++ internal/uvm/clone.go | 2 ++ internal/uvm/combine_layers.go | 2 ++ internal/uvm/computeagent.go | 2 ++ internal/uvm/computeagent_test.go | 2 ++ internal/uvm/counter.go | 2 ++ internal/uvm/cpugroups.go | 2 ++ internal/uvm/cpulimits_update.go | 2 ++ internal/uvm/create.go | 4 +++- internal/uvm/create_lcow.go | 12 ++++++------ internal/uvm/create_test.go | 2 ++ internal/uvm/create_wcow.go | 8 +++++--- internal/uvm/delete_container.go | 2 ++ internal/uvm/doc.go | 2 ++ internal/uvm/dumpstacks.go | 2 ++ internal/uvm/guest_request.go | 2 ++ internal/uvm/hvsocket.go | 2 ++ internal/uvm/memory_update.go | 2 ++ internal/uvm/modify.go | 2 ++ internal/uvm/network.go | 4 +++- internal/uvm/pipes.go | 2 ++ internal/uvm/plan9.go | 2 ++ internal/uvm/scsi.go | 3 ++- internal/uvm/security_policy.go | 2 ++ internal/uvm/share.go | 2 ++ internal/uvm/start.go | 2 ++ internal/uvm/stats.go | 2 ++ internal/uvm/timezone.go | 2 ++ internal/uvm/types.go | 4 ++-- internal/uvm/update_uvm.go | 2 ++ internal/uvm/virtual_device.go | 2 ++ internal/uvm/vpmem.go | 2 ++ internal/uvm/vpmem_mapped.go | 2 ++ internal/uvm/vpmem_mapped_test.go | 2 ++ internal/uvm/vsmb.go | 2 ++ internal/uvm/wait.go | 2 ++ internal/uvmfolder/doc.go | 1 + internal/vm/hcs/boot.go | 2 ++ internal/vm/hcs/builder.go | 2 ++ internal/vm/hcs/doc.go | 1 + internal/vm/hcs/hcs.go | 2 ++ internal/vm/hcs/memory.go | 2 ++ internal/vm/hcs/network.go | 2 ++ internal/vm/hcs/pci.go | 2 ++ internal/vm/hcs/plan9.go | 2 ++ internal/vm/hcs/processor.go | 2 ++ internal/vm/hcs/scsi.go | 2 ++ internal/vm/hcs/serial.go | 2 ++ internal/vm/hcs/stats.go | 2 ++ internal/vm/hcs/storage.go | 2 ++ internal/vm/hcs/supported.go | 2 ++ internal/vm/hcs/vmsocket.go | 2 ++ internal/vm/hcs/vpmem.go | 2 ++ internal/vm/hcs/vsmb.go | 2 ++ internal/vm/hcs/windows.go | 2 ++ internal/vm/remotevm/boot.go | 2 ++ internal/vm/remotevm/builder.go | 2 ++ internal/vm/remotevm/doc.go | 1 + internal/vm/remotevm/memory.go | 2 ++ internal/vm/remotevm/network.go | 2 ++ internal/vm/remotevm/processor.go | 2 ++ internal/vm/remotevm/remotevm.go | 2 ++ internal/vm/remotevm/scsi.go | 2 ++ internal/vm/remotevm/serial.go | 2 ++ internal/vm/remotevm/stats.go | 2 ++ internal/vm/remotevm/storage.go | 2 ++ internal/vm/remotevm/vmsocket.go | 2 ++ internal/vm/remotevm/windows.go | 2 ++ internal/vmcompute/doc.go | 1 + internal/vmcompute/vmcompute.go | 2 ++ internal/wclayer/activatelayer.go | 2 ++ internal/wclayer/baselayer.go | 3 ++- internal/wclayer/createlayer.go | 2 ++ internal/wclayer/createscratchlayer.go | 2 ++ internal/wclayer/deactivatelayer.go | 2 ++ internal/wclayer/destroylayer.go | 2 ++ internal/wclayer/doc.go | 4 ++++ internal/wclayer/expandscratchsize.go | 2 ++ internal/wclayer/exportlayer.go | 2 ++ internal/wclayer/getlayermountpath.go | 2 ++ internal/wclayer/getsharedbaseimages.go | 2 ++ internal/wclayer/grantvmaccess.go | 2 ++ internal/wclayer/importlayer.go | 2 ++ internal/wclayer/layerexists.go | 2 ++ internal/wclayer/layerid.go | 2 ++ internal/wclayer/layerutils.go | 2 ++ internal/wclayer/legacy.go | 3 ++- internal/wclayer/nametoguid.go | 2 ++ internal/wclayer/preparelayer.go | 2 ++ internal/wclayer/processimage.go | 2 ++ internal/wclayer/unpreparelayer.go | 2 ++ internal/wclayer/wclayer.go | 5 ++--- internal/wcow/doc.go | 1 + internal/wcow/scratch.go | 2 ++ internal/winapi/console.go | 2 ++ internal/winapi/devices.go | 2 ++ internal/winapi/doc.go | 3 +++ internal/winapi/errors.go | 2 ++ internal/winapi/filesystem.go | 2 ++ internal/winapi/jobobject.go | 2 ++ internal/winapi/system.go | 2 ++ internal/winapi/user.go | 2 ++ internal/winapi/utils.go | 2 ++ internal/winapi/winapi.go | 2 -- internal/winapi/winapi_test.go | 2 ++ internal/windevice/devicequery.go | 2 ++ internal/windevice/doc.go | 1 + internal/winobjdir/doc.go | 1 + internal/winobjdir/object_dir.go | 2 ++ layer.go | 2 ++ osversion/osversion_windows.go | 2 ++ pkg/go-runhcs/doc.go | 1 + pkg/go-runhcs/runhcs.go | 8 +++++--- pkg/go-runhcs/runhcs_create-scratch.go | 2 ++ pkg/go-runhcs/runhcs_create.go | 4 +++- pkg/go-runhcs/runhcs_delete.go | 2 ++ pkg/go-runhcs/runhcs_exec.go | 4 +++- pkg/go-runhcs/runhcs_kill.go | 2 ++ pkg/go-runhcs/runhcs_list.go | 2 ++ pkg/go-runhcs/runhcs_pause.go | 2 ++ pkg/go-runhcs/runhcs_ps.go | 2 ++ pkg/go-runhcs/runhcs_resize-tty.go | 2 ++ pkg/go-runhcs/runhcs_resume.go | 2 ++ pkg/go-runhcs/runhcs_start.go | 2 ++ pkg/go-runhcs/runhcs_state.go | 2 ++ pkg/go-runhcs/runhcs_test.go | 2 ++ pkg/ociwclayer/doc.go | 3 +++ pkg/ociwclayer/export.go | 4 ++-- pkg/ociwclayer/import.go | 2 ++ pkg/securitypolicy/securitypolicy_test.go | 2 -- pkg/securitypolicy/securitypolicyenforcer.go | 2 +- process.go | 2 ++ test/containerd-shim-runhcs-v1/delete_test.go | 4 ++-- .../containerd-shim-runhcs-v1/global_command_test.go | 3 ++- test/containerd-shim-runhcs-v1/start_test.go | 4 ++-- test/cri-containerd/clone_test.go | 4 ++-- test/cri-containerd/container.go | 4 ++-- test/cri-containerd/container_downlevel_test.go | 4 ++-- test/cri-containerd/container_fileshare_test.go | 4 ++-- test/cri-containerd/container_gmsa_test.go | 4 ++-- test/cri-containerd/container_layers_packing_test.go | 4 ++-- test/cri-containerd/container_network_test.go | 4 ++-- test/cri-containerd/container_test.go | 4 ++-- test/cri-containerd/container_update_test.go | 4 ++-- test/cri-containerd/container_virtual_device_test.go | 4 ++-- test/cri-containerd/containerdrestart_test.go | 4 ++-- test/cri-containerd/createcontainer_test.go | 4 ++-- test/cri-containerd/exec.go | 4 ++-- test/cri-containerd/execcontainer_test.go | 4 ++-- test/cri-containerd/extended_task_test.go | 3 ++- test/cri-containerd/{gmsa.go => gmsa_test.go} | 4 ++-- test/cri-containerd/helpers/log.go | 2 ++ test/cri-containerd/jobcontainer_test.go | 4 ++-- test/cri-containerd/layer_integrity_test.go | 4 ++-- test/cri-containerd/logging_binary_test.go | 4 ++-- test/cri-containerd/main_test.go | 4 ++-- test/cri-containerd/pod_update_test.go | 4 ++-- test/cri-containerd/policy_test.go | 4 ++-- test/cri-containerd/pullimage_test.go | 4 ++-- test/cri-containerd/removepodsandbox_test.go | 4 ++-- test/cri-containerd/runpodsandbox_test.go | 4 ++-- test/cri-containerd/{sandbox.go => sandbox_test.go} | 4 ++-- .../scale_cpu_limits_to_sandbox_test.go | 4 ++-- test/cri-containerd/service_test.go | 2 ++ test/cri-containerd/share.go | 4 ++-- test/cri-containerd/stats_test.go | 4 ++-- test/cri-containerd/stopcontainer_test.go | 4 ++-- .../test-images/jobcontainer_createvhd/main.go | 3 +++ .../test-images/jobcontainer_etw/main.go | 3 +++ .../test-images/jobcontainer_hns/main.go | 3 +++ test/cri-containerd/test-images/timezone/main.go | 3 +++ ...{update_utilities.go => update_utilities_test.go} | 4 ++-- test/internal/schemaversion_test.go | 2 ++ test/runhcs/create-scratch_test.go | 4 ++-- test/runhcs/e2e_matrix_test.go | 3 ++- test/runhcs/list_test.go | 3 ++- test/runhcs/runhcs_test.go | 3 ++- test/vendor/github.com/Microsoft/hcsshim/.gitignore | 5 ++++- test/vendor/github.com/Microsoft/hcsshim/Makefile | 2 +- .../Microsoft/hcsshim/computestorage/attach.go | 2 ++ .../Microsoft/hcsshim/computestorage/destroy.go | 2 ++ .../Microsoft/hcsshim/computestorage/detach.go | 2 ++ .../Microsoft/hcsshim/computestorage/export.go | 2 ++ .../Microsoft/hcsshim/computestorage/format.go | 2 ++ .../Microsoft/hcsshim/computestorage/helpers.go | 2 ++ .../Microsoft/hcsshim/computestorage/import.go | 2 ++ .../Microsoft/hcsshim/computestorage/initialize.go | 2 ++ .../Microsoft/hcsshim/computestorage/mount.go | 2 ++ .../Microsoft/hcsshim/computestorage/setup.go | 2 ++ .../vendor/github.com/Microsoft/hcsshim/container.go | 2 ++ test/vendor/github.com/Microsoft/hcsshim/errors.go | 2 ++ test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go | 3 +++ test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go | 4 ++-- .../github.com/Microsoft/hcsshim/hcn/hcnendpoint.go | 2 ++ .../github.com/Microsoft/hcsshim/hcn/hcnerrors.go | 6 +++--- .../github.com/Microsoft/hcsshim/hcn/hcnglobals.go | 2 ++ .../Microsoft/hcsshim/hcn/hcnloadbalancer.go | 2 ++ .../github.com/Microsoft/hcsshim/hcn/hcnnamespace.go | 2 ++ .../github.com/Microsoft/hcsshim/hcn/hcnnetwork.go | 2 ++ .../github.com/Microsoft/hcsshim/hcn/hcnpolicy.go | 2 ++ .../github.com/Microsoft/hcsshim/hcn/hcnroute.go | 2 ++ .../github.com/Microsoft/hcsshim/hcn/hcnsupport.go | 2 ++ test/vendor/github.com/Microsoft/hcsshim/hcsshim.go | 2 ++ .../github.com/Microsoft/hcsshim/hnsendpoint.go | 2 ++ .../github.com/Microsoft/hcsshim/hnsglobals.go | 2 ++ .../github.com/Microsoft/hcsshim/hnsnetwork.go | 2 ++ .../github.com/Microsoft/hcsshim/hnspolicylist.go | 2 ++ .../github.com/Microsoft/hcsshim/hnssupport.go | 2 ++ .../vendor/github.com/Microsoft/hcsshim/interface.go | 2 ++ .../Microsoft/hcsshim/internal/clone/doc.go | 1 + .../Microsoft/hcsshim/internal/clone/registry.go | 2 ++ .../github.com/Microsoft/hcsshim/internal/cmd/cmd.go | 4 ++-- .../Microsoft/hcsshim/internal/cmd/diag.go | 2 ++ .../github.com/Microsoft/hcsshim/internal/cmd/doc.go | 3 +++ .../github.com/Microsoft/hcsshim/internal/cmd/io.go | 2 ++ .../Microsoft/hcsshim/internal/cmd/io_binary.go | 2 ++ .../Microsoft/hcsshim/internal/cmd/io_npipe.go | 4 +++- .../github.com/Microsoft/hcsshim/internal/cni/doc.go | 1 + .../Microsoft/hcsshim/internal/cni/registry.go | 2 ++ .../Microsoft/hcsshim/internal/computeagent/doc.go | 1 - .../Microsoft/hcsshim/internal/copyfile/copyfile.go | 2 ++ .../Microsoft/hcsshim/internal/copyfile/doc.go | 1 + .../github.com/Microsoft/hcsshim/internal/cow/cow.go | 2 ++ .../Microsoft/hcsshim/internal/cpugroup/cpugroup.go | 2 ++ .../Microsoft/hcsshim/internal/cpugroup/doc.go | 1 + .../hcsshim/internal/credentials/credentials.go | 3 --- .../Microsoft/hcsshim/internal/credentials/doc.go | 4 ++++ .../Microsoft/hcsshim/internal/devices/doc.go | 1 + .../Microsoft/hcsshim/internal/gcs/bridge.go | 2 ++ .../Microsoft/hcsshim/internal/gcs/container.go | 2 ++ .../github.com/Microsoft/hcsshim/internal/gcs/doc.go | 1 + .../hcsshim/internal/gcs/guestconnection.go | 2 ++ .../Microsoft/hcsshim/internal/gcs/process.go | 2 ++ .../Microsoft/hcsshim/internal/gcs/protocol.go | 2 ++ .../Microsoft/hcsshim/internal/hcs/callback.go | 2 ++ .../github.com/Microsoft/hcsshim/internal/hcs/doc.go | 1 + .../Microsoft/hcsshim/internal/hcs/errors.go | 2 ++ .../Microsoft/hcsshim/internal/hcs/process.go | 5 +++-- .../hcsshim/internal/hcs/schema1/schema1.go | 4 +++- .../Microsoft/hcsshim/internal/hcs/service.go | 2 ++ .../Microsoft/hcsshim/internal/hcs/system.go | 4 +++- .../Microsoft/hcsshim/internal/hcs/utils.go | 2 ++ .../Microsoft/hcsshim/internal/hcs/waithelper.go | 2 ++ .../Microsoft/hcsshim/internal/hcserror/doc.go | 1 + .../Microsoft/hcsshim/internal/hcserror/hcserror.go | 2 ++ .../Microsoft/hcsshim/internal/hcsoci/create.go | 1 - .../Microsoft/hcsshim/internal/hcsoci/devices.go | 4 ++-- .../Microsoft/hcsshim/internal/hcsoci/doc.go | 1 + .../Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go | 1 - .../Microsoft/hcsshim/internal/hcsoci/network.go | 2 ++ .../github.com/Microsoft/hcsshim/internal/hns/doc.go | 1 + .../Microsoft/hcsshim/internal/hns/hnsendpoint.go | 4 ++-- .../Microsoft/hcsshim/internal/hns/hnsfuncs.go | 2 ++ .../Microsoft/hcsshim/internal/hns/hnsglobals.go | 2 ++ .../Microsoft/hcsshim/internal/hns/hnsnetwork.go | 9 ++++++--- .../Microsoft/hcsshim/internal/hns/hnspolicylist.go | 2 ++ .../Microsoft/hcsshim/internal/hns/hnssupport.go | 2 ++ .../Microsoft/hcsshim/internal/hns/namespace.go | 2 ++ .../Microsoft/hcsshim/internal/interop/doc.go | 1 + .../Microsoft/hcsshim/internal/interop/interop.go | 2 ++ .../Microsoft/hcsshim/internal/layers/doc.go | 2 ++ .../Microsoft/hcsshim/internal/layers/layers.go | 1 - .../Microsoft/hcsshim/internal/lcow/common.go | 2 ++ .../Microsoft/hcsshim/internal/lcow/disk.go | 2 ++ .../Microsoft/hcsshim/internal/lcow/doc.go | 1 + .../Microsoft/hcsshim/internal/lcow/scratch.go | 2 ++ .../Microsoft/hcsshim/internal/oci/sandbox.go | 1 + .../github.com/Microsoft/hcsshim/internal/oci/uvm.go | 4 +++- .../Microsoft/hcsshim/internal/processorinfo/doc.go | 1 + .../internal/processorinfo/host_information.go | 2 ++ .../internal/processorinfo/processor_count.go | 2 ++ .../Microsoft/hcsshim/internal/regstate/doc.go | 1 + .../Microsoft/hcsshim/internal/regstate/regstate.go | 2 ++ .../Microsoft/hcsshim/internal/resources/doc.go | 3 +++ .../hcsshim/internal/resources/resources.go | 4 ++-- .../Microsoft/hcsshim/internal/runhcs/container.go | 2 ++ .../Microsoft/hcsshim/internal/runhcs/vm.go | 2 ++ .../Microsoft/hcsshim/internal/safefile/do.go | 1 + .../Microsoft/hcsshim/internal/safefile/safeopen.go | 3 ++- .../Microsoft/hcsshim/internal/schemaversion/doc.go | 1 + .../Microsoft/hcsshim/internal/shimdiag/shimdiag.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/capabilities.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/clone.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/combine_layers.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/computeagent.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/counter.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/cpugroups.go | 2 ++ .../hcsshim/internal/uvm/cpulimits_update.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/create.go | 4 +++- .../Microsoft/hcsshim/internal/uvm/create_lcow.go | 12 ++++++------ .../Microsoft/hcsshim/internal/uvm/create_wcow.go | 8 +++++--- .../hcsshim/internal/uvm/delete_container.go | 2 ++ .../github.com/Microsoft/hcsshim/internal/uvm/doc.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/dumpstacks.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/guest_request.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/hvsocket.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/memory_update.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/modify.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/network.go | 4 +++- .../Microsoft/hcsshim/internal/uvm/pipes.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/plan9.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/scsi.go | 3 ++- .../hcsshim/internal/uvm/security_policy.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/share.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/start.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/stats.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/timezone.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/types.go | 4 ++-- .../Microsoft/hcsshim/internal/uvm/update_uvm.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/virtual_device.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/vpmem.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/vpmem_mapped.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/vsmb.go | 2 ++ .../Microsoft/hcsshim/internal/uvm/wait.go | 2 ++ .../Microsoft/hcsshim/internal/uvmfolder/doc.go | 1 + .../Microsoft/hcsshim/internal/vmcompute/doc.go | 1 + .../hcsshim/internal/vmcompute/vmcompute.go | 2 ++ .../hcsshim/internal/wclayer/activatelayer.go | 2 ++ .../Microsoft/hcsshim/internal/wclayer/baselayer.go | 3 ++- .../hcsshim/internal/wclayer/createlayer.go | 2 ++ .../hcsshim/internal/wclayer/createscratchlayer.go | 2 ++ .../hcsshim/internal/wclayer/deactivatelayer.go | 2 ++ .../hcsshim/internal/wclayer/destroylayer.go | 2 ++ .../Microsoft/hcsshim/internal/wclayer/doc.go | 4 ++++ .../hcsshim/internal/wclayer/expandscratchsize.go | 2 ++ .../hcsshim/internal/wclayer/exportlayer.go | 2 ++ .../hcsshim/internal/wclayer/getlayermountpath.go | 2 ++ .../hcsshim/internal/wclayer/getsharedbaseimages.go | 2 ++ .../hcsshim/internal/wclayer/grantvmaccess.go | 2 ++ .../hcsshim/internal/wclayer/importlayer.go | 2 ++ .../hcsshim/internal/wclayer/layerexists.go | 2 ++ .../Microsoft/hcsshim/internal/wclayer/layerid.go | 2 ++ .../Microsoft/hcsshim/internal/wclayer/layerutils.go | 2 ++ .../Microsoft/hcsshim/internal/wclayer/legacy.go | 3 ++- .../Microsoft/hcsshim/internal/wclayer/nametoguid.go | 2 ++ .../hcsshim/internal/wclayer/preparelayer.go | 2 ++ .../hcsshim/internal/wclayer/processimage.go | 2 ++ .../hcsshim/internal/wclayer/unpreparelayer.go | 2 ++ .../Microsoft/hcsshim/internal/wclayer/wclayer.go | 5 ++--- .../Microsoft/hcsshim/internal/wcow/doc.go | 1 + .../Microsoft/hcsshim/internal/wcow/scratch.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/console.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/devices.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/doc.go | 3 +++ .../Microsoft/hcsshim/internal/winapi/errors.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/filesystem.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/jobobject.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/system.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/user.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/utils.go | 2 ++ .../Microsoft/hcsshim/internal/winapi/winapi.go | 2 -- test/vendor/github.com/Microsoft/hcsshim/layer.go | 2 ++ .../Microsoft/hcsshim/osversion/osversion_windows.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/doc.go | 1 + .../Microsoft/hcsshim/pkg/go-runhcs/runhcs.go | 8 +++++--- .../hcsshim/pkg/go-runhcs/runhcs_create-scratch.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go | 4 +++- .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go | 4 +++- .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go | 2 ++ .../hcsshim/pkg/go-runhcs/runhcs_resize-tty.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go | 2 ++ .../Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go | 2 ++ .../Microsoft/hcsshim/pkg/ociwclayer/doc.go | 3 +++ .../Microsoft/hcsshim/pkg/ociwclayer/export.go | 4 ++-- .../Microsoft/hcsshim/pkg/ociwclayer/import.go | 2 ++ .../pkg/securitypolicy/securitypolicyenforcer.go | 2 +- test/vendor/github.com/Microsoft/hcsshim/process.go | 2 ++ 623 files changed, 1246 insertions(+), 263 deletions(-) create mode 100644 hcn/doc.go create mode 100644 internal/clone/doc.go create mode 100644 internal/cmd/doc.go create mode 100644 internal/cni/doc.go create mode 100644 internal/conpty/doc.go create mode 100644 internal/copyfile/doc.go create mode 100644 internal/cpugroup/doc.go create mode 100644 internal/credentials/doc.go create mode 100644 internal/devices/doc.go create mode 100644 internal/exec/doc.go create mode 100644 internal/gcs/doc.go create mode 100644 internal/guest/bridge/doc.go create mode 100644 internal/guest/kmsg/doc.go create mode 100644 internal/guest/network/doc.go create mode 100644 internal/guest/runtime/doc.go create mode 100644 internal/guest/runtime/hcsv2/doc.go create mode 100644 internal/guest/runtime/runc/doc.go create mode 100644 internal/guest/stdio/doc.go create mode 100644 internal/guest/storage/crypt/doc.go create mode 100644 internal/guest/storage/devicemapper/doc.go create mode 100644 internal/guest/storage/doc.go create mode 100644 internal/guest/storage/overlay/doc.go create mode 100644 internal/guest/storage/pci/doc.go create mode 100644 internal/guest/storage/plan9/doc.go create mode 100644 internal/guest/storage/pmem/doc.go create mode 100644 internal/guest/storage/scsi/doc.go create mode 100644 internal/guest/transport/doc.go create mode 100644 internal/hcs/doc.go create mode 100644 internal/hcserror/doc.go create mode 100644 internal/hcsoci/doc.go create mode 100644 internal/hns/doc.go create mode 100644 internal/interop/doc.go create mode 100644 internal/jobcontainers/doc.go create mode 100644 internal/jobobject/doc.go create mode 100644 internal/layers/doc.go create mode 100644 internal/lcow/doc.go create mode 100644 internal/processorinfo/doc.go create mode 100644 internal/regstate/doc.go create mode 100644 internal/resources/doc.go create mode 100644 internal/safefile/do.go create mode 100644 internal/schemaversion/doc.go create mode 100644 internal/uvm/doc.go create mode 100644 internal/uvmfolder/doc.go create mode 100644 internal/vm/hcs/doc.go create mode 100644 internal/vm/remotevm/doc.go create mode 100644 internal/vmcompute/doc.go create mode 100644 internal/wclayer/doc.go create mode 100644 internal/wcow/doc.go create mode 100644 internal/winapi/doc.go create mode 100644 internal/windevice/doc.go create mode 100644 internal/winobjdir/doc.go create mode 100644 pkg/go-runhcs/doc.go create mode 100644 pkg/ociwclayer/doc.go rename test/cri-containerd/{gmsa.go => gmsa_test.go} (94%) rename test/cri-containerd/{sandbox.go => sandbox_test.go} (97%) rename test/cri-containerd/{update_utilities.go => update_utilities_test.go} (97%) create mode 100644 test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go diff --git a/.gitignore b/.gitignore index c91812a4b4..292630f9ea 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,7 @@ rootfs-conv/* /build/ deps/* -out/* \ No newline at end of file +out/* + +go.work +go.work.sum \ No newline at end of file diff --git a/Makefile b/Makefile index 362ddea7c6..e1a0f51129 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ clean: rm -rf bin deps rootfs out test: - cd $(SRCROOT) && go test -v ./internal/guest/... + cd $(SRCROOT) && $(GO) test -v ./internal/guest/... rootfs: out/rootfs.vhd diff --git a/cmd/containerd-shim-runhcs-v1/clone.go b/cmd/containerd-shim-runhcs-v1/clone.go index 221aabacab..42ebf71d63 100644 --- a/cmd/containerd-shim-runhcs-v1/clone.go +++ b/cmd/containerd-shim-runhcs-v1/clone.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/delete.go b/cmd/containerd-shim-runhcs-v1/delete.go index 2f8c50e597..69905c0f72 100644 --- a/cmd/containerd-shim-runhcs-v1/delete.go +++ b/cmd/containerd-shim-runhcs-v1/delete.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/events.go b/cmd/containerd-shim-runhcs-v1/events.go index 267b315d40..f15479c282 100644 --- a/cmd/containerd-shim-runhcs-v1/events.go +++ b/cmd/containerd-shim-runhcs-v1/events.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/events_test.go b/cmd/containerd-shim-runhcs-v1/events_test.go index 04f3d4897c..8c70c1043c 100644 --- a/cmd/containerd-shim-runhcs-v1/events_test.go +++ b/cmd/containerd-shim-runhcs-v1/events_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import "context" diff --git a/cmd/containerd-shim-runhcs-v1/exec.go b/cmd/containerd-shim-runhcs-v1/exec.go index 5a476757d8..f39f150b46 100644 --- a/cmd/containerd-shim-runhcs-v1/exec.go +++ b/cmd/containerd-shim-runhcs-v1/exec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_clone.go b/cmd/containerd-shim-runhcs-v1/exec_clone.go index 078149f140..f2c2ce03ff 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_clone.go +++ b/cmd/containerd-shim-runhcs-v1/exec_clone.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_hcs.go b/cmd/containerd-shim-runhcs-v1/exec_hcs.go index b3b8e84ee9..ffad91cb5a 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_hcs.go +++ b/cmd/containerd-shim-runhcs-v1/exec_hcs.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_test.go b/cmd/containerd-shim-runhcs-v1/exec_test.go index 3ba98bdb65..ef4e5a698b 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_test.go +++ b/cmd/containerd-shim-runhcs-v1/exec_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go index 0a4b4e7eb7..466cdb8b91 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go +++ b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go index 066f6c0470..aab573d562 100644 --- a/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go +++ b/cmd/containerd-shim-runhcs-v1/exec_wcow_podsandbox_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/main.go b/cmd/containerd-shim-runhcs-v1/main.go index 375b2dcb46..f64d93ec30 100644 --- a/cmd/containerd-shim-runhcs-v1/main.go +++ b/cmd/containerd-shim-runhcs-v1/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/pod.go b/cmd/containerd-shim-runhcs-v1/pod.go index b241d3439c..5069f4014b 100644 --- a/cmd/containerd-shim-runhcs-v1/pod.go +++ b/cmd/containerd-shim-runhcs-v1/pod.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/pod_test.go b/cmd/containerd-shim-runhcs-v1/pod_test.go index ff9941c8ae..d3ad0ba8b5 100644 --- a/cmd/containerd-shim-runhcs-v1/pod_test.go +++ b/cmd/containerd-shim-runhcs-v1/pod_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/serve.go b/cmd/containerd-shim-runhcs-v1/serve.go index c772dbf4a8..47e204cbb6 100644 --- a/cmd/containerd-shim-runhcs-v1/serve.go +++ b/cmd/containerd-shim-runhcs-v1/serve.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service.go b/cmd/containerd-shim-runhcs-v1/service.go index c1a080eff5..92abc70a5c 100644 --- a/cmd/containerd-shim-runhcs-v1/service.go +++ b/cmd/containerd-shim-runhcs-v1/service.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service_internal.go b/cmd/containerd-shim-runhcs-v1/service_internal.go index 0571a13cd3..3c64932e80 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go b/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go index 0d1fcc7766..7850630e62 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal_podshim_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go b/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go index 43fbaa66d1..ad97a71790 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal_taskshim_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -609,7 +611,7 @@ func Test_TaskShim_waitInternal_InitTaskID_2ndExecID_Success(t *testing.T) { } } -func Test_TaskShim_statsInternal_InitTaskID_Sucess(t *testing.T) { +func Test_TaskShim_statsInternal_InitTaskID_Success(t *testing.T) { testNames := []string{"WCOW", "LCOW"} for i, isWCOW := range []bool{true, false} { t.Run(testNames[i], func(t *testing.T) { diff --git a/cmd/containerd-shim-runhcs-v1/service_internal_test.go b/cmd/containerd-shim-runhcs-v1/service_internal_test.go index 2d0e483963..1e23ccc678 100644 --- a/cmd/containerd-shim-runhcs-v1/service_internal_test.go +++ b/cmd/containerd-shim-runhcs-v1/service_internal_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/start.go b/cmd/containerd-shim-runhcs-v1/start.go index 520ddcb7f3..a0c06afb64 100644 --- a/cmd/containerd-shim-runhcs-v1/start.go +++ b/cmd/containerd-shim-runhcs-v1/start.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task.go b/cmd/containerd-shim-runhcs-v1/task.go index 5a0210a4af..6bae368284 100644 --- a/cmd/containerd-shim-runhcs-v1/task.go +++ b/cmd/containerd-shim-runhcs-v1/task.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_hcs.go b/cmd/containerd-shim-runhcs-v1/task_hcs.go index 8238e7f172..d32fade6e5 100644 --- a/cmd/containerd-shim-runhcs-v1/task_hcs.go +++ b/cmd/containerd-shim-runhcs-v1/task_hcs.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_hcs_test.go b/cmd/containerd-shim-runhcs-v1/task_hcs_test.go index cbeeaabda7..a279e434f5 100644 --- a/cmd/containerd-shim-runhcs-v1/task_hcs_test.go +++ b/cmd/containerd-shim-runhcs-v1/task_hcs_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_test.go b/cmd/containerd-shim-runhcs-v1/task_test.go index 9b73486dd7..cb9e975ecc 100644 --- a/cmd/containerd-shim-runhcs-v1/task_test.go +++ b/cmd/containerd-shim-runhcs-v1/task_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go b/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go index 576573466c..c99dea3483 100644 --- a/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go +++ b/cmd/containerd-shim-runhcs-v1/task_wcow_podsandbox.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/device-util/main.go b/cmd/device-util/main.go index 8ca35f3d3a..61deb0f977 100644 --- a/cmd/device-util/main.go +++ b/cmd/device-util/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/jobobject-util/main.go b/cmd/jobobject-util/main.go index 34b18a31f0..5d52a53454 100644 --- a/cmd/jobobject-util/main.go +++ b/cmd/jobobject-util/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/computeagent_cache.go b/cmd/ncproxy/computeagent_cache.go index 66b7a93ca4..bc2200783f 100644 --- a/cmd/ncproxy/computeagent_cache.go +++ b/cmd/ncproxy/computeagent_cache.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -38,7 +40,6 @@ func (c *computeAgentCache) getAllAndClear() ([]*computeAgentClient, error) { results = append(results, agent) } return results, nil - } func (c *computeAgentCache) get(cid string) (*computeAgentClient, error) { diff --git a/cmd/ncproxy/config.go b/cmd/ncproxy/config.go index e75373f7f4..ab5e0aaae4 100644 --- a/cmd/ncproxy/config.go +++ b/cmd/ncproxy/config.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/hcn.go b/cmd/ncproxy/hcn.go index 7c0063f976..9f75e40332 100644 --- a/cmd/ncproxy/hcn.go +++ b/cmd/ncproxy/hcn.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/hcn_networking_test.go b/cmd/ncproxy/hcn_networking_test.go index e0bd32411c..0d4533ebe8 100644 --- a/cmd/ncproxy/hcn_networking_test.go +++ b/cmd/ncproxy/hcn_networking_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/main.go b/cmd/ncproxy/main.go index 2430c1a450..319b0d2759 100644 --- a/cmd/ncproxy/main.go +++ b/cmd/ncproxy/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/ncproxy.go b/cmd/ncproxy/ncproxy.go index 922c615741..f5de74c66f 100644 --- a/cmd/ncproxy/ncproxy.go +++ b/cmd/ncproxy/ncproxy.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -153,7 +155,6 @@ func (s *grpcService) AddNIC(ctx context.Context, req *ncproxygrpc.AddNICRequest return nil, err } return &ncproxygrpc.AddNICResponse{}, nil - } func (s *grpcService) ModifyNIC(ctx context.Context, req *ncproxygrpc.ModifyNICRequest) (_ *ncproxygrpc.ModifyNICResponse, err error) { diff --git a/cmd/ncproxy/ncproxy_networking_test.go b/cmd/ncproxy/ncproxy_networking_test.go index 4d30acdbb8..1171c9cce2 100644 --- a/cmd/ncproxy/ncproxy_networking_test.go +++ b/cmd/ncproxy/ncproxy_networking_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/run.go b/cmd/ncproxy/run.go index 4e49de4aa5..6bfbd590e7 100644 --- a/cmd/ncproxy/run.go +++ b/cmd/ncproxy/run.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/server.go b/cmd/ncproxy/server.go index 975650618c..1be82a1146 100644 --- a/cmd/ncproxy/server.go +++ b/cmd/ncproxy/server.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/server_test.go b/cmd/ncproxy/server_test.go index eb08925d50..15921e2fa9 100644 --- a/cmd/ncproxy/server_test.go +++ b/cmd/ncproxy/server_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/service.go b/cmd/ncproxy/service.go index 1d45b81a55..83219c5868 100644 --- a/cmd/ncproxy/service.go +++ b/cmd/ncproxy/service.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/ncproxy/utilities_test.go b/cmd/ncproxy/utilities_test.go index 5a8411558d..fc9af997cd 100644 --- a/cmd/ncproxy/utilities_test.go +++ b/cmd/ncproxy/utilities_test.go @@ -32,7 +32,6 @@ func networkExists(targetName string, networks []*ncproxygrpc.GetNetworkResponse return true } } - } return false } @@ -50,7 +49,6 @@ func endpointExists(targetName string, endpoints []*ncproxygrpc.GetEndpointRespo return true } } - } return false } diff --git a/cmd/runhcs/container.go b/cmd/runhcs/container.go index 6726606839..c4b8d4ee43 100644 --- a/cmd/runhcs/container.go +++ b/cmd/runhcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -36,7 +38,7 @@ type persistedState struct { ID string `json:",omitempty"` // Owner is the owner value passed into the runhcs command and may be `""`. Owner string `json:",omitempty"` - // SandboxID is the sandbox identifer passed in via OCI specifications. This + // SandboxID is the sandbox identifier passed in via OCI specifications. This // can either be the sandbox itself or the sandbox this container should run // in. See `parseSandboxAnnotations`. SandboxID string `json:",omitempty"` @@ -203,8 +205,8 @@ func launchShim(cmd, pidFile, logFile string, args []string, data interface{}) ( // different runtimes to represent a sandbox ID, and sandbox type. // // If found returns the tuple `(sandboxID, isSandbox)` where `isSandbox == true` -// indicates the identifer is the sandbox itself; `isSandbox == false` indicates -// the identifer is the sandbox in which to place this container. Otherwise +// indicates the identifier is the sandbox itself; `isSandbox == false` indicates +// the identifier is the sandbox in which to place this container. Otherwise // returns `("", false)`. func parseSandboxAnnotations(a map[string]string) (string, bool) { var t, id string diff --git a/cmd/runhcs/create-scratch.go b/cmd/runhcs/create-scratch.go index 2572186856..9f63df4a69 100644 --- a/cmd/runhcs/create-scratch.go +++ b/cmd/runhcs/create-scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/create.go b/cmd/runhcs/create.go index 7443729a53..cb1f8023ad 100644 --- a/cmd/runhcs/create.go +++ b/cmd/runhcs/create.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/delete.go b/cmd/runhcs/delete.go index 3edf3b8d41..91a150ff7a 100644 --- a/cmd/runhcs/delete.go +++ b/cmd/runhcs/delete.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/exec.go b/cmd/runhcs/exec.go index 3b4941f77c..f97f0f84a4 100644 --- a/cmd/runhcs/exec.go +++ b/cmd/runhcs/exec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/kill.go b/cmd/runhcs/kill.go index 1e7328c824..2f21a7c080 100644 --- a/cmd/runhcs/kill.go +++ b/cmd/runhcs/kill.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/list.go b/cmd/runhcs/list.go index a1b1a7555e..a022015e08 100644 --- a/cmd/runhcs/list.go +++ b/cmd/runhcs/list.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/main.go b/cmd/runhcs/main.go index 4ee443b837..39eeba503f 100644 --- a/cmd/runhcs/main.go +++ b/cmd/runhcs/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/pause.go b/cmd/runhcs/pause.go index b7878c2e11..56973d2d1c 100644 --- a/cmd/runhcs/pause.go +++ b/cmd/runhcs/pause.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/prepare-disk.go b/cmd/runhcs/prepare-disk.go index 6d0a437af6..bebd641c20 100644 --- a/cmd/runhcs/prepare-disk.go +++ b/cmd/runhcs/prepare-disk.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/ps.go b/cmd/runhcs/ps.go index d83181b967..d989d31ac2 100644 --- a/cmd/runhcs/ps.go +++ b/cmd/runhcs/ps.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/run.go b/cmd/runhcs/run.go index a88bf8b4df..29f325e8ca 100644 --- a/cmd/runhcs/run.go +++ b/cmd/runhcs/run.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/shim.go b/cmd/runhcs/shim.go index cc37503eb7..c0c57919c1 100644 --- a/cmd/runhcs/shim.go +++ b/cmd/runhcs/shim.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/spec.go b/cmd/runhcs/spec.go index 005afdf442..4fca5c8c8b 100644 --- a/cmd/runhcs/spec.go +++ b/cmd/runhcs/spec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/start.go b/cmd/runhcs/start.go index d5d004cdf5..019e7e39b3 100644 --- a/cmd/runhcs/start.go +++ b/cmd/runhcs/start.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/state.go b/cmd/runhcs/state.go index bae1c3deea..2ece4fab9f 100644 --- a/cmd/runhcs/state.go +++ b/cmd/runhcs/state.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/tty.go b/cmd/runhcs/tty.go index 1a15c94740..c784c8ff05 100644 --- a/cmd/runhcs/tty.go +++ b/cmd/runhcs/tty.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/utils.go b/cmd/runhcs/utils.go index 846dd73351..f682ceecb1 100644 --- a/cmd/runhcs/utils.go +++ b/cmd/runhcs/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/utils_test.go b/cmd/runhcs/utils_test.go index 8fbebcdae2..5dfeb07e03 100644 --- a/cmd/runhcs/utils_test.go +++ b/cmd/runhcs/utils_test.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/runhcs/vm.go b/cmd/runhcs/vm.go index 9e684e486b..93e96242f4 100644 --- a/cmd/runhcs/vm.go +++ b/cmd/runhcs/vm.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/exec.go b/cmd/shimdiag/exec.go index dc54332777..403ca7f987 100644 --- a/cmd/shimdiag/exec.go +++ b/cmd/shimdiag/exec.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/list.go b/cmd/shimdiag/list.go index 4bb771acec..fec1b04031 100644 --- a/cmd/shimdiag/list.go +++ b/cmd/shimdiag/list.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/share.go b/cmd/shimdiag/share.go index 328e32f83f..703ba65996 100644 --- a/cmd/shimdiag/share.go +++ b/cmd/shimdiag/share.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/shimdiag.go b/cmd/shimdiag/shimdiag.go index 55fbb4687b..e658011d9c 100644 --- a/cmd/shimdiag/shimdiag.go +++ b/cmd/shimdiag/shimdiag.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/shimdiag/stacks.go b/cmd/shimdiag/stacks.go index 1ef6561d85..81d58236f2 100644 --- a/cmd/shimdiag/stacks.go +++ b/cmd/shimdiag/stacks.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/create.go b/cmd/wclayer/create.go index 5a48cbc355..7d797ec6cd 100644 --- a/cmd/wclayer/create.go +++ b/cmd/wclayer/create.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/export.go b/cmd/wclayer/export.go index b02b2eb365..d739e457de 100644 --- a/cmd/wclayer/export.go +++ b/cmd/wclayer/export.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/import.go b/cmd/wclayer/import.go index ea0f823aa8..523e0fba27 100644 --- a/cmd/wclayer/import.go +++ b/cmd/wclayer/import.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/mount.go b/cmd/wclayer/mount.go index 096aba60cf..613de1f8ea 100644 --- a/cmd/wclayer/mount.go +++ b/cmd/wclayer/mount.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/remove.go b/cmd/wclayer/remove.go index db5f73df8a..da27617047 100644 --- a/cmd/wclayer/remove.go +++ b/cmd/wclayer/remove.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/cmd/wclayer/volumemountutils.go b/cmd/wclayer/volumemountutils.go index 316252c8f5..b9a02e8477 100644 --- a/cmd/wclayer/volumemountutils.go +++ b/cmd/wclayer/volumemountutils.go @@ -1,3 +1,5 @@ +//go:build windows + package main // Simple wrappers around SetVolumeMountPoint and DeleteVolumeMountPoint diff --git a/cmd/wclayer/wclayer.go b/cmd/wclayer/wclayer.go index cc8c0dca14..1a4a9b2370 100644 --- a/cmd/wclayer/wclayer.go +++ b/cmd/wclayer/wclayer.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/computestorage/attach.go b/computestorage/attach.go index 7f1f2823dd..05b6ea7bd4 100644 --- a/computestorage/attach.go +++ b/computestorage/attach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/destroy.go b/computestorage/destroy.go index 8e28e6c504..8dd942bab9 100644 --- a/computestorage/destroy.go +++ b/computestorage/destroy.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/detach.go b/computestorage/detach.go index 435473257e..934ee5b1a6 100644 --- a/computestorage/detach.go +++ b/computestorage/detach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/export.go b/computestorage/export.go index 2db6d40399..cf90d9b6c9 100644 --- a/computestorage/export.go +++ b/computestorage/export.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/format.go b/computestorage/format.go index 61d8d5a634..05e0729f50 100644 --- a/computestorage/format.go +++ b/computestorage/format.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/helpers.go b/computestorage/helpers.go index 87fee452cd..3bbbc226c0 100644 --- a/computestorage/helpers.go +++ b/computestorage/helpers.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/import.go b/computestorage/import.go index 0c61dab329..a40b4037cc 100644 --- a/computestorage/import.go +++ b/computestorage/import.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/initialize.go b/computestorage/initialize.go index 53ed8ea6ed..ddd8f318da 100644 --- a/computestorage/initialize.go +++ b/computestorage/initialize.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/mount.go b/computestorage/mount.go index fcdbbef814..6e445e766b 100644 --- a/computestorage/mount.go +++ b/computestorage/mount.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/computestorage/setup.go b/computestorage/setup.go index 06aaf841e8..4b27b895ad 100644 --- a/computestorage/setup.go +++ b/computestorage/setup.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/container.go b/container.go index bfd722898e..640e0b26f4 100644 --- a/container.go +++ b/container.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/errors.go b/errors.go index a1a2912177..594bbfb7a8 100644 --- a/errors.go +++ b/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/ext4/internal/compactext4/verify_linux_test.go b/ext4/internal/compactext4/verify_linux_test.go index 86ece03b50..e88d59c874 100644 --- a/ext4/internal/compactext4/verify_linux_test.go +++ b/ext4/internal/compactext4/verify_linux_test.go @@ -1,3 +1,5 @@ +//go:build linux + package compactext4 import ( diff --git a/hcn/doc.go b/hcn/doc.go new file mode 100644 index 0000000000..83b2fffb02 --- /dev/null +++ b/hcn/doc.go @@ -0,0 +1,3 @@ +// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server +// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +package hcn diff --git a/hcn/hcn.go b/hcn/hcn.go index fe3d13a052..17539b8694 100644 --- a/hcn/hcn.go +++ b/hcn/hcn.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( diff --git a/hcn/hcnendpoint.go b/hcn/hcnendpoint.go index 213cfe0b1f..267bbe7cb1 100644 --- a/hcn/hcnendpoint.go +++ b/hcn/hcnendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnendpoint_test.go b/hcn/hcnendpoint_test.go index 02ae9d63a6..a7eeda2e94 100644 --- a/hcn/hcnendpoint_test.go +++ b/hcn/hcnendpoint_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnerrors.go b/hcn/hcnerrors.go index 1d52d2e72a..8b719fa112 100644 --- a/hcn/hcnerrors.go +++ b/hcn/hcnerrors.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( @@ -87,7 +87,7 @@ func new(hr error, title string, rest string) error { // // Note that the below errors are not errors returned by hcn itself -// we wish to seperate them as they are shim usage error +// we wish to separate them as they are shim usage error // // NetworkNotFoundError results from a failed search for a network by Id or Name diff --git a/hcn/hcnerrors_test.go b/hcn/hcnerrors_test.go index b064d25a73..671f7cf7df 100644 --- a/hcn/hcnerrors_test.go +++ b/hcn/hcnerrors_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnglobals.go b/hcn/hcnglobals.go index 14903bc5e9..25e368fc23 100644 --- a/hcn/hcnglobals.go +++ b/hcn/hcnglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnloadbalancer.go b/hcn/hcnloadbalancer.go index 28fa855656..f68d39053e 100644 --- a/hcn/hcnloadbalancer.go +++ b/hcn/hcnloadbalancer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnloadbalancer_test.go b/hcn/hcnloadbalancer_test.go index a3ec0764ff..28dc12705b 100644 --- a/hcn/hcnloadbalancer_test.go +++ b/hcn/hcnloadbalancer_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnnamespace.go b/hcn/hcnnamespace.go index 12e69de9cc..7539e39fa8 100644 --- a/hcn/hcnnamespace.go +++ b/hcn/hcnnamespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnnamespace_test.go b/hcn/hcnnamespace_test.go index c075705525..d4c19d15f1 100644 --- a/hcn/hcnnamespace_test.go +++ b/hcn/hcnnamespace_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnnetwork.go b/hcn/hcnnetwork.go index c36b136387..41dcdac24a 100644 --- a/hcn/hcnnetwork.go +++ b/hcn/hcnnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnnetwork_test.go b/hcn/hcnnetwork_test.go index 642be24ede..2508845975 100644 --- a/hcn/hcnnetwork_test.go +++ b/hcn/hcnnetwork_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnpolicy.go b/hcn/hcnpolicy.go index 56bde82e1b..a695f1c27d 100644 --- a/hcn/hcnpolicy.go +++ b/hcn/hcnpolicy.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnroute.go b/hcn/hcnroute.go index 52e2498462..d0761d6bd0 100644 --- a/hcn/hcnroute.go +++ b/hcn/hcnroute.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnroute_test.go b/hcn/hcnroute_test.go index bbf5c83dd8..9d3222b7d8 100644 --- a/hcn/hcnroute_test.go +++ b/hcn/hcnroute_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnsupport.go b/hcn/hcnsupport.go index bacb91feda..00af20be31 100644 --- a/hcn/hcnsupport.go +++ b/hcn/hcnsupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/hcn/hcnsupport_test.go b/hcn/hcnsupport_test.go index 3b9967cd46..35c2f16fcf 100644 --- a/hcn/hcnsupport_test.go +++ b/hcn/hcnsupport_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnutils_test.go b/hcn/hcnutils_test.go index 63d378f58f..039f920ad6 100644 --- a/hcn/hcnutils_test.go +++ b/hcn/hcnutils_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hcnv1schema_test.go b/hcn/hcnv1schema_test.go index 9683da9329..7558627915 100644 --- a/hcn/hcnv1schema_test.go +++ b/hcn/hcnv1schema_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcn/hnsv1_test.go b/hcn/hnsv1_test.go index d727851d60..ef668cb8a9 100644 --- a/hcn/hnsv1_test.go +++ b/hcn/hnsv1_test.go @@ -1,5 +1,5 @@ -//go:build integration -// +build integration +//go:build windows && integration +// +build windows,integration package hcn diff --git a/hcsshim.go b/hcsshim.go index ceb3ac85ee..95dc2a0255 100644 --- a/hcsshim.go +++ b/hcsshim.go @@ -1,3 +1,5 @@ +//go:build windows + // Shim for the Host Compute Service (HCS) to manage Windows Server // containers and Hyper-V containers. diff --git a/hnsendpoint.go b/hnsendpoint.go index 9e0059447d..ea71135acc 100644 --- a/hnsendpoint.go +++ b/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnsglobals.go b/hnsglobals.go index 2b53819047..c564bf4a35 100644 --- a/hnsglobals.go +++ b/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnsnetwork.go b/hnsnetwork.go index 25240d9ccc..925c212495 100644 --- a/hnsnetwork.go +++ b/hnsnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnspolicylist.go b/hnspolicylist.go index 55aaa4a50e..9bfe61ee83 100644 --- a/hnspolicylist.go +++ b/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/hnssupport.go b/hnssupport.go index 69405244b6..d97681e0ca 100644 --- a/hnssupport.go +++ b/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/interface.go b/interface.go index 300eb59966..81a2819516 100644 --- a/interface.go +++ b/interface.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/internal/clone/doc.go b/internal/clone/doc.go new file mode 100644 index 0000000000..c65f2e337e --- /dev/null +++ b/internal/clone/doc.go @@ -0,0 +1 @@ +package clone diff --git a/internal/clone/registry.go b/internal/clone/registry.go index 67fb7ef077..1727d57afb 100644 --- a/internal/clone/registry.go +++ b/internal/clone/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package clone import ( diff --git a/internal/cmd/cmd.go b/internal/cmd/cmd.go index 91a7da0277..758eb78880 100644 --- a/internal/cmd/cmd.go +++ b/internal/cmd/cmd.go @@ -1,5 +1,5 @@ -// Package cmd provides functionality used to execute commands inside of containers -// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +//go:build windows + package cmd import ( diff --git a/internal/cmd/cmd_test.go b/internal/cmd/cmd_test.go index 5a7b7b98c3..c87fd07793 100644 --- a/internal/cmd/cmd_test.go +++ b/internal/cmd/cmd_test.go @@ -1,4 +1,5 @@ -// build +windows +//go:build windows +// +build windows package cmd diff --git a/internal/cmd/diag.go b/internal/cmd/diag.go index f4caff3251..e397bb85ee 100644 --- a/internal/cmd/diag.go +++ b/internal/cmd/diag.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/doc.go b/internal/cmd/doc.go new file mode 100644 index 0000000000..7fe443fc92 --- /dev/null +++ b/internal/cmd/doc.go @@ -0,0 +1,3 @@ +// Package cmd provides functionality used to execute commands inside of containers +// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +package cmd diff --git a/internal/cmd/io.go b/internal/cmd/io.go index 0912af160c..75ddd1f355 100644 --- a/internal/cmd/io.go +++ b/internal/cmd/io.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/io_binary.go b/internal/cmd/io_binary.go index ecfd1fa5ef..989a53c93c 100644 --- a/internal/cmd/io_binary.go +++ b/internal/cmd/io_binary.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/io_binary_test.go b/internal/cmd/io_binary_test.go index 7ff5b24176..fcb00a511b 100644 --- a/internal/cmd/io_binary_test.go +++ b/internal/cmd/io_binary_test.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/internal/cmd/io_npipe.go b/internal/cmd/io_npipe.go index 63b9f9b732..614f34ca29 100644 --- a/internal/cmd/io_npipe.go +++ b/internal/cmd/io_npipe.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( @@ -53,7 +55,7 @@ func NewNpipeIO(ctx context.Context, stdin, stdout, stderr string, terminal bool } // We don't have any retry logic for stdin as there's no good way to detect that we'd even need to retry. If the process forwarding // stdin to the container (some client interface to exec a process in a container) exited, we'll get EOF which io.Copy treats as - // success. For fifos on Linux it seems if all fd's for the write end of the pipe dissappear, which is the same scenario, then + // success. For fifos on Linux it seems if all fd's for the write end of the pipe disappear, which is the same scenario, then // the read end will get EOF as well. nio.sin = c } diff --git a/internal/cni/doc.go b/internal/cni/doc.go new file mode 100644 index 0000000000..b94015b5aa --- /dev/null +++ b/internal/cni/doc.go @@ -0,0 +1 @@ +package cni diff --git a/internal/cni/registry.go b/internal/cni/registry.go index 2afcc6981c..3543a590d0 100644 --- a/internal/cni/registry.go +++ b/internal/cni/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package cni import ( diff --git a/internal/cni/registry_test.go b/internal/cni/registry_test.go index 9533129734..854d3727fd 100644 --- a/internal/cni/registry_test.go +++ b/internal/cni/registry_test.go @@ -1,3 +1,5 @@ +//go:build windows + package cni import ( diff --git a/internal/computeagent/doc.go b/internal/computeagent/doc.go index 4389559b9a..7df98b60c0 100644 --- a/internal/computeagent/doc.go +++ b/internal/computeagent/doc.go @@ -7,5 +7,4 @@ // The mock service is compiled using the following command: // // mockgen -source="computeagent.pb.go" -package="computeagent_mock" > mock\computeagent_mock.pb.go - package computeagent diff --git a/internal/conpty/conpty.go b/internal/conpty/conpty.go index 179c74389d..230c905738 100644 --- a/internal/conpty/conpty.go +++ b/internal/conpty/conpty.go @@ -1,3 +1,5 @@ +//go:build windows + package conpty import ( diff --git a/internal/conpty/doc.go b/internal/conpty/doc.go new file mode 100644 index 0000000000..012771ea11 --- /dev/null +++ b/internal/conpty/doc.go @@ -0,0 +1 @@ +package conpty diff --git a/internal/copyfile/copyfile.go b/internal/copyfile/copyfile.go index fe7a2faa11..61aa2dc405 100644 --- a/internal/copyfile/copyfile.go +++ b/internal/copyfile/copyfile.go @@ -1,3 +1,5 @@ +//go:build windows + package copyfile import ( diff --git a/internal/copyfile/doc.go b/internal/copyfile/doc.go new file mode 100644 index 0000000000..a2812a6ee8 --- /dev/null +++ b/internal/copyfile/doc.go @@ -0,0 +1 @@ +package copyfile diff --git a/internal/cow/cow.go b/internal/cow/cow.go index 27a62a7238..c6eeb167b9 100644 --- a/internal/cow/cow.go +++ b/internal/cow/cow.go @@ -1,3 +1,5 @@ +//go:build windows + package cow import ( diff --git a/internal/cpugroup/cpugroup.go b/internal/cpugroup/cpugroup.go index 61cd703586..3abaa9c439 100644 --- a/internal/cpugroup/cpugroup.go +++ b/internal/cpugroup/cpugroup.go @@ -1,3 +1,5 @@ +//go:build windows + package cpugroup import ( diff --git a/internal/cpugroup/cpugroup_test.go b/internal/cpugroup/cpugroup_test.go index 13cd3c83ac..c7b35e8998 100644 --- a/internal/cpugroup/cpugroup_test.go +++ b/internal/cpugroup/cpugroup_test.go @@ -1,3 +1,5 @@ +//go:build windows + package cpugroup import ( diff --git a/internal/cpugroup/doc.go b/internal/cpugroup/doc.go new file mode 100644 index 0000000000..a2c3357977 --- /dev/null +++ b/internal/cpugroup/doc.go @@ -0,0 +1 @@ +package cpugroup diff --git a/internal/credentials/credentials.go b/internal/credentials/credentials.go index 0c98eb1493..d9ec9a3490 100644 --- a/internal/credentials/credentials.go +++ b/internal/credentials/credentials.go @@ -1,9 +1,6 @@ //go:build windows // +build windows -// Package credentials holds the necessary structs and functions for adding -// and removing Container Credential Guard instances (shortened to CCG -// normally) for V2 HCS schema containers. package credentials import ( diff --git a/internal/credentials/doc.go b/internal/credentials/doc.go new file mode 100644 index 0000000000..cbf23ed082 --- /dev/null +++ b/internal/credentials/doc.go @@ -0,0 +1,4 @@ +// Package credentials holds the necessary structs and functions for adding +// and removing Container Credential Guard instances (shortened to CCG +// normally) for V2 HCS schema containers. +package credentials diff --git a/internal/devices/doc.go b/internal/devices/doc.go new file mode 100644 index 0000000000..c1c721e298 --- /dev/null +++ b/internal/devices/doc.go @@ -0,0 +1 @@ +package devices diff --git a/internal/exec/doc.go b/internal/exec/doc.go new file mode 100644 index 0000000000..bda552188c --- /dev/null +++ b/internal/exec/doc.go @@ -0,0 +1,3 @@ +// Package exec implements a minimalized external process launcher. It exists to work around some shortcomings for +// Windows scenarios that aren't exposed via the os/exec package. +package exec diff --git a/internal/exec/exec.go b/internal/exec/exec.go index 79463b3fb2..bfe197cdea 100644 --- a/internal/exec/exec.go +++ b/internal/exec/exec.go @@ -1,5 +1,5 @@ -// Package exec implements a minimalized external process launcher. It exists to work around some shortcomings for -// Windows scenarios that aren't exposed via the os/exec package. +//go:build windows + package exec import ( diff --git a/internal/exec/exec_test.go b/internal/exec/exec_test.go index 80e5eb4012..66cd016250 100644 --- a/internal/exec/exec_test.go +++ b/internal/exec/exec_test.go @@ -1,3 +1,5 @@ +//go:build windows + package exec import ( diff --git a/internal/exec/options.go b/internal/exec/options.go index 0039125f66..30bd77db02 100644 --- a/internal/exec/options.go +++ b/internal/exec/options.go @@ -1,3 +1,5 @@ +//go:build windows + package exec import ( diff --git a/internal/gcs/bridge.go b/internal/gcs/bridge.go index 22d89dd303..1e3e7c201d 100644 --- a/internal/gcs/bridge.go +++ b/internal/gcs/bridge.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/bridge_test.go b/internal/gcs/bridge_test.go index 6699ac3a32..11363804a7 100644 --- a/internal/gcs/bridge_test.go +++ b/internal/gcs/bridge_test.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/container.go b/internal/gcs/container.go index 6ec5b8b84f..bf704fb548 100644 --- a/internal/gcs/container.go +++ b/internal/gcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/doc.go b/internal/gcs/doc.go new file mode 100644 index 0000000000..260915232f --- /dev/null +++ b/internal/gcs/doc.go @@ -0,0 +1 @@ +package gcs diff --git a/internal/gcs/guestconnection.go b/internal/gcs/guestconnection.go index bdf796010c..bb28d890ff 100644 --- a/internal/gcs/guestconnection.go +++ b/internal/gcs/guestconnection.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/guestconnection_test.go b/internal/gcs/guestconnection_test.go index 1202ffa4e7..f43a30d0bf 100644 --- a/internal/gcs/guestconnection_test.go +++ b/internal/gcs/guestconnection_test.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/iochannel_test.go b/internal/gcs/iochannel_test.go index 64352f96d9..e4ab3e92d0 100644 --- a/internal/gcs/iochannel_test.go +++ b/internal/gcs/iochannel_test.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/process.go b/internal/gcs/process.go index 628cb8b0d7..60141e9f70 100644 --- a/internal/gcs/process.go +++ b/internal/gcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/gcs/protocol.go b/internal/gcs/protocol.go index 840dcb2392..8450222a1a 100644 --- a/internal/gcs/protocol.go +++ b/internal/gcs/protocol.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/internal/guest/bridge/bridge.go b/internal/guest/bridge/bridge.go index 6b371950b0..402034f479 100644 --- a/internal/guest/bridge/bridge.go +++ b/internal/guest/bridge/bridge.go @@ -1,8 +1,6 @@ //go:build linux // +build linux -// Package bridge defines the bridge struct, which implements the control loop -// and functions of the GCS's bridge client. package bridge import ( diff --git a/internal/guest/bridge/doc.go b/internal/guest/bridge/doc.go new file mode 100644 index 0000000000..727a615b7b --- /dev/null +++ b/internal/guest/bridge/doc.go @@ -0,0 +1,3 @@ +// Package bridge defines the bridge struct, which implements the control loop +// and functions of the GCS's bridge client. +package bridge diff --git a/internal/guest/kmsg/doc.go b/internal/guest/kmsg/doc.go new file mode 100644 index 0000000000..88a860d8e1 --- /dev/null +++ b/internal/guest/kmsg/doc.go @@ -0,0 +1,8 @@ +// Package kmsg contains support for parsing Linux kernel log entries read from +// /dev/kmsg. These are the same log entries that can be read via the `dmesg` +// command. Each read from /dev/kmsg is guaranteed to return a single log entry, +// so no line-splitting is required. +// +// More information can be found here: +// https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg +package kmsg diff --git a/internal/guest/kmsg/kmsg.go b/internal/guest/kmsg/kmsg.go index 429235bb16..112b26b2cc 100644 --- a/internal/guest/kmsg/kmsg.go +++ b/internal/guest/kmsg/kmsg.go @@ -1,10 +1,5 @@ -// Package kmsg contains support for parsing Linux kernel log entries read from -// /dev/kmsg. These are the same log entries that can be read via the `dmesg` -// command. Each read from /dev/kmsg is guaranteed to return a single log entry, -// so no line-splitting is required. -// -// More information can be found here: -// https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg +//go:build linux + package kmsg import ( diff --git a/internal/guest/network/doc.go b/internal/guest/network/doc.go new file mode 100644 index 0000000000..1ae2e9d505 --- /dev/null +++ b/internal/guest/network/doc.go @@ -0,0 +1 @@ +package network diff --git a/internal/guest/prot/protocol.go b/internal/guest/prot/protocol.go index 84d05ff446..538a206997 100644 --- a/internal/guest/prot/protocol.go +++ b/internal/guest/prot/protocol.go @@ -47,7 +47,7 @@ type MessageType uint32 const ( // MtNone is the default MessageType. MtNone = 0 - // MtRequest is the MessageType when a request is recieved. + // MtRequest is the MessageType when a request is received. MtRequest = 0x10000000 // MtResponse is the MessageType used to send a response. MtResponse = 0x20000000 @@ -144,7 +144,7 @@ const ( ComputeSystemNotificationV1 = 0x30100101 ) -// String returns the string representation of the message identifer. +// String returns the string representation of the message identifier. func (mi MessageIdentifier) String() string { switch mi { case MiNone: @@ -241,7 +241,7 @@ type ProtocolSupport struct { MaximumProtocolVersion uint32 } -// OsType defines the operating system type identifer of the guest hosting the +// OsType defines the operating system type identifier of the guest hosting the // GCS. type OsType string @@ -619,7 +619,7 @@ func (mrp *MessageResponseBase) Base() *MessageResponseBase { } // NegotiateProtocolResponse is the message to the HCS responding to a -// NegotiateProtocol message. It specifies the prefered protocol version and +// NegotiateProtocol message. It specifies the preferred protocol version and // available capabilities of the GCS. type NegotiateProtocolResponse struct { MessageResponseBase diff --git a/internal/guest/runtime/doc.go b/internal/guest/runtime/doc.go new file mode 100644 index 0000000000..d777766756 --- /dev/null +++ b/internal/guest/runtime/doc.go @@ -0,0 +1,3 @@ +// Package runtime defines the interface between the GCS and an OCI container +// runtime. +package runtime diff --git a/internal/guest/runtime/hcsv2/doc.go b/internal/guest/runtime/hcsv2/doc.go new file mode 100644 index 0000000000..dd988e19f4 --- /dev/null +++ b/internal/guest/runtime/hcsv2/doc.go @@ -0,0 +1 @@ +package hcsv2 diff --git a/internal/guest/runtime/runc/doc.go b/internal/guest/runtime/runc/doc.go new file mode 100644 index 0000000000..bc3fc77b48 --- /dev/null +++ b/internal/guest/runtime/runc/doc.go @@ -0,0 +1,3 @@ +// Package runc defines an implementation of the Runtime interface which uses +// runC as the container runtime. +package runc diff --git a/internal/guest/runtime/runc/runc.go b/internal/guest/runtime/runc/runc.go index 060bbf6867..2e31c26cfb 100644 --- a/internal/guest/runtime/runc/runc.go +++ b/internal/guest/runtime/runc/runc.go @@ -1,8 +1,6 @@ //go:build linux // +build linux -// Package runc defines an implementation of the Runtime interface which uses -// runC as the container runtime. package runc import ( diff --git a/internal/guest/runtime/runtime.go b/internal/guest/runtime/runtime.go index 8fc0c28bcd..a8c5231cfc 100644 --- a/internal/guest/runtime/runtime.go +++ b/internal/guest/runtime/runtime.go @@ -1,8 +1,6 @@ //go:build linux // +build linux -// Package runtime defines the interface between the GCS and an OCI container -// runtime. package runtime import ( diff --git a/internal/guest/stdio/doc.go b/internal/guest/stdio/doc.go new file mode 100644 index 0000000000..873c9263d4 --- /dev/null +++ b/internal/guest/stdio/doc.go @@ -0,0 +1 @@ +package stdio diff --git a/internal/guest/storage/crypt/doc.go b/internal/guest/storage/crypt/doc.go new file mode 100644 index 0000000000..283fd7b6ab --- /dev/null +++ b/internal/guest/storage/crypt/doc.go @@ -0,0 +1 @@ +package crypt diff --git a/internal/guest/storage/devicemapper/doc.go b/internal/guest/storage/devicemapper/doc.go new file mode 100644 index 0000000000..8506e94175 --- /dev/null +++ b/internal/guest/storage/devicemapper/doc.go @@ -0,0 +1 @@ +package devicemapper diff --git a/internal/guest/storage/doc.go b/internal/guest/storage/doc.go new file mode 100644 index 0000000000..82be0547ed --- /dev/null +++ b/internal/guest/storage/doc.go @@ -0,0 +1 @@ +package storage diff --git a/internal/guest/storage/overlay/doc.go b/internal/guest/storage/overlay/doc.go new file mode 100644 index 0000000000..3b838cf74b --- /dev/null +++ b/internal/guest/storage/overlay/doc.go @@ -0,0 +1 @@ +package overlay diff --git a/internal/guest/storage/pci/doc.go b/internal/guest/storage/pci/doc.go new file mode 100644 index 0000000000..93928ae73c --- /dev/null +++ b/internal/guest/storage/pci/doc.go @@ -0,0 +1 @@ +package pci diff --git a/internal/guest/storage/plan9/doc.go b/internal/guest/storage/plan9/doc.go new file mode 100644 index 0000000000..215f738050 --- /dev/null +++ b/internal/guest/storage/plan9/doc.go @@ -0,0 +1 @@ +package plan9 diff --git a/internal/guest/storage/pmem/doc.go b/internal/guest/storage/pmem/doc.go new file mode 100644 index 0000000000..b7fcd4b8cf --- /dev/null +++ b/internal/guest/storage/pmem/doc.go @@ -0,0 +1 @@ +package pmem diff --git a/internal/guest/storage/scsi/doc.go b/internal/guest/storage/scsi/doc.go new file mode 100644 index 0000000000..5ae8677e96 --- /dev/null +++ b/internal/guest/storage/scsi/doc.go @@ -0,0 +1 @@ +package scsi diff --git a/internal/guest/transport/doc.go b/internal/guest/transport/doc.go new file mode 100644 index 0000000000..02b02e9cc4 --- /dev/null +++ b/internal/guest/transport/doc.go @@ -0,0 +1,3 @@ +// Package transport defines the interfaces describing a connection-like data +// transport mechanism. +package transport diff --git a/internal/guest/transport/transport.go b/internal/guest/transport/transport.go index 0bff0299d5..59fdb804e4 100644 --- a/internal/guest/transport/transport.go +++ b/internal/guest/transport/transport.go @@ -1,5 +1,3 @@ -// Package transport defines the interfaces describing a connection-like data -// transport mechanism. package transport import ( diff --git a/internal/hcs/callback.go b/internal/hcs/callback.go index d13772b030..7b27173c3a 100644 --- a/internal/hcs/callback.go +++ b/internal/hcs/callback.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/doc.go b/internal/hcs/doc.go new file mode 100644 index 0000000000..d792dda986 --- /dev/null +++ b/internal/hcs/doc.go @@ -0,0 +1 @@ +package hcs diff --git a/internal/hcs/errors.go b/internal/hcs/errors.go index 85584f5b87..226dad2fbc 100644 --- a/internal/hcs/errors.go +++ b/internal/hcs/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/process.go b/internal/hcs/process.go index 605856f2a3..4bf3a167a5 100644 --- a/internal/hcs/process.go +++ b/internal/hcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -254,7 +256,7 @@ func (process *Process) waitBackground() { } // Wait waits for the process to exit. If the process has already exited returns -// the pervious error (if any). +// the previous error (if any). func (process *Process) Wait() error { <-process.waitBlock return process.waitError @@ -441,7 +443,6 @@ func (process *Process) CloseStderr(ctx context.Context) (err error) { if process.stderr != nil { process.stderr.Close() process.stderr = nil - } return nil } diff --git a/internal/hcs/schema1/schema1.go b/internal/hcs/schema1/schema1.go index b621c55938..d1f219cfad 100644 --- a/internal/hcs/schema1/schema1.go +++ b/internal/hcs/schema1/schema1.go @@ -1,3 +1,5 @@ +//go:build windows + package schema1 import ( @@ -101,7 +103,7 @@ type ContainerConfig struct { HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM Servicing bool `json:",omitempty"` // True if this container is for servicing AllowUnqualifiedDNSQuery bool `json:",omitempty"` // True to allow unqualified DNS name resolution - DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution + DNSSearchList string `json:",omitempty"` // Comma separated list of DNS suffixes to use for name resolution ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise. TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start diff --git a/internal/hcs/service.go b/internal/hcs/service.go index a634dfc151..a46b0051df 100644 --- a/internal/hcs/service.go +++ b/internal/hcs/service.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/system.go b/internal/hcs/system.go index 75499c967f..052d08ccc3 100644 --- a/internal/hcs/system.go +++ b/internal/hcs/system.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -592,7 +594,7 @@ func (computeSystem *System) unregisterCallback(ctx context.Context) error { return nil } - // hcsUnregisterComputeSystemCallback has its own syncronization + // hcsUnregisterComputeSystemCallback has its own synchronization // to wait for all callbacks to complete. We must NOT hold the callbackMapLock. err := vmcompute.HcsUnregisterComputeSystemCallback(ctx, handle) if err != nil { diff --git a/internal/hcs/utils.go b/internal/hcs/utils.go index 3342e5bb94..5dcb97eb39 100644 --- a/internal/hcs/utils.go +++ b/internal/hcs/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcs/waithelper.go b/internal/hcs/waithelper.go index db4e14fdfb..6e161e6aa1 100644 --- a/internal/hcs/waithelper.go +++ b/internal/hcs/waithelper.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/hcserror/doc.go b/internal/hcserror/doc.go new file mode 100644 index 0000000000..ce70676789 --- /dev/null +++ b/internal/hcserror/doc.go @@ -0,0 +1 @@ +package hcserror diff --git a/internal/hcserror/hcserror.go b/internal/hcserror/hcserror.go index 921c2c8556..bad2705416 100644 --- a/internal/hcserror/hcserror.go +++ b/internal/hcserror/hcserror.go @@ -1,3 +1,5 @@ +//go:build windows + package hcserror import ( diff --git a/internal/hcsoci/create.go b/internal/hcsoci/create.go index 058530aac1..6df67ee876 100644 --- a/internal/hcsoci/create.go +++ b/internal/hcsoci/create.go @@ -132,7 +132,6 @@ func verifyCloneContainerSpecs(templateSpec, cloneSpec *specs.Spec) error { } func validateContainerConfig(ctx context.Context, coi *createOptionsInternal) error { - if coi.HostingSystem != nil && coi.HostingSystem.IsTemplate && !coi.isTemplate { return fmt.Errorf("only a template container can be created inside a template pod. Any other combination is not valid") } diff --git a/internal/hcsoci/devices.go b/internal/hcsoci/devices.go index 4f17a715d6..ccc19d4af8 100644 --- a/internal/hcsoci/devices.go +++ b/internal/hcsoci/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( @@ -117,7 +119,6 @@ func handleAssignedDevicesWindows( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure @@ -175,7 +176,6 @@ func handleAssignedDevicesLCOW( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure diff --git a/internal/hcsoci/doc.go b/internal/hcsoci/doc.go new file mode 100644 index 0000000000..b4b2ac611b --- /dev/null +++ b/internal/hcsoci/doc.go @@ -0,0 +1 @@ +package hcsoci diff --git a/internal/hcsoci/hcsdoc_wcow.go b/internal/hcsoci/hcsdoc_wcow.go index b3080399a6..1d25b44438 100644 --- a/internal/hcsoci/hcsdoc_wcow.go +++ b/internal/hcsoci/hcsdoc_wcow.go @@ -42,7 +42,6 @@ func createMountsConfig(ctx context.Context, coi *createOptionsInternal) (*mount // TODO: Mapped pipes to add in v2 schema. var config mountsConfig for _, mount := range coi.Spec.Mounts { - if uvm.IsPipe(mount.Source) { src, dst := uvm.GetContainerPipeMapping(coi.HostingSystem, mount) config.mpsv1 = append(config.mpsv1, schema1.MappedPipe{HostPath: src, ContainerPipeName: dst}) diff --git a/internal/hcsoci/network.go b/internal/hcsoci/network.go index daa4e46d00..27bf2669d2 100644 --- a/internal/hcsoci/network.go +++ b/internal/hcsoci/network.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( diff --git a/internal/hns/doc.go b/internal/hns/doc.go new file mode 100644 index 0000000000..f6d35df0e5 --- /dev/null +++ b/internal/hns/doc.go @@ -0,0 +1 @@ +package hns diff --git a/internal/hns/hnsendpoint.go b/internal/hns/hnsendpoint.go index 7cf954c7b2..83b683bd90 100644 --- a/internal/hns/hnsendpoint.go +++ b/internal/hns/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( @@ -146,7 +148,6 @@ func (endpoint *HNSEndpoint) IsAttached(vID string) (bool, error) { } return false, nil - } // Create Endpoint by sending EndpointRequest to HNS. TODO: Create a separate HNS interface to place all these methods @@ -281,7 +282,6 @@ func (endpoint *HNSEndpoint) HostAttach(compartmentID uint16) error { return err } return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response) - } // HostDetach detaches a nic on the host diff --git a/internal/hns/hnsfuncs.go b/internal/hns/hnsfuncs.go index 2df4a57f56..0a8f36d832 100644 --- a/internal/hns/hnsfuncs.go +++ b/internal/hns/hnsfuncs.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/hns/hnsglobals.go b/internal/hns/hnsglobals.go index a8d8cc56ae..464bb8954f 100644 --- a/internal/hns/hnsglobals.go +++ b/internal/hns/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hns type HNSGlobals struct { diff --git a/internal/hns/hnsnetwork.go b/internal/hns/hnsnetwork.go index f12d3ab041..8861faee7a 100644 --- a/internal/hns/hnsnetwork.go +++ b/internal/hns/hnsnetwork.go @@ -1,13 +1,16 @@ +//go:build windows + package hns import ( "encoding/json" "errors" - "github.com/sirupsen/logrus" "net" + + "github.com/sirupsen/logrus" ) -// Subnet is assoicated with a network and represents a list +// Subnet is associated with a network and represents a list // of subnets available to the network type Subnet struct { AddressPrefix string `json:",omitempty"` @@ -15,7 +18,7 @@ type Subnet struct { Policies []json.RawMessage `json:",omitempty"` } -// MacPool is assoicated with a network and represents a list +// MacPool is associated with a network and represents a list // of macaddresses available to the network type MacPool struct { StartMacAddress string `json:",omitempty"` diff --git a/internal/hns/hnspolicylist.go b/internal/hns/hnspolicylist.go index 31322a6816..b98db40e8d 100644 --- a/internal/hns/hnspolicylist.go +++ b/internal/hns/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/hns/hnssupport.go b/internal/hns/hnssupport.go index d5efba7f28..b9c30b9019 100644 --- a/internal/hns/hnssupport.go +++ b/internal/hns/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/hns/namespace.go b/internal/hns/namespace.go index d3b04eefe0..749588ad39 100644 --- a/internal/hns/namespace.go +++ b/internal/hns/namespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/internal/interop/doc.go b/internal/interop/doc.go new file mode 100644 index 0000000000..cb554867fe --- /dev/null +++ b/internal/interop/doc.go @@ -0,0 +1 @@ +package interop diff --git a/internal/interop/interop.go b/internal/interop/interop.go index 922f7c679e..137dc3990a 100644 --- a/internal/interop/interop.go +++ b/internal/interop/interop.go @@ -1,3 +1,5 @@ +//go:build windows + package interop import ( diff --git a/internal/jobcontainers/cpurate_test.go b/internal/jobcontainers/cpurate_test.go index 486b42f783..1dc7eba912 100644 --- a/internal/jobcontainers/cpurate_test.go +++ b/internal/jobcontainers/cpurate_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/doc.go b/internal/jobcontainers/doc.go new file mode 100644 index 0000000000..0ad9f81133 --- /dev/null +++ b/internal/jobcontainers/doc.go @@ -0,0 +1 @@ +package jobcontainers diff --git a/internal/jobcontainers/env.go b/internal/jobcontainers/env.go index b64a365471..25f1bab64d 100644 --- a/internal/jobcontainers/env.go +++ b/internal/jobcontainers/env.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/jobcontainer.go b/internal/jobcontainers/jobcontainer.go index b9cb630fab..f0433102a4 100644 --- a/internal/jobcontainers/jobcontainer.go +++ b/internal/jobcontainers/jobcontainer.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( @@ -164,7 +166,7 @@ func (c *JobContainer) CreateProcess(ctx context.Context, config interface{}) (_ return nil, errors.New("unsupported process config passed in") } - // Replace any occurences of the sandbox mount point env variable in the commandline. + // Replace any occurrences of the sandbox mount point env variable in the commandline. // %CONTAINER_SANDBOX_MOUNTPOINT%\mybinary.exe -> C:\C\123456789\mybinary.exe commandLine, _ := c.replaceWithMountPoint(conf.CommandLine) diff --git a/internal/jobcontainers/logon.go b/internal/jobcontainers/logon.go index 0ccfebd4da..45fafee715 100644 --- a/internal/jobcontainers/logon.go +++ b/internal/jobcontainers/logon.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/mounts.go b/internal/jobcontainers/mounts.go index 187c340de2..b962032609 100644 --- a/internal/jobcontainers/mounts.go +++ b/internal/jobcontainers/mounts.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/mounts_test.go b/internal/jobcontainers/mounts_test.go index 22d61dfcd4..856be66fce 100644 --- a/internal/jobcontainers/mounts_test.go +++ b/internal/jobcontainers/mounts_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/oci.go b/internal/jobcontainers/oci.go index da01236ae9..ef8a17a1f8 100644 --- a/internal/jobcontainers/oci.go +++ b/internal/jobcontainers/oci.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/path.go b/internal/jobcontainers/path.go index 94895ee249..62e32b4a89 100644 --- a/internal/jobcontainers/path.go +++ b/internal/jobcontainers/path.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( @@ -160,7 +162,7 @@ func getApplicationName(commandLine, workingDirectory, pathEnv string) (string, // searchPathForExe calls the Windows API function `SearchPathW` to try and locate // `fileName` by searching in `pathsToSearch`. `pathsToSearch` is generally a semicolon -// seperated string of paths to search that `SearchPathW` will iterate through one by one. +// separated string of paths to search that `SearchPathW` will iterate through one by one. // If the path resolved for `fileName` ends up being a directory, this function will return an // error. func searchPathForExe(fileName, pathsToSearch string) (string, error) { diff --git a/internal/jobcontainers/path_test.go b/internal/jobcontainers/path_test.go index c9ef5cda66..98b02df000 100644 --- a/internal/jobcontainers/path_test.go +++ b/internal/jobcontainers/path_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/process.go b/internal/jobcontainers/process.go index f6df14f498..3e53657338 100644 --- a/internal/jobcontainers/process.go +++ b/internal/jobcontainers/process.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/storage.go b/internal/jobcontainers/storage.go index c9fe72228a..2de67feef3 100644 --- a/internal/jobcontainers/storage.go +++ b/internal/jobcontainers/storage.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobcontainers/system_test.go b/internal/jobcontainers/system_test.go index 0b4a882e28..472ba53aad 100644 --- a/internal/jobcontainers/system_test.go +++ b/internal/jobcontainers/system_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobcontainers import ( diff --git a/internal/jobobject/doc.go b/internal/jobobject/doc.go new file mode 100644 index 0000000000..34b53d6e48 --- /dev/null +++ b/internal/jobobject/doc.go @@ -0,0 +1,8 @@ +// This package provides higher level constructs for the win32 job object API. +// Most of the core creation and management functions are already present in "golang.org/x/sys/windows" +// (CreateJobObject, AssignProcessToJobObject, etc.) as well as most of the limit information +// structs and associated limit flags. Whatever is not present from the job object API +// in golang.org/x/sys/windows is located in /internal/winapi. +// +// https://docs.microsoft.com/en-us/windows/win32/procthread/job-objects +package jobobject diff --git a/internal/jobobject/iocp.go b/internal/jobobject/iocp.go index 3d640ac7bd..d31a6a1e66 100644 --- a/internal/jobobject/iocp.go +++ b/internal/jobobject/iocp.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( diff --git a/internal/jobobject/jobobject.go b/internal/jobobject/jobobject.go index a0257b39cd..338a682d92 100644 --- a/internal/jobobject/jobobject.go +++ b/internal/jobobject/jobobject.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( @@ -15,14 +17,6 @@ import ( "golang.org/x/sys/windows" ) -// This file provides higher level constructs for the win32 job object API. -// Most of the core creation and management functions are already present in "golang.org/x/sys/windows" -// (CreateJobObject, AssignProcessToJobObject, etc.) as well as most of the limit information -// structs and associated limit flags. Whatever is not present from the job object API -// in golang.org/x/sys/windows is located in /internal/winapi. -// -// https://docs.microsoft.com/en-us/windows/win32/procthread/job-objects - // JobObject is a high level wrapper around a Windows job object. Holds a handle to // the job, a queue to receive iocp notifications about the lifecycle // of the job and a mutex for synchronized handle access. diff --git a/internal/jobobject/jobobject_test.go b/internal/jobobject/jobobject_test.go index a4877d4bdd..b885dc6ad4 100644 --- a/internal/jobobject/jobobject_test.go +++ b/internal/jobobject/jobobject_test.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( diff --git a/internal/jobobject/limits.go b/internal/jobobject/limits.go index 5d4c90d241..fd69d9e341 100644 --- a/internal/jobobject/limits.go +++ b/internal/jobobject/limits.go @@ -1,3 +1,5 @@ +//go:build windows + package jobobject import ( diff --git a/internal/layers/doc.go b/internal/layers/doc.go new file mode 100644 index 0000000000..747ac49a97 --- /dev/null +++ b/internal/layers/doc.go @@ -0,0 +1,2 @@ +// Package layers deals with container layer mounting/unmounting for LCOW and WCOW +package layers diff --git a/internal/layers/layers.go b/internal/layers/layers.go index 0334076365..e0fa566b63 100644 --- a/internal/layers/layers.go +++ b/internal/layers/layers.go @@ -1,7 +1,6 @@ //go:build windows // +build windows -// Package layers deals with container layer mounting/unmounting for LCOW and WCOW package layers import ( diff --git a/internal/lcow/common.go b/internal/lcow/common.go index 32938641e8..fa78a8ecb6 100644 --- a/internal/lcow/common.go +++ b/internal/lcow/common.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/internal/lcow/disk.go b/internal/lcow/disk.go index c7af7cf6ce..937b8deafa 100644 --- a/internal/lcow/disk.go +++ b/internal/lcow/disk.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/internal/lcow/doc.go b/internal/lcow/doc.go new file mode 100644 index 0000000000..6105d5b57d --- /dev/null +++ b/internal/lcow/doc.go @@ -0,0 +1 @@ +package lcow diff --git a/internal/lcow/scratch.go b/internal/lcow/scratch.go index ae385a1c1b..001f3347cd 100644 --- a/internal/lcow/scratch.go +++ b/internal/lcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/internal/oci/sandbox.go b/internal/oci/sandbox.go index 569b035654..3b9064d671 100644 --- a/internal/oci/sandbox.go +++ b/internal/oci/sandbox.go @@ -2,6 +2,7 @@ package oci import ( "fmt" + "github.com/Microsoft/hcsshim/pkg/annotations" ) diff --git a/internal/oci/uvm.go b/internal/oci/uvm.go index b0876465f0..4a624639f8 100644 --- a/internal/oci/uvm.go +++ b/internal/oci/uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package oci import ( @@ -285,7 +287,7 @@ func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) ( handleAnnotationFullyPhysicallyBacked(ctx, s.Annotations, lopts) // SecurityPolicy is very sensitive to other settings and will silently change those that are incompatible. - // Eg VMPem device count, overriden kernel option cannot be respected. + // Eg VMPem device count, overridden kernel option cannot be respected. handleSecurityPolicy(ctx, s.Annotations, lopts) // override the default GuestState filename if specified diff --git a/internal/oci/uvm_test.go b/internal/oci/uvm_test.go index c3425f8751..70bb54d669 100644 --- a/internal/oci/uvm_test.go +++ b/internal/oci/uvm_test.go @@ -1,3 +1,5 @@ +//go:build windows + package oci import ( @@ -45,7 +47,6 @@ func Test_SpecUpdate_MemorySize_NoAnnotation_WithOpts(t *testing.T) { } func Test_SpecUpdate_ProcessorCount_WithAnnotation_WithOpts(t *testing.T) { - opts := &runhcsopts.Options{ VmProcessorCount: 4, } @@ -63,7 +64,6 @@ func Test_SpecUpdate_ProcessorCount_WithAnnotation_WithOpts(t *testing.T) { } func Test_SpecUpdate_ProcessorCount_NoAnnotation_WithOpts(t *testing.T) { - opts := &runhcsopts.Options{ VmProcessorCount: 4, } @@ -186,5 +186,4 @@ func Test_SpecToUVMCreateOptions_Common(t *testing.T) { } }) } - } diff --git a/internal/processorinfo/doc.go b/internal/processorinfo/doc.go new file mode 100644 index 0000000000..dd2a53b5c6 --- /dev/null +++ b/internal/processorinfo/doc.go @@ -0,0 +1 @@ +package processorinfo diff --git a/internal/processorinfo/host_information.go b/internal/processorinfo/host_information.go index f179857a63..0aa766a43e 100644 --- a/internal/processorinfo/host_information.go +++ b/internal/processorinfo/host_information.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/internal/processorinfo/processor_count.go b/internal/processorinfo/processor_count.go index 3f6301ed68..848df8248e 100644 --- a/internal/processorinfo/processor_count.go +++ b/internal/processorinfo/processor_count.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/internal/regstate/doc.go b/internal/regstate/doc.go new file mode 100644 index 0000000000..51bcdf6e98 --- /dev/null +++ b/internal/regstate/doc.go @@ -0,0 +1 @@ +package regstate diff --git a/internal/regstate/regstate.go b/internal/regstate/regstate.go index dcbc9334d7..184975add8 100644 --- a/internal/regstate/regstate.go +++ b/internal/regstate/regstate.go @@ -1,3 +1,5 @@ +//go:build windows + package regstate import ( diff --git a/internal/regstate/regstate_test.go b/internal/regstate/regstate_test.go index 7a449e27c4..9cafe08646 100644 --- a/internal/regstate/regstate_test.go +++ b/internal/regstate/regstate_test.go @@ -1,3 +1,5 @@ +//go:build windows + package regstate import ( diff --git a/internal/resources/doc.go b/internal/resources/doc.go new file mode 100644 index 0000000000..878cd99d0c --- /dev/null +++ b/internal/resources/doc.go @@ -0,0 +1,3 @@ +// Package resources handles creating, updating, and releasing resources +// on a container +package resources diff --git a/internal/resources/resources.go b/internal/resources/resources.go index 89851ae7c3..90fe116ae5 100644 --- a/internal/resources/resources.go +++ b/internal/resources/resources.go @@ -1,5 +1,5 @@ -// Package resources handles creating, updating, and releasing resources -// on a container +//go:build windows + package resources import ( diff --git a/internal/runhcs/container.go b/internal/runhcs/container.go index a161c204e2..33c43e6c59 100644 --- a/internal/runhcs/container.go +++ b/internal/runhcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/internal/runhcs/vm.go b/internal/runhcs/vm.go index 2c8957b88d..b3e443d600 100644 --- a/internal/runhcs/vm.go +++ b/internal/runhcs/vm.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/internal/safefile/do.go b/internal/safefile/do.go new file mode 100644 index 0000000000..f211d25e72 --- /dev/null +++ b/internal/safefile/do.go @@ -0,0 +1 @@ +package safefile diff --git a/internal/safefile/safeopen.go b/internal/safefile/safeopen.go index 66b8d7e035..8770bf5627 100644 --- a/internal/safefile/safeopen.go +++ b/internal/safefile/safeopen.go @@ -1,3 +1,5 @@ +//go:build windows + package safefile import ( @@ -156,7 +158,6 @@ func LinkRelative(oldname string, oldroot *os.File, newname string, newroot *os. if (fi.FileAttributes & syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 { return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: winapi.RtlNtStatusToDosError(winapi.STATUS_REPARSE_POINT_ENCOUNTERED)} } - } else { parent = newroot } diff --git a/internal/safefile/safeopen_admin_test.go b/internal/safefile/safeopen_admin_test.go index 966903677e..fba451c8f6 100644 --- a/internal/safefile/safeopen_admin_test.go +++ b/internal/safefile/safeopen_admin_test.go @@ -1,5 +1,5 @@ -//go:build admin -// +build admin +//go:build windows && admin +// +build windows,admin package safefile diff --git a/internal/safefile/safeopen_test.go b/internal/safefile/safeopen_test.go index 900cc04d35..db2957c9e8 100644 --- a/internal/safefile/safeopen_test.go +++ b/internal/safefile/safeopen_test.go @@ -1,3 +1,5 @@ +//go:build windows + package safefile import ( diff --git a/internal/schemaversion/doc.go b/internal/schemaversion/doc.go new file mode 100644 index 0000000000..c1432114b1 --- /dev/null +++ b/internal/schemaversion/doc.go @@ -0,0 +1 @@ +package schemaversion diff --git a/internal/shimdiag/shimdiag.go b/internal/shimdiag/shimdiag.go index 2d1242da42..6d37c7b411 100644 --- a/internal/shimdiag/shimdiag.go +++ b/internal/shimdiag/shimdiag.go @@ -1,3 +1,5 @@ +//go:build windows + package shimdiag import ( diff --git a/internal/tools/extendedtask/extendedtask.go b/internal/tools/extendedtask/extendedtask.go index 34c988d15c..464ab3fb32 100644 --- a/internal/tools/extendedtask/extendedtask.go +++ b/internal/tools/extendedtask/extendedtask.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/grantvmgroupaccess/main.go b/internal/tools/grantvmgroupaccess/main.go index c3914cb64b..5fa6644d77 100644 --- a/internal/tools/grantvmgroupaccess/main.go +++ b/internal/tools/grantvmgroupaccess/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/networkagent/defs.go b/internal/tools/networkagent/defs.go index bdad12ac89..5af5d38fc1 100644 --- a/internal/tools/networkagent/defs.go +++ b/internal/tools/networkagent/defs.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/networkagent/main.go b/internal/tools/networkagent/main.go index 50099e1b98..acf5508dbd 100644 --- a/internal/tools/networkagent/main.go +++ b/internal/tools/networkagent/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( @@ -313,7 +315,6 @@ func (s *service) ConfigureContainerNetworking(ctx context.Context, req *nodenet }, nil } else if req.RequestType == nodenetsvc.RequestType_Teardown { return s.teardownConfigureContainerNetworking(ctx, req) - } return nil, fmt.Errorf("invalid request type %v", req.RequestType) } @@ -361,7 +362,6 @@ func (s *service) addHelper(ctx context.Context, req *nodenetsvc.ConfigureNetwor } s.endpointToNicID[endpointName] = nicID.String() } - } defer func() { @@ -371,7 +371,6 @@ func (s *service) addHelper(ctx context.Context, req *nodenetsvc.ConfigureNetwor }() return &nodenetsvc.ConfigureNetworkingResponse{}, nil - } func (s *service) teardownHelper(ctx context.Context, req *nodenetsvc.ConfigureNetworkingRequest, containerNamespaceID string) (*nodenetsvc.ConfigureNetworkingResponse, error) { diff --git a/internal/tools/uvmboot/lcow.go b/internal/tools/uvmboot/lcow.go index 99446b40d9..e2c39af4f8 100644 --- a/internal/tools/uvmboot/lcow.go +++ b/internal/tools/uvmboot/lcow.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/uvmboot/main.go b/internal/tools/uvmboot/main.go index 8f0a1b6293..3d89af513d 100644 --- a/internal/tools/uvmboot/main.go +++ b/internal/tools/uvmboot/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/uvmboot/wcow.go b/internal/tools/uvmboot/wcow.go index 808be645c0..1ed1e4eaf4 100644 --- a/internal/tools/uvmboot/wcow.go +++ b/internal/tools/uvmboot/wcow.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/tools/zapdir/main.go b/internal/tools/zapdir/main.go index 7a46cf3da8..777d569eb3 100644 --- a/internal/tools/zapdir/main.go +++ b/internal/tools/zapdir/main.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/internal/uvm/capabilities.go b/internal/uvm/capabilities.go index d76bfdbef4..50ac874bce 100644 --- a/internal/uvm/capabilities.go +++ b/internal/uvm/capabilities.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import "github.com/Microsoft/hcsshim/internal/hcs/schema1" diff --git a/internal/uvm/clone.go b/internal/uvm/clone.go index 4e2f95a148..010bac3145 100644 --- a/internal/uvm/clone.go +++ b/internal/uvm/clone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/combine_layers.go b/internal/uvm/combine_layers.go index fe06563488..468139c0f7 100644 --- a/internal/uvm/combine_layers.go +++ b/internal/uvm/combine_layers.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/computeagent.go b/internal/uvm/computeagent.go index b87edf2796..44b328ad37 100644 --- a/internal/uvm/computeagent.go +++ b/internal/uvm/computeagent.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/computeagent_test.go b/internal/uvm/computeagent_test.go index 8a404cb3ad..46c37c63aa 100644 --- a/internal/uvm/computeagent_test.go +++ b/internal/uvm/computeagent_test.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/counter.go b/internal/uvm/counter.go index fc08daae2f..fd49be9bfc 100644 --- a/internal/uvm/counter.go +++ b/internal/uvm/counter.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/cpugroups.go b/internal/uvm/cpugroups.go index f4c17fae2c..f93a83ca6e 100644 --- a/internal/uvm/cpugroups.go +++ b/internal/uvm/cpugroups.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/cpulimits_update.go b/internal/uvm/cpulimits_update.go index 264da31a28..ea5fccf625 100644 --- a/internal/uvm/cpulimits_update.go +++ b/internal/uvm/cpulimits_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/create.go b/internal/uvm/create.go index 1a08bae535..b07a78bdd3 100644 --- a/internal/uvm/create.go +++ b/internal/uvm/create.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -74,7 +76,7 @@ type Options struct { // far as the container is concerned and it is only able to view the NICs in the compartment it's assigned to. // This is the compartment setup (and behavior) that is followed for V1 HCS schema containers (docker) so // this change brings parity as well. This behavior is gated behind a registry key currently to avoid any - // unneccessary behavior and once this restriction is removed then we can remove the need for this variable + // unnecessary behavior and once this restriction is removed then we can remove the need for this variable // and the associated annotation as well. DisableCompartmentNamespace bool diff --git a/internal/uvm/create_lcow.go b/internal/uvm/create_lcow.go index ada420cca2..3acfa875c3 100644 --- a/internal/uvm/create_lcow.go +++ b/internal/uvm/create_lcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -28,7 +30,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" ) -// General infomation about how this works at a high level. +// General information about how this works at a high level. // // The purpose is to start an LCOW Utility VM or UVM using the Host Compute Service, an API to create and manipulate running virtual machines // HCS takes json descriptions of the work to be done. @@ -180,7 +182,7 @@ func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hc return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -278,7 +280,6 @@ Example JSON document produced once the hcsschema.ComputeSytem returned by makeL // Make a hcsschema.ComputeSytem with the parts that target booting from a VMGS file func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - // Kernel and initrd are combined into a single vmgs file. vmgsFullPath := filepath.Join(opts.BootFilesPath, opts.GuestStateFile) if _, err := os.Stat(vmgsFullPath); os.IsNotExist(err) { @@ -371,7 +372,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ ApplySecureBootTemplate: "Apply", - SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivilent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, + SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivalent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, } @@ -391,7 +392,6 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ // Many details are quite different (see the typical JSON examples), in particular it boots from a VMGS file // which contains both the kernel and initrd as well as kernel boot options. func makeLCOWSecurityDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - doc, vmgsErr := makeLCOWVMGSDoc(ctx, opts, uvm) if vmgsErr != nil { return nil, vmgsErr @@ -487,7 +487,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs } var processor *hcsschema.Processor2 - processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existance tests above. + processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existence tests above. if err != nil { return nil, err } diff --git a/internal/uvm/create_test.go b/internal/uvm/create_test.go index 0a6e82f322..98623f19b5 100644 --- a/internal/uvm/create_test.go +++ b/internal/uvm/create_test.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/create_wcow.go b/internal/uvm/create_wcow.go index 4a92fc962d..ba11257b56 100644 --- a/internal/uvm/create_wcow.go +++ b/internal/uvm/create_wcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -87,7 +89,7 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -278,10 +280,10 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error } // TODO: BUGBUG Remove this. @jhowardmsft - // It should be the responsiblity of the caller to do the creation and population. + // It should be the responsibility of the caller to do the creation and population. // - Update runhcs too (vm.go). // - Remove comment in function header - // - Update tests that rely on this current behaviour. + // - Update tests that rely on this current behavior. // Create the RW scratch in the top-most layer folder, creating the folder if it doesn't already exist. scratchFolder := opts.LayerFolders[len(opts.LayerFolders)-1] diff --git a/internal/uvm/delete_container.go b/internal/uvm/delete_container.go index 5ef5c73cbd..46bef7b163 100644 --- a/internal/uvm/delete_container.go +++ b/internal/uvm/delete_container.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/doc.go b/internal/uvm/doc.go new file mode 100644 index 0000000000..c4e25cc15c --- /dev/null +++ b/internal/uvm/doc.go @@ -0,0 +1,2 @@ +// This package describes the external interface for utility VMs. +package uvm diff --git a/internal/uvm/dumpstacks.go b/internal/uvm/dumpstacks.go index d4ad56d7ec..ed39fd282d 100644 --- a/internal/uvm/dumpstacks.go +++ b/internal/uvm/dumpstacks.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/guest_request.go b/internal/uvm/guest_request.go index 5459859453..f097c4f33c 100644 --- a/internal/uvm/guest_request.go +++ b/internal/uvm/guest_request.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/hvsocket.go b/internal/uvm/hvsocket.go index 03c1855796..4e439c7894 100644 --- a/internal/uvm/hvsocket.go +++ b/internal/uvm/hvsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/memory_update.go b/internal/uvm/memory_update.go index 058ffff013..7a06f283dd 100644 --- a/internal/uvm/memory_update.go +++ b/internal/uvm/memory_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/modify.go b/internal/uvm/modify.go index 009806e683..5a57dce9a6 100644 --- a/internal/uvm/modify.go +++ b/internal/uvm/modify.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/network.go b/internal/uvm/network.go index dca3ad5ab9..03509ad882 100644 --- a/internal/uvm/network.go +++ b/internal/uvm/network.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -41,7 +43,7 @@ var ( // In this function we take the namespace ID of the namespace that was created for this // UVM. We hot add the namespace (with the default ID if this is a template). We get the // endpoints associated with this namespace and then hot add those endpoints (by changing -// their namespace IDs by the deafult IDs if it is a template). +// their namespace IDs by the default IDs if it is a template). func (uvm *UtilityVM) SetupNetworkNamespace(ctx context.Context, nsid string) error { nsidInsideUVM := nsid if uvm.IsTemplate || uvm.IsClone { diff --git a/internal/uvm/pipes.go b/internal/uvm/pipes.go index c4fcd34e82..cc67f9a798 100644 --- a/internal/uvm/pipes.go +++ b/internal/uvm/pipes.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/plan9.go b/internal/uvm/plan9.go index 475a9dbc1d..d8fce975f8 100644 --- a/internal/uvm/plan9.go +++ b/internal/uvm/plan9.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/scsi.go b/internal/uvm/scsi.go index 78d7516ffa..cc884c3bcd 100644 --- a/internal/uvm/scsi.go +++ b/internal/uvm/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -515,7 +517,6 @@ func (uvm *UtilityVM) allocateSCSIMount( log.G(ctx).WithFields(uvm.scsiLocations[controller][lun].logFormat()).Debug("allocated SCSI mount") return uvm.scsiLocations[controller][lun], false, nil - } // GetScsiUvmPath returns the guest mounted path of a SCSI drive. diff --git a/internal/uvm/security_policy.go b/internal/uvm/security_policy.go index 89278acb6b..6570928ea7 100644 --- a/internal/uvm/security_policy.go +++ b/internal/uvm/security_policy.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/share.go b/internal/uvm/share.go index db05448c68..41ecda3a3a 100644 --- a/internal/uvm/share.go +++ b/internal/uvm/share.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/start.go b/internal/uvm/start.go index 702815ed6a..412717aca6 100644 --- a/internal/uvm/start.go +++ b/internal/uvm/start.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/stats.go b/internal/uvm/stats.go index d6a27b67a3..2cd5c24ce0 100644 --- a/internal/uvm/stats.go +++ b/internal/uvm/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/timezone.go b/internal/uvm/timezone.go index 18c191cf4a..3ce7b9764f 100644 --- a/internal/uvm/timezone.go +++ b/internal/uvm/timezone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/types.go b/internal/uvm/types.go index b87fe45f7f..020eb7099b 100644 --- a/internal/uvm/types.go +++ b/internal/uvm/types.go @@ -1,6 +1,6 @@ -package uvm +//go:build windows -// This package describes the external interface for utility VMs. +package uvm import ( "net" diff --git a/internal/uvm/update_uvm.go b/internal/uvm/update_uvm.go index 1e1e07f274..b8fcddac6e 100644 --- a/internal/uvm/update_uvm.go +++ b/internal/uvm/update_uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/virtual_device.go b/internal/uvm/virtual_device.go index 0a729ecde5..3bd6e187a9 100644 --- a/internal/uvm/virtual_device.go +++ b/internal/uvm/virtual_device.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vpmem.go b/internal/uvm/vpmem.go index b41ed27aa6..cde51aa014 100644 --- a/internal/uvm/vpmem.go +++ b/internal/uvm/vpmem.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vpmem_mapped.go b/internal/uvm/vpmem_mapped.go index b98948ecfd..510e9ed4c4 100644 --- a/internal/uvm/vpmem_mapped.go +++ b/internal/uvm/vpmem_mapped.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vpmem_mapped_test.go b/internal/uvm/vpmem_mapped_test.go index b3d1a119d0..5ef9f1d257 100644 --- a/internal/uvm/vpmem_mapped_test.go +++ b/internal/uvm/vpmem_mapped_test.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/vsmb.go b/internal/uvm/vsmb.go index b2ccf5be4f..348058c7ef 100644 --- a/internal/uvm/vsmb.go +++ b/internal/uvm/vsmb.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvm/wait.go b/internal/uvm/wait.go index 552ee5fad7..d052be533a 100644 --- a/internal/uvm/wait.go +++ b/internal/uvm/wait.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/internal/uvmfolder/doc.go b/internal/uvmfolder/doc.go new file mode 100644 index 0000000000..9e2b205da0 --- /dev/null +++ b/internal/uvmfolder/doc.go @@ -0,0 +1 @@ +package uvmfolder diff --git a/internal/vm/hcs/boot.go b/internal/vm/hcs/boot.go index 425feebd2c..a1794a4f2c 100644 --- a/internal/vm/hcs/boot.go +++ b/internal/vm/hcs/boot.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/builder.go b/internal/vm/hcs/builder.go index 676e114bf6..960f50e40c 100644 --- a/internal/vm/hcs/builder.go +++ b/internal/vm/hcs/builder.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/doc.go b/internal/vm/hcs/doc.go new file mode 100644 index 0000000000..d792dda986 --- /dev/null +++ b/internal/vm/hcs/doc.go @@ -0,0 +1 @@ +package hcs diff --git a/internal/vm/hcs/hcs.go b/internal/vm/hcs/hcs.go index 1c7f337304..ebf56a7cb6 100644 --- a/internal/vm/hcs/hcs.go +++ b/internal/vm/hcs/hcs.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/memory.go b/internal/vm/hcs/memory.go index afb9932628..5934d470fc 100644 --- a/internal/vm/hcs/memory.go +++ b/internal/vm/hcs/memory.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/network.go b/internal/vm/hcs/network.go index 71a30c1dc5..f61f6bb4ed 100644 --- a/internal/vm/hcs/network.go +++ b/internal/vm/hcs/network.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/pci.go b/internal/vm/hcs/pci.go index 9936f3b45a..35e97e1de8 100644 --- a/internal/vm/hcs/pci.go +++ b/internal/vm/hcs/pci.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/plan9.go b/internal/vm/hcs/plan9.go index 3de9ed90ee..23cd7cc030 100644 --- a/internal/vm/hcs/plan9.go +++ b/internal/vm/hcs/plan9.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/processor.go b/internal/vm/hcs/processor.go index fcbe12954e..27bfbc61d3 100644 --- a/internal/vm/hcs/processor.go +++ b/internal/vm/hcs/processor.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs func (uvmb *utilityVMBuilder) SetProcessorCount(count uint32) error { diff --git a/internal/vm/hcs/scsi.go b/internal/vm/hcs/scsi.go index ca238df974..ad2582d16e 100644 --- a/internal/vm/hcs/scsi.go +++ b/internal/vm/hcs/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/serial.go b/internal/vm/hcs/serial.go index 974493344a..ef6541c5c1 100644 --- a/internal/vm/hcs/serial.go +++ b/internal/vm/hcs/serial.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/stats.go b/internal/vm/hcs/stats.go index bb4cbfc59c..8cd3edbc3e 100644 --- a/internal/vm/hcs/stats.go +++ b/internal/vm/hcs/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/storage.go b/internal/vm/hcs/storage.go index 9b2317a036..edc7d4dd6e 100644 --- a/internal/vm/hcs/storage.go +++ b/internal/vm/hcs/storage.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs func (uvmb *utilityVMBuilder) SetStorageQos(iopsMaximum int64, bandwidthMaximum int64) error { diff --git a/internal/vm/hcs/supported.go b/internal/vm/hcs/supported.go index e179c252c3..0fb4453a80 100644 --- a/internal/vm/hcs/supported.go +++ b/internal/vm/hcs/supported.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import "github.com/Microsoft/hcsshim/internal/vm" diff --git a/internal/vm/hcs/vmsocket.go b/internal/vm/hcs/vmsocket.go index 22e268858a..49c50b88b8 100644 --- a/internal/vm/hcs/vmsocket.go +++ b/internal/vm/hcs/vmsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/vpmem.go b/internal/vm/hcs/vpmem.go index fb3a2dbc1a..915a10e7f7 100644 --- a/internal/vm/hcs/vpmem.go +++ b/internal/vm/hcs/vpmem.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/vsmb.go b/internal/vm/hcs/vsmb.go index c48596fc2a..3cb1696c50 100644 --- a/internal/vm/hcs/vsmb.go +++ b/internal/vm/hcs/vsmb.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/hcs/windows.go b/internal/vm/hcs/windows.go index e4775b0528..40ab8629c6 100644 --- a/internal/vm/hcs/windows.go +++ b/internal/vm/hcs/windows.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/internal/vm/remotevm/boot.go b/internal/vm/remotevm/boot.go index 9f170033b1..91e42ae748 100644 --- a/internal/vm/remotevm/boot.go +++ b/internal/vm/remotevm/boot.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/builder.go b/internal/vm/remotevm/builder.go index b289428044..5887bf4e7f 100644 --- a/internal/vm/remotevm/builder.go +++ b/internal/vm/remotevm/builder.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/doc.go b/internal/vm/remotevm/doc.go new file mode 100644 index 0000000000..651278471e --- /dev/null +++ b/internal/vm/remotevm/doc.go @@ -0,0 +1 @@ +package remotevm diff --git a/internal/vm/remotevm/memory.go b/internal/vm/remotevm/memory.go index f0933cfc4e..9f7b3ce8cb 100644 --- a/internal/vm/remotevm/memory.go +++ b/internal/vm/remotevm/memory.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/network.go b/internal/vm/remotevm/network.go index 25a634cb8a..d44f41c6a4 100644 --- a/internal/vm/remotevm/network.go +++ b/internal/vm/remotevm/network.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/processor.go b/internal/vm/remotevm/processor.go index 9e1ca2264a..da8aa276ff 100644 --- a/internal/vm/remotevm/processor.go +++ b/internal/vm/remotevm/processor.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/remotevm.go b/internal/vm/remotevm/remotevm.go index 733e33b49d..d48ebd64b3 100644 --- a/internal/vm/remotevm/remotevm.go +++ b/internal/vm/remotevm/remotevm.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/scsi.go b/internal/vm/remotevm/scsi.go index ba30dde4af..fc7863669e 100644 --- a/internal/vm/remotevm/scsi.go +++ b/internal/vm/remotevm/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/serial.go b/internal/vm/remotevm/serial.go index 599f7b5242..8a60db0e24 100644 --- a/internal/vm/remotevm/serial.go +++ b/internal/vm/remotevm/serial.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/stats.go b/internal/vm/remotevm/stats.go index ca2a780280..bef8363f8a 100644 --- a/internal/vm/remotevm/stats.go +++ b/internal/vm/remotevm/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/storage.go b/internal/vm/remotevm/storage.go index f2f7783316..13a8358193 100644 --- a/internal/vm/remotevm/storage.go +++ b/internal/vm/remotevm/storage.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/vmsocket.go b/internal/vm/remotevm/vmsocket.go index 048c9e48bd..d0a6c60468 100644 --- a/internal/vm/remotevm/vmsocket.go +++ b/internal/vm/remotevm/vmsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vm/remotevm/windows.go b/internal/vm/remotevm/windows.go index 17aefa5422..9e1ef7fb18 100644 --- a/internal/vm/remotevm/windows.go +++ b/internal/vm/remotevm/windows.go @@ -1,3 +1,5 @@ +//go:build windows + package remotevm import ( diff --git a/internal/vmcompute/doc.go b/internal/vmcompute/doc.go new file mode 100644 index 0000000000..9dd00c8128 --- /dev/null +++ b/internal/vmcompute/doc.go @@ -0,0 +1 @@ +package vmcompute diff --git a/internal/vmcompute/vmcompute.go b/internal/vmcompute/vmcompute.go index 8ca01f8247..ef2e3708b8 100644 --- a/internal/vmcompute/vmcompute.go +++ b/internal/vmcompute/vmcompute.go @@ -1,3 +1,5 @@ +//go:build windows + package vmcompute import ( diff --git a/internal/wclayer/activatelayer.go b/internal/wclayer/activatelayer.go index 5debe974d4..98a79ef4c5 100644 --- a/internal/wclayer/activatelayer.go +++ b/internal/wclayer/activatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/baselayer.go b/internal/wclayer/baselayer.go index 3ec708d1ed..aea8b421ef 100644 --- a/internal/wclayer/baselayer.go +++ b/internal/wclayer/baselayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -48,7 +50,6 @@ func reapplyDirectoryTimes(root *os.File, dis []dirInfo) error { if err != nil { return err } - } return nil } diff --git a/internal/wclayer/createlayer.go b/internal/wclayer/createlayer.go index 480aee8725..4e81298514 100644 --- a/internal/wclayer/createlayer.go +++ b/internal/wclayer/createlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/createscratchlayer.go b/internal/wclayer/createscratchlayer.go index 131aa94f14..5750d53e91 100644 --- a/internal/wclayer/createscratchlayer.go +++ b/internal/wclayer/createscratchlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/deactivatelayer.go b/internal/wclayer/deactivatelayer.go index d5bf2f5bdc..724af6223d 100644 --- a/internal/wclayer/deactivatelayer.go +++ b/internal/wclayer/deactivatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/destroylayer.go b/internal/wclayer/destroylayer.go index 424467ac33..20c5afea7f 100644 --- a/internal/wclayer/destroylayer.go +++ b/internal/wclayer/destroylayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/doc.go b/internal/wclayer/doc.go new file mode 100644 index 0000000000..dd1d555804 --- /dev/null +++ b/internal/wclayer/doc.go @@ -0,0 +1,4 @@ +// Package wclayer provides bindings to HCS's legacy layer management API and +// provides a higher level interface around these calls for container layer +// management. +package wclayer diff --git a/internal/wclayer/expandscratchsize.go b/internal/wclayer/expandscratchsize.go index 035c9041e6..38071322b7 100644 --- a/internal/wclayer/expandscratchsize.go +++ b/internal/wclayer/expandscratchsize.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/exportlayer.go b/internal/wclayer/exportlayer.go index 97b27eb7d6..3c388ef4bc 100644 --- a/internal/wclayer/exportlayer.go +++ b/internal/wclayer/exportlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/getlayermountpath.go b/internal/wclayer/getlayermountpath.go index 8d213f5871..761b5bbd1d 100644 --- a/internal/wclayer/getlayermountpath.go +++ b/internal/wclayer/getlayermountpath.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/getsharedbaseimages.go b/internal/wclayer/getsharedbaseimages.go index ae1fff8403..1da329c7a4 100644 --- a/internal/wclayer/getsharedbaseimages.go +++ b/internal/wclayer/getsharedbaseimages.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/grantvmaccess.go b/internal/wclayer/grantvmaccess.go index 4b282fef9d..b0da3e71df 100644 --- a/internal/wclayer/grantvmaccess.go +++ b/internal/wclayer/grantvmaccess.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/importlayer.go b/internal/wclayer/importlayer.go index 687550f0be..cd4e470837 100644 --- a/internal/wclayer/importlayer.go +++ b/internal/wclayer/importlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/layerexists.go b/internal/wclayer/layerexists.go index 01e6723393..5ee3379cfb 100644 --- a/internal/wclayer/layerexists.go +++ b/internal/wclayer/layerexists.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/layerid.go b/internal/wclayer/layerid.go index 0ce34a30f8..ea459d2d42 100644 --- a/internal/wclayer/layerid.go +++ b/internal/wclayer/layerid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/layerutils.go b/internal/wclayer/layerutils.go index 1ec893c6af..86f0549ef6 100644 --- a/internal/wclayer/layerutils.go +++ b/internal/wclayer/layerutils.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer // This file contains utility functions to support storage (graph) related diff --git a/internal/wclayer/legacy.go b/internal/wclayer/legacy.go index b7f3064f26..f012d51104 100644 --- a/internal/wclayer/legacy.go +++ b/internal/wclayer/legacy.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -262,7 +264,6 @@ func (r *legacyLayerReader) Next() (path string, size int64, fileInfo *winio.Fil // The creation time and access time get reset for files outside of the Files path. fileInfo.CreationTime = fileInfo.LastWriteTime fileInfo.LastAccessTime = fileInfo.LastWriteTime - } else { // The file attributes are written before the backup stream. var attr uint32 diff --git a/internal/wclayer/nametoguid.go b/internal/wclayer/nametoguid.go index 09950297ce..30938e3d66 100644 --- a/internal/wclayer/nametoguid.go +++ b/internal/wclayer/nametoguid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/preparelayer.go b/internal/wclayer/preparelayer.go index 90129faefb..2f128ab153 100644 --- a/internal/wclayer/preparelayer.go +++ b/internal/wclayer/preparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/processimage.go b/internal/wclayer/processimage.go index 30bcdff5f5..aaf55d887b 100644 --- a/internal/wclayer/processimage.go +++ b/internal/wclayer/processimage.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/unpreparelayer.go b/internal/wclayer/unpreparelayer.go index 71b130c525..c53a06ea2c 100644 --- a/internal/wclayer/unpreparelayer.go +++ b/internal/wclayer/unpreparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/internal/wclayer/wclayer.go b/internal/wclayer/wclayer.go index 9b1e06d50c..8aeab8d24e 100644 --- a/internal/wclayer/wclayer.go +++ b/internal/wclayer/wclayer.go @@ -1,6 +1,5 @@ -// Package wclayer provides bindings to HCS's legacy layer management API and -// provides a higher level interface around these calls for container layer -// management. +//go:build windows + package wclayer import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/internal/wcow/doc.go b/internal/wcow/doc.go new file mode 100644 index 0000000000..b02b2ddcf2 --- /dev/null +++ b/internal/wcow/doc.go @@ -0,0 +1 @@ +package wcow diff --git a/internal/wcow/scratch.go b/internal/wcow/scratch.go index 940ccbf7f6..992ac0edda 100644 --- a/internal/wcow/scratch.go +++ b/internal/wcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package wcow import ( diff --git a/internal/winapi/console.go b/internal/winapi/console.go index def9525417..4547cdd8e8 100644 --- a/internal/winapi/console.go +++ b/internal/winapi/console.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/devices.go b/internal/winapi/devices.go index df28ea2421..7875466cad 100644 --- a/internal/winapi/devices.go +++ b/internal/winapi/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/internal/winapi/doc.go b/internal/winapi/doc.go new file mode 100644 index 0000000000..9acc0bfc17 --- /dev/null +++ b/internal/winapi/doc.go @@ -0,0 +1,3 @@ +// Package winapi contains various low-level bindings to Windows APIs. It can +// be thought of as an extension to golang.org/x/sys/windows. +package winapi diff --git a/internal/winapi/errors.go b/internal/winapi/errors.go index 4e80ef68c9..49ce924cbe 100644 --- a/internal/winapi/errors.go +++ b/internal/winapi/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "syscall" diff --git a/internal/winapi/filesystem.go b/internal/winapi/filesystem.go index 7ce52afd5e..0d78c051ba 100644 --- a/internal/winapi/filesystem.go +++ b/internal/winapi/filesystem.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi //sys NtCreateFile(handle *uintptr, accessMask uint32, oa *ObjectAttributes, iosb *IOStatusBlock, allocationSize *uint64, fileAttributes uint32, shareAccess uint32, createDisposition uint32, createOptions uint32, eaBuffer *byte, eaLength uint32) (status uint32) = ntdll.NtCreateFile diff --git a/internal/winapi/jobobject.go b/internal/winapi/jobobject.go index 44371b3886..ecf7c1c2e4 100644 --- a/internal/winapi/jobobject.go +++ b/internal/winapi/jobobject.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/system.go b/internal/winapi/system.go index 9e4009d873..f5b1868e48 100644 --- a/internal/winapi/system.go +++ b/internal/winapi/system.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "golang.org/x/sys/windows" diff --git a/internal/winapi/user.go b/internal/winapi/user.go index 47aa63e34a..8abc095d60 100644 --- a/internal/winapi/user.go +++ b/internal/winapi/user.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/utils.go b/internal/winapi/utils.go index 859b753c24..7b93974846 100644 --- a/internal/winapi/utils.go +++ b/internal/winapi/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/winapi/winapi.go b/internal/winapi/winapi.go index 298ff838ac..b45fc7de43 100644 --- a/internal/winapi/winapi.go +++ b/internal/winapi/winapi.go @@ -1,5 +1,3 @@ -// Package winapi contains various low-level bindings to Windows APIs. It can -// be thought of as an extension to golang.org/x/sys/windows. package winapi //go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go bindflt.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/internal/winapi/winapi_test.go b/internal/winapi/winapi_test.go index 80759edf8a..de42adcd21 100644 --- a/internal/winapi/winapi_test.go +++ b/internal/winapi/winapi_test.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/internal/windevice/devicequery.go b/internal/windevice/devicequery.go index 19eddec590..313c853abb 100644 --- a/internal/windevice/devicequery.go +++ b/internal/windevice/devicequery.go @@ -1,3 +1,5 @@ +//go:build windows + package windevice import ( diff --git a/internal/windevice/doc.go b/internal/windevice/doc.go new file mode 100644 index 0000000000..5b3c437e6e --- /dev/null +++ b/internal/windevice/doc.go @@ -0,0 +1 @@ +package windevice diff --git a/internal/winobjdir/doc.go b/internal/winobjdir/doc.go new file mode 100644 index 0000000000..3378df0134 --- /dev/null +++ b/internal/winobjdir/doc.go @@ -0,0 +1 @@ +package winobjdir diff --git a/internal/winobjdir/object_dir.go b/internal/winobjdir/object_dir.go index 83baf2551d..1b09f314a9 100644 --- a/internal/winobjdir/object_dir.go +++ b/internal/winobjdir/object_dir.go @@ -1,3 +1,5 @@ +//go:build windows + package winobjdir import ( diff --git a/layer.go b/layer.go index 8916163706..e323c8308d 100644 --- a/layer.go +++ b/layer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/osversion/osversion_windows.go b/osversion/osversion_windows.go index 3ab3bcd89a..ecb0766164 100644 --- a/osversion/osversion_windows.go +++ b/osversion/osversion_windows.go @@ -1,3 +1,5 @@ +//go:build windows + package osversion import ( diff --git a/pkg/go-runhcs/doc.go b/pkg/go-runhcs/doc.go new file mode 100644 index 0000000000..f2523af44a --- /dev/null +++ b/pkg/go-runhcs/doc.go @@ -0,0 +1 @@ +package runhcs diff --git a/pkg/go-runhcs/runhcs.go b/pkg/go-runhcs/runhcs.go index 64491a70cc..1d82f72c6f 100644 --- a/pkg/go-runhcs/runhcs.go +++ b/pkg/go-runhcs/runhcs.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -20,7 +22,7 @@ type Format string const ( none Format = "" - // Text is the default text log ouput. + // Text is the default text log output. Text Format = "text" // JSON is the JSON formatted log output. JSON Format = "json" @@ -140,7 +142,7 @@ func (r *Runhcs) runOrError(cmd *exec.Cmd) error { } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } @@ -166,7 +168,7 @@ func cmdOutput(cmd *exec.Cmd, combined bool) ([]byte, error) { status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return b.Bytes(), err diff --git a/pkg/go-runhcs/runhcs_create-scratch.go b/pkg/go-runhcs/runhcs_create-scratch.go index 720386c273..956e4c1f77 100644 --- a/pkg/go-runhcs/runhcs_create-scratch.go +++ b/pkg/go-runhcs/runhcs_create-scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_create.go b/pkg/go-runhcs/runhcs_create.go index 20d5d402ec..f908de4e29 100644 --- a/pkg/go-runhcs/runhcs_create.go +++ b/pkg/go-runhcs/runhcs_create.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -95,7 +97,7 @@ func (r *Runhcs) Create(context context.Context, id, bundle string, opts *Create } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/pkg/go-runhcs/runhcs_delete.go b/pkg/go-runhcs/runhcs_delete.go index 08b82bbd9a..307a1de5c1 100644 --- a/pkg/go-runhcs/runhcs_delete.go +++ b/pkg/go-runhcs/runhcs_delete.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_exec.go b/pkg/go-runhcs/runhcs_exec.go index 090a0a31f8..a85ee66f7a 100644 --- a/pkg/go-runhcs/runhcs_exec.go +++ b/pkg/go-runhcs/runhcs_exec.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -82,7 +84,7 @@ func (r *Runhcs) Exec(context context.Context, id, processFile string, opts *Exe } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/pkg/go-runhcs/runhcs_kill.go b/pkg/go-runhcs/runhcs_kill.go index 021e5b16fe..8480c64929 100644 --- a/pkg/go-runhcs/runhcs_kill.go +++ b/pkg/go-runhcs/runhcs_kill.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_list.go b/pkg/go-runhcs/runhcs_list.go index 3b9208017f..d7e88a2f05 100644 --- a/pkg/go-runhcs/runhcs_list.go +++ b/pkg/go-runhcs/runhcs_list.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_pause.go b/pkg/go-runhcs/runhcs_pause.go index 56392fa43e..93ec1e8770 100644 --- a/pkg/go-runhcs/runhcs_pause.go +++ b/pkg/go-runhcs/runhcs_pause.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_ps.go b/pkg/go-runhcs/runhcs_ps.go index 4dc9f144fe..b60dabe8f5 100644 --- a/pkg/go-runhcs/runhcs_ps.go +++ b/pkg/go-runhcs/runhcs_ps.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_resize-tty.go b/pkg/go-runhcs/runhcs_resize-tty.go index b9f90491d3..016b948056 100644 --- a/pkg/go-runhcs/runhcs_resize-tty.go +++ b/pkg/go-runhcs/runhcs_resize-tty.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_resume.go b/pkg/go-runhcs/runhcs_resume.go index 1fdeb87d9b..0116d0a2de 100644 --- a/pkg/go-runhcs/runhcs_resume.go +++ b/pkg/go-runhcs/runhcs_resume.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_start.go b/pkg/go-runhcs/runhcs_start.go index ad3df746a8..98de529de7 100644 --- a/pkg/go-runhcs/runhcs_start.go +++ b/pkg/go-runhcs/runhcs_start.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_state.go b/pkg/go-runhcs/runhcs_state.go index b22bb079cc..cc18801ec1 100644 --- a/pkg/go-runhcs/runhcs_state.go +++ b/pkg/go-runhcs/runhcs_state.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/go-runhcs/runhcs_test.go b/pkg/go-runhcs/runhcs_test.go index bdbae1bffb..b44b550915 100644 --- a/pkg/go-runhcs/runhcs_test.go +++ b/pkg/go-runhcs/runhcs_test.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/pkg/ociwclayer/doc.go b/pkg/ociwclayer/doc.go new file mode 100644 index 0000000000..0ec1aa05c4 --- /dev/null +++ b/pkg/ociwclayer/doc.go @@ -0,0 +1,3 @@ +// Package ociwclayer provides functions for importing and exporting Windows +// container layers from and to their OCI tar representation. +package ociwclayer diff --git a/pkg/ociwclayer/export.go b/pkg/ociwclayer/export.go index e3f1be333d..feea29080e 100644 --- a/pkg/ociwclayer/export.go +++ b/pkg/ociwclayer/export.go @@ -1,5 +1,5 @@ -// Package ociwclayer provides functions for importing and exporting Windows -// container layers from and to their OCI tar representation. +//go:build windows + package ociwclayer import ( diff --git a/pkg/ociwclayer/import.go b/pkg/ociwclayer/import.go index e74a6b5946..863329c1ba 100644 --- a/pkg/ociwclayer/import.go +++ b/pkg/ociwclayer/import.go @@ -1,3 +1,5 @@ +//go:build windows + package ociwclayer import ( diff --git a/pkg/securitypolicy/securitypolicy_test.go b/pkg/securitypolicy/securitypolicy_test.go index 775c2e3744..0dbe84e9f8 100644 --- a/pkg/securitypolicy/securitypolicy_test.go +++ b/pkg/securitypolicy/securitypolicy_test.go @@ -156,7 +156,6 @@ func Test_EnforceDeviceMountPolicy_No_Matches(t *testing.T) { // return an error when there's a matching root hash in the policy func Test_EnforceDeviceMountPolicy_Matches(t *testing.T) { f := func(p *generatedContainers) bool { - policy := NewStandardSecurityPolicyEnforcer(p.containers, ignoredEncodedPolicyString) r := rand.New(rand.NewSource(time.Now().UnixNano())) @@ -959,7 +958,6 @@ func generateInvalidRootHash(r *rand.Rand) string { } func selectRootHashFromContainers(containers *generatedContainers, r *rand.Rand) string { - numberOfContainersInPolicy := len(containers.containers) container := containers.containers[r.Intn(numberOfContainersInPolicy)] numberOfLayersInContainer := len(container.Layers) diff --git a/pkg/securitypolicy/securitypolicyenforcer.go b/pkg/securitypolicy/securitypolicyenforcer.go index b435080e9e..97145d819b 100644 --- a/pkg/securitypolicy/securitypolicyenforcer.go +++ b/pkg/securitypolicy/securitypolicyenforcer.go @@ -85,7 +85,7 @@ type StandardSecurityPolicyEnforcer struct { // // Most of the work that this security policy enforcer does it around managing // state needed to map from a container definition in the SecurityPolicy to - // a specfic container ID as we bring up each container. See + // a specific container ID as we bring up each container. See // enforceCommandPolicy where most of the functionality is handling the case // were policy containers share an overlay and have to try to distinguish them // based on the command line arguments. enforceEnvironmentVariablePolicy can diff --git a/process.go b/process.go index 3362c68335..44df91cde2 100644 --- a/process.go +++ b/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/containerd-shim-runhcs-v1/delete_test.go b/test/containerd-shim-runhcs-v1/delete_test.go index 291dbbf227..b1df035deb 100644 --- a/test/containerd-shim-runhcs-v1/delete_test.go +++ b/test/containerd-shim-runhcs-v1/delete_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package main diff --git a/test/containerd-shim-runhcs-v1/global_command_test.go b/test/containerd-shim-runhcs-v1/global_command_test.go index d927836bb1..c0bf688096 100644 --- a/test/containerd-shim-runhcs-v1/global_command_test.go +++ b/test/containerd-shim-runhcs-v1/global_command_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package main diff --git a/test/containerd-shim-runhcs-v1/start_test.go b/test/containerd-shim-runhcs-v1/start_test.go index c478c3233e..dbc7c48974 100644 --- a/test/containerd-shim-runhcs-v1/start_test.go +++ b/test/containerd-shim-runhcs-v1/start_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package main diff --git a/test/cri-containerd/clone_test.go b/test/cri-containerd/clone_test.go index f2d578f9de..1da12e4903 100644 --- a/test/cri-containerd/clone_test.go +++ b/test/cri-containerd/clone_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container.go b/test/cri-containerd/container.go index de5cad1702..8257f988b2 100644 --- a/test/cri-containerd/container.go +++ b/test/cri-containerd/container.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_downlevel_test.go b/test/cri-containerd/container_downlevel_test.go index 0197b9da2f..6bee88adf6 100644 --- a/test/cri-containerd/container_downlevel_test.go +++ b/test/cri-containerd/container_downlevel_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_fileshare_test.go b/test/cri-containerd/container_fileshare_test.go index cdd9c088ac..511a133c87 100644 --- a/test/cri-containerd/container_fileshare_test.go +++ b/test/cri-containerd/container_fileshare_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_gmsa_test.go b/test/cri-containerd/container_gmsa_test.go index ac59a38b8c..ef9fe22701 100644 --- a/test/cri-containerd/container_gmsa_test.go +++ b/test/cri-containerd/container_gmsa_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_layers_packing_test.go b/test/cri-containerd/container_layers_packing_test.go index 9b9ec85704..89a64bbb02 100644 --- a/test/cri-containerd/container_layers_packing_test.go +++ b/test/cri-containerd/container_layers_packing_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_network_test.go b/test/cri-containerd/container_network_test.go index 73129d508a..6e4888ea85 100644 --- a/test/cri-containerd/container_network_test.go +++ b/test/cri-containerd/container_network_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_test.go b/test/cri-containerd/container_test.go index 1afbc1b7ce..0f777c740a 100644 --- a/test/cri-containerd/container_test.go +++ b/test/cri-containerd/container_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_update_test.go b/test/cri-containerd/container_update_test.go index b9df5e5d28..ccfdc8bb8d 100644 --- a/test/cri-containerd/container_update_test.go +++ b/test/cri-containerd/container_update_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/container_virtual_device_test.go b/test/cri-containerd/container_virtual_device_test.go index ecbee741d0..591da7b7fd 100644 --- a/test/cri-containerd/container_virtual_device_test.go +++ b/test/cri-containerd/container_virtual_device_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/containerdrestart_test.go b/test/cri-containerd/containerdrestart_test.go index a234776bc7..706730fb4a 100644 --- a/test/cri-containerd/containerdrestart_test.go +++ b/test/cri-containerd/containerdrestart_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/createcontainer_test.go b/test/cri-containerd/createcontainer_test.go index 18f855342a..0efa1c62e3 100644 --- a/test/cri-containerd/createcontainer_test.go +++ b/test/cri-containerd/createcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/exec.go b/test/cri-containerd/exec.go index a3381cc44d..729541640f 100644 --- a/test/cri-containerd/exec.go +++ b/test/cri-containerd/exec.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/execcontainer_test.go b/test/cri-containerd/execcontainer_test.go index 640f4fe42f..fb7a7fa702 100644 --- a/test/cri-containerd/execcontainer_test.go +++ b/test/cri-containerd/execcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/extended_task_test.go b/test/cri-containerd/extended_task_test.go index 040ec8c835..214f718dc0 100644 --- a/test/cri-containerd/extended_task_test.go +++ b/test/cri-containerd/extended_task_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/gmsa.go b/test/cri-containerd/gmsa_test.go similarity index 94% rename from test/cri-containerd/gmsa.go rename to test/cri-containerd/gmsa_test.go index 4e73b1b84a..3fd4de016f 100644 --- a/test/cri-containerd/gmsa.go +++ b/test/cri-containerd/gmsa_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/helpers/log.go b/test/cri-containerd/helpers/log.go index fe8933afef..8c58021d3c 100644 --- a/test/cri-containerd/helpers/log.go +++ b/test/cri-containerd/helpers/log.go @@ -1,3 +1,5 @@ +//go:build windows + package main import ( diff --git a/test/cri-containerd/jobcontainer_test.go b/test/cri-containerd/jobcontainer_test.go index 91ba59793a..c533012192 100644 --- a/test/cri-containerd/jobcontainer_test.go +++ b/test/cri-containerd/jobcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/layer_integrity_test.go b/test/cri-containerd/layer_integrity_test.go index 2be96dda8c..b4ae92ea59 100644 --- a/test/cri-containerd/layer_integrity_test.go +++ b/test/cri-containerd/layer_integrity_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/logging_binary_test.go b/test/cri-containerd/logging_binary_test.go index 4e4949c60d..a0f31a62a1 100644 --- a/test/cri-containerd/logging_binary_test.go +++ b/test/cri-containerd/logging_binary_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/main_test.go b/test/cri-containerd/main_test.go index 4af3204e1c..5e0a5468aa 100644 --- a/test/cri-containerd/main_test.go +++ b/test/cri-containerd/main_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/pod_update_test.go b/test/cri-containerd/pod_update_test.go index e8ba337c13..bf1fc6f50f 100644 --- a/test/cri-containerd/pod_update_test.go +++ b/test/cri-containerd/pod_update_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/policy_test.go b/test/cri-containerd/policy_test.go index f46f34b555..2f8d5e8d8b 100644 --- a/test/cri-containerd/policy_test.go +++ b/test/cri-containerd/policy_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/pullimage_test.go b/test/cri-containerd/pullimage_test.go index ce536b3a3e..d8da0ade31 100644 --- a/test/cri-containerd/pullimage_test.go +++ b/test/cri-containerd/pullimage_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/removepodsandbox_test.go b/test/cri-containerd/removepodsandbox_test.go index 506d78c2ca..db192ac598 100644 --- a/test/cri-containerd/removepodsandbox_test.go +++ b/test/cri-containerd/removepodsandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/runpodsandbox_test.go b/test/cri-containerd/runpodsandbox_test.go index e7a7b6af4c..515ab9765e 100644 --- a/test/cri-containerd/runpodsandbox_test.go +++ b/test/cri-containerd/runpodsandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/sandbox.go b/test/cri-containerd/sandbox_test.go similarity index 97% rename from test/cri-containerd/sandbox.go rename to test/cri-containerd/sandbox_test.go index e2723e955e..9c1dc65c36 100644 --- a/test/cri-containerd/sandbox.go +++ b/test/cri-containerd/sandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go b/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go index d079dc6eec..609b55efcc 100644 --- a/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go +++ b/test/cri-containerd/scale_cpu_limits_to_sandbox_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/service_test.go b/test/cri-containerd/service_test.go index e995a9a194..4656891a67 100644 --- a/test/cri-containerd/service_test.go +++ b/test/cri-containerd/service_test.go @@ -1,3 +1,5 @@ +//go:build windows && functional + package cri_containerd import ( diff --git a/test/cri-containerd/share.go b/test/cri-containerd/share.go index d6dc7d692a..a3be151988 100644 --- a/test/cri-containerd/share.go +++ b/test/cri-containerd/share.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/stats_test.go b/test/cri-containerd/stats_test.go index a8f367ad4c..f7a4906d40 100644 --- a/test/cri-containerd/stats_test.go +++ b/test/cri-containerd/stats_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/stopcontainer_test.go b/test/cri-containerd/stopcontainer_test.go index 89e0478b8f..3a582877a6 100644 --- a/test/cri-containerd/stopcontainer_test.go +++ b/test/cri-containerd/stopcontainer_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/cri-containerd/test-images/jobcontainer_createvhd/main.go b/test/cri-containerd/test-images/jobcontainer_createvhd/main.go index 1788dea39f..0e51cc10a4 100644 --- a/test/cri-containerd/test-images/jobcontainer_createvhd/main.go +++ b/test/cri-containerd/test-images/jobcontainer_createvhd/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/test-images/jobcontainer_etw/main.go b/test/cri-containerd/test-images/jobcontainer_etw/main.go index 4637d6160f..43f34758f5 100644 --- a/test/cri-containerd/test-images/jobcontainer_etw/main.go +++ b/test/cri-containerd/test-images/jobcontainer_etw/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/test-images/jobcontainer_hns/main.go b/test/cri-containerd/test-images/jobcontainer_hns/main.go index e2e28f8d6b..1ac550fee0 100644 --- a/test/cri-containerd/test-images/jobcontainer_hns/main.go +++ b/test/cri-containerd/test-images/jobcontainer_hns/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/test-images/timezone/main.go b/test/cri-containerd/test-images/timezone/main.go index 1cca744fca..318c61a154 100644 --- a/test/cri-containerd/test-images/timezone/main.go +++ b/test/cri-containerd/test-images/timezone/main.go @@ -1,3 +1,6 @@ +//go:build windows +// +build windows + package main import ( diff --git a/test/cri-containerd/update_utilities.go b/test/cri-containerd/update_utilities_test.go similarity index 97% rename from test/cri-containerd/update_utilities.go rename to test/cri-containerd/update_utilities_test.go index d6dfa225df..1cfe00d337 100644 --- a/test/cri-containerd/update_utilities.go +++ b/test/cri-containerd/update_utilities_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package cri_containerd diff --git a/test/internal/schemaversion_test.go b/test/internal/schemaversion_test.go index cb7ecf241a..1c492bd8a9 100644 --- a/test/internal/schemaversion_test.go +++ b/test/internal/schemaversion_test.go @@ -1,3 +1,5 @@ +//go:build windows + package internal import ( diff --git a/test/runhcs/create-scratch_test.go b/test/runhcs/create-scratch_test.go index 059bf60fe6..79fd555db2 100644 --- a/test/runhcs/create-scratch_test.go +++ b/test/runhcs/create-scratch_test.go @@ -1,5 +1,5 @@ -//go:build functional -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/runhcs/e2e_matrix_test.go b/test/runhcs/e2e_matrix_test.go index 28c81a7746..8aeb815134 100644 --- a/test/runhcs/e2e_matrix_test.go +++ b/test/runhcs/e2e_matrix_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/runhcs/list_test.go b/test/runhcs/list_test.go index 4716c5c969..8230338d92 100644 --- a/test/runhcs/list_test.go +++ b/test/runhcs/list_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/runhcs/runhcs_test.go b/test/runhcs/runhcs_test.go index 427c3d1ec2..6e7b98152e 100644 --- a/test/runhcs/runhcs_test.go +++ b/test/runhcs/runhcs_test.go @@ -1,4 +1,5 @@ -// +build functional +//go:build windows && functional +// +build windows,functional package runhcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/.gitignore b/test/vendor/github.com/Microsoft/hcsshim/.gitignore index c91812a4b4..292630f9ea 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/.gitignore +++ b/test/vendor/github.com/Microsoft/hcsshim/.gitignore @@ -34,4 +34,7 @@ rootfs-conv/* /build/ deps/* -out/* \ No newline at end of file +out/* + +go.work +go.work.sum \ No newline at end of file diff --git a/test/vendor/github.com/Microsoft/hcsshim/Makefile b/test/vendor/github.com/Microsoft/hcsshim/Makefile index 362ddea7c6..e1a0f51129 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/Makefile +++ b/test/vendor/github.com/Microsoft/hcsshim/Makefile @@ -32,7 +32,7 @@ clean: rm -rf bin deps rootfs out test: - cd $(SRCROOT) && go test -v ./internal/guest/... + cd $(SRCROOT) && $(GO) test -v ./internal/guest/... rootfs: out/rootfs.vhd diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go index 7f1f2823dd..05b6ea7bd4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/attach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go index 8e28e6c504..8dd942bab9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go index 435473257e..934ee5b1a6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/detach.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go index 2db6d40399..cf90d9b6c9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/export.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go index 61d8d5a634..05e0729f50 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/format.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go index 87fee452cd..3bbbc226c0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go index 0c61dab329..a40b4037cc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/import.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go index 53ed8ea6ed..ddd8f318da 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/initialize.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go index fcdbbef814..6e445e766b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/mount.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go b/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go index 06aaf841e8..4b27b895ad 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go +++ b/test/vendor/github.com/Microsoft/hcsshim/computestorage/setup.go @@ -1,3 +1,5 @@ +//go:build windows + package computestorage import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/container.go b/test/vendor/github.com/Microsoft/hcsshim/container.go index bfd722898e..640e0b26f4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/container.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/errors.go b/test/vendor/github.com/Microsoft/hcsshim/errors.go index a1a2912177..594bbfb7a8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/errors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go new file mode 100644 index 0000000000..83b2fffb02 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/doc.go @@ -0,0 +1,3 @@ +// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server +// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +package hcn diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go index fe3d13a052..17539b8694 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcn.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go index 213cfe0b1f..267bbe7cb1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go index 1d52d2e72a..8b719fa112 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors.go @@ -1,5 +1,5 @@ -// Package hcn is a shim for the Host Compute Networking (HCN) service, which manages networking for Windows Server -// containers and Hyper-V containers. Previous to RS5, HCN was referred to as Host Networking Service (HNS). +//go:build windows + package hcn import ( @@ -87,7 +87,7 @@ func new(hr error, title string, rest string) error { // // Note that the below errors are not errors returned by hcn itself -// we wish to seperate them as they are shim usage error +// we wish to separate them as they are shim usage error // // NetworkNotFoundError results from a failed search for a network by Id or Name diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go index 14903bc5e9..25e368fc23 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go index 28fa855656..f68d39053e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnloadbalancer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go index 12e69de9cc..7539e39fa8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnamespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go index c36b136387..41dcdac24a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go index 56bde82e1b..a695f1c27d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnpolicy.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go index 52e2498462..d0761d6bd0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnroute.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go index bacb91feda..00af20be31 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcn/hcnsupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcn import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go b/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go index ceb3ac85ee..95dc2a0255 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hcsshim.go @@ -1,3 +1,5 @@ +//go:build windows + // Shim for the Host Compute Service (HCS) to manage Windows Server // containers and Hyper-V containers. diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go b/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go index 9e0059447d..ea71135acc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go b/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go index 2b53819047..c564bf4a35 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go b/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go index 25240d9ccc..925c212495 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnsnetwork.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go b/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go index 55aaa4a50e..9bfe61ee83 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go b/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go index 69405244b6..d97681e0ca 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go +++ b/test/vendor/github.com/Microsoft/hcsshim/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/interface.go b/test/vendor/github.com/Microsoft/hcsshim/interface.go index 300eb59966..81a2819516 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/interface.go +++ b/test/vendor/github.com/Microsoft/hcsshim/interface.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go new file mode 100644 index 0000000000..c65f2e337e --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/doc.go @@ -0,0 +1 @@ +package clone diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go index 67fb7ef077..1727d57afb 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/clone/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package clone import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go index 91a7da0277..758eb78880 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/cmd.go @@ -1,5 +1,5 @@ -// Package cmd provides functionality used to execute commands inside of containers -// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go index f4caff3251..e397bb85ee 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/diag.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go new file mode 100644 index 0000000000..7fe443fc92 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/doc.go @@ -0,0 +1,3 @@ +// Package cmd provides functionality used to execute commands inside of containers +// or UVMs, and to connect an upstream client to those commands for handling in/out/err IO. +package cmd diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go index 0912af160c..75ddd1f355 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go index ecfd1fa5ef..989a53c93c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_binary.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go index 63b9f9b732..614f34ca29 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cmd/io_npipe.go @@ -1,3 +1,5 @@ +//go:build windows + package cmd import ( @@ -53,7 +55,7 @@ func NewNpipeIO(ctx context.Context, stdin, stdout, stderr string, terminal bool } // We don't have any retry logic for stdin as there's no good way to detect that we'd even need to retry. If the process forwarding // stdin to the container (some client interface to exec a process in a container) exited, we'll get EOF which io.Copy treats as - // success. For fifos on Linux it seems if all fd's for the write end of the pipe dissappear, which is the same scenario, then + // success. For fifos on Linux it seems if all fd's for the write end of the pipe disappear, which is the same scenario, then // the read end will get EOF as well. nio.sin = c } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go new file mode 100644 index 0000000000..b94015b5aa --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/doc.go @@ -0,0 +1 @@ +package cni diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go index 2afcc6981c..3543a590d0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cni/registry.go @@ -1,3 +1,5 @@ +//go:build windows + package cni import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go index 4389559b9a..7df98b60c0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/doc.go @@ -7,5 +7,4 @@ // The mock service is compiled using the following command: // // mockgen -source="computeagent.pb.go" -package="computeagent_mock" > mock\computeagent_mock.pb.go - package computeagent diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go index fe7a2faa11..61aa2dc405 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/copyfile.go @@ -1,3 +1,5 @@ +//go:build windows + package copyfile import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go new file mode 100644 index 0000000000..a2812a6ee8 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/copyfile/doc.go @@ -0,0 +1 @@ +package copyfile diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go index 27a62a7238..c6eeb167b9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cow/cow.go @@ -1,3 +1,5 @@ +//go:build windows + package cow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go index 61cd703586..3abaa9c439 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/cpugroup.go @@ -1,3 +1,5 @@ +//go:build windows + package cpugroup import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go new file mode 100644 index 0000000000..a2c3357977 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/cpugroup/doc.go @@ -0,0 +1 @@ +package cpugroup diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go index 0c98eb1493..d9ec9a3490 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/credentials.go @@ -1,9 +1,6 @@ //go:build windows // +build windows -// Package credentials holds the necessary structs and functions for adding -// and removing Container Credential Guard instances (shortened to CCG -// normally) for V2 HCS schema containers. package credentials import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go new file mode 100644 index 0000000000..cbf23ed082 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/credentials/doc.go @@ -0,0 +1,4 @@ +// Package credentials holds the necessary structs and functions for adding +// and removing Container Credential Guard instances (shortened to CCG +// normally) for V2 HCS schema containers. +package credentials diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go new file mode 100644 index 0000000000..c1c721e298 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/devices/doc.go @@ -0,0 +1 @@ +package devices diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go index 22d89dd303..1e3e7c201d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/bridge.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go index 6ec5b8b84f..bf704fb548 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go new file mode 100644 index 0000000000..260915232f --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/doc.go @@ -0,0 +1 @@ +package gcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go index bdf796010c..bb28d890ff 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go index 628cb8b0d7..60141e9f70 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go index 840dcb2392..8450222a1a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go @@ -1,3 +1,5 @@ +//go:build windows + package gcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go index d13772b030..7b27173c3a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/callback.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go new file mode 100644 index 0000000000..d792dda986 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/doc.go @@ -0,0 +1 @@ +package hcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go index 85584f5b87..226dad2fbc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go index 605856f2a3..4bf3a167a5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -254,7 +256,7 @@ func (process *Process) waitBackground() { } // Wait waits for the process to exit. If the process has already exited returns -// the pervious error (if any). +// the previous error (if any). func (process *Process) Wait() error { <-process.waitBlock return process.waitError @@ -441,7 +443,6 @@ func (process *Process) CloseStderr(ctx context.Context) (err error) { if process.stderr != nil { process.stderr.Close() process.stderr = nil - } return nil } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go index b621c55938..d1f219cfad 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema1/schema1.go @@ -1,3 +1,5 @@ +//go:build windows + package schema1 import ( @@ -101,7 +103,7 @@ type ContainerConfig struct { HvRuntime *HvRuntime `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM Servicing bool `json:",omitempty"` // True if this container is for servicing AllowUnqualifiedDNSQuery bool `json:",omitempty"` // True to allow unqualified DNS name resolution - DNSSearchList string `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution + DNSSearchList string `json:",omitempty"` // Comma separated list of DNS suffixes to use for name resolution ContainerType string `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise. TerminateOnLastHandleClosed bool `json:",omitempty"` // Should HCS terminate the container once all handles have been closed MappedVirtualDisks []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go index a634dfc151..a46b0051df 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/service.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go index 75499c967f..052d08ccc3 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/system.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( @@ -592,7 +594,7 @@ func (computeSystem *System) unregisterCallback(ctx context.Context) error { return nil } - // hcsUnregisterComputeSystemCallback has its own syncronization + // hcsUnregisterComputeSystemCallback has its own synchronization // to wait for all callbacks to complete. We must NOT hold the callbackMapLock. err := vmcompute.HcsUnregisterComputeSystemCallback(ctx, handle) if err != nil { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go index 3342e5bb94..5dcb97eb39 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go index db4e14fdfb..6e161e6aa1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/waithelper.go @@ -1,3 +1,5 @@ +//go:build windows + package hcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go new file mode 100644 index 0000000000..ce70676789 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/doc.go @@ -0,0 +1 @@ +package hcserror diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go index 921c2c8556..bad2705416 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcserror/hcserror.go @@ -1,3 +1,5 @@ +//go:build windows + package hcserror import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go index 058530aac1..6df67ee876 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/create.go @@ -132,7 +132,6 @@ func verifyCloneContainerSpecs(templateSpec, cloneSpec *specs.Spec) error { } func validateContainerConfig(ctx context.Context, coi *createOptionsInternal) error { - if coi.HostingSystem != nil && coi.HostingSystem.IsTemplate && !coi.isTemplate { return fmt.Errorf("only a template container can be created inside a template pod. Any other combination is not valid") } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go index 4f17a715d6..ccc19d4af8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( @@ -117,7 +119,6 @@ func handleAssignedDevicesWindows( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure @@ -175,7 +176,6 @@ func handleAssignedDevicesLCOW( vm *uvm.UtilityVM, annotations map[string]string, specDevs []specs.WindowsDevice) (resultDevs []specs.WindowsDevice, closers []resources.ResourceCloser, err error) { - defer func() { if err != nil { // best effort clean up allocated resources on failure diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go new file mode 100644 index 0000000000..b4b2ac611b --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/doc.go @@ -0,0 +1 @@ +package hcsoci diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go index b3080399a6..1d25b44438 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/hcsdoc_wcow.go @@ -42,7 +42,6 @@ func createMountsConfig(ctx context.Context, coi *createOptionsInternal) (*mount // TODO: Mapped pipes to add in v2 schema. var config mountsConfig for _, mount := range coi.Spec.Mounts { - if uvm.IsPipe(mount.Source) { src, dst := uvm.GetContainerPipeMapping(coi.HostingSystem, mount) config.mpsv1 = append(config.mpsv1, schema1.MappedPipe{HostPath: src, ContainerPipeName: dst}) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go index daa4e46d00..27bf2669d2 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcsoci/network.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsoci import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go new file mode 100644 index 0000000000..f6d35df0e5 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/doc.go @@ -0,0 +1 @@ +package hns diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go index 7cf954c7b2..83b683bd90 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsendpoint.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( @@ -146,7 +148,6 @@ func (endpoint *HNSEndpoint) IsAttached(vID string) (bool, error) { } return false, nil - } // Create Endpoint by sending EndpointRequest to HNS. TODO: Create a separate HNS interface to place all these methods @@ -281,7 +282,6 @@ func (endpoint *HNSEndpoint) HostAttach(compartmentID uint16) error { return err } return hnsCall("POST", "/endpoints/"+endpoint.Id+"/attach", string(jsonString), &response) - } // HostDetach detaches a nic on the host diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go index 2df4a57f56..0a8f36d832 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsfuncs.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go index a8d8cc56ae..464bb8954f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsglobals.go @@ -1,3 +1,5 @@ +//go:build windows + package hns type HNSGlobals struct { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go index f12d3ab041..8861faee7a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnsnetwork.go @@ -1,13 +1,16 @@ +//go:build windows + package hns import ( "encoding/json" "errors" - "github.com/sirupsen/logrus" "net" + + "github.com/sirupsen/logrus" ) -// Subnet is assoicated with a network and represents a list +// Subnet is associated with a network and represents a list // of subnets available to the network type Subnet struct { AddressPrefix string `json:",omitempty"` @@ -15,7 +18,7 @@ type Subnet struct { Policies []json.RawMessage `json:",omitempty"` } -// MacPool is assoicated with a network and represents a list +// MacPool is associated with a network and represents a list // of macaddresses available to the network type MacPool struct { StartMacAddress string `json:",omitempty"` diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go index 31322a6816..b98db40e8d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnspolicylist.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go index d5efba7f28..b9c30b9019 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/hnssupport.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go index d3b04eefe0..749588ad39 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hns/namespace.go @@ -1,3 +1,5 @@ +//go:build windows + package hns import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go new file mode 100644 index 0000000000..cb554867fe --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/doc.go @@ -0,0 +1 @@ +package interop diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go index 922f7c679e..137dc3990a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/interop/interop.go @@ -1,3 +1,5 @@ +//go:build windows + package interop import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go new file mode 100644 index 0000000000..747ac49a97 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/doc.go @@ -0,0 +1,2 @@ +// Package layers deals with container layer mounting/unmounting for LCOW and WCOW +package layers diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go index 0334076365..e0fa566b63 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/layers/layers.go @@ -1,7 +1,6 @@ //go:build windows // +build windows -// Package layers deals with container layer mounting/unmounting for LCOW and WCOW package layers import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go index 32938641e8..fa78a8ecb6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/common.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go index c7af7cf6ce..937b8deafa 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/disk.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go new file mode 100644 index 0000000000..6105d5b57d --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/doc.go @@ -0,0 +1 @@ +package lcow diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go index ae385a1c1b..001f3347cd 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/lcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package lcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go index 569b035654..3b9064d671 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/sandbox.go @@ -2,6 +2,7 @@ package oci import ( "fmt" + "github.com/Microsoft/hcsshim/pkg/annotations" ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go index b0876465f0..4a624639f8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package oci import ( @@ -285,7 +287,7 @@ func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) ( handleAnnotationFullyPhysicallyBacked(ctx, s.Annotations, lopts) // SecurityPolicy is very sensitive to other settings and will silently change those that are incompatible. - // Eg VMPem device count, overriden kernel option cannot be respected. + // Eg VMPem device count, overridden kernel option cannot be respected. handleSecurityPolicy(ctx, s.Annotations, lopts) // override the default GuestState filename if specified diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go new file mode 100644 index 0000000000..dd2a53b5c6 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/doc.go @@ -0,0 +1 @@ +package processorinfo diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go index f179857a63..0aa766a43e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/host_information.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go index 3f6301ed68..848df8248e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/processorinfo/processor_count.go @@ -1,3 +1,5 @@ +//go:build windows + package processorinfo import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go new file mode 100644 index 0000000000..51bcdf6e98 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/doc.go @@ -0,0 +1 @@ +package regstate diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go index dcbc9334d7..184975add8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/regstate/regstate.go @@ -1,3 +1,5 @@ +//go:build windows + package regstate import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go new file mode 100644 index 0000000000..878cd99d0c --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/doc.go @@ -0,0 +1,3 @@ +// Package resources handles creating, updating, and releasing resources +// on a container +package resources diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go index 89851ae7c3..90fe116ae5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/resources/resources.go @@ -1,5 +1,5 @@ -// Package resources handles creating, updating, and releasing resources -// on a container +//go:build windows + package resources import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go index a161c204e2..33c43e6c59 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/container.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go index 2c8957b88d..b3e443d600 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/runhcs/vm.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go new file mode 100644 index 0000000000..f211d25e72 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/do.go @@ -0,0 +1 @@ +package safefile diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go index 66b8d7e035..8770bf5627 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/safefile/safeopen.go @@ -1,3 +1,5 @@ +//go:build windows + package safefile import ( @@ -156,7 +158,6 @@ func LinkRelative(oldname string, oldroot *os.File, newname string, newroot *os. if (fi.FileAttributes & syscall.FILE_ATTRIBUTE_REPARSE_POINT) != 0 { return &os.LinkError{Op: "link", Old: oldf.Name(), New: filepath.Join(newroot.Name(), newname), Err: winapi.RtlNtStatusToDosError(winapi.STATUS_REPARSE_POINT_ENCOUNTERED)} } - } else { parent = newroot } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go new file mode 100644 index 0000000000..c1432114b1 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/schemaversion/doc.go @@ -0,0 +1 @@ +package schemaversion diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go b/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go index 2d1242da42..6d37c7b411 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.go @@ -1,3 +1,5 @@ +//go:build windows + package shimdiag import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go index d76bfdbef4..50ac874bce 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/capabilities.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import "github.com/Microsoft/hcsshim/internal/hcs/schema1" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go index 4e2f95a148..010bac3145 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/clone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go index fe06563488..468139c0f7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/combine_layers.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go index b87edf2796..44b328ad37 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/computeagent.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go index fc08daae2f..fd49be9bfc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/counter.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go index f4c17fae2c..f93a83ca6e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpugroups.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go index 264da31a28..ea5fccf625 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/cpulimits_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go index 1a08bae535..b07a78bdd3 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -74,7 +76,7 @@ type Options struct { // far as the container is concerned and it is only able to view the NICs in the compartment it's assigned to. // This is the compartment setup (and behavior) that is followed for V1 HCS schema containers (docker) so // this change brings parity as well. This behavior is gated behind a registry key currently to avoid any - // unneccessary behavior and once this restriction is removed then we can remove the need for this variable + // unnecessary behavior and once this restriction is removed then we can remove the need for this variable // and the associated annotation as well. DisableCompartmentNamespace bool diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go index ada420cca2..3acfa875c3 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_lcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -28,7 +30,7 @@ import ( "github.com/Microsoft/hcsshim/osversion" ) -// General infomation about how this works at a high level. +// General information about how this works at a high level. // // The purpose is to start an LCOW Utility VM or UVM using the Host Compute Service, an API to create and manipulate running virtual machines // HCS takes json descriptions of the work to be done. @@ -180,7 +182,7 @@ func fetchProcessor(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (*hc return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -278,7 +280,6 @@ Example JSON document produced once the hcsschema.ComputeSytem returned by makeL // Make a hcsschema.ComputeSytem with the parts that target booting from a VMGS file func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - // Kernel and initrd are combined into a single vmgs file. vmgsFullPath := filepath.Join(opts.BootFilesPath, opts.GuestStateFile) if _, err := os.Stat(vmgsFullPath); os.IsNotExist(err) { @@ -371,7 +372,7 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ doc.VirtualMachine.Chipset.Uefi = &hcsschema.Uefi{ ApplySecureBootTemplate: "Apply", - SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivilent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, + SecureBootTemplateId: "1734c6e8-3154-4dda-ba5f-a874cc483422", // aka MicrosoftWindowsSecureBootTemplateGUID equivalent to "Microsoft Windows" template from Get-VMHost | select SecureBootTemplates, } @@ -391,7 +392,6 @@ func makeLCOWVMGSDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ // Many details are quite different (see the typical JSON examples), in particular it boots from a VMGS file // which contains both the kernel and initrd as well as kernel boot options. func makeLCOWSecurityDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcsschema.ComputeSystem, err error) { - doc, vmgsErr := makeLCOWVMGSDoc(ctx, opts, uvm) if vmgsErr != nil { return nil, vmgsErr @@ -487,7 +487,7 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs } var processor *hcsschema.Processor2 - processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existance tests above. + processor, err = fetchProcessor(ctx, opts, uvm) // must happen after the file existence tests above. if err != nil { return nil, err } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go index 4a92fc962d..ba11257b56 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/create_wcow.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -87,7 +89,7 @@ func prepareConfigDoc(ctx context.Context, uvm *UtilityVM, opts *OptionsWCOW, uv return nil, fmt.Errorf("failed to get host processor information: %s", err) } - // To maintain compatability with Docker we need to automatically downgrade + // To maintain compatibility with Docker we need to automatically downgrade // a user CPU count if the setting is not possible. uvm.processorCount = uvm.normalizeProcessorCount(ctx, opts.ProcessorCount, processorTopology) @@ -278,10 +280,10 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error } // TODO: BUGBUG Remove this. @jhowardmsft - // It should be the responsiblity of the caller to do the creation and population. + // It should be the responsibility of the caller to do the creation and population. // - Update runhcs too (vm.go). // - Remove comment in function header - // - Update tests that rely on this current behaviour. + // - Update tests that rely on this current behavior. // Create the RW scratch in the top-most layer folder, creating the folder if it doesn't already exist. scratchFolder := opts.LayerFolders[len(opts.LayerFolders)-1] diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go index 5ef5c73cbd..46bef7b163 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/delete_container.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go new file mode 100644 index 0000000000..c4e25cc15c --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/doc.go @@ -0,0 +1,2 @@ +// This package describes the external interface for utility VMs. +package uvm diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go index d4ad56d7ec..ed39fd282d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/dumpstacks.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go index 5459859453..f097c4f33c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/guest_request.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go index 03c1855796..4e439c7894 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/hvsocket.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go index 058ffff013..7a06f283dd 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/memory_update.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go index 009806e683..5a57dce9a6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/modify.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go index dca3ad5ab9..03509ad882 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/network.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -41,7 +43,7 @@ var ( // In this function we take the namespace ID of the namespace that was created for this // UVM. We hot add the namespace (with the default ID if this is a template). We get the // endpoints associated with this namespace and then hot add those endpoints (by changing -// their namespace IDs by the deafult IDs if it is a template). +// their namespace IDs by the default IDs if it is a template). func (uvm *UtilityVM) SetupNetworkNamespace(ctx context.Context, nsid string) error { nsidInsideUVM := nsid if uvm.IsTemplate || uvm.IsClone { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go index c4fcd34e82..cc67f9a798 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/pipes.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go index 475a9dbc1d..d8fce975f8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/plan9.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go index 78d7516ffa..cc884c3bcd 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/scsi.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( @@ -515,7 +517,6 @@ func (uvm *UtilityVM) allocateSCSIMount( log.G(ctx).WithFields(uvm.scsiLocations[controller][lun].logFormat()).Debug("allocated SCSI mount") return uvm.scsiLocations[controller][lun], false, nil - } // GetScsiUvmPath returns the guest mounted path of a SCSI drive. diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go index 89278acb6b..6570928ea7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/security_policy.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go index db05448c68..41ecda3a3a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/share.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go index 702815ed6a..412717aca6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go index d6a27b67a3..2cd5c24ce0 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/stats.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go index 18c191cf4a..3ce7b9764f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go index b87fe45f7f..020eb7099b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go @@ -1,6 +1,6 @@ -package uvm +//go:build windows -// This package describes the external interface for utility VMs. +package uvm import ( "net" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go index 1e1e07f274..b8fcddac6e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/update_uvm.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go index 0a729ecde5..3bd6e187a9 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/virtual_device.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go index b41ed27aa6..cde51aa014 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go index b98948ecfd..510e9ed4c4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vpmem_mapped.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go index b2ccf5be4f..348058c7ef 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/vsmb.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go index 552ee5fad7..d052be533a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/wait.go @@ -1,3 +1,5 @@ +//go:build windows + package uvm import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go new file mode 100644 index 0000000000..9e2b205da0 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvmfolder/doc.go @@ -0,0 +1 @@ +package uvmfolder diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go new file mode 100644 index 0000000000..9dd00c8128 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/doc.go @@ -0,0 +1 @@ +package vmcompute diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go index 8ca01f8247..ef2e3708b8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/vmcompute/vmcompute.go @@ -1,3 +1,5 @@ +//go:build windows + package vmcompute import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go index 5debe974d4..98a79ef4c5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/activatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go index 3ec708d1ed..aea8b421ef 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/baselayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -48,7 +50,6 @@ func reapplyDirectoryTimes(root *os.File, dis []dirInfo) error { if err != nil { return err } - } return nil } diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go index 480aee8725..4e81298514 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go index 131aa94f14..5750d53e91 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/createscratchlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go index d5bf2f5bdc..724af6223d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/deactivatelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go index 424467ac33..20c5afea7f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go new file mode 100644 index 0000000000..dd1d555804 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/doc.go @@ -0,0 +1,4 @@ +// Package wclayer provides bindings to HCS's legacy layer management API and +// provides a higher level interface around these calls for container layer +// management. +package wclayer diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go index 035c9041e6..38071322b7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/expandscratchsize.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go index 97b27eb7d6..3c388ef4bc 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go index 8d213f5871..761b5bbd1d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getlayermountpath.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go index ae1fff8403..1da329c7a4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/getsharedbaseimages.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go index 4b282fef9d..b0da3e71df 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/grantvmaccess.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go index 687550f0be..cd4e470837 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/importlayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go index 01e6723393..5ee3379cfb 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go index 0ce34a30f8..ea459d2d42 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go index 1ec893c6af..86f0549ef6 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerutils.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer // This file contains utility functions to support storage (graph) related diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go index b7f3064f26..f012d51104 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/legacy.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( @@ -262,7 +264,6 @@ func (r *legacyLayerReader) Next() (path string, size int64, fileInfo *winio.Fil // The creation time and access time get reset for files outside of the Files path. fileInfo.CreationTime = fileInfo.LastWriteTime fileInfo.LastAccessTime = fileInfo.LastWriteTime - } else { // The file attributes are written before the backup stream. var attr uint32 diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go index 09950297ce..30938e3d66 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/nametoguid.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go index 90129faefb..2f128ab153 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/preparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go index 30bcdff5f5..aaf55d887b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/processimage.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go index 71b130c525..c53a06ea2c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/unpreparelayer.go @@ -1,3 +1,5 @@ +//go:build windows + package wclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go index 9b1e06d50c..8aeab8d24e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wclayer/wclayer.go @@ -1,6 +1,5 @@ -// Package wclayer provides bindings to HCS's legacy layer management API and -// provides a higher level interface around these calls for container layer -// management. +//go:build windows + package wclayer import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go new file mode 100644 index 0000000000..b02b2ddcf2 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/doc.go @@ -0,0 +1 @@ +package wcow diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go index 940ccbf7f6..992ac0edda 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/wcow/scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package wcow import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go index def9525417..4547cdd8e8 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/console.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go index df28ea2421..7875466cad 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/devices.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "github.com/Microsoft/go-winio/pkg/guid" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go new file mode 100644 index 0000000000..9acc0bfc17 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/doc.go @@ -0,0 +1,3 @@ +// Package winapi contains various low-level bindings to Windows APIs. It can +// be thought of as an extension to golang.org/x/sys/windows. +package winapi diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go index 4e80ef68c9..49ce924cbe 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/errors.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "syscall" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go index 7ce52afd5e..0d78c051ba 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/filesystem.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi //sys NtCreateFile(handle *uintptr, accessMask uint32, oa *ObjectAttributes, iosb *IOStatusBlock, allocationSize *uint64, fileAttributes uint32, shareAccess uint32, createDisposition uint32, createOptions uint32, eaBuffer *byte, eaLength uint32) (status uint32) = ntdll.NtCreateFile diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go index 44371b3886..ecf7c1c2e4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/jobobject.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go index 9e4009d873..f5b1868e48 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/system.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import "golang.org/x/sys/windows" diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go index 47aa63e34a..8abc095d60 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/user.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go index 859b753c24..7b93974846 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/utils.go @@ -1,3 +1,5 @@ +//go:build windows + package winapi import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go index 298ff838ac..b45fc7de43 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/winapi/winapi.go @@ -1,5 +1,3 @@ -// Package winapi contains various low-level bindings to Windows APIs. It can -// be thought of as an extension to golang.org/x/sys/windows. package winapi //go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go bindflt.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go diff --git a/test/vendor/github.com/Microsoft/hcsshim/layer.go b/test/vendor/github.com/Microsoft/hcsshim/layer.go index 8916163706..e323c8308d 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/layer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/layer.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go b/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go index 3ab3bcd89a..ecb0766164 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go +++ b/test/vendor/github.com/Microsoft/hcsshim/osversion/osversion_windows.go @@ -1,3 +1,5 @@ +//go:build windows + package osversion import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go new file mode 100644 index 0000000000..f2523af44a --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/doc.go @@ -0,0 +1 @@ +package runhcs diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go index 64491a70cc..1d82f72c6f 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -20,7 +22,7 @@ type Format string const ( none Format = "" - // Text is the default text log ouput. + // Text is the default text log output. Text Format = "text" // JSON is the JSON formatted log output. JSON Format = "json" @@ -140,7 +142,7 @@ func (r *Runhcs) runOrError(cmd *exec.Cmd) error { } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } @@ -166,7 +168,7 @@ func cmdOutput(cmd *exec.Cmd, combined bool) ([]byte, error) { status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return b.Bytes(), err diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go index 720386c273..956e4c1f77 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create-scratch.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go index 20d5d402ec..f908de4e29 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_create.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -95,7 +97,7 @@ func (r *Runhcs) Create(context context.Context, id, bundle string, opts *Create } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go index 08b82bbd9a..307a1de5c1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_delete.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go index 090a0a31f8..a85ee66f7a 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_exec.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( @@ -82,7 +84,7 @@ func (r *Runhcs) Exec(context context.Context, id, processFile string, opts *Exe } status, err := runc.Monitor.Wait(cmd, ec) if err == nil && status != 0 { - err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0]) + err = fmt.Errorf("%s did not terminate successfully", cmd.Args[0]) } return err } diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go index 021e5b16fe..8480c64929 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_kill.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go index 3b9208017f..d7e88a2f05 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_list.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go index 56392fa43e..93ec1e8770 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_pause.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go index 4dc9f144fe..b60dabe8f5 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_ps.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go index b9f90491d3..016b948056 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resize-tty.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go index 1fdeb87d9b..0116d0a2de 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_resume.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go index ad3df746a8..98de529de7 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_start.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go index b22bb079cc..cc18801ec1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/go-runhcs/runhcs_state.go @@ -1,3 +1,5 @@ +//go:build windows + package runhcs import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go new file mode 100644 index 0000000000..0ec1aa05c4 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/doc.go @@ -0,0 +1,3 @@ +// Package ociwclayer provides functions for importing and exporting Windows +// container layers from and to their OCI tar representation. +package ociwclayer diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go index e3f1be333d..feea29080e 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/export.go @@ -1,5 +1,5 @@ -// Package ociwclayer provides functions for importing and exporting Windows -// container layers from and to their OCI tar representation. +//go:build windows + package ociwclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go index e74a6b5946..863329c1ba 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/ociwclayer/import.go @@ -1,3 +1,5 @@ +//go:build windows + package ociwclayer import ( diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go index b435080e9e..97145d819b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go @@ -85,7 +85,7 @@ type StandardSecurityPolicyEnforcer struct { // // Most of the work that this security policy enforcer does it around managing // state needed to map from a container definition in the SecurityPolicy to - // a specfic container ID as we bring up each container. See + // a specific container ID as we bring up each container. See // enforceCommandPolicy where most of the functionality is handling the case // were policy containers share an overlay and have to try to distinguish them // based on the command line arguments. enforceEnvironmentVariablePolicy can diff --git a/test/vendor/github.com/Microsoft/hcsshim/process.go b/test/vendor/github.com/Microsoft/hcsshim/process.go index 3362c68335..44df91cde2 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/process.go +++ b/test/vendor/github.com/Microsoft/hcsshim/process.go @@ -1,3 +1,5 @@ +//go:build windows + package hcsshim import ( From 6b31cba6647165e2faa1a94e63a0818d6af07072 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Tue, 5 Apr 2022 14:00:36 -0700 Subject: [PATCH 4/7] Run Protobuild on GitHub Actions (#1302) containerd is planning to migrate off from github.com/gogo/protobuf which will affect hcsshim. See https://github.com/containerd/containerd/issues/6564 for the overall progress. Before that, this commit runs Protobuild in GitHub Actions to make sure all generated files are reproducible from .proto files. Signed-off-by: Kazuyoshi Kato --- .github/workflows/ci.yml | 45 + Protobuild.toml | 7 +- .../options/runhcs.pb.go | 149 +- .../stats/stats.pb.go | 759 +++--- internal/computeagent/computeagent.pb.go | 544 ++-- internal/extendedtask/extendedtask.pb.go | 135 +- .../ncproxyttrpc/networkconfigproxy.pb.go | 248 +- internal/shimdiag/shimdiag.pb.go | 388 ++- internal/vmservice/vmservice.pb.go | 2292 ++++++++--------- .../ncproxygrpc/v1/networkconfigproxy.pb.go | 2078 +++++++-------- pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go | 527 ++-- .../Microsoft/hcsshim/Protobuild.toml | 7 +- .../options/runhcs.pb.go | 149 +- .../stats/stats.pb.go | 759 +++--- .../internal/computeagent/computeagent.pb.go | 544 ++-- .../internal/extendedtask/extendedtask.pb.go | 135 +- .../ncproxyttrpc/networkconfigproxy.pb.go | 248 +- .../hcsshim/internal/shimdiag/shimdiag.pb.go | 388 ++- 18 files changed, 4676 insertions(+), 4726 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 543484cdf0..34b7a8c7c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,51 @@ env: GOPROXY: off jobs: + protos: + runs-on: 'windows-2019' + steps: + - uses: actions/setup-go@v2 + with: + go-version: '^1.15.0' + - uses: actions/checkout@v2 + with: + path: 'go/src/github.com/Microsoft/hcsshim' + # Install protoc-gen-gogoctrd in D:\bin + - uses: actions/checkout@v2 + with: + repository: containerd/containerd + ref: v1.6.2 + path: 'containerd' + - name: Install protoc-gen-gogoctrd + shell: powershell + run: | + cd containerd + go build ./cmd/protoc-gen-gogoctrd + mkdir D:\bin + mv protoc-gen-gogoctrd.exe D:\bin + # Install protoc in D:\bin + - name: Install protoc + shell: powershell + run: | + Invoke-WebRequest -OutFile protoc.zip -Uri https://github.com/protocolbuffers/protobuf/releases/download/v3.19.4/protoc-3.19.4-win32.zip + Expand-Archive -Path protoc.zip -DestinationPath . + mv include go/src/github.com/Microsoft/hcsshim/protobuf + mv bin\protoc.exe D:\bin + - name: Run Protobuild + shell: powershell + run: | + go install github.com/containerd/protobuild@v0.2.0 + cd go\src\github.com\Microsoft\hcsshim + + $Env:Path += ";D:\bin;" + $Env:GOPATH + "\bin" + protobuild $(go list ./... | grep -v /vendor/) + + git diff --exit-code + env: + GOPATH: '${{ github.workspace }}\go' + GOFLAGS: + GOPROXY: + lint: runs-on: 'windows-2019' steps: diff --git a/Protobuild.toml b/Protobuild.toml index 4f5616619c..471f133866 100644 --- a/Protobuild.toml +++ b/Protobuild.toml @@ -1,4 +1,4 @@ -version = "unstable" +version = "1" generator = "gogoctrd" plugins = ["grpc", "fieldpath"] @@ -14,11 +14,6 @@ plugins = ["grpc", "fieldpath"] # target package. packages = ["github.com/gogo/protobuf"] - # Paths that will be added untouched to the end of the includes. We use - # `/usr/local/include` to pickup the common install location of protobuf. - # This is the default. - after = ["/usr/local/include"] - # This section maps protobuf imports to Go packages. These will become # `-M` directives in the call to the go protobuf generator. [packages] diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index 708e9201e3..c48fe4fa90 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto +// source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto package options @@ -54,7 +54,7 @@ func (x Options_DebugType) String() string { } func (Options_DebugType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{0, 0} + return fileDescriptor_b643df6839c75082, []int{0, 0} } type Options_SandboxIsolation int32 @@ -79,7 +79,7 @@ func (x Options_SandboxIsolation) String() string { } func (Options_SandboxIsolation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{0, 1} + return fileDescriptor_b643df6839c75082, []int{0, 1} } // Options are the set of customizations that can be passed at Create time. @@ -161,7 +161,7 @@ type Options struct { func (m *Options) Reset() { *m = Options{} } func (*Options) ProtoMessage() {} func (*Options) Descriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{0} + return fileDescriptor_b643df6839c75082, []int{0} } func (m *Options) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -210,7 +210,7 @@ type ProcessDetails struct { func (m *ProcessDetails) Reset() { *m = ProcessDetails{} } func (*ProcessDetails) ProtoMessage() {} func (*ProcessDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{1} + return fileDescriptor_b643df6839c75082, []int{1} } func (m *ProcessDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,79 +248,78 @@ func init() { } func init() { - proto.RegisterFile("github.com/microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptor_024c3924f1246980) + proto.RegisterFile("github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptor_b643df6839c75082) } -var fileDescriptor_024c3924f1246980 = []byte{ - // 1076 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdb, 0x4f, 0x23, 0xb7, - 0x17, 0xce, 0x2c, 0xb7, 0x8c, 0xb9, 0x05, 0x93, 0x9f, 0x76, 0x04, 0xbf, 0x4d, 0x22, 0xb6, 0xd2, - 0xb2, 0xea, 0x32, 0x01, 0x5a, 0xa9, 0x55, 0x5b, 0xb5, 0x82, 0x24, 0x2c, 0xa9, 0xb8, 0x44, 0x93, - 0x94, 0xed, 0xe5, 0xc1, 0x9a, 0x8b, 0x99, 0x58, 0xcc, 0x8c, 0x47, 0xb6, 0x27, 0x25, 0x3c, 0x55, - 0xfd, 0x0b, 0xfa, 0x67, 0xf1, 0xd8, 0xc7, 0x56, 0x95, 0x68, 0x37, 0x7f, 0x49, 0x65, 0x8f, 0x07, - 0x58, 0x44, 0xbb, 0x52, 0x9f, 0x62, 0x7f, 0xdf, 0xe7, 0xcf, 0xe7, 0x9c, 0xf8, 0x9c, 0x01, 0xa7, - 0x21, 0x11, 0xc3, 0xcc, 0xb3, 0x7d, 0x1a, 0x37, 0x63, 0xe2, 0x33, 0xca, 0xe9, 0xb9, 0x68, 0x0e, +var fileDescriptor_b643df6839c75082 = []byte{ + // 1072 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4b, 0x6f, 0xe3, 0x36, + 0x17, 0xb5, 0xf2, 0xb4, 0x98, 0x97, 0xc3, 0xf8, 0xc3, 0x08, 0xc9, 0x37, 0xb6, 0x91, 0x29, 0x30, + 0x19, 0x74, 0x22, 0x27, 0x69, 0x81, 0x16, 0x6d, 0xd1, 0x22, 0xb1, 0x9d, 0x89, 0x8b, 0x3c, 0x0c, + 0xd9, 0xcd, 0xf4, 0xb1, 0x20, 0xf4, 0x60, 0x64, 0x22, 0x92, 0x28, 0x90, 0x94, 0x1b, 0x67, 0x55, + 0xf4, 0x17, 0xf4, 0x67, 0x65, 0xd9, 0x65, 0x8b, 0x02, 0x69, 0xc7, 0xbf, 0xa4, 0x20, 0x45, 0x25, + 0x33, 0x41, 0xda, 0x59, 0x74, 0x65, 0xf2, 0x9c, 0xc3, 0xc3, 0x7b, 0xaf, 0x78, 0xaf, 0xc1, 0x59, + 0x48, 0xc4, 0x30, 0xf3, 0x6c, 0x9f, 0xc6, 0xcd, 0x13, 0xe2, 0x33, 0xca, 0xe9, 0x85, 0x68, 0x0e, 0x7d, 0xce, 0x87, 0x24, 0x6e, 0xfa, 0x71, 0xd0, 0xf4, 0x69, 0x22, 0x5c, 0x92, 0x60, 0x16, 0x6c, - 0x49, 0x6c, 0x8b, 0x65, 0xc9, 0xd0, 0xe7, 0x5b, 0xa3, 0x9d, 0x26, 0x4d, 0x05, 0xa1, 0x09, 0x6f, - 0xe6, 0x88, 0x9d, 0x32, 0x2a, 0x28, 0xac, 0xde, 0xe9, 0x6d, 0x4d, 0x8c, 0x76, 0xd6, 0xaa, 0x21, - 0x0d, 0xa9, 0x12, 0x34, 0xe5, 0x2a, 0xd7, 0xae, 0xd5, 0x43, 0x4a, 0xc3, 0x08, 0x37, 0xd5, 0xce, - 0xcb, 0xce, 0x9b, 0x82, 0xc4, 0x98, 0x0b, 0x37, 0x4e, 0x73, 0xc1, 0xc6, 0xef, 0x26, 0x98, 0x3b, - 0xcd, 0x6f, 0x81, 0x55, 0x30, 0x13, 0x60, 0x2f, 0x0b, 0x2d, 0xa3, 0x61, 0x6c, 0x96, 0x9d, 0x7c, - 0x03, 0x0f, 0x00, 0x50, 0x0b, 0x24, 0xc6, 0x29, 0xb6, 0x9e, 0x34, 0x8c, 0xcd, 0xa5, 0xdd, 0x17, - 0xf6, 0x63, 0x31, 0xd8, 0xda, 0xc8, 0x6e, 0x4b, 0xfd, 0x60, 0x9c, 0x62, 0xc7, 0x0c, 0x8a, 0x25, - 0x7c, 0x0e, 0x16, 0x19, 0x0e, 0x09, 0x17, 0x6c, 0x8c, 0x18, 0xa5, 0xc2, 0x9a, 0x6a, 0x18, 0x9b, - 0xa6, 0xb3, 0x50, 0x80, 0x0e, 0xa5, 0x42, 0x8a, 0xb8, 0x9b, 0x04, 0x1e, 0xbd, 0x44, 0x24, 0x76, - 0x43, 0x6c, 0x4d, 0xe7, 0x22, 0x0d, 0x76, 0x25, 0x06, 0x5f, 0x82, 0x4a, 0x21, 0x4a, 0x23, 0x57, - 0x9c, 0x53, 0x16, 0x5b, 0x33, 0x4a, 0xb7, 0xac, 0xf1, 0x9e, 0x86, 0xe1, 0x0f, 0x60, 0xe5, 0xd6, - 0x8f, 0xd3, 0xc8, 0x95, 0xf1, 0x59, 0xb3, 0x2a, 0x07, 0xfb, 0xdf, 0x73, 0xe8, 0xeb, 0x1b, 0x8b, - 0x53, 0x4e, 0x71, 0xe7, 0x2d, 0x02, 0x9b, 0xa0, 0xea, 0x51, 0x2a, 0xd0, 0x39, 0x89, 0x30, 0x57, - 0x39, 0xa1, 0xd4, 0x15, 0x43, 0x6b, 0x4e, 0xc5, 0xb2, 0x22, 0xb9, 0x03, 0x49, 0xc9, 0xcc, 0x7a, - 0xae, 0x18, 0xc2, 0x57, 0x00, 0x8e, 0x62, 0x94, 0x32, 0xea, 0x63, 0xce, 0x29, 0x43, 0x3e, 0xcd, - 0x12, 0x61, 0x95, 0x1b, 0xc6, 0xe6, 0x8c, 0x53, 0x19, 0xc5, 0xbd, 0x82, 0x68, 0x49, 0x1c, 0xda, - 0xa0, 0x3a, 0x8a, 0x51, 0x8c, 0x63, 0xca, 0xc6, 0x88, 0x93, 0x2b, 0x8c, 0x48, 0x82, 0x62, 0xcf, - 0x32, 0x0b, 0xfd, 0xb1, 0xa2, 0xfa, 0xe4, 0x0a, 0x77, 0x93, 0x63, 0x0f, 0xd6, 0x00, 0x78, 0xdd, - 0xfb, 0xe6, 0xec, 0xb0, 0x2d, 0xef, 0xb2, 0x80, 0x0a, 0xe2, 0x1e, 0x02, 0xbf, 0x00, 0xeb, 0xdc, - 0x77, 0x23, 0x8c, 0xfc, 0x34, 0x43, 0x11, 0x89, 0x89, 0xe0, 0x48, 0x50, 0xa4, 0xd3, 0xb2, 0xe6, - 0xd5, 0x9f, 0xfe, 0x54, 0x49, 0x5a, 0x69, 0x76, 0xa4, 0x04, 0x03, 0xaa, 0xeb, 0x00, 0x8f, 0xc1, - 0x07, 0x01, 0x3e, 0x77, 0xb3, 0x48, 0xa0, 0xdb, 0xba, 0x21, 0xee, 0x33, 0x57, 0xf8, 0xc3, 0xdb, - 0xe8, 0x42, 0xcf, 0x5a, 0x50, 0xd1, 0xd5, 0xb5, 0xb6, 0x55, 0x48, 0xfb, 0xb9, 0x32, 0x0f, 0xf6, - 0xb5, 0x07, 0xbf, 0x02, 0xcf, 0x0a, 0xbb, 0x51, 0xfc, 0x98, 0xcf, 0xa2, 0xf2, 0xb1, 0xb4, 0xe8, - 0x2c, 0x7e, 0x68, 0x20, 0x5f, 0xca, 0xd0, 0x65, 0xb8, 0x38, 0x6b, 0x2d, 0xa9, 0xf8, 0x17, 0x14, - 0xa8, 0xc5, 0xb0, 0x01, 0xe6, 0x4f, 0x5a, 0x3d, 0x46, 0x2f, 0xc7, 0x7b, 0x41, 0xc0, 0xac, 0x65, - 0x55, 0x93, 0xfb, 0x10, 0x5c, 0x07, 0x66, 0x44, 0x43, 0x14, 0xe1, 0x11, 0x8e, 0xac, 0x8a, 0xe2, - 0xcb, 0x11, 0x0d, 0x8f, 0xe4, 0x1e, 0x7e, 0x0c, 0x9e, 0x12, 0x8a, 0x18, 0x96, 0x4f, 0x56, 0x36, - 0x0e, 0xcd, 0x84, 0x8c, 0x8e, 0x63, 0xdf, 0x5a, 0x51, 0xe1, 0xad, 0x12, 0xea, 0x48, 0x76, 0x90, - 0x93, 0xdd, 0xa4, 0x8f, 0x7d, 0xf8, 0xb3, 0x71, 0x97, 0xdb, 0x5d, 0xa9, 0xdc, 0x24, 0xa1, 0x42, - 0xbd, 0x1b, 0x6e, 0xc1, 0xc6, 0xd4, 0xe6, 0xfc, 0xee, 0x97, 0xef, 0x6b, 0xa2, 0x77, 0x2b, 0xb8, - 0x77, 0x67, 0xd0, 0x49, 0x64, 0xbf, 0xac, 0x07, 0xff, 0xac, 0x80, 0x9f, 0x00, 0x2b, 0xa1, 0x88, - 0x24, 0x43, 0xcc, 0x88, 0x40, 0x43, 0xca, 0x85, 0xca, 0xe0, 0x8a, 0x26, 0xd8, 0x5a, 0x55, 0x95, - 0xfa, 0x5f, 0x42, 0xbb, 0x39, 0x7d, 0x48, 0xb9, 0x18, 0x68, 0x12, 0x3e, 0x03, 0x80, 0xfb, 0x2c, - 0xf3, 0x50, 0x44, 0x43, 0x6e, 0x55, 0x95, 0xd4, 0x54, 0xc8, 0x11, 0x0d, 0xf9, 0xda, 0x09, 0x68, - 0xbc, 0x2f, 0x30, 0x58, 0x01, 0x53, 0x17, 0x78, 0xac, 0xa6, 0x88, 0xe9, 0xc8, 0xa5, 0x9c, 0x2c, - 0x23, 0x37, 0xca, 0xf2, 0xf1, 0x61, 0x3a, 0xf9, 0xe6, 0xb3, 0x27, 0x9f, 0x1a, 0x1b, 0x2f, 0x81, - 0x79, 0x3b, 0x2d, 0xa0, 0x09, 0x66, 0x4e, 0x7a, 0xdd, 0x5e, 0xa7, 0x52, 0x82, 0x65, 0x30, 0x7d, - 0xd0, 0x3d, 0xea, 0x54, 0x0c, 0x38, 0x07, 0xa6, 0x3a, 0x83, 0x37, 0x95, 0x27, 0x1b, 0x4d, 0x50, - 0x79, 0xd8, 0x94, 0x70, 0x1e, 0xcc, 0xf5, 0x9c, 0xd3, 0x56, 0xa7, 0xdf, 0xaf, 0x94, 0xe0, 0x12, - 0x00, 0x87, 0xdf, 0xf5, 0x3a, 0xce, 0x59, 0xb7, 0x7f, 0xea, 0x54, 0x8c, 0x8d, 0x3f, 0xa6, 0xc0, - 0x92, 0xee, 0xa9, 0x36, 0x16, 0x2e, 0x89, 0xb8, 0xcc, 0x4e, 0xcd, 0x15, 0x94, 0xb8, 0x31, 0xd6, - 0x11, 0x9a, 0x0a, 0x39, 0x71, 0x63, 0x0c, 0x5b, 0x00, 0xf8, 0x0c, 0xbb, 0x02, 0x07, 0xc8, 0x15, - 0x2a, 0xd8, 0xf9, 0xdd, 0x35, 0x3b, 0x9f, 0xa1, 0x76, 0x31, 0x43, 0xed, 0x41, 0x31, 0x43, 0xf7, - 0xcb, 0xd7, 0x37, 0xf5, 0xd2, 0x2f, 0x7f, 0xd6, 0x0d, 0xc7, 0xd4, 0xe7, 0xf6, 0x04, 0xfc, 0x10, - 0xc0, 0x0b, 0xcc, 0x12, 0x1c, 0xa9, 0x8a, 0xa3, 0x9d, 0xed, 0x6d, 0x94, 0x70, 0x35, 0xed, 0xa6, - 0x9d, 0xe5, 0x9c, 0x91, 0x0e, 0x3b, 0xdb, 0xdb, 0x27, 0x1c, 0xda, 0x60, 0x55, 0x77, 0xb8, 0x4f, - 0xe3, 0x98, 0x08, 0xe4, 0x8d, 0x05, 0xe6, 0x6a, 0xec, 0x4d, 0x3b, 0x2b, 0x39, 0xd5, 0x52, 0xcc, - 0xbe, 0x24, 0xe0, 0x01, 0x68, 0x68, 0xfd, 0x8f, 0x94, 0x5d, 0x90, 0x24, 0x44, 0x1c, 0x0b, 0x94, - 0x32, 0x32, 0x72, 0x05, 0xd6, 0x87, 0x67, 0xd4, 0xe1, 0xff, 0xe7, 0xba, 0x37, 0xb9, 0xac, 0x8f, - 0x45, 0x2f, 0x17, 0xe5, 0x3e, 0x6d, 0x50, 0x7f, 0xc4, 0x47, 0x35, 0x4f, 0xa0, 0x6d, 0x66, 0x95, - 0xcd, 0xfa, 0x43, 0x9b, 0xbe, 0xd2, 0xe4, 0x2e, 0xaf, 0x00, 0xd0, 0xd3, 0x0c, 0x91, 0x40, 0xcd, - 0xbd, 0xc5, 0xfd, 0xc5, 0xc9, 0x4d, 0xdd, 0xd4, 0x65, 0xef, 0xb6, 0x1d, 0x53, 0x0b, 0xba, 0x01, - 0x7c, 0x01, 0x2a, 0x19, 0xc7, 0xec, 0x9d, 0xb2, 0x94, 0xd5, 0x25, 0x8b, 0x12, 0xbf, 0x2b, 0xca, - 0x73, 0x30, 0x87, 0x2f, 0xb1, 0x2f, 0x3d, 0xe5, 0xb0, 0x33, 0xf7, 0xc1, 0xe4, 0xa6, 0x3e, 0xdb, - 0xb9, 0xc4, 0x7e, 0xb7, 0xed, 0xcc, 0x4a, 0xaa, 0x1b, 0xec, 0x07, 0xd7, 0x6f, 0x6b, 0xa5, 0xdf, - 0xde, 0xd6, 0x4a, 0x3f, 0x4d, 0x6a, 0xc6, 0xf5, 0xa4, 0x66, 0xfc, 0x3a, 0xa9, 0x19, 0x7f, 0x4d, - 0x6a, 0xc6, 0xf7, 0x5f, 0xdf, 0xfb, 0xe2, 0x1e, 0xff, 0xb7, 0x2f, 0xee, 0xe7, 0xfa, 0xf7, 0xdb, - 0x92, 0x37, 0xab, 0xfe, 0xf7, 0x8f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x64, 0xc1, 0xed, 0x65, - 0xc8, 0x07, 0x00, 0x00, + 0x4b, 0x6c, 0x9b, 0x65, 0xc9, 0xd0, 0xe7, 0xdb, 0xa3, 0xdd, 0x26, 0x4d, 0x05, 0xa1, 0x09, 0x6f, + 0xe6, 0x88, 0x9d, 0x32, 0x2a, 0x28, 0xac, 0xde, 0xeb, 0x6d, 0x4d, 0x8c, 0x76, 0xd7, 0xab, 0x21, + 0x0d, 0xa9, 0x12, 0x34, 0xe5, 0x2a, 0xd7, 0xae, 0xd7, 0x43, 0x4a, 0xc3, 0x08, 0x37, 0xd5, 0xce, + 0xcb, 0x2e, 0x9a, 0x82, 0xc4, 0x98, 0x0b, 0x37, 0x4e, 0x73, 0xc1, 0xe6, 0xef, 0x26, 0x98, 0x3f, + 0xcb, 0x6f, 0x81, 0x55, 0x30, 0x1b, 0x60, 0x2f, 0x0b, 0x2d, 0xa3, 0x61, 0x6c, 0x95, 0x9d, 0x7c, + 0x03, 0x0f, 0x01, 0x50, 0x0b, 0x24, 0xc6, 0x29, 0xb6, 0xa6, 0x1a, 0xc6, 0xd6, 0xf2, 0xde, 0x73, + 0xfb, 0xb1, 0x18, 0x6c, 0x6d, 0x64, 0xb7, 0xa5, 0x7e, 0x30, 0x4e, 0xb1, 0x63, 0x06, 0xc5, 0x12, + 0x3e, 0x03, 0x4b, 0x0c, 0x87, 0x84, 0x0b, 0x36, 0x46, 0x8c, 0x52, 0x61, 0x4d, 0x37, 0x8c, 0x2d, + 0xd3, 0x59, 0x2c, 0x40, 0x87, 0x52, 0x21, 0x45, 0xdc, 0x4d, 0x02, 0x8f, 0x5e, 0x21, 0x12, 0xbb, + 0x21, 0xb6, 0x66, 0x72, 0x91, 0x06, 0xbb, 0x12, 0x83, 0x2f, 0x40, 0xa5, 0x10, 0xa5, 0x91, 0x2b, + 0x2e, 0x28, 0x8b, 0xad, 0x59, 0xa5, 0x5b, 0xd1, 0x78, 0x4f, 0xc3, 0xf0, 0x07, 0xb0, 0x7a, 0xe7, + 0xc7, 0x69, 0xe4, 0xca, 0xf8, 0xac, 0x39, 0x95, 0x83, 0xfd, 0xef, 0x39, 0xf4, 0xf5, 0x8d, 0xc5, + 0x29, 0xa7, 0xb8, 0xf3, 0x0e, 0x81, 0x4d, 0x50, 0xf5, 0x28, 0x15, 0xe8, 0x82, 0x44, 0x98, 0xab, + 0x9c, 0x50, 0xea, 0x8a, 0xa1, 0x35, 0xaf, 0x62, 0x59, 0x95, 0xdc, 0xa1, 0xa4, 0x64, 0x66, 0x3d, + 0x57, 0x0c, 0xe1, 0x4b, 0x00, 0x47, 0x31, 0x4a, 0x19, 0xf5, 0x31, 0xe7, 0x94, 0x21, 0x9f, 0x66, + 0x89, 0xb0, 0xca, 0x0d, 0x63, 0x6b, 0xd6, 0xa9, 0x8c, 0xe2, 0x5e, 0x41, 0xb4, 0x24, 0x0e, 0x6d, + 0x50, 0x1d, 0xc5, 0x28, 0xc6, 0x31, 0x65, 0x63, 0xc4, 0xc9, 0x35, 0x46, 0x24, 0x41, 0xb1, 0x67, + 0x99, 0x85, 0xfe, 0x44, 0x51, 0x7d, 0x72, 0x8d, 0xbb, 0xc9, 0x89, 0x07, 0x6b, 0x00, 0xbc, 0xea, + 0x7d, 0x73, 0x7e, 0xd4, 0x96, 0x77, 0x59, 0x40, 0x05, 0xf1, 0x16, 0x02, 0xbf, 0x00, 0x1b, 0xdc, + 0x77, 0x23, 0x8c, 0xfc, 0x34, 0x43, 0x11, 0x89, 0x89, 0xe0, 0x48, 0x50, 0xa4, 0xd3, 0xb2, 0x16, + 0xd4, 0x47, 0x7f, 0xa2, 0x24, 0xad, 0x34, 0x3b, 0x56, 0x82, 0x01, 0xd5, 0x75, 0x80, 0x27, 0xe0, + 0x83, 0x00, 0x5f, 0xb8, 0x59, 0x24, 0xd0, 0x5d, 0xdd, 0x10, 0xf7, 0x99, 0x2b, 0xfc, 0xe1, 0x5d, + 0x74, 0xa1, 0x67, 0x2d, 0xaa, 0xe8, 0xea, 0x5a, 0xdb, 0x2a, 0xa4, 0xfd, 0x5c, 0x99, 0x07, 0xfb, + 0xca, 0x83, 0x5f, 0x81, 0xa7, 0x85, 0xdd, 0x28, 0x7e, 0xcc, 0x67, 0x49, 0xf9, 0x58, 0x5a, 0x74, + 0x1e, 0x3f, 0x34, 0x90, 0x2f, 0x65, 0xe8, 0x32, 0x5c, 0x9c, 0xb5, 0x96, 0x55, 0xfc, 0x8b, 0x0a, + 0xd4, 0x62, 0xd8, 0x00, 0x0b, 0xa7, 0xad, 0x1e, 0xa3, 0x57, 0xe3, 0xfd, 0x20, 0x60, 0xd6, 0x8a, + 0xaa, 0xc9, 0xdb, 0x10, 0xdc, 0x00, 0x66, 0x44, 0x43, 0x14, 0xe1, 0x11, 0x8e, 0xac, 0x8a, 0xe2, + 0xcb, 0x11, 0x0d, 0x8f, 0xe5, 0x1e, 0x7e, 0x0c, 0x9e, 0x10, 0x8a, 0x18, 0x96, 0x4f, 0x56, 0x36, + 0x0e, 0xcd, 0x84, 0x8c, 0x8e, 0x63, 0xdf, 0x5a, 0x55, 0xe1, 0xad, 0x11, 0xea, 0x48, 0x76, 0x90, + 0x93, 0xdd, 0xa4, 0x8f, 0x7d, 0xf8, 0xb3, 0x71, 0x9f, 0xdb, 0x7d, 0xa9, 0xdc, 0x24, 0xa1, 0x42, + 0xbd, 0x1b, 0x6e, 0xc1, 0xc6, 0xf4, 0xd6, 0xc2, 0xde, 0x97, 0xef, 0x6b, 0xa2, 0x77, 0x2b, 0xb8, + 0x7f, 0x6f, 0xd0, 0x49, 0x64, 0xbf, 0x6c, 0x04, 0xff, 0xac, 0x80, 0x9f, 0x00, 0x2b, 0xa1, 0x88, + 0x24, 0x43, 0xcc, 0x88, 0x40, 0x43, 0xca, 0x85, 0xca, 0xe0, 0x9a, 0x26, 0xd8, 0x5a, 0x53, 0x95, + 0xfa, 0x5f, 0x42, 0xbb, 0x39, 0x7d, 0x44, 0xb9, 0x18, 0x68, 0x12, 0x3e, 0x05, 0x80, 0xfb, 0x2c, + 0xf3, 0x50, 0x44, 0x43, 0x6e, 0x55, 0x95, 0xd4, 0x54, 0xc8, 0x31, 0x0d, 0xf9, 0xfa, 0x29, 0x68, + 0xbc, 0x2f, 0x30, 0x58, 0x01, 0xd3, 0x97, 0x78, 0xac, 0xa6, 0x88, 0xe9, 0xc8, 0xa5, 0x9c, 0x2c, + 0x23, 0x37, 0xca, 0xf2, 0xf1, 0x61, 0x3a, 0xf9, 0xe6, 0xb3, 0xa9, 0x4f, 0x8d, 0xcd, 0x17, 0xc0, + 0xbc, 0x9b, 0x16, 0xd0, 0x04, 0xb3, 0xa7, 0xbd, 0x6e, 0xaf, 0x53, 0x29, 0xc1, 0x32, 0x98, 0x39, + 0xec, 0x1e, 0x77, 0x2a, 0x06, 0x9c, 0x07, 0xd3, 0x9d, 0xc1, 0xeb, 0xca, 0xd4, 0x66, 0x13, 0x54, + 0x1e, 0x36, 0x25, 0x5c, 0x00, 0xf3, 0x3d, 0xe7, 0xac, 0xd5, 0xe9, 0xf7, 0x2b, 0x25, 0xb8, 0x0c, + 0xc0, 0xd1, 0x77, 0xbd, 0x8e, 0x73, 0xde, 0xed, 0x9f, 0x39, 0x15, 0x63, 0xf3, 0x8f, 0x69, 0xb0, + 0xac, 0x7b, 0xaa, 0x8d, 0x85, 0x4b, 0x22, 0x2e, 0xb3, 0x53, 0x73, 0x05, 0x25, 0x6e, 0x8c, 0x75, + 0x84, 0xa6, 0x42, 0x4e, 0xdd, 0x18, 0xc3, 0x16, 0x00, 0x3e, 0xc3, 0xae, 0xc0, 0x01, 0x72, 0x85, + 0x0a, 0x76, 0x61, 0x6f, 0xdd, 0xce, 0x67, 0xa8, 0x5d, 0xcc, 0x50, 0x7b, 0x50, 0xcc, 0xd0, 0x83, + 0xf2, 0xcd, 0x6d, 0xbd, 0xf4, 0xcb, 0x9f, 0x75, 0xc3, 0x31, 0xf5, 0xb9, 0x7d, 0x01, 0x3f, 0x04, + 0xf0, 0x12, 0xb3, 0x04, 0x47, 0xaa, 0xe2, 0x68, 0x77, 0x67, 0x07, 0x25, 0x5c, 0x4d, 0xbb, 0x19, + 0x67, 0x25, 0x67, 0xa4, 0xc3, 0xee, 0xce, 0xce, 0x29, 0x87, 0x36, 0x58, 0xd3, 0x1d, 0xee, 0xd3, + 0x38, 0x26, 0x02, 0x79, 0x63, 0x81, 0xb9, 0x1a, 0x7b, 0x33, 0xce, 0x6a, 0x4e, 0xb5, 0x14, 0x73, + 0x20, 0x09, 0x78, 0x08, 0x1a, 0x5a, 0xff, 0x23, 0x65, 0x97, 0x24, 0x09, 0x11, 0xc7, 0x02, 0xa5, + 0x8c, 0x8c, 0x5c, 0x81, 0xf5, 0xe1, 0x59, 0x75, 0xf8, 0xff, 0xb9, 0xee, 0x75, 0x2e, 0xeb, 0x63, + 0xd1, 0xcb, 0x45, 0xb9, 0x4f, 0x1b, 0xd4, 0x1f, 0xf1, 0x51, 0xcd, 0x13, 0x68, 0x9b, 0x39, 0x65, + 0xb3, 0xf1, 0xd0, 0xa6, 0xaf, 0x34, 0xb9, 0xcb, 0x4b, 0x00, 0xf4, 0x34, 0x43, 0x24, 0x50, 0x73, + 0x6f, 0xe9, 0x60, 0x69, 0x72, 0x5b, 0x37, 0x75, 0xd9, 0xbb, 0x6d, 0xc7, 0xd4, 0x82, 0x6e, 0x00, + 0x9f, 0x83, 0x4a, 0xc6, 0x31, 0x7b, 0xa7, 0x2c, 0x65, 0x75, 0xc9, 0x92, 0xc4, 0xef, 0x8b, 0xf2, + 0x0c, 0xcc, 0xe3, 0x2b, 0xec, 0x4b, 0x4f, 0x39, 0xec, 0xcc, 0x03, 0x30, 0xb9, 0xad, 0xcf, 0x75, + 0xae, 0xb0, 0xdf, 0x6d, 0x3b, 0x73, 0x92, 0xea, 0x06, 0x07, 0xc1, 0xcd, 0x9b, 0x5a, 0xe9, 0xb7, + 0x37, 0xb5, 0xd2, 0x4f, 0x93, 0x9a, 0x71, 0x33, 0xa9, 0x19, 0xbf, 0x4e, 0x6a, 0xc6, 0x5f, 0x93, + 0x9a, 0xf1, 0xfd, 0xd7, 0xff, 0xfd, 0x1f, 0xf7, 0x73, 0xfd, 0xfb, 0x6d, 0xc9, 0x9b, 0x53, 0xdf, + 0xfd, 0xa3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xba, 0x6d, 0x7b, 0x04, 0xc8, 0x07, 0x00, 0x00, } func (m *Options) Marshal() (dAtA []byte, err error) { diff --git a/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go b/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go index 0b41b11b0c..9e28127151 100644 --- a/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go +++ b/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go @@ -11,6 +11,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -26,7 +27,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Statistics struct { // Types that are valid to be assigned to Container: @@ -52,7 +53,7 @@ func (m *Statistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Statistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -78,10 +79,10 @@ type isStatistics_Container interface { } type Statistics_Windows struct { - Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof"` + Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof" json:"windows,omitempty"` } type Statistics_Linux struct { - Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof"` + Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof" json:"linux,omitempty"` } func (*Statistics_Windows) isStatistics_Container() {} @@ -108,80 +109,14 @@ func (m *Statistics) GetLinux() *v1.Metrics { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Statistics) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Statistics_OneofMarshaler, _Statistics_OneofUnmarshaler, _Statistics_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Statistics) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Statistics_Windows)(nil), (*Statistics_Linux)(nil), } } -func _Statistics_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Statistics) - // container - switch x := m.Container.(type) { - case *Statistics_Windows: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Windows); err != nil { - return err - } - case *Statistics_Linux: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Linux); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Statistics.Container has unexpected type %T", x) - } - return nil -} - -func _Statistics_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Statistics) - switch tag { - case 1: // container.windows - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WindowsContainerStatistics) - err := b.DecodeMessage(msg) - m.Container = &Statistics_Windows{msg} - return true, err - case 2: // container.linux - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(v1.Metrics) - err := b.DecodeMessage(msg) - m.Container = &Statistics_Linux{msg} - return true, err - default: - return false, nil - } -} - -func _Statistics_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Statistics) - // container - switch x := m.Container.(type) { - case *Statistics_Windows: - s := proto.Size(x.Windows) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Statistics_Linux: - s := proto.Size(x.Linux) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type WindowsContainerStatistics struct { Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` ContainerStartTime time.Time `protobuf:"bytes,2,opt,name=container_start_time,json=containerStartTime,proto3,stdtime" json:"container_start_time"` @@ -207,7 +142,7 @@ func (m *WindowsContainerStatistics) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_WindowsContainerStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -248,7 +183,7 @@ func (m *WindowsContainerProcessorStatistics) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_WindowsContainerProcessorStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -289,7 +224,7 @@ func (m *WindowsContainerMemoryStatistics) XXX_Marshal(b []byte, deterministic b return xxx_messageInfo_WindowsContainerMemoryStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -331,7 +266,7 @@ func (m *WindowsContainerStorageStatistics) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_WindowsContainerStorageStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -371,7 +306,7 @@ func (m *VirtualMachineStatistics) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_VirtualMachineStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -410,7 +345,7 @@ func (m *VirtualMachineProcessorStatistics) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_VirtualMachineProcessorStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -451,7 +386,7 @@ func (m *VirtualMachineMemoryStatistics) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_VirtualMachineMemoryStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -496,7 +431,7 @@ func (m *VirtualMachineMemory) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_VirtualMachineMemory.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -603,7 +538,7 @@ var fileDescriptor_23217f96da3a05cc = []byte{ func (m *Statistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -611,65 +546,89 @@ func (m *Statistics) Marshal() (dAtA []byte, err error) { } func (m *Statistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Container != nil { - nn1, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VM != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VM.Size())) - n2, err := m.VM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Container != nil { + { + size := m.Container.Size() + i -= size + if _, err := m.Container.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *Statistics_Windows) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics_Windows) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Windows != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Windows.Size())) - n3, err := m.Windows.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Statistics_Linux) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics_Linux) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Linux != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Linux.Size())) - n4, err := m.Linux.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -677,71 +636,83 @@ func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - if m.UptimeNS != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Processor != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size())) - n7, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Storage != nil { + { + size, err := m.Storage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x32 } if m.Memory != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size())) - n8, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x2a } - if m.Storage != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Storage.Size())) - n9, err := m.Storage.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Processor != nil { + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.UptimeNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS)) + i-- + dAtA[i] = 0x18 + } + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintStats(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err8 != nil { + return 0, err8 } - return i, nil + i -= n8 + i = encodeVarintStats(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -749,35 +720,41 @@ func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) } func (m *WindowsContainerProcessorStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerProcessorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.TotalRuntimeNS != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) - } - if m.RuntimeUserNS != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RuntimeKernelNS != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.RuntimeKernelNS)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.RuntimeUserNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS)) + i-- + dAtA[i] = 0x10 + } + if m.TotalRuntimeNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -785,35 +762,41 @@ func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerMemoryStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerMemoryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryUsageCommitBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes)) - } - if m.MemoryUsageCommitPeakBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.MemoryUsagePrivateWorkingSetBytes != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsagePrivateWorkingSetBytes)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryUsageCommitPeakBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.MemoryUsageCommitBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -821,40 +804,46 @@ func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerStorageStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerStorageStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ReadCountNormalized != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ReadSizeBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes)) + if m.WriteSizeBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes)) + i-- + dAtA[i] = 0x20 } if m.WriteCountNormalized != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.WriteCountNormalized)) + i-- + dAtA[i] = 0x18 } - if m.WriteSizeBytes != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes)) + if m.ReadSizeBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ReadCountNormalized != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -862,40 +851,50 @@ func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Processor != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size())) - n10, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Memory != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size())) - n11, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Processor != nil { + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -903,25 +902,31 @@ func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineProcessorStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineProcessorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.TotalRuntimeNS != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -929,40 +934,48 @@ func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineMemoryStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineMemoryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkingSetBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes)) - } - if m.VirtualNodeCount != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VmMemory != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VmMemory.Size())) - n12, err := m.VmMemory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VmMemory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.VirtualNodeCount != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount)) + i-- + dAtA[i] = 0x10 + } + if m.WorkingSetBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -970,74 +983,82 @@ func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineMemory) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineMemory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.AvailableMemory != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory)) - } - if m.AvailableMemoryBuffer != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer)) - } - if m.ReservedMemory != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory)) - } - if m.AssignedMemory != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.SlpActive { - dAtA[i] = 0x28 - i++ - if m.SlpActive { + if m.DmOperationInProgress { + i-- + if m.DmOperationInProgress { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } if m.BalancingEnabled { - dAtA[i] = 0x30 - i++ + i-- if m.BalancingEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - if m.DmOperationInProgress { - dAtA[i] = 0x38 - i++ - if m.DmOperationInProgress { + if m.SlpActive { + i-- + if m.SlpActive { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.AssignedMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory)) + i-- + dAtA[i] = 0x20 + } + if m.ReservedMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory)) + i-- + dAtA[i] = 0x18 + } + if m.AvailableMemoryBuffer != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.AvailableMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintStats(dAtA []byte, offset int, v uint64) int { + offset -= sovStats(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Statistics) Size() (n int) { if m == nil { @@ -1270,14 +1291,7 @@ func (m *VirtualMachineMemory) Size() (n int) { } func sovStats(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozStats(x uint64) (n int) { return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1288,7 +1302,7 @@ func (this *Statistics) String() string { } s := strings.Join([]string{`&Statistics{`, `Container:` + fmt.Sprintf("%v", this.Container) + `,`, - `VM:` + strings.Replace(fmt.Sprintf("%v", this.VM), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`, + `VM:` + strings.Replace(this.VM.String(), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1319,12 +1333,12 @@ func (this *WindowsContainerStatistics) String() string { return "nil" } s := strings.Join([]string{`&WindowsContainerStatistics{`, - `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `ContainerStartTime:` + strings.Replace(strings.Replace(this.ContainerStartTime.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `ContainerStartTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ContainerStartTime), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `UptimeNS:` + fmt.Sprintf("%v", this.UptimeNS) + `,`, - `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`, - `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`, - `Storage:` + strings.Replace(fmt.Sprintf("%v", this.Storage), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`, + `Processor:` + strings.Replace(this.Processor.String(), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`, + `Storage:` + strings.Replace(this.Storage.String(), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1375,8 +1389,8 @@ func (this *VirtualMachineStatistics) String() string { return "nil" } s := strings.Join([]string{`&VirtualMachineStatistics{`, - `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`, - `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`, + `Processor:` + strings.Replace(this.Processor.String(), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1400,7 +1414,7 @@ func (this *VirtualMachineMemoryStatistics) String() string { s := strings.Join([]string{`&VirtualMachineMemoryStatistics{`, `WorkingSetBytes:` + fmt.Sprintf("%v", this.WorkingSetBytes) + `,`, `VirtualNodeCount:` + fmt.Sprintf("%v", this.VirtualNodeCount) + `,`, - `VmMemory:` + strings.Replace(fmt.Sprintf("%v", this.VmMemory), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`, + `VmMemory:` + strings.Replace(this.VmMemory.String(), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1572,10 +1586,7 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -1819,10 +1830,7 @@ func (m *WindowsContainerStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -1930,10 +1938,7 @@ func (m *WindowsContainerProcessorStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2041,10 +2046,7 @@ func (m *WindowsContainerMemoryStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2171,10 +2173,7 @@ func (m *WindowsContainerStorageStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2297,10 +2296,7 @@ func (m *VirtualMachineStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2370,10 +2366,7 @@ func (m *VirtualMachineProcessorStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2498,10 +2491,7 @@ func (m *VirtualMachineMemoryStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2688,10 +2678,7 @@ func (m *VirtualMachineMemory) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2710,6 +2697,7 @@ func (m *VirtualMachineMemory) Unmarshal(dAtA []byte) error { func skipStats(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2741,10 +2729,8 @@ func skipStats(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2765,55 +2751,30 @@ func skipStats(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthStats } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipStats(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStats + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStats = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/computeagent/computeagent.pb.go b/internal/computeagent/computeagent.pb.go index 8d7236dffd..5ec5e514a1 100644 --- a/internal/computeagent/computeagent.pb.go +++ b/internal/computeagent/computeagent.pb.go @@ -11,6 +11,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -24,7 +25,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AssignPCIInternalRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -49,7 +50,7 @@ func (m *AssignPCIInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_AssignPCIInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -88,7 +89,7 @@ func (m *AssignPCIInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_AssignPCIInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -129,7 +130,7 @@ func (m *RemovePCIInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_RemovePCIInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +168,7 @@ func (m *RemovePCIInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_RemovePCIInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (m *AddNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_AddNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (m *AddNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_AddNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -287,7 +288,7 @@ func (m *ModifyNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ModifyNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -325,7 +326,7 @@ func (m *ModifyNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ModifyNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -366,7 +367,7 @@ func (m *DeleteNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_DeleteNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -404,7 +405,7 @@ func (m *DeleteNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_DeleteNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -445,7 +446,7 @@ func (m *IovSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_IovSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -530,7 +531,7 @@ var fileDescriptor_7f2f03dc308add4c = []byte{ func (m *AssignPCIInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -538,43 +539,52 @@ func (m *AssignPCIInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *AssignPCIInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignPCIInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.DeviceID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x22 } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x18 } - if len(m.NicID) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AssignPCIInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -582,26 +592,33 @@ func (m *AssignPCIInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *AssignPCIInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignPCIInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemovePCIInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -609,37 +626,45 @@ func (m *RemovePCIInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *RemovePCIInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemovePCIInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.DeviceID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RemovePCIInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -647,20 +672,26 @@ func (m *RemovePCIInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *RemovePCIInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemovePCIInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -668,42 +699,52 @@ func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *AddNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n1, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AddNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -711,20 +752,26 @@ func (m *AddNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *AddNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -732,46 +779,57 @@ func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NicID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) - } - if m.Endpoint != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n2, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovPolicySettings.Size())) - n3, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -779,20 +837,26 @@ func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -800,42 +864,52 @@ func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n4, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *DeleteNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -843,20 +917,26 @@ func (m *DeleteNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *IovSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -864,39 +944,47 @@ func (m *IovSettings) Marshal() (dAtA []byte, err error) { } func (m *IovSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IovSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.IovOffloadWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) - } - if m.QueuePairsRequested != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.InterruptModeration != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.InterruptModeration)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.QueuePairsRequested != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.IovOffloadWeight != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintComputeagent(dAtA []byte, offset int, v uint64) int { + offset -= sovComputeagent(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *AssignPCIInternalRequest) Size() (n int) { if m == nil { @@ -1106,14 +1194,7 @@ func (m *IovSettings) Size() (n int) { } func sovComputeagent(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozComputeagent(x uint64) (n int) { return sovComputeagent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1196,7 +1277,7 @@ func (this *ModifyNICInternalRequest) String() string { s := strings.Join([]string{`&ModifyNICInternalRequest{`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Any", "types.Any", 1) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovSettings", "IovSettings", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovSettings", "IovSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1504,10 +1585,7 @@ func (m *AssignPCIInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1590,10 +1668,7 @@ func (m *AssignPCIInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1727,10 +1802,7 @@ func (m *RemovePCIInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1781,10 +1853,7 @@ func (m *RemovePCIInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1935,10 +2004,7 @@ func (m *AddNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1989,10 +2055,7 @@ func (m *AddNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2147,10 +2210,7 @@ func (m *ModifyNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2201,10 +2261,7 @@ func (m *ModifyNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2355,10 +2412,7 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2409,10 +2463,7 @@ func (m *DeleteNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2520,10 +2571,7 @@ func (m *IovSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2542,6 +2590,7 @@ func (m *IovSettings) Unmarshal(dAtA []byte) error { func skipComputeagent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2573,10 +2622,8 @@ func skipComputeagent(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2597,55 +2644,30 @@ func skipComputeagent(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthComputeagent } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthComputeagent - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowComputeagent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipComputeagent(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthComputeagent - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupComputeagent + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthComputeagent + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthComputeagent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowComputeagent = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthComputeagent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowComputeagent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupComputeagent = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/extendedtask/extendedtask.pb.go b/internal/extendedtask/extendedtask.pb.go index cde41d4a3f..c13f92defb 100644 --- a/internal/extendedtask/extendedtask.pb.go +++ b/internal/extendedtask/extendedtask.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ComputeProcessorInfoRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -45,7 +46,7 @@ func (m *ComputeProcessorInfoRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ComputeProcessorInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -84,7 +85,7 @@ func (m *ComputeProcessorInfoResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ComputeProcessorInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -135,7 +136,7 @@ var fileDescriptor_c90988f6b70b2a29 = []byte{ func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -143,26 +144,33 @@ func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) { } func (m *ComputeProcessorInfoRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ComputeProcessorInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintExtendedtask(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -170,29 +178,37 @@ func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) { } func (m *ComputeProcessorInfoResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ComputeProcessorInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Count != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintExtendedtask(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintExtendedtask(dAtA []byte, offset int, v uint64) int { + offset -= sovExtendedtask(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ComputeProcessorInfoRequest) Size() (n int) { if m == nil { @@ -226,14 +242,7 @@ func (m *ComputeProcessorInfoResponse) Size() (n int) { } func sovExtendedtask(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozExtendedtask(x uint64) (n int) { return sovExtendedtask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -369,10 +378,7 @@ func (m *ComputeProcessorInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthExtendedtask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExtendedtask } if (iNdEx + skippy) > l { @@ -442,10 +448,7 @@ func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthExtendedtask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExtendedtask } if (iNdEx + skippy) > l { @@ -464,6 +467,7 @@ func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error { func skipExtendedtask(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -495,10 +499,8 @@ func skipExtendedtask(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -519,55 +521,30 @@ func skipExtendedtask(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthExtendedtask } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedtask - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowExtendedtask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipExtendedtask(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedtask - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupExtendedtask + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthExtendedtask + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupExtendedtask = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/ncproxyttrpc/networkconfigproxy.pb.go b/internal/ncproxyttrpc/networkconfigproxy.pb.go index a0fa845090..39ac60ed87 100644 --- a/internal/ncproxyttrpc/networkconfigproxy.pb.go +++ b/internal/ncproxyttrpc/networkconfigproxy.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RequestTypeInternal int32 @@ -71,7 +72,7 @@ func (m *RegisterComputeAgentRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RegisterComputeAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -109,7 +110,7 @@ func (m *RegisterComputeAgentResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RegisterComputeAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -148,7 +149,7 @@ func (m *UnregisterComputeAgentRequest) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_UnregisterComputeAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -186,7 +187,7 @@ func (m *UnregisterComputeAgentResponse) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_UnregisterComputeAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -226,7 +227,7 @@ func (m *ConfigureNetworkingInternalRequest) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_ConfigureNetworkingInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (m *ConfigureNetworkingInternalResponse) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ConfigureNetworkingInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -332,7 +333,7 @@ var fileDescriptor_11f9efc6dfbf9b45 = []byte{ func (m *RegisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -340,32 +341,40 @@ func (m *RegisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *RegisterComputeAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterComputeAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.AgentAddress) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.AgentAddress))) - i += copy(dAtA[i:], m.AgentAddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.AgentAddress) > 0 { + i -= len(m.AgentAddress) + copy(dAtA[i:], m.AgentAddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.AgentAddress))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RegisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -373,20 +382,26 @@ func (m *RegisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *RegisterComputeAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterComputeAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *UnregisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -394,26 +409,33 @@ func (m *UnregisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *UnregisterComputeAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnregisterComputeAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UnregisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -421,20 +443,26 @@ func (m *UnregisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *UnregisterComputeAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnregisterComputeAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -442,31 +470,38 @@ func (m *ConfigureNetworkingInternalRequest) Marshal() (dAtA []byte, err error) } func (m *ConfigureNetworkingInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RequestType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -474,24 +509,32 @@ func (m *ConfigureNetworkingInternalResponse) Marshal() (dAtA []byte, err error) } func (m *ConfigureNetworkingInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNetworkconfigproxy(dAtA []byte, offset int, v uint64) int { + offset -= sovNetworkconfigproxy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *RegisterComputeAgentRequest) Size() (n int) { if m == nil { @@ -585,14 +628,7 @@ func (m *ConfigureNetworkingInternalResponse) Size() (n int) { } func sovNetworkconfigproxy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNetworkconfigproxy(x uint64) (n int) { return sovNetworkconfigproxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -835,10 +871,7 @@ func (m *RegisterComputeAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -889,10 +922,7 @@ func (m *RegisterComputeAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -975,10 +1005,7 @@ func (m *UnregisterComputeAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1029,10 +1056,7 @@ func (m *UnregisterComputeAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1134,10 +1158,7 @@ func (m *ConfigureNetworkingInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1188,10 +1209,7 @@ func (m *ConfigureNetworkingInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1210,6 +1228,7 @@ func (m *ConfigureNetworkingInternalResponse) Unmarshal(dAtA []byte) error { func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1241,10 +1260,8 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1265,55 +1282,30 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNetworkconfigproxy } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetworkconfigproxy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNetworkconfigproxy(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNetworkconfigproxy + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNetworkconfigproxy = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/shimdiag/shimdiag.pb.go b/internal/shimdiag/shimdiag.pb.go index 7a44c3064c..84ca8aa334 100644 --- a/internal/shimdiag/shimdiag.pb.go +++ b/internal/shimdiag/shimdiag.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ExecProcessRequest struct { Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` @@ -50,7 +51,7 @@ func (m *ExecProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ExecProcessRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -89,7 +90,7 @@ func (m *ExecProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ExecProcessResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -127,7 +128,7 @@ func (m *StacksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StacksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +168,7 @@ func (m *StacksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_StacksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (m *ShareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ShareRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (m *ShareResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ShareResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -284,7 +285,7 @@ func (m *PidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PidRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -323,7 +324,7 @@ func (m *PidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -398,7 +399,7 @@ var fileDescriptor_c7933dc6ffbb8784 = []byte{ func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -406,69 +407,73 @@ func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) { } func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Args) > 0 { - for _, s := range m.Args { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Workdir) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Workdir))) - i += copy(dAtA[i:], m.Workdir) + if len(m.Stderr) > 0 { + i -= len(m.Stderr) + copy(dAtA[i:], m.Stderr) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stderr))) + i-- + dAtA[i] = 0x32 + } + if len(m.Stdout) > 0 { + i -= len(m.Stdout) + copy(dAtA[i:], m.Stdout) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdout))) + i-- + dAtA[i] = 0x2a + } + if len(m.Stdin) > 0 { + i -= len(m.Stdin) + copy(dAtA[i:], m.Stdin) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdin))) + i-- + dAtA[i] = 0x22 } if m.Terminal { - dAtA[i] = 0x18 - i++ + i-- if m.Terminal { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.Stdin) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdin))) - i += copy(dAtA[i:], m.Stdin) - } - if len(m.Stdout) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdout))) - i += copy(dAtA[i:], m.Stdout) + i-- + dAtA[i] = 0x18 } - if len(m.Stderr) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stderr))) - i += copy(dAtA[i:], m.Stderr) + if len(m.Workdir) > 0 { + i -= len(m.Workdir) + copy(dAtA[i:], m.Workdir) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Workdir))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -476,25 +481,31 @@ func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) { } func (m *ExecProcessResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ExitCode != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintShimdiag(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StacksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -502,20 +513,26 @@ func (m *StacksRequest) Marshal() (dAtA []byte, err error) { } func (m *StacksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StacksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *StacksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -523,32 +540,40 @@ func (m *StacksResponse) Marshal() (dAtA []byte, err error) { } func (m *StacksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StacksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Stacks) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stacks))) - i += copy(dAtA[i:], m.Stacks) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.GuestStacks) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.GuestStacks) + copy(dAtA[i:], m.GuestStacks) i = encodeVarintShimdiag(dAtA, i, uint64(len(m.GuestStacks))) - i += copy(dAtA[i:], m.GuestStacks) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Stacks) > 0 { + i -= len(m.Stacks) + copy(dAtA[i:], m.Stacks) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stacks))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ShareRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -556,42 +581,50 @@ func (m *ShareRequest) Marshal() (dAtA []byte, err error) { } func (m *ShareRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.HostPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if len(m.UvmPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.UvmPath))) - i += copy(dAtA[i:], m.UvmPath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x18 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.UvmPath) > 0 { + i -= len(m.UvmPath) + copy(dAtA[i:], m.UvmPath) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.UvmPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ShareResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -599,20 +632,26 @@ func (m *ShareResponse) Marshal() (dAtA []byte, err error) { } func (m *ShareResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -620,20 +659,26 @@ func (m *PidRequest) Marshal() (dAtA []byte, err error) { } func (m *PidRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PidResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -641,29 +686,37 @@ func (m *PidResponse) Marshal() (dAtA []byte, err error) { } func (m *PidResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Pid != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintShimdiag(dAtA, i, uint64(m.Pid)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintShimdiag(dAtA []byte, offset int, v uint64) int { + offset -= sovShimdiag(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ExecProcessRequest) Size() (n int) { if m == nil { @@ -812,14 +865,7 @@ func (m *PidResponse) Size() (n int) { } func sovShimdiag(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozShimdiag(x uint64) (n int) { return sovShimdiag(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1222,10 +1268,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1295,10 +1338,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1349,10 +1389,7 @@ func (m *StacksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1467,10 +1504,7 @@ func (m *StacksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1605,10 +1639,7 @@ func (m *ShareRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1659,10 +1690,7 @@ func (m *ShareResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1713,10 +1741,7 @@ func (m *PidRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1786,10 +1811,7 @@ func (m *PidResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1808,6 +1830,7 @@ func (m *PidResponse) Unmarshal(dAtA []byte) error { func skipShimdiag(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1839,10 +1862,8 @@ func skipShimdiag(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1863,55 +1884,30 @@ func skipShimdiag(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthShimdiag } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthShimdiag - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowShimdiag - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipShimdiag(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthShimdiag - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupShimdiag + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthShimdiag + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthShimdiag = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowShimdiag = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthShimdiag = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowShimdiag = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupShimdiag = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/vmservice/vmservice.pb.go b/internal/vmservice/vmservice.pb.go index c828d0dadd..79cf5624df 100644 --- a/internal/vmservice/vmservice.pb.go +++ b/internal/vmservice/vmservice.pb.go @@ -12,6 +12,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -25,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ModifyType int32 @@ -195,7 +196,7 @@ func (m *DirectBoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DirectBoot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -238,7 +239,7 @@ func (m *UEFI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UEFI.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -285,7 +286,7 @@ func (m *MemoryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MemoryConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -326,7 +327,7 @@ func (m *ProcessorConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ProcessorConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -368,7 +369,7 @@ func (m *DevicesConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_DevicesConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -417,7 +418,7 @@ func (m *VMConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VMConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -443,10 +444,10 @@ type isVMConfig_BootConfig interface { } type VMConfig_DirectBoot struct { - DirectBoot *DirectBoot `protobuf:"bytes,5,opt,name=direct_boot,json=directBoot,proto3,oneof"` + DirectBoot *DirectBoot `protobuf:"bytes,5,opt,name=direct_boot,json=directBoot,proto3,oneof" json:"direct_boot,omitempty"` } type VMConfig_Uefi struct { - Uefi *UEFI `protobuf:"bytes,6,opt,name=uefi,proto3,oneof"` + Uefi *UEFI `protobuf:"bytes,6,opt,name=uefi,proto3,oneof" json:"uefi,omitempty"` } func (*VMConfig_DirectBoot) isVMConfig_BootConfig() {} @@ -473,80 +474,14 @@ func (m *VMConfig) GetUefi() *UEFI { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*VMConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _VMConfig_OneofMarshaler, _VMConfig_OneofUnmarshaler, _VMConfig_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*VMConfig) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*VMConfig_DirectBoot)(nil), (*VMConfig_Uefi)(nil), } } -func _VMConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*VMConfig) - // BootConfig - switch x := m.BootConfig.(type) { - case *VMConfig_DirectBoot: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.DirectBoot); err != nil { - return err - } - case *VMConfig_Uefi: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Uefi); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("VMConfig.BootConfig has unexpected type %T", x) - } - return nil -} - -func _VMConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*VMConfig) - switch tag { - case 5: // BootConfig.direct_boot - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DirectBoot) - err := b.DecodeMessage(msg) - m.BootConfig = &VMConfig_DirectBoot{msg} - return true, err - case 6: // BootConfig.uefi - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(UEFI) - err := b.DecodeMessage(msg) - m.BootConfig = &VMConfig_Uefi{msg} - return true, err - default: - return false, nil - } -} - -func _VMConfig_OneofSizer(msg proto.Message) (n int) { - m := msg.(*VMConfig) - // BootConfig - switch x := m.BootConfig.(type) { - case *VMConfig_DirectBoot: - s := proto.Size(x.DirectBoot) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *VMConfig_Uefi: - s := proto.Size(x.Uefi) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // WindowsOptions contains virtual machine configurations that are only present on a Windows host. type WindowsOptions struct { CpuGroupID uint64 `protobuf:"varint,1,opt,name=cpu_group_id,json=cpuGroupId,proto3" json:"cpu_group_id,omitempty"` @@ -568,7 +503,7 @@ func (m *WindowsOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_WindowsOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -607,7 +542,7 @@ func (m *SerialConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SerialConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -648,7 +583,7 @@ func (m *SerialConfig_Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SerialConfig_Config.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -691,7 +626,7 @@ func (m *CreateVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_CreateVMRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -731,7 +666,7 @@ func (m *InspectVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_InspectVMRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -770,7 +705,7 @@ func (m *InspectVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_InspectVMResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -812,7 +747,7 @@ func (m *MemoryStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MemoryStats.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -851,7 +786,7 @@ func (m *ProcessorStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ProcessorStats.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -890,7 +825,7 @@ func (m *PropertiesVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PropertiesVMRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -930,7 +865,7 @@ func (m *PropertiesVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_PropertiesVMResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -970,7 +905,7 @@ func (m *CapabilitiesVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CapabilitiesVMResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1014,7 +949,7 @@ func (m *CapabilitiesVMResponse_SupportedResource) XXX_Marshal(b []byte, determi return xxx_messageInfo_CapabilitiesVMResponse_SupportedResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1056,7 +991,7 @@ func (m *HVSocketListen) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_HVSocketListen.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1096,7 +1031,7 @@ func (m *VSockListen) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_VSockListen.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1139,7 +1074,7 @@ func (m *VMSocketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_VMSocketRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1165,10 +1100,10 @@ type isVMSocketRequest_Config interface { } type VMSocketRequest_HvsocketList struct { - HvsocketList *HVSocketListen `protobuf:"bytes,2,opt,name=hvsocket_list,json=hvsocketList,proto3,oneof"` + HvsocketList *HVSocketListen `protobuf:"bytes,2,opt,name=hvsocket_list,json=hvsocketList,proto3,oneof" json:"hvsocket_list,omitempty"` } type VMSocketRequest_VsockListen struct { - VsockListen *VSockListen `protobuf:"bytes,3,opt,name=vsock_listen,json=vsockListen,proto3,oneof"` + VsockListen *VSockListen `protobuf:"bytes,3,opt,name=vsock_listen,json=vsockListen,proto3,oneof" json:"vsock_listen,omitempty"` } func (*VMSocketRequest_HvsocketList) isVMSocketRequest_Config() {} @@ -1195,80 +1130,14 @@ func (m *VMSocketRequest) GetVsockListen() *VSockListen { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*VMSocketRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _VMSocketRequest_OneofMarshaler, _VMSocketRequest_OneofUnmarshaler, _VMSocketRequest_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*VMSocketRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*VMSocketRequest_HvsocketList)(nil), (*VMSocketRequest_VsockListen)(nil), } } -func _VMSocketRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*VMSocketRequest) - // Config - switch x := m.Config.(type) { - case *VMSocketRequest_HvsocketList: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HvsocketList); err != nil { - return err - } - case *VMSocketRequest_VsockListen: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.VsockListen); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("VMSocketRequest.Config has unexpected type %T", x) - } - return nil -} - -func _VMSocketRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*VMSocketRequest) - switch tag { - case 2: // Config.hvsocket_list - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HVSocketListen) - err := b.DecodeMessage(msg) - m.Config = &VMSocketRequest_HvsocketList{msg} - return true, err - case 3: // Config.vsock_listen - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(VSockListen) - err := b.DecodeMessage(msg) - m.Config = &VMSocketRequest_VsockListen{msg} - return true, err - default: - return false, nil - } -} - -func _VMSocketRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*VMSocketRequest) - // Config - switch x := m.Config.(type) { - case *VMSocketRequest_HvsocketList: - s := proto.Size(x.HvsocketList) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *VMSocketRequest_VsockListen: - s := proto.Size(x.VsockListen) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type SCSIDisk struct { Controller uint32 `protobuf:"varint,1,opt,name=controller,proto3" json:"controller,omitempty"` Lun uint32 `protobuf:"varint,2,opt,name=lun,proto3" json:"lun,omitempty"` @@ -1293,7 +1162,7 @@ func (m *SCSIDisk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SCSIDisk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1334,7 +1203,7 @@ func (m *VPMEMDisk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VPMEMDisk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1378,7 +1247,7 @@ func (m *NICConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NICConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1418,7 +1287,7 @@ func (m *WindowsPCIDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_WindowsPCIDevice.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1457,7 +1326,7 @@ func (m *ModifyMemoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ModifyMemoryRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1497,7 +1366,7 @@ func (m *ModifyProcessorRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_ModifyProcessorRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1537,7 +1406,7 @@ func (m *ModifyProcessorConfigRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ModifyProcessorConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1585,7 +1454,7 @@ func (m *ModifyResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ModifyResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1611,25 +1480,25 @@ type isModifyResourceRequest_Resource interface { } type ModifyResourceRequest_Processor struct { - Processor *ModifyProcessorRequest `protobuf:"bytes,2,opt,name=processor,proto3,oneof"` + Processor *ModifyProcessorRequest `protobuf:"bytes,2,opt,name=processor,proto3,oneof" json:"processor,omitempty"` } type ModifyResourceRequest_ProcessorConfig struct { - ProcessorConfig *ModifyProcessorConfigRequest `protobuf:"bytes,3,opt,name=processor_config,json=processorConfig,proto3,oneof"` + ProcessorConfig *ModifyProcessorConfigRequest `protobuf:"bytes,3,opt,name=processor_config,json=processorConfig,proto3,oneof" json:"processor_config,omitempty"` } type ModifyResourceRequest_Memory struct { - Memory *ModifyMemoryRequest `protobuf:"bytes,4,opt,name=memory,proto3,oneof"` + Memory *ModifyMemoryRequest `protobuf:"bytes,4,opt,name=memory,proto3,oneof" json:"memory,omitempty"` } type ModifyResourceRequest_ScsiDisk struct { - ScsiDisk *SCSIDisk `protobuf:"bytes,5,opt,name=scsi_disk,json=scsiDisk,proto3,oneof"` + ScsiDisk *SCSIDisk `protobuf:"bytes,5,opt,name=scsi_disk,json=scsiDisk,proto3,oneof" json:"scsi_disk,omitempty"` } type ModifyResourceRequest_VpmemDisk struct { - VpmemDisk *VPMEMDisk `protobuf:"bytes,6,opt,name=vpmem_disk,json=vpmemDisk,proto3,oneof"` + VpmemDisk *VPMEMDisk `protobuf:"bytes,6,opt,name=vpmem_disk,json=vpmemDisk,proto3,oneof" json:"vpmem_disk,omitempty"` } type ModifyResourceRequest_NicConfig struct { - NicConfig *NICConfig `protobuf:"bytes,7,opt,name=nic_config,json=nicConfig,proto3,oneof"` + NicConfig *NICConfig `protobuf:"bytes,7,opt,name=nic_config,json=nicConfig,proto3,oneof" json:"nic_config,omitempty"` } type ModifyResourceRequest_WindowsDevice struct { - WindowsDevice *WindowsPCIDevice `protobuf:"bytes,8,opt,name=windows_device,json=windowsDevice,proto3,oneof"` + WindowsDevice *WindowsPCIDevice `protobuf:"bytes,8,opt,name=windows_device,json=windowsDevice,proto3,oneof" json:"windows_device,omitempty"` } func (*ModifyResourceRequest_Processor) isModifyResourceRequest_Resource() {} @@ -1696,9 +1565,9 @@ func (m *ModifyResourceRequest) GetWindowsDevice() *WindowsPCIDevice { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ModifyResourceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ModifyResourceRequest_OneofMarshaler, _ModifyResourceRequest_OneofUnmarshaler, _ModifyResourceRequest_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ModifyResourceRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ModifyResourceRequest_Processor)(nil), (*ModifyResourceRequest_ProcessorConfig)(nil), (*ModifyResourceRequest_Memory)(nil), @@ -1709,162 +1578,6 @@ func (*ModifyResourceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto } } -func _ModifyResourceRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ModifyResourceRequest) - // resource - switch x := m.Resource.(type) { - case *ModifyResourceRequest_Processor: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Processor); err != nil { - return err - } - case *ModifyResourceRequest_ProcessorConfig: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ProcessorConfig); err != nil { - return err - } - case *ModifyResourceRequest_Memory: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Memory); err != nil { - return err - } - case *ModifyResourceRequest_ScsiDisk: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ScsiDisk); err != nil { - return err - } - case *ModifyResourceRequest_VpmemDisk: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.VpmemDisk); err != nil { - return err - } - case *ModifyResourceRequest_NicConfig: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NicConfig); err != nil { - return err - } - case *ModifyResourceRequest_WindowsDevice: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.WindowsDevice); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ModifyResourceRequest.Resource has unexpected type %T", x) - } - return nil -} - -func _ModifyResourceRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ModifyResourceRequest) - switch tag { - case 2: // resource.processor - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ModifyProcessorRequest) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_Processor{msg} - return true, err - case 3: // resource.processor_config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ModifyProcessorConfigRequest) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_ProcessorConfig{msg} - return true, err - case 4: // resource.memory - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ModifyMemoryRequest) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_Memory{msg} - return true, err - case 5: // resource.scsi_disk - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SCSIDisk) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_ScsiDisk{msg} - return true, err - case 6: // resource.vpmem_disk - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(VPMEMDisk) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_VpmemDisk{msg} - return true, err - case 7: // resource.nic_config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NICConfig) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_NicConfig{msg} - return true, err - case 8: // resource.windows_device - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WindowsPCIDevice) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_WindowsDevice{msg} - return true, err - default: - return false, nil - } -} - -func _ModifyResourceRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ModifyResourceRequest) - // resource - switch x := m.Resource.(type) { - case *ModifyResourceRequest_Processor: - s := proto.Size(x.Processor) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_ProcessorConfig: - s := proto.Size(x.ProcessorConfig) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_Memory: - s := proto.Size(x.Memory) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_ScsiDisk: - s := proto.Size(x.ScsiDisk) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_VpmemDisk: - s := proto.Size(x.VpmemDisk) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_NicConfig: - s := proto.Size(x.NicConfig) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_WindowsDevice: - s := proto.Size(x.WindowsDevice) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - func init() { proto.RegisterEnum("vmservice.ModifyType", ModifyType_name, ModifyType_value) proto.RegisterEnum("vmservice.DiskType", DiskType_name, DiskType_value) @@ -2058,7 +1771,7 @@ var fileDescriptor_272f12cfdaa6c7c8 = []byte{ func (m *DirectBoot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2066,38 +1779,47 @@ func (m *DirectBoot) Marshal() (dAtA []byte, err error) { } func (m *DirectBoot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DirectBoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.KernelPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.KernelPath))) - i += copy(dAtA[i:], m.KernelPath) - } - if len(m.InitrdPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.InitrdPath))) - i += copy(dAtA[i:], m.InitrdPath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.KernelCmdline) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.KernelCmdline) + copy(dAtA[i:], m.KernelCmdline) i = encodeVarintVmservice(dAtA, i, uint64(len(m.KernelCmdline))) - i += copy(dAtA[i:], m.KernelCmdline) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.InitrdPath) > 0 { + i -= len(m.InitrdPath) + copy(dAtA[i:], m.InitrdPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.InitrdPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.KernelPath) > 0 { + i -= len(m.KernelPath) + copy(dAtA[i:], m.KernelPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.KernelPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UEFI) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2105,38 +1827,47 @@ func (m *UEFI) Marshal() (dAtA []byte, err error) { } func (m *UEFI) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UEFI) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.FirmwarePath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.FirmwarePath))) - i += copy(dAtA[i:], m.FirmwarePath) - } - if len(m.DevicePath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.DevicePath))) - i += copy(dAtA[i:], m.DevicePath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.OptionalData) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.OptionalData) + copy(dAtA[i:], m.OptionalData) i = encodeVarintVmservice(dAtA, i, uint64(len(m.OptionalData))) - i += copy(dAtA[i:], m.OptionalData) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DevicePath) > 0 { + i -= len(m.DevicePath) + copy(dAtA[i:], m.DevicePath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.DevicePath))) + i-- + dAtA[i] = 0x12 + } + if len(m.FirmwarePath) > 0 { + i -= len(m.FirmwarePath) + copy(dAtA[i:], m.FirmwarePath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.FirmwarePath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemoryConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2144,90 +1875,96 @@ func (m *MemoryConfig) Marshal() (dAtA []byte, err error) { } func (m *MemoryConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoryConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryMb != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryMb)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.AllowOvercommit { - dAtA[i] = 0x10 - i++ - if m.AllowOvercommit { + if m.HighMmioGapInMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioGapInMb)) + i-- + dAtA[i] = 0x48 + } + if m.HighMmioBaseInMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioBaseInMb)) + i-- + dAtA[i] = 0x40 + } + if m.LowMmioGapInMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.LowMmioGapInMb)) + i-- + dAtA[i] = 0x38 + } + if m.ColdDiscardHint { + i-- + if m.ColdDiscardHint { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - if m.DeferredCommit { - dAtA[i] = 0x18 - i++ - if m.DeferredCommit { + if m.ColdHint { + i-- + if m.ColdHint { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } if m.HotHint { - dAtA[i] = 0x20 - i++ + i-- if m.HotHint { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - if m.ColdHint { - dAtA[i] = 0x28 - i++ - if m.ColdHint { + if m.DeferredCommit { + i-- + if m.DeferredCommit { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.ColdDiscardHint { - dAtA[i] = 0x30 - i++ - if m.ColdDiscardHint { + if m.AllowOvercommit { + i-- + if m.AllowOvercommit { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.LowMmioGapInMb != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.LowMmioGapInMb)) - } - if m.HighMmioBaseInMb != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioBaseInMb)) - } - if m.HighMmioGapInMb != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioGapInMb)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryMb)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessorConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2235,35 +1972,41 @@ func (m *ProcessorConfig) Marshal() (dAtA []byte, err error) { } func (m *ProcessorConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessorConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ProcessorCount != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorCount)) - } - if m.ProcessorWeight != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProcessorLimit != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorLimit)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ProcessorWeight != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + i-- + dAtA[i] = 0x10 + } + if m.ProcessorCount != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorCount)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *DevicesConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2271,68 +2014,82 @@ func (m *DevicesConfig) Marshal() (dAtA []byte, err error) { } func (m *DevicesConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DevicesConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ScsiDisks) > 0 { - for _, msg := range m.ScsiDisks { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.VpmemDisks) > 0 { - for _, msg := range m.VpmemDisks { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.WindowsDevice) > 0 { + for iNdEx := len(m.WindowsDevice) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.WindowsDevice[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } if len(m.NicConfig) > 0 { - for _, msg := range m.NicConfig { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.NicConfig) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NicConfig[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if len(m.WindowsDevice) > 0 { - for _, msg := range m.WindowsDevice { - dAtA[i] = 0x22 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.VpmemDisks) > 0 { + for iNdEx := len(m.VpmemDisks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VpmemDisks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ScsiDisks) > 0 { + for iNdEx := len(m.ScsiDisks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ScsiDisks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *VMConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2340,122 +2097,156 @@ func (m *VMConfig) Marshal() (dAtA []byte, err error) { } func (m *VMConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryConfig != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryConfig.Size())) - n1, err := m.MemoryConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ExtraData) > 0 { + for k := range m.ExtraData { + v := m.ExtraData[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVmservice(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVmservice(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVmservice(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 } - i += n1 } - if m.ProcessorConfig != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorConfig.Size())) - n2, err := m.ProcessorConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.WindowsOptions != nil { + { + size, err := m.WindowsOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x3a } - if m.DevicesConfig != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.DevicesConfig.Size())) - n3, err := m.DevicesConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.BootConfig != nil { + { + size := m.BootConfig.Size() + i -= size + if _, err := m.BootConfig.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n3 } if m.SerialConfig != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.SerialConfig.Size())) - n4, err := m.SerialConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SerialConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x22 } - if m.BootConfig != nil { - nn5, err := m.BootConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DevicesConfig != nil { + { + size, err := m.DevicesConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += nn5 + i-- + dAtA[i] = 0x1a } - if m.WindowsOptions != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.WindowsOptions.Size())) - n6, err := m.WindowsOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ProcessorConfig != nil { + { + size, err := m.ProcessorConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x12 } - if len(m.ExtraData) > 0 { - for k := range m.ExtraData { - dAtA[i] = 0x42 - i++ - v := m.ExtraData[k] - mapSize := 1 + len(k) + sovVmservice(uint64(len(k))) + 1 + len(v) + sovVmservice(uint64(len(v))) - i = encodeVarintVmservice(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.MemoryConfig != nil { + { + size, err := m.MemoryConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *VMConfig_DirectBoot) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMConfig_DirectBoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DirectBoot != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.DirectBoot.Size())) - n7, err := m.DirectBoot.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DirectBoot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *VMConfig_Uefi) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMConfig_Uefi) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Uefi != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Uefi.Size())) - n8, err := m.Uefi.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Uefi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2463,25 +2254,31 @@ func (m *WindowsOptions) Marshal() (dAtA []byte, err error) { } func (m *WindowsOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.CpuGroupID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.CpuGroupID)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *SerialConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2489,32 +2286,40 @@ func (m *SerialConfig) Marshal() (dAtA []byte, err error) { } func (m *SerialConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SerialConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *SerialConfig_Config) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2522,31 +2327,38 @@ func (m *SerialConfig_Config) Marshal() (dAtA []byte, err error) { } func (m *SerialConfig_Config) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SerialConfig_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SocketPath) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SocketPath) + copy(dAtA[i:], m.SocketPath) i = encodeVarintVmservice(dAtA, i, uint64(len(m.SocketPath))) - i += copy(dAtA[i:], m.SocketPath) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *CreateVMRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2554,36 +2366,45 @@ func (m *CreateVMRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateVMRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Config.Size())) - n9, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.LogID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.LogID) + copy(dAtA[i:], m.LogID) i = encodeVarintVmservice(dAtA, i, uint64(len(m.LogID))) - i += copy(dAtA[i:], m.LogID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *InspectVMRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2591,31 +2412,38 @@ func (m *InspectVMRequest) Marshal() (dAtA []byte, err error) { } func (m *InspectVMRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InspectVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Query) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.Query))) - i += copy(dAtA[i:], m.Query) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RecursionLimit != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.RecursionLimit)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *InspectVMResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2623,30 +2451,38 @@ func (m *InspectVMResponse) Marshal() (dAtA []byte, err error) { } func (m *InspectVMResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InspectVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Result != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Result.Size())) - n10, err := m.Result.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemoryStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2654,40 +2490,46 @@ func (m *MemoryStats) Marshal() (dAtA []byte, err error) { } func (m *MemoryStats) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoryStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkingSetBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.WorkingSetBytes)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.AvailableMemory != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.AvailableMemory)) + if m.AssignedMemory != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.AssignedMemory)) + i-- + dAtA[i] = 0x20 } if m.ReservedMemory != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ReservedMemory)) + i-- + dAtA[i] = 0x18 } - if m.AssignedMemory != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.AssignedMemory)) + if m.AvailableMemory != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.AvailableMemory)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.WorkingSetBytes != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.WorkingSetBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessorStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2695,25 +2537,31 @@ func (m *ProcessorStats) Marshal() (dAtA []byte, err error) { } func (m *ProcessorStats) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessorStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.TotalRuntimeNs != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.TotalRuntimeNs)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *PropertiesVMRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2721,37 +2569,44 @@ func (m *PropertiesVMRequest) Marshal() (dAtA []byte, err error) { } func (m *PropertiesVMRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PropertiesVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Types) > 0 { - dAtA12 := make([]byte, len(m.Types)*10) - var j11 int + dAtA11 := make([]byte, len(m.Types)*10) + var j10 int for _, num := range m.Types { for num >= 1<<7 { - dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j11++ + j10++ } - dAtA12[j11] = uint8(num) - j11++ + dAtA11[j10] = uint8(num) + j10++ } + i -= j10 + copy(dAtA[i:], dAtA11[:j10]) + i = encodeVarintVmservice(dAtA, i, uint64(j10)) + i-- dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(j11)) - i += copy(dAtA[i:], dAtA12[:j11]) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PropertiesVMResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2759,40 +2614,50 @@ func (m *PropertiesVMResponse) Marshal() (dAtA []byte, err error) { } func (m *PropertiesVMResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PropertiesVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryStats != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryStats.Size())) - n13, err := m.MemoryStats.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProcessorStats != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorStats.Size())) - n14, err := m.ProcessorStats.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProcessorStats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryStats != nil { + { + size, err := m.MemoryStats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesVMResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2800,49 +2665,58 @@ func (m *CapabilitiesVMResponse) Marshal() (dAtA []byte, err error) { } func (m *CapabilitiesVMResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SupportedResources) > 0 { - for _, msg := range m.SupportedResources { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SupportedGuestOs) > 0 { - dAtA16 := make([]byte, len(m.SupportedGuestOs)*10) - var j15 int + dAtA15 := make([]byte, len(m.SupportedGuestOs)*10) + var j14 int for _, num := range m.SupportedGuestOs { for num >= 1<<7 { - dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80) + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j15++ + j14++ } - dAtA16[j15] = uint8(num) - j15++ + dAtA15[j14] = uint8(num) + j14++ } + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintVmservice(dAtA, i, uint64(j14)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(j15)) - i += copy(dAtA[i:], dAtA16[:j15]) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.SupportedResources) > 0 { + for iNdEx := len(m.SupportedResources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SupportedResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesVMResponse_SupportedResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2850,55 +2724,61 @@ func (m *CapabilitiesVMResponse_SupportedResource) Marshal() (dAtA []byte, err e } func (m *CapabilitiesVMResponse_SupportedResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesVMResponse_SupportedResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Add { - dAtA[i] = 0x8 - i++ - if m.Add { + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Resource != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Resource)) + i-- + dAtA[i] = 0x20 + } + if m.Update { + i-- + if m.Update { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } if m.Remove { - dAtA[i] = 0x10 - i++ + i-- if m.Remove { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.Update { - dAtA[i] = 0x18 - i++ - if m.Update { + if m.Add { + i-- + if m.Add { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.Resource != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Resource)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *HVSocketListen) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2906,32 +2786,40 @@ func (m *HVSocketListen) Marshal() (dAtA []byte, err error) { } func (m *HVSocketListen) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HVSocketListen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ListenerPath) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ListenerPath) + copy(dAtA[i:], m.ListenerPath) i = encodeVarintVmservice(dAtA, i, uint64(len(m.ListenerPath))) - i += copy(dAtA[i:], m.ListenerPath) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *VSockListen) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2939,31 +2827,38 @@ func (m *VSockListen) Marshal() (dAtA []byte, err error) { } func (m *VSockListen) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VSockListen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ListenerPath) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ListenerPath) + copy(dAtA[i:], m.ListenerPath) i = encodeVarintVmservice(dAtA, i, uint64(len(m.ListenerPath))) - i += copy(dAtA[i:], m.ListenerPath) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VMSocketRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2971,60 +2866,82 @@ func (m *VMSocketRequest) Marshal() (dAtA []byte, err error) { } func (m *VMSocketRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMSocketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Config != nil { - nn17, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Config.Size() + i -= size + if _, err := m.Config.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn17 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VMSocketRequest_HvsocketList) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMSocketRequest_HvsocketList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HvsocketList != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.HvsocketList.Size())) - n18, err := m.HvsocketList.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HvsocketList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *VMSocketRequest_VsockListen) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMSocketRequest_VsockListen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.VsockListen != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.VsockListen.Size())) - n19, err := m.VsockListen.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VsockListen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *SCSIDisk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3032,51 +2949,58 @@ func (m *SCSIDisk) Marshal() (dAtA []byte, err error) { } func (m *SCSIDisk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SCSIDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Controller != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Controller)) - } - if m.Lun != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Lun)) - } - if len(m.HostPath) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if m.Type != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x28 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x20 + } + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0x1a + } + if m.Lun != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Lun)) + i-- + dAtA[i] = 0x10 + } + if m.Controller != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Controller)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VPMEMDisk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3084,41 +3008,48 @@ func (m *VPMEMDisk) Marshal() (dAtA []byte, err error) { } func (m *VPMEMDisk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VPMEMDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.HostPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if m.Type != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x18 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 + } + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NICConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3126,50 +3057,61 @@ func (m *NICConfig) Marshal() (dAtA []byte, err error) { } func (m *NICConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NICConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NicID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) - } - if len(m.PortID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.PortID))) - i += copy(dAtA[i:], m.PortID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.MacAddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.MacAddress))) - i += copy(dAtA[i:], m.MacAddress) + if len(m.NicName) > 0 { + i -= len(m.NicName) + copy(dAtA[i:], m.NicName) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicName))) + i-- + dAtA[i] = 0x2a } if len(m.SwitchID) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.SwitchID) + copy(dAtA[i:], m.SwitchID) i = encodeVarintVmservice(dAtA, i, uint64(len(m.SwitchID))) - i += copy(dAtA[i:], m.SwitchID) + i-- + dAtA[i] = 0x22 } - if len(m.NicName) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicName))) - i += copy(dAtA[i:], m.NicName) + if len(m.MacAddress) > 0 { + i -= len(m.MacAddress) + copy(dAtA[i:], m.MacAddress) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.MacAddress))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.PortID) > 0 { + i -= len(m.PortID) + copy(dAtA[i:], m.PortID) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.PortID))) + i-- + dAtA[i] = 0x12 + } + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsPCIDevice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3177,26 +3119,33 @@ func (m *WindowsPCIDevice) Marshal() (dAtA []byte, err error) { } func (m *WindowsPCIDevice) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsPCIDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.InstanceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.InstanceID) + copy(dAtA[i:], m.InstanceID) i = encodeVarintVmservice(dAtA, i, uint64(len(m.InstanceID))) - i += copy(dAtA[i:], m.InstanceID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyMemoryRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3204,25 +3153,31 @@ func (m *ModifyMemoryRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyMemoryRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyMemoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.MemoryMb != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryMb)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyProcessorRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3230,25 +3185,31 @@ func (m *ModifyProcessorRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyProcessorRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyProcessorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ProcessorIndex != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorIndex)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyProcessorConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3256,30 +3217,36 @@ func (m *ModifyProcessorConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyProcessorConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyProcessorConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ProcessorWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProcessorLimit != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorLimit)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ProcessorWeight != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3287,134 +3254,193 @@ func (m *ModifyResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Resource != nil { - nn20, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Resource.Size() + i -= size + if _, err := m.Resource.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn20 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_Processor) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_Processor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Processor != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Processor.Size())) - n21, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n21 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_ProcessorConfig) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_ProcessorConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ProcessorConfig != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorConfig.Size())) - n22, err := m.ProcessorConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProcessorConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n22 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_Memory) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_Memory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Memory != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Memory.Size())) - n23, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n23 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_ScsiDisk) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_ScsiDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ScsiDisk != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ScsiDisk.Size())) - n24, err := m.ScsiDisk.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ScsiDisk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n24 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_VpmemDisk) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_VpmemDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.VpmemDisk != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.VpmemDisk.Size())) - n25, err := m.VpmemDisk.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VpmemDisk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_NicConfig) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_NicConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NicConfig != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.NicConfig.Size())) - n26, err := m.NicConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NicConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_WindowsDevice) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_WindowsDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.WindowsDevice != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.WindowsDevice.Size())) - n27, err := m.WindowsDevice.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.WindowsDevice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n27 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintVmservice(dAtA []byte, offset int, v uint64) int { + offset -= sovVmservice(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *DirectBoot) Size() (n int) { if m == nil { @@ -4192,14 +4218,7 @@ func (m *ModifyResourceRequest_WindowsDevice) Size() (n int) { } func sovVmservice(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozVmservice(x uint64) (n int) { return sovVmservice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4266,11 +4285,31 @@ func (this *DevicesConfig) String() string { if this == nil { return "nil" } + repeatedStringForScsiDisks := "[]*SCSIDisk{" + for _, f := range this.ScsiDisks { + repeatedStringForScsiDisks += strings.Replace(f.String(), "SCSIDisk", "SCSIDisk", 1) + "," + } + repeatedStringForScsiDisks += "}" + repeatedStringForVpmemDisks := "[]*VPMEMDisk{" + for _, f := range this.VpmemDisks { + repeatedStringForVpmemDisks += strings.Replace(f.String(), "VPMEMDisk", "VPMEMDisk", 1) + "," + } + repeatedStringForVpmemDisks += "}" + repeatedStringForNicConfig := "[]*NICConfig{" + for _, f := range this.NicConfig { + repeatedStringForNicConfig += strings.Replace(f.String(), "NICConfig", "NICConfig", 1) + "," + } + repeatedStringForNicConfig += "}" + repeatedStringForWindowsDevice := "[]*WindowsPCIDevice{" + for _, f := range this.WindowsDevice { + repeatedStringForWindowsDevice += strings.Replace(f.String(), "WindowsPCIDevice", "WindowsPCIDevice", 1) + "," + } + repeatedStringForWindowsDevice += "}" s := strings.Join([]string{`&DevicesConfig{`, - `ScsiDisks:` + strings.Replace(fmt.Sprintf("%v", this.ScsiDisks), "SCSIDisk", "SCSIDisk", 1) + `,`, - `VpmemDisks:` + strings.Replace(fmt.Sprintf("%v", this.VpmemDisks), "VPMEMDisk", "VPMEMDisk", 1) + `,`, - `NicConfig:` + strings.Replace(fmt.Sprintf("%v", this.NicConfig), "NICConfig", "NICConfig", 1) + `,`, - `WindowsDevice:` + strings.Replace(fmt.Sprintf("%v", this.WindowsDevice), "WindowsPCIDevice", "WindowsPCIDevice", 1) + `,`, + `ScsiDisks:` + repeatedStringForScsiDisks + `,`, + `VpmemDisks:` + repeatedStringForVpmemDisks + `,`, + `NicConfig:` + repeatedStringForNicConfig + `,`, + `WindowsDevice:` + repeatedStringForWindowsDevice + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4281,7 +4320,7 @@ func (this *VMConfig) String() string { return "nil" } keysForExtraData := make([]string, 0, len(this.ExtraData)) - for k := range this.ExtraData { + for k, _ := range this.ExtraData { keysForExtraData = append(keysForExtraData, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForExtraData) @@ -4291,12 +4330,12 @@ func (this *VMConfig) String() string { } mapStringForExtraData += "}" s := strings.Join([]string{`&VMConfig{`, - `MemoryConfig:` + strings.Replace(fmt.Sprintf("%v", this.MemoryConfig), "MemoryConfig", "MemoryConfig", 1) + `,`, - `ProcessorConfig:` + strings.Replace(fmt.Sprintf("%v", this.ProcessorConfig), "ProcessorConfig", "ProcessorConfig", 1) + `,`, - `DevicesConfig:` + strings.Replace(fmt.Sprintf("%v", this.DevicesConfig), "DevicesConfig", "DevicesConfig", 1) + `,`, - `SerialConfig:` + strings.Replace(fmt.Sprintf("%v", this.SerialConfig), "SerialConfig", "SerialConfig", 1) + `,`, + `MemoryConfig:` + strings.Replace(this.MemoryConfig.String(), "MemoryConfig", "MemoryConfig", 1) + `,`, + `ProcessorConfig:` + strings.Replace(this.ProcessorConfig.String(), "ProcessorConfig", "ProcessorConfig", 1) + `,`, + `DevicesConfig:` + strings.Replace(this.DevicesConfig.String(), "DevicesConfig", "DevicesConfig", 1) + `,`, + `SerialConfig:` + strings.Replace(this.SerialConfig.String(), "SerialConfig", "SerialConfig", 1) + `,`, `BootConfig:` + fmt.Sprintf("%v", this.BootConfig) + `,`, - `WindowsOptions:` + strings.Replace(fmt.Sprintf("%v", this.WindowsOptions), "WindowsOptions", "WindowsOptions", 1) + `,`, + `WindowsOptions:` + strings.Replace(this.WindowsOptions.String(), "WindowsOptions", "WindowsOptions", 1) + `,`, `ExtraData:` + mapStringForExtraData + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, @@ -4338,8 +4377,13 @@ func (this *SerialConfig) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*SerialConfig_Config{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "SerialConfig_Config", "SerialConfig_Config", 1) + "," + } + repeatedStringForPorts += "}" s := strings.Join([]string{`&SerialConfig{`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "SerialConfig_Config", "SerialConfig_Config", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4362,7 +4406,7 @@ func (this *CreateVMRequest) String() string { return "nil" } s := strings.Join([]string{`&CreateVMRequest{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "VMConfig", "VMConfig", 1) + `,`, + `Config:` + strings.Replace(this.Config.String(), "VMConfig", "VMConfig", 1) + `,`, `LogID:` + fmt.Sprintf("%v", this.LogID) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, @@ -4433,8 +4477,8 @@ func (this *PropertiesVMResponse) String() string { return "nil" } s := strings.Join([]string{`&PropertiesVMResponse{`, - `MemoryStats:` + strings.Replace(fmt.Sprintf("%v", this.MemoryStats), "MemoryStats", "MemoryStats", 1) + `,`, - `ProcessorStats:` + strings.Replace(fmt.Sprintf("%v", this.ProcessorStats), "ProcessorStats", "ProcessorStats", 1) + `,`, + `MemoryStats:` + strings.Replace(this.MemoryStats.String(), "MemoryStats", "MemoryStats", 1) + `,`, + `ProcessorStats:` + strings.Replace(this.ProcessorStats.String(), "ProcessorStats", "ProcessorStats", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4444,8 +4488,13 @@ func (this *CapabilitiesVMResponse) String() string { if this == nil { return "nil" } + repeatedStringForSupportedResources := "[]*CapabilitiesVMResponse_SupportedResource{" + for _, f := range this.SupportedResources { + repeatedStringForSupportedResources += strings.Replace(fmt.Sprintf("%v", f), "CapabilitiesVMResponse_SupportedResource", "CapabilitiesVMResponse_SupportedResource", 1) + "," + } + repeatedStringForSupportedResources += "}" s := strings.Join([]string{`&CapabilitiesVMResponse{`, - `SupportedResources:` + strings.Replace(fmt.Sprintf("%v", this.SupportedResources), "CapabilitiesVMResponse_SupportedResource", "CapabilitiesVMResponse_SupportedResource", 1) + `,`, + `SupportedResources:` + repeatedStringForSupportedResources + `,`, `SupportedGuestOs:` + fmt.Sprintf("%v", this.SupportedGuestOs) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, @@ -5025,10 +5074,7 @@ func (m *DirectBoot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5175,10 +5221,7 @@ func (m *UEFI) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5405,10 +5448,7 @@ func (m *MemoryConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5516,10 +5556,7 @@ func (m *ProcessorConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5706,10 +5743,7 @@ func (m *DevicesConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6120,7 +6154,7 @@ func (m *VMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > postIndex { @@ -6137,10 +6171,7 @@ func (m *VMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6210,10 +6241,7 @@ func (m *WindowsOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6298,10 +6326,7 @@ func (m *SerialConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6403,10 +6428,7 @@ func (m *SerialConfig_Config) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6525,10 +6547,7 @@ func (m *CreateVMRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6630,10 +6649,7 @@ func (m *InspectVMRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6720,10 +6736,7 @@ func (m *InspectVMResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6850,10 +6863,7 @@ func (m *MemoryStats) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6923,10 +6933,7 @@ func (m *ProcessorStats) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7046,10 +7053,7 @@ func (m *PropertiesVMRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7172,10 +7176,7 @@ func (m *PropertiesVMResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7329,10 +7330,7 @@ func (m *CapabilitiesVMResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7462,10 +7460,7 @@ func (m *CapabilitiesVMResponse_SupportedResource) Unmarshal(dAtA []byte) error if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7580,10 +7575,7 @@ func (m *HVSocketListen) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7685,10 +7677,7 @@ func (m *VSockListen) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7828,10 +7817,7 @@ func (m *VMSocketRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7991,10 +7977,7 @@ func (m *SCSIDisk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8116,10 +8099,7 @@ func (m *VPMEMDisk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8330,10 +8310,7 @@ func (m *NICConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8416,10 +8393,7 @@ func (m *WindowsPCIDevice) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8489,10 +8463,7 @@ func (m *ModifyMemoryRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8562,10 +8533,7 @@ func (m *ModifyProcessorRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8654,10 +8622,7 @@ func (m *ModifyProcessorConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8972,10 +8937,7 @@ func (m *ModifyResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8994,6 +8956,7 @@ func (m *ModifyResourceRequest) Unmarshal(dAtA []byte) error { func skipVmservice(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -9025,10 +8988,8 @@ func skipVmservice(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -9049,55 +9010,30 @@ func skipVmservice(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthVmservice } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthVmservice - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVmservice - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipVmservice(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthVmservice - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupVmservice + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthVmservice + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthVmservice = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowVmservice = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthVmservice = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowVmservice = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupVmservice = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go b/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go index 6343596af3..c80b299e20 100644 --- a/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go +++ b/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go @@ -8,8 +8,11 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type HostComputeNetworkSettings_NetworkMode int32 @@ -98,7 +101,7 @@ func (m *AddNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_AddNICRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -136,7 +139,7 @@ func (m *AddNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_AddNICResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -178,7 +181,7 @@ func (m *ModifyNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ModifyNICRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -216,7 +219,7 @@ func (m *ModifyNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ModifyNICResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -257,7 +260,7 @@ func (m *DeleteNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_DeleteNICRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -295,7 +298,7 @@ func (m *DeleteNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_DeleteNICResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -334,7 +337,7 @@ func (m *CreateNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -376,7 +379,7 @@ func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Network.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -402,10 +405,10 @@ type isNetwork_Settings interface { } type Network_HcnNetwork struct { - HcnNetwork *HostComputeNetworkSettings `protobuf:"bytes,1,opt,name=hcn_network,json=hcnNetwork,proto3,oneof"` + HcnNetwork *HostComputeNetworkSettings `protobuf:"bytes,1,opt,name=hcn_network,json=hcnNetwork,proto3,oneof" json:"hcn_network,omitempty"` } type Network_NcproxyNetwork struct { - NcproxyNetwork *NCProxyNetworkSettings `protobuf:"bytes,2,opt,name=ncproxy_network,json=ncproxyNetwork,proto3,oneof"` + NcproxyNetwork *NCProxyNetworkSettings `protobuf:"bytes,2,opt,name=ncproxy_network,json=ncproxyNetwork,proto3,oneof" json:"ncproxy_network,omitempty"` } func (*Network_HcnNetwork) isNetwork_Settings() {} @@ -432,80 +435,14 @@ func (m *Network) GetNcproxyNetwork() *NCProxyNetworkSettings { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Network) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Network_OneofMarshaler, _Network_OneofUnmarshaler, _Network_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Network) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Network_HcnNetwork)(nil), (*Network_NcproxyNetwork)(nil), } } -func _Network_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Network) - // settings - switch x := m.Settings.(type) { - case *Network_HcnNetwork: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HcnNetwork); err != nil { - return err - } - case *Network_NcproxyNetwork: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NcproxyNetwork); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Network.Settings has unexpected type %T", x) - } - return nil -} - -func _Network_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Network) - switch tag { - case 1: // settings.hcn_network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HostComputeNetworkSettings) - err := b.DecodeMessage(msg) - m.Settings = &Network_HcnNetwork{msg} - return true, err - case 2: // settings.ncproxy_network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NCProxyNetworkSettings) - err := b.DecodeMessage(msg) - m.Settings = &Network_NcproxyNetwork{msg} - return true, err - default: - return false, nil - } -} - -func _Network_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Network) - // settings - switch x := m.Settings.(type) { - case *Network_HcnNetwork: - s := proto.Size(x.HcnNetwork) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Network_NcproxyNetwork: - s := proto.Size(x.NcproxyNetwork) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type NCProxyNetworkSettings struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -526,7 +463,7 @@ func (m *NCProxyNetworkSettings) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_NCProxyNetworkSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -570,7 +507,7 @@ func (m *HostComputeNetworkSettings) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_HostComputeNetworkSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -609,7 +546,7 @@ func (m *CreateNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -648,7 +585,7 @@ func (m *PortNameEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_PortNameEndpointPolicySetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -689,7 +626,7 @@ func (m *IovEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_IovEndpointPolicySetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -730,7 +667,7 @@ func (m *DnsSetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DnsSetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -769,7 +706,7 @@ func (m *CreateEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -811,7 +748,7 @@ func (m *EndpointSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_EndpointSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -837,10 +774,10 @@ type isEndpointSettings_Settings interface { } type EndpointSettings_HcnEndpoint struct { - HcnEndpoint *HcnEndpointSettings `protobuf:"bytes,1,opt,name=hcn_endpoint,json=hcnEndpoint,proto3,oneof"` + HcnEndpoint *HcnEndpointSettings `protobuf:"bytes,1,opt,name=hcn_endpoint,json=hcnEndpoint,proto3,oneof" json:"hcn_endpoint,omitempty"` } type EndpointSettings_NcproxyEndpoint struct { - NcproxyEndpoint *NCProxyEndpointSettings `protobuf:"bytes,2,opt,name=ncproxy_endpoint,json=ncproxyEndpoint,proto3,oneof"` + NcproxyEndpoint *NCProxyEndpointSettings `protobuf:"bytes,2,opt,name=ncproxy_endpoint,json=ncproxyEndpoint,proto3,oneof" json:"ncproxy_endpoint,omitempty"` } func (*EndpointSettings_HcnEndpoint) isEndpointSettings_Settings() {} @@ -867,80 +804,14 @@ func (m *EndpointSettings) GetNcproxyEndpoint() *NCProxyEndpointSettings { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*EndpointSettings) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _EndpointSettings_OneofMarshaler, _EndpointSettings_OneofUnmarshaler, _EndpointSettings_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*EndpointSettings) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*EndpointSettings_HcnEndpoint)(nil), (*EndpointSettings_NcproxyEndpoint)(nil), } } -func _EndpointSettings_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*EndpointSettings) - // settings - switch x := m.Settings.(type) { - case *EndpointSettings_HcnEndpoint: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HcnEndpoint); err != nil { - return err - } - case *EndpointSettings_NcproxyEndpoint: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NcproxyEndpoint); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("EndpointSettings.Settings has unexpected type %T", x) - } - return nil -} - -func _EndpointSettings_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*EndpointSettings) - switch tag { - case 1: // settings.hcn_endpoint - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HcnEndpointSettings) - err := b.DecodeMessage(msg) - m.Settings = &EndpointSettings_HcnEndpoint{msg} - return true, err - case 2: // settings.ncproxy_endpoint - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NCProxyEndpointSettings) - err := b.DecodeMessage(msg) - m.Settings = &EndpointSettings_NcproxyEndpoint{msg} - return true, err - default: - return false, nil - } -} - -func _EndpointSettings_OneofSizer(msg proto.Message) (n int) { - m := msg.(*EndpointSettings) - // settings - switch x := m.Settings.(type) { - case *EndpointSettings_HcnEndpoint: - s := proto.Size(x.HcnEndpoint) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *EndpointSettings_NcproxyEndpoint: - s := proto.Size(x.NcproxyEndpoint) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type HcnEndpointResponse struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` @@ -963,7 +834,7 @@ func (m *HcnEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HcnEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1008,7 +879,7 @@ func (m *HcnEndpointSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HcnEndpointSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1048,7 +919,7 @@ func (m *HcnEndpointPolicies) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HcnEndpointPolicies.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1095,7 +966,7 @@ func (m *NCProxyEndpointSettings) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_NCProxyEndpointSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1121,7 +992,7 @@ type isNCProxyEndpointSettings_DeviceDetails interface { } type NCProxyEndpointSettings_PciDeviceDetails struct { - PciDeviceDetails *PCIDeviceDetails `protobuf:"bytes,7,opt,name=pci_device_details,json=pciDeviceDetails,proto3,oneof"` + PciDeviceDetails *PCIDeviceDetails `protobuf:"bytes,7,opt,name=pci_device_details,json=pciDeviceDetails,proto3,oneof" json:"pci_device_details,omitempty"` } func (*NCProxyEndpointSettings_PciDeviceDetails) isNCProxyEndpointSettings_DeviceDetails() {} @@ -1140,61 +1011,13 @@ func (m *NCProxyEndpointSettings) GetPciDeviceDetails() *PCIDeviceDetails { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*NCProxyEndpointSettings) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _NCProxyEndpointSettings_OneofMarshaler, _NCProxyEndpointSettings_OneofUnmarshaler, _NCProxyEndpointSettings_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NCProxyEndpointSettings) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*NCProxyEndpointSettings_PciDeviceDetails)(nil), } } -func _NCProxyEndpointSettings_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*NCProxyEndpointSettings) - // device_details - switch x := m.DeviceDetails.(type) { - case *NCProxyEndpointSettings_PciDeviceDetails: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.PciDeviceDetails); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("NCProxyEndpointSettings.DeviceDetails has unexpected type %T", x) - } - return nil -} - -func _NCProxyEndpointSettings_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*NCProxyEndpointSettings) - switch tag { - case 7: // device_details.pci_device_details - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PCIDeviceDetails) - err := b.DecodeMessage(msg) - m.DeviceDetails = &NCProxyEndpointSettings_PciDeviceDetails{msg} - return true, err - default: - return false, nil - } -} - -func _NCProxyEndpointSettings_OneofSizer(msg proto.Message) (n int) { - m := msg.(*NCProxyEndpointSettings) - // device_details - switch x := m.DeviceDetails.(type) { - case *NCProxyEndpointSettings_PciDeviceDetails: - s := proto.Size(x.PciDeviceDetails) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type PCIDeviceDetails struct { DeviceID string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` VirtualFunctionIndex uint32 `protobuf:"varint,2,opt,name=virtual_function_index,json=virtualFunctionIndex,proto3" json:"virtual_function_index,omitempty"` @@ -1216,7 +1039,7 @@ func (m *PCIDeviceDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_PCIDeviceDetails.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1255,7 +1078,7 @@ func (m *CreateEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CreateEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1295,7 +1118,7 @@ func (m *AddEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AddEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1333,7 +1156,7 @@ func (m *AddEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AddEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1372,7 +1195,7 @@ func (m *DeleteEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_DeleteEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1410,7 +1233,7 @@ func (m *DeleteEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_DeleteEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1449,7 +1272,7 @@ func (m *DeleteNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_DeleteNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1487,7 +1310,7 @@ func (m *DeleteNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_DeleteNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1526,7 +1349,7 @@ func (m *GetEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1567,7 +1390,7 @@ func (m *GetEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1606,7 +1429,7 @@ func (m *GetNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1646,7 +1469,7 @@ func (m *GetNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1684,7 +1507,7 @@ func (m *GetEndpointsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetEndpointsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1723,7 +1546,7 @@ func (m *GetEndpointsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetEndpointsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1761,7 +1584,7 @@ func (m *GetNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1800,7 +1623,7 @@ func (m *GetNetworksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2127,6 +1950,47 @@ type NetworkConfigProxyServer interface { GetNetworks(context.Context, *GetNetworksRequest) (*GetNetworksResponse, error) } +// UnimplementedNetworkConfigProxyServer can be embedded to have forward compatible implementations. +type UnimplementedNetworkConfigProxyServer struct { +} + +func (*UnimplementedNetworkConfigProxyServer) AddNIC(ctx context.Context, req *AddNICRequest) (*AddNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) ModifyNIC(ctx context.Context, req *ModifyNICRequest) (*ModifyNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModifyNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteNIC(ctx context.Context, req *DeleteNICRequest) (*DeleteNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (*CreateNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) CreateEndpoint(ctx context.Context, req *CreateEndpointRequest) (*CreateEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) AddEndpoint(ctx context.Context, req *AddEndpointRequest) (*AddEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteEndpoint(ctx context.Context, req *DeleteEndpointRequest) (*DeleteEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteNetwork(ctx context.Context, req *DeleteNetworkRequest) (*DeleteNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetEndpoint(ctx context.Context, req *GetEndpointRequest) (*GetEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetNetwork(ctx context.Context, req *GetNetworkRequest) (*GetNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetEndpoints(ctx context.Context, req *GetEndpointsRequest) (*GetEndpointsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndpoints not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetNetworks(ctx context.Context, req *GetNetworksRequest) (*GetNetworksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetworks not implemented") +} + func RegisterNetworkConfigProxyServer(s *grpc.Server, srv NetworkConfigProxyServer) { s.RegisterService(&_NetworkConfigProxy_serviceDesc, srv) } @@ -2407,7 +2271,7 @@ var _NetworkConfigProxy_serviceDesc = grpc.ServiceDesc{ func (m *AddNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2415,48 +2279,59 @@ func (m *AddNICRequest) Marshal() (dAtA []byte, err error) { } func (m *AddNICRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.EndpointSettings != nil { + { + size, err := m.EndpointSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + i-- + dAtA[i] = 0x1a } - if m.EndpointSettings != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.EndpointSettings.Size())) - n1, err := m.EndpointSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AddNICResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2464,20 +2339,26 @@ func (m *AddNICResponse) Marshal() (dAtA []byte, err error) { } func (m *AddNICResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2485,48 +2366,59 @@ func (m *ModifyNICRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.EndpointSettings != nil { + { + size, err := m.EndpointSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + i-- + dAtA[i] = 0x1a } - if m.EndpointSettings != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.EndpointSettings.Size())) - n2, err := m.EndpointSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2534,20 +2426,26 @@ func (m *ModifyNICResponse) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2555,38 +2453,47 @@ func (m *DeleteNICRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2594,20 +2501,26 @@ func (m *DeleteNICResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2615,30 +2528,38 @@ func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Network.Size())) - n3, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Network) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2646,55 +2567,77 @@ func (m *Network) Marshal() (dAtA []byte, err error) { } func (m *Network) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Settings != nil { - nn4, err := m.Settings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Settings.Size() + i -= size + if _, err := m.Settings.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn4 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *Network_HcnNetwork) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network_HcnNetwork) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HcnNetwork != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.HcnNetwork.Size())) - n5, err := m.HcnNetwork.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HcnNetwork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Network_NcproxyNetwork) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network_NcproxyNetwork) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NcproxyNetwork != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.NcproxyNetwork.Size())) - n6, err := m.NcproxyNetwork.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NcproxyNetwork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *NCProxyNetworkSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2702,26 +2645,33 @@ func (m *NCProxyNetworkSettings) Marshal() (dAtA []byte, err error) { } func (m *NCProxyNetworkSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NCProxyNetworkSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HostComputeNetworkSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2729,63 +2679,66 @@ func (m *HostComputeNetworkSettings) Marshal() (dAtA []byte, err error) { } func (m *HostComputeNetworkSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostComputeNetworkSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Mode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Mode)) + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x32 } - if len(m.SwitchName) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SwitchName))) - i += copy(dAtA[i:], m.SwitchName) + if len(m.SubnetIpaddressPrefix) > 0 { + for iNdEx := len(m.SubnetIpaddressPrefix) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubnetIpaddressPrefix[iNdEx]) + copy(dAtA[i:], m.SubnetIpaddressPrefix[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SubnetIpaddressPrefix[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } if m.IpamType != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpamType)) + i-- + dAtA[i] = 0x20 } - if len(m.SubnetIpaddressPrefix) > 0 { - for _, s := range m.SubnetIpaddressPrefix { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.SwitchName) > 0 { + i -= len(m.SwitchName) + copy(dAtA[i:], m.SwitchName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SwitchName))) + i-- + dAtA[i] = 0x1a } - if len(m.DefaultGateway) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) - i += copy(dAtA[i:], m.DefaultGateway) + if m.Mode != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2793,26 +2746,33 @@ func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2820,26 +2780,33 @@ func (m *PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { } func (m *PortNameEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortNameEndpointPolicySetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.PortName) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.PortName))) - i += copy(dAtA[i:], m.PortName) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *IovEndpointPolicySetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2847,35 +2814,41 @@ func (m *IovEndpointPolicySetting) Marshal() (dAtA []byte, err error) { } func (m *IovEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IovEndpointPolicySetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.IovOffloadWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) - } - if m.QueuePairsRequested != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.QueuePairsRequested)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.InterruptModeration != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.InterruptModeration)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.QueuePairsRequested != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.QueuePairsRequested)) + i-- + dAtA[i] = 0x10 + } + if m.IovOffloadWeight != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *DnsSetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2883,56 +2856,51 @@ func (m *DnsSetting) Marshal() (dAtA []byte, err error) { } func (m *DnsSetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DnsSetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServerIpAddrs) > 0 { - for _, s := range m.ServerIpAddrs { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Search) > 0 { + for iNdEx := len(m.Search) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Search[iNdEx]) + copy(dAtA[i:], m.Search[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Search[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.Domain) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Domain))) - i += copy(dAtA[i:], m.Domain) + i-- + dAtA[i] = 0x12 } - if len(m.Search) > 0 { - for _, s := range m.Search { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.ServerIpAddrs) > 0 { + for iNdEx := len(m.ServerIpAddrs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServerIpAddrs[iNdEx]) + copy(dAtA[i:], m.ServerIpAddrs[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ServerIpAddrs[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2940,30 +2908,38 @@ func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.EndpointSettings != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.EndpointSettings.Size())) - n7, err := m.EndpointSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.EndpointSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n7 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2971,55 +2947,77 @@ func (m *EndpointSettings) Marshal() (dAtA []byte, err error) { } func (m *EndpointSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Settings != nil { - nn8, err := m.Settings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Settings.Size() + i -= size + if _, err := m.Settings.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSettings_HcnEndpoint) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSettings_HcnEndpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HcnEndpoint != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.HcnEndpoint.Size())) - n9, err := m.HcnEndpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HcnEndpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSettings_NcproxyEndpoint) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSettings_NcproxyEndpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NcproxyEndpoint != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.NcproxyEndpoint.Size())) - n10, err := m.NcproxyEndpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NcproxyEndpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *HcnEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3027,42 +3025,52 @@ func (m *HcnEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *HcnEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HcnEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Namespace) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) - } - if len(m.ID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Settings != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Settings.Size())) - n11, err := m.Settings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Settings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HcnEndpointSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3070,69 +3078,83 @@ func (m *HcnEndpointSettings) Marshal() (dAtA []byte, err error) { } func (m *HcnEndpointSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HcnEndpointSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Macaddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) - i += copy(dAtA[i:], m.Macaddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ipaddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) - i += copy(dAtA[i:], m.Ipaddress) + if m.DnsSetting != nil { + { + size, err := m.DnsSetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - if m.IpaddressPrefixlength != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + if m.Policies != nil { + { + size, err := m.Policies.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } if len(m.NetworkName) > 0 { - dAtA[i] = 0x2a - i++ + i -= len(m.NetworkName) + copy(dAtA[i:], m.NetworkName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) - i += copy(dAtA[i:], m.NetworkName) + i-- + dAtA[i] = 0x2a } - if m.Policies != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Policies.Size())) - n12, err := m.Policies.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if m.IpaddressPrefixlength != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + i-- + dAtA[i] = 0x20 } - if m.DnsSetting != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.DnsSetting.Size())) - n13, err := m.DnsSetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 + if len(m.Ipaddress) > 0 { + i -= len(m.Ipaddress) + copy(dAtA[i:], m.Ipaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Macaddress) > 0 { + i -= len(m.Macaddress) + copy(dAtA[i:], m.Macaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HcnEndpointPolicies) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3140,40 +3162,50 @@ func (m *HcnEndpointPolicies) Marshal() (dAtA []byte, err error) { } func (m *HcnEndpointPolicies) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HcnEndpointPolicies) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PortnamePolicySetting != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PortnamePolicySetting.Size())) - n14, err := m.PortnamePolicySetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IovPolicySettings != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovPolicySettings.Size())) - n15, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.PortnamePolicySetting != nil { + { + size, err := m.PortnamePolicySetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NCProxyEndpointSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3181,76 +3213,96 @@ func (m *NCProxyEndpointSettings) Marshal() (dAtA []byte, err error) { } func (m *NCProxyEndpointSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NCProxyEndpointSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Macaddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) - i += copy(dAtA[i:], m.Macaddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ipaddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) - i += copy(dAtA[i:], m.Ipaddress) + if m.DeviceDetails != nil { + { + size := m.DeviceDetails.Size() + i -= size + if _, err := m.DeviceDetails.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - if m.IpaddressPrefixlength != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x32 } if len(m.NetworkName) > 0 { - dAtA[i] = 0x2a - i++ + i -= len(m.NetworkName) + copy(dAtA[i:], m.NetworkName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) - i += copy(dAtA[i:], m.NetworkName) + i-- + dAtA[i] = 0x2a } - if len(m.DefaultGateway) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) - i += copy(dAtA[i:], m.DefaultGateway) + if m.IpaddressPrefixlength != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + i-- + dAtA[i] = 0x20 } - if m.DeviceDetails != nil { - nn16, err := m.DeviceDetails.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn16 + if len(m.Ipaddress) > 0 { + i -= len(m.Ipaddress) + copy(dAtA[i:], m.Ipaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Macaddress) > 0 { + i -= len(m.Macaddress) + copy(dAtA[i:], m.Macaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NCProxyEndpointSettings_PciDeviceDetails) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NCProxyEndpointSettings_PciDeviceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.PciDeviceDetails != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PciDeviceDetails.Size())) - n17, err := m.PciDeviceDetails.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.PciDeviceDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *PCIDeviceDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3258,31 +3310,38 @@ func (m *PCIDeviceDetails) Marshal() (dAtA []byte, err error) { } func (m *PCIDeviceDetails) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PCIDeviceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.DeviceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3290,26 +3349,33 @@ func (m *CreateEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AddEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3317,32 +3383,40 @@ func (m *AddEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *AddEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.NamespaceID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NamespaceID) + copy(dAtA[i:], m.NamespaceID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NamespaceID))) - i += copy(dAtA[i:], m.NamespaceID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AddEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3350,20 +3424,26 @@ func (m *AddEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *AddEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3371,26 +3451,33 @@ func (m *DeleteEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3398,20 +3485,26 @@ func (m *DeleteEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3419,26 +3512,33 @@ func (m *DeleteNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3446,20 +3546,26 @@ func (m *DeleteNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3467,26 +3573,33 @@ func (m *GetEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3494,42 +3607,52 @@ func (m *GetEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Namespace) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) - } - if len(m.ID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Endpoint.Size())) - n18, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3537,26 +3660,33 @@ func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3564,36 +3694,45 @@ func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Network != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Network.Size())) - n19, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3601,20 +3740,26 @@ func (m *GetEndpointsRequest) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3622,32 +3767,40 @@ func (m *GetEndpointsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Endpoints) > 0 { - for _, msg := range m.Endpoints { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3655,20 +3808,26 @@ func (m *GetNetworksRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNetworksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3676,36 +3835,46 @@ func (m *GetNetworksResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNetworksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNetworkconfigproxy(dAtA []byte, offset int, v uint64) int { + offset -= sovNetworkconfigproxy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *AddNICRequest) Size() (n int) { if m == nil { @@ -4459,14 +4628,7 @@ func (m *GetNetworksResponse) Size() (n int) { } func sovNetworkconfigproxy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNetworkconfigproxy(x uint64) (n int) { return sovNetworkconfigproxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4479,7 +4641,7 @@ func (this *AddNICRequest) String() string { `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, - `EndpointSettings:` + strings.Replace(fmt.Sprintf("%v", this.EndpointSettings), "EndpointSettings", "EndpointSettings", 1) + `,`, + `EndpointSettings:` + strings.Replace(this.EndpointSettings.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4503,7 +4665,7 @@ func (this *ModifyNICRequest) String() string { `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, - `EndpointSettings:` + strings.Replace(fmt.Sprintf("%v", this.EndpointSettings), "EndpointSettings", "EndpointSettings", 1) + `,`, + `EndpointSettings:` + strings.Replace(this.EndpointSettings.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4547,7 +4709,7 @@ func (this *CreateNetworkRequest) String() string { return "nil" } s := strings.Join([]string{`&CreateNetworkRequest{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4664,7 +4826,7 @@ func (this *CreateEndpointRequest) String() string { return "nil" } s := strings.Join([]string{`&CreateEndpointRequest{`, - `EndpointSettings:` + strings.Replace(fmt.Sprintf("%v", this.EndpointSettings), "EndpointSettings", "EndpointSettings", 1) + `,`, + `EndpointSettings:` + strings.Replace(this.EndpointSettings.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4708,7 +4870,7 @@ func (this *HcnEndpointResponse) String() string { s := strings.Join([]string{`&HcnEndpointResponse{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Settings:` + strings.Replace(fmt.Sprintf("%v", this.Settings), "HcnEndpointSettings", "HcnEndpointSettings", 1) + `,`, + `Settings:` + strings.Replace(this.Settings.String(), "HcnEndpointSettings", "HcnEndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4724,8 +4886,8 @@ func (this *HcnEndpointSettings) String() string { `Ipaddress:` + fmt.Sprintf("%v", this.Ipaddress) + `,`, `IpaddressPrefixlength:` + fmt.Sprintf("%v", this.IpaddressPrefixlength) + `,`, `NetworkName:` + fmt.Sprintf("%v", this.NetworkName) + `,`, - `Policies:` + strings.Replace(fmt.Sprintf("%v", this.Policies), "HcnEndpointPolicies", "HcnEndpointPolicies", 1) + `,`, - `DnsSetting:` + strings.Replace(fmt.Sprintf("%v", this.DnsSetting), "DnsSetting", "DnsSetting", 1) + `,`, + `Policies:` + strings.Replace(this.Policies.String(), "HcnEndpointPolicies", "HcnEndpointPolicies", 1) + `,`, + `DnsSetting:` + strings.Replace(this.DnsSetting.String(), "DnsSetting", "DnsSetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4736,8 +4898,8 @@ func (this *HcnEndpointPolicies) String() string { return "nil" } s := strings.Join([]string{`&HcnEndpointPolicies{`, - `PortnamePolicySetting:` + strings.Replace(fmt.Sprintf("%v", this.PortnamePolicySetting), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `PortnamePolicySetting:` + strings.Replace(this.PortnamePolicySetting.String(), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4875,7 +5037,7 @@ func (this *GetEndpointResponse) String() string { s := strings.Join([]string{`&GetEndpointResponse{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "EndpointSettings", "EndpointSettings", 1) + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4898,7 +5060,7 @@ func (this *GetNetworkResponse) String() string { } s := strings.Join([]string{`&GetNetworkResponse{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4918,8 +5080,13 @@ func (this *GetEndpointsResponse) String() string { if this == nil { return "nil" } + repeatedStringForEndpoints := "[]*GetEndpointResponse{" + for _, f := range this.Endpoints { + repeatedStringForEndpoints += strings.Replace(f.String(), "GetEndpointResponse", "GetEndpointResponse", 1) + "," + } + repeatedStringForEndpoints += "}" s := strings.Join([]string{`&GetEndpointsResponse{`, - `Endpoints:` + strings.Replace(fmt.Sprintf("%v", this.Endpoints), "GetEndpointResponse", "GetEndpointResponse", 1) + `,`, + `Endpoints:` + repeatedStringForEndpoints + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4939,8 +5106,13 @@ func (this *GetNetworksResponse) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*GetNetworkResponse{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(f.String(), "GetNetworkResponse", "GetNetworkResponse", 1) + "," + } + repeatedStringForNetworks += "}" s := strings.Join([]string{`&GetNetworksResponse{`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "GetNetworkResponse", "GetNetworkResponse", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -5121,10 +5293,7 @@ func (m *AddNICRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5175,10 +5344,7 @@ func (m *AddNICResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5361,10 +5527,7 @@ func (m *ModifyNICRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5415,10 +5578,7 @@ func (m *ModifyNICResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5565,10 +5725,7 @@ func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5619,10 +5776,7 @@ func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5709,10 +5863,7 @@ func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5833,10 +5984,7 @@ func (m *Network) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5919,10 +6067,7 @@ func (m *NCProxyNetworkSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6139,10 +6284,7 @@ func (m *HostComputeNetworkSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6225,10 +6367,7 @@ func (m *CreateNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6311,10 +6450,7 @@ func (m *PortNameEndpointPolicySetting) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6422,10 +6558,7 @@ func (m *IovEndpointPolicySetting) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6572,10 +6705,7 @@ func (m *DnsSetting) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6662,10 +6792,7 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6786,10 +6913,7 @@ func (m *EndpointSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6940,10 +7064,7 @@ func (m *HcnEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7213,10 +7334,7 @@ func (m *HcnEndpointSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7339,10 +7457,7 @@ func (m *HcnEndpointPolicies) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7607,10 +7722,7 @@ func (m *NCProxyEndpointSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7712,10 +7824,7 @@ func (m *PCIDeviceDetails) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7798,10 +7907,7 @@ func (m *CreateEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7916,10 +8022,7 @@ func (m *AddEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7970,10 +8073,7 @@ func (m *AddEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8056,10 +8156,7 @@ func (m *DeleteEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8110,10 +8207,7 @@ func (m *DeleteEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8196,10 +8290,7 @@ func (m *DeleteNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8250,10 +8341,7 @@ func (m *DeleteNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8336,10 +8424,7 @@ func (m *GetEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8490,10 +8575,7 @@ func (m *GetEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8576,10 +8658,7 @@ func (m *GetNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8698,10 +8777,7 @@ func (m *GetNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8752,10 +8828,7 @@ func (m *GetEndpointsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8840,10 +8913,7 @@ func (m *GetEndpointsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8894,10 +8964,7 @@ func (m *GetNetworksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8982,10 +9049,7 @@ func (m *GetNetworksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -9004,6 +9068,7 @@ func (m *GetNetworksResponse) Unmarshal(dAtA []byte) error { func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -9035,10 +9100,8 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -9059,55 +9122,30 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNetworkconfigproxy } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetworkconfigproxy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNetworkconfigproxy(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNetworkconfigproxy + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNetworkconfigproxy = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go b/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go index f2fd334f88..842300c922 100644 --- a/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go +++ b/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go @@ -8,8 +8,11 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RequestType int32 @@ -71,7 +74,7 @@ func (m *ConfigureNetworkingRequest) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ConfigureNetworkingRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -109,7 +112,7 @@ func (m *ConfigureNetworkingResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ConfigureNetworkingResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -148,7 +151,7 @@ func (m *PingNodeNetworkServiceRequest) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_PingNodeNetworkServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -187,7 +190,7 @@ func (m *PingNodeNetworkServiceResponse) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_PingNodeNetworkServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -228,7 +231,7 @@ func (m *ConfigureContainerNetworkingRequest) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ConfigureContainerNetworkingRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -267,7 +270,7 @@ func (m *ConfigureContainerNetworkingResponse) XXX_Marshal(b []byte, determinist return xxx_messageInfo_ConfigureContainerNetworkingResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -309,7 +312,7 @@ func (m *ContainerIPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ContainerIPAddress.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -351,7 +354,7 @@ func (m *ContainerNetworkInterface) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ContainerNetworkInterface.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -390,7 +393,7 @@ func (m *GetHostLocalIpAddressRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_GetHostLocalIpAddressRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -429,7 +432,7 @@ func (m *GetHostLocalIpAddressResponse) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_GetHostLocalIpAddressResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -584,6 +587,23 @@ type NodeNetworkServiceServer interface { GetHostLocalIpAddress(context.Context, *GetHostLocalIpAddressRequest) (*GetHostLocalIpAddressResponse, error) } +// UnimplementedNodeNetworkServiceServer can be embedded to have forward compatible implementations. +type UnimplementedNodeNetworkServiceServer struct { +} + +func (*UnimplementedNodeNetworkServiceServer) ConfigureNetworking(ctx context.Context, req *ConfigureNetworkingRequest) (*ConfigureNetworkingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureNetworking not implemented") +} +func (*UnimplementedNodeNetworkServiceServer) ConfigureContainerNetworking(ctx context.Context, req *ConfigureContainerNetworkingRequest) (*ConfigureContainerNetworkingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureContainerNetworking not implemented") +} +func (*UnimplementedNodeNetworkServiceServer) PingNodeNetworkService(ctx context.Context, req *PingNodeNetworkServiceRequest) (*PingNodeNetworkServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PingNodeNetworkService not implemented") +} +func (*UnimplementedNodeNetworkServiceServer) GetHostLocalIpAddress(ctx context.Context, req *GetHostLocalIpAddressRequest) (*GetHostLocalIpAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHostLocalIpAddress not implemented") +} + func RegisterNodeNetworkServiceServer(s *grpc.Server, srv NodeNetworkServiceServer) { s.RegisterService(&_NodeNetworkService_serviceDesc, srv) } @@ -688,7 +708,7 @@ var _NodeNetworkService_serviceDesc = grpc.ServiceDesc{ func (m *ConfigureNetworkingRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -696,31 +716,38 @@ func (m *ConfigureNetworkingRequest) Marshal() (dAtA []byte, err error) { } func (m *ConfigureNetworkingRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RequestType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -728,20 +755,26 @@ func (m *ConfigureNetworkingResponse) Marshal() (dAtA []byte, err error) { } func (m *ConfigureNetworkingResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PingNodeNetworkServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -749,26 +782,33 @@ func (m *PingNodeNetworkServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *PingNodeNetworkServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PingNodeNetworkServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.PingRequestMessage) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.PingRequestMessage) + copy(dAtA[i:], m.PingRequestMessage) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.PingRequestMessage))) - i += copy(dAtA[i:], m.PingRequestMessage) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PingNodeNetworkServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -776,26 +816,33 @@ func (m *PingNodeNetworkServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *PingNodeNetworkServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PingNodeNetworkServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.PingResponseMessage) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.PingResponseMessage) + copy(dAtA[i:], m.PingResponseMessage) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.PingResponseMessage))) - i += copy(dAtA[i:], m.PingResponseMessage) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureContainerNetworkingRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -803,37 +850,45 @@ func (m *ConfigureContainerNetworkingRequest) Marshal() (dAtA []byte, err error) } func (m *ConfigureContainerNetworkingRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureContainerNetworkingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RequestType != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) - } - if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.NetworkNamespaceID) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.NetworkNamespaceID) + copy(dAtA[i:], m.NetworkNamespaceID) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.NetworkNamespaceID))) - i += copy(dAtA[i:], m.NetworkNamespaceID) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0x12 + } + if m.RequestType != 0 { + i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureContainerNetworkingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -841,32 +896,40 @@ func (m *ConfigureContainerNetworkingResponse) Marshal() (dAtA []byte, err error } func (m *ConfigureContainerNetworkingResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureContainerNetworkingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Interfaces) > 0 { - for _, msg := range m.Interfaces { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Interfaces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Interfaces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNodenetsvc(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerIPAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -874,44 +937,54 @@ func (m *ContainerIPAddress) Marshal() (dAtA []byte, err error) { } func (m *ContainerIPAddress) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerIPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Version) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Version))) - i += copy(dAtA[i:], m.Version) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ip) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Ip))) - i += copy(dAtA[i:], m.Ip) + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x2a } if len(m.PrefixLength) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.PrefixLength) + copy(dAtA[i:], m.PrefixLength) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.PrefixLength))) - i += copy(dAtA[i:], m.PrefixLength) + i-- + dAtA[i] = 0x22 } - if len(m.DefaultGateway) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.DefaultGateway))) - i += copy(dAtA[i:], m.DefaultGateway) + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerNetworkInterface) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -919,50 +992,61 @@ func (m *ContainerNetworkInterface) Marshal() (dAtA []byte, err error) { } func (m *ContainerNetworkInterface) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerNetworkInterface) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.MacAddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.MacAddress))) - i += copy(dAtA[i:], m.MacAddress) + if len(m.Ipaddresses) > 0 { + for iNdEx := len(m.Ipaddresses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ipaddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNodenetsvc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } if len(m.NetworkNamespaceID) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.NetworkNamespaceID) + copy(dAtA[i:], m.NetworkNamespaceID) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.NetworkNamespaceID))) - i += copy(dAtA[i:], m.NetworkNamespaceID) + i-- + dAtA[i] = 0x1a } - if len(m.Ipaddresses) > 0 { - for _, msg := range m.Ipaddresses { - dAtA[i] = 0x22 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.MacAddress) > 0 { + i -= len(m.MacAddress) + copy(dAtA[i:], m.MacAddress) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.MacAddress))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetHostLocalIpAddressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -970,26 +1054,33 @@ func (m *GetHostLocalIpAddressRequest) Marshal() (dAtA []byte, err error) { } func (m *GetHostLocalIpAddressRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetHostLocalIpAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetHostLocalIpAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -997,30 +1088,39 @@ func (m *GetHostLocalIpAddressResponse) Marshal() (dAtA []byte, err error) { } func (m *GetHostLocalIpAddressResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetHostLocalIpAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.IpAddr) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.IpAddr) + copy(dAtA[i:], m.IpAddr) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.IpAddr))) - i += copy(dAtA[i:], m.IpAddr) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNodenetsvc(dAtA []byte, offset int, v uint64) int { + offset -= sovNodenetsvc(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ConfigureNetworkingRequest) Size() (n int) { if m == nil { @@ -1217,14 +1317,7 @@ func (m *GetHostLocalIpAddressResponse) Size() (n int) { } func sovNodenetsvc(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNodenetsvc(x uint64) (n int) { return sovNodenetsvc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1290,8 +1383,13 @@ func (this *ConfigureContainerNetworkingResponse) String() string { if this == nil { return "nil" } + repeatedStringForInterfaces := "[]*ContainerNetworkInterface{" + for _, f := range this.Interfaces { + repeatedStringForInterfaces += strings.Replace(f.String(), "ContainerNetworkInterface", "ContainerNetworkInterface", 1) + "," + } + repeatedStringForInterfaces += "}" s := strings.Join([]string{`&ConfigureContainerNetworkingResponse{`, - `Interfaces:` + strings.Replace(fmt.Sprintf("%v", this.Interfaces), "ContainerNetworkInterface", "ContainerNetworkInterface", 1) + `,`, + `Interfaces:` + repeatedStringForInterfaces + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1315,11 +1413,16 @@ func (this *ContainerNetworkInterface) String() string { if this == nil { return "nil" } + repeatedStringForIpaddresses := "[]*ContainerIPAddress{" + for _, f := range this.Ipaddresses { + repeatedStringForIpaddresses += strings.Replace(f.String(), "ContainerIPAddress", "ContainerIPAddress", 1) + "," + } + repeatedStringForIpaddresses += "}" s := strings.Join([]string{`&ContainerNetworkInterface{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `MacAddress:` + fmt.Sprintf("%v", this.MacAddress) + `,`, `NetworkNamespaceID:` + fmt.Sprintf("%v", this.NetworkNamespaceID) + `,`, - `Ipaddresses:` + strings.Replace(fmt.Sprintf("%v", this.Ipaddresses), "ContainerIPAddress", "ContainerIPAddress", 1) + `,`, + `Ipaddresses:` + repeatedStringForIpaddresses + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1441,10 +1544,7 @@ func (m *ConfigureNetworkingRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1495,10 +1595,7 @@ func (m *ConfigureNetworkingResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1581,10 +1678,7 @@ func (m *PingNodeNetworkServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1667,10 +1761,7 @@ func (m *PingNodeNetworkServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1804,10 +1895,7 @@ func (m *ConfigureContainerNetworkingRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1892,10 +1980,7 @@ func (m *ConfigureContainerNetworkingResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2074,10 +2159,7 @@ func (m *ContainerIPAddress) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2258,10 +2340,7 @@ func (m *ContainerNetworkInterface) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2344,10 +2423,7 @@ func (m *GetHostLocalIpAddressRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2430,10 +2506,7 @@ func (m *GetHostLocalIpAddressResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2452,6 +2525,7 @@ func (m *GetHostLocalIpAddressResponse) Unmarshal(dAtA []byte) error { func skipNodenetsvc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2483,10 +2557,8 @@ func skipNodenetsvc(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2507,55 +2579,30 @@ func skipNodenetsvc(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNodenetsvc } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNodenetsvc - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNodenetsvc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNodenetsvc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNodenetsvc - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNodenetsvc + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNodenetsvc + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNodenetsvc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNodenetsvc = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNodenetsvc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNodenetsvc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNodenetsvc = fmt.Errorf("proto: unexpected end of group") ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/Protobuild.toml b/test/vendor/github.com/Microsoft/hcsshim/Protobuild.toml index 4f5616619c..471f133866 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/Protobuild.toml +++ b/test/vendor/github.com/Microsoft/hcsshim/Protobuild.toml @@ -1,4 +1,4 @@ -version = "unstable" +version = "1" generator = "gogoctrd" plugins = ["grpc", "fieldpath"] @@ -14,11 +14,6 @@ plugins = ["grpc", "fieldpath"] # target package. packages = ["github.com/gogo/protobuf"] - # Paths that will be added untouched to the end of the includes. We use - # `/usr/local/include` to pickup the common install location of protobuf. - # This is the default. - after = ["/usr/local/include"] - # This section maps protobuf imports to Go packages. These will become # `-M` directives in the call to the go protobuf generator. [packages] diff --git a/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index 708e9201e3..c48fe4fa90 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto +// source: github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto package options @@ -54,7 +54,7 @@ func (x Options_DebugType) String() string { } func (Options_DebugType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{0, 0} + return fileDescriptor_b643df6839c75082, []int{0, 0} } type Options_SandboxIsolation int32 @@ -79,7 +79,7 @@ func (x Options_SandboxIsolation) String() string { } func (Options_SandboxIsolation) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{0, 1} + return fileDescriptor_b643df6839c75082, []int{0, 1} } // Options are the set of customizations that can be passed at Create time. @@ -161,7 +161,7 @@ type Options struct { func (m *Options) Reset() { *m = Options{} } func (*Options) ProtoMessage() {} func (*Options) Descriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{0} + return fileDescriptor_b643df6839c75082, []int{0} } func (m *Options) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -210,7 +210,7 @@ type ProcessDetails struct { func (m *ProcessDetails) Reset() { *m = ProcessDetails{} } func (*ProcessDetails) ProtoMessage() {} func (*ProcessDetails) Descriptor() ([]byte, []int) { - return fileDescriptor_024c3924f1246980, []int{1} + return fileDescriptor_b643df6839c75082, []int{1} } func (m *ProcessDetails) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,79 +248,78 @@ func init() { } func init() { - proto.RegisterFile("github.com/microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptor_024c3924f1246980) + proto.RegisterFile("github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto", fileDescriptor_b643df6839c75082) } -var fileDescriptor_024c3924f1246980 = []byte{ - // 1076 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xdb, 0x4f, 0x23, 0xb7, - 0x17, 0xce, 0x2c, 0xb7, 0x8c, 0xb9, 0x05, 0x93, 0x9f, 0x76, 0x04, 0xbf, 0x4d, 0x22, 0xb6, 0xd2, - 0xb2, 0xea, 0x32, 0x01, 0x5a, 0xa9, 0x55, 0x5b, 0xb5, 0x82, 0x24, 0x2c, 0xa9, 0xb8, 0x44, 0x93, - 0x94, 0xed, 0xe5, 0xc1, 0x9a, 0x8b, 0x99, 0x58, 0xcc, 0x8c, 0x47, 0xb6, 0x27, 0x25, 0x3c, 0x55, - 0xfd, 0x0b, 0xfa, 0x67, 0xf1, 0xd8, 0xc7, 0x56, 0x95, 0x68, 0x37, 0x7f, 0x49, 0x65, 0x8f, 0x07, - 0x58, 0x44, 0xbb, 0x52, 0x9f, 0x62, 0x7f, 0xdf, 0xe7, 0xcf, 0xe7, 0x9c, 0xf8, 0x9c, 0x01, 0xa7, - 0x21, 0x11, 0xc3, 0xcc, 0xb3, 0x7d, 0x1a, 0x37, 0x63, 0xe2, 0x33, 0xca, 0xe9, 0xb9, 0x68, 0x0e, +var fileDescriptor_b643df6839c75082 = []byte{ + // 1072 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4b, 0x6f, 0xe3, 0x36, + 0x17, 0xb5, 0xf2, 0xb4, 0x98, 0x97, 0xc3, 0xf8, 0xc3, 0x08, 0xc9, 0x37, 0xb6, 0x91, 0x29, 0x30, + 0x19, 0x74, 0x22, 0x27, 0x69, 0x81, 0x16, 0x6d, 0xd1, 0x22, 0xb1, 0x9d, 0x89, 0x8b, 0x3c, 0x0c, + 0xd9, 0xcd, 0xf4, 0xb1, 0x20, 0xf4, 0x60, 0x64, 0x22, 0x92, 0x28, 0x90, 0x94, 0x1b, 0x67, 0x55, + 0xf4, 0x17, 0xf4, 0x67, 0x65, 0xd9, 0x65, 0x8b, 0x02, 0x69, 0xc7, 0xbf, 0xa4, 0x20, 0x45, 0x25, + 0x33, 0x41, 0xda, 0x59, 0x74, 0x65, 0xf2, 0x9c, 0xc3, 0xc3, 0x7b, 0xaf, 0x78, 0xaf, 0xc1, 0x59, + 0x48, 0xc4, 0x30, 0xf3, 0x6c, 0x9f, 0xc6, 0xcd, 0x13, 0xe2, 0x33, 0xca, 0xe9, 0x85, 0x68, 0x0e, 0x7d, 0xce, 0x87, 0x24, 0x6e, 0xfa, 0x71, 0xd0, 0xf4, 0x69, 0x22, 0x5c, 0x92, 0x60, 0x16, 0x6c, - 0x49, 0x6c, 0x8b, 0x65, 0xc9, 0xd0, 0xe7, 0x5b, 0xa3, 0x9d, 0x26, 0x4d, 0x05, 0xa1, 0x09, 0x6f, - 0xe6, 0x88, 0x9d, 0x32, 0x2a, 0x28, 0xac, 0xde, 0xe9, 0x6d, 0x4d, 0x8c, 0x76, 0xd6, 0xaa, 0x21, - 0x0d, 0xa9, 0x12, 0x34, 0xe5, 0x2a, 0xd7, 0xae, 0xd5, 0x43, 0x4a, 0xc3, 0x08, 0x37, 0xd5, 0xce, - 0xcb, 0xce, 0x9b, 0x82, 0xc4, 0x98, 0x0b, 0x37, 0x4e, 0x73, 0xc1, 0xc6, 0xef, 0x26, 0x98, 0x3b, - 0xcd, 0x6f, 0x81, 0x55, 0x30, 0x13, 0x60, 0x2f, 0x0b, 0x2d, 0xa3, 0x61, 0x6c, 0x96, 0x9d, 0x7c, - 0x03, 0x0f, 0x00, 0x50, 0x0b, 0x24, 0xc6, 0x29, 0xb6, 0x9e, 0x34, 0x8c, 0xcd, 0xa5, 0xdd, 0x17, - 0xf6, 0x63, 0x31, 0xd8, 0xda, 0xc8, 0x6e, 0x4b, 0xfd, 0x60, 0x9c, 0x62, 0xc7, 0x0c, 0x8a, 0x25, - 0x7c, 0x0e, 0x16, 0x19, 0x0e, 0x09, 0x17, 0x6c, 0x8c, 0x18, 0xa5, 0xc2, 0x9a, 0x6a, 0x18, 0x9b, - 0xa6, 0xb3, 0x50, 0x80, 0x0e, 0xa5, 0x42, 0x8a, 0xb8, 0x9b, 0x04, 0x1e, 0xbd, 0x44, 0x24, 0x76, - 0x43, 0x6c, 0x4d, 0xe7, 0x22, 0x0d, 0x76, 0x25, 0x06, 0x5f, 0x82, 0x4a, 0x21, 0x4a, 0x23, 0x57, - 0x9c, 0x53, 0x16, 0x5b, 0x33, 0x4a, 0xb7, 0xac, 0xf1, 0x9e, 0x86, 0xe1, 0x0f, 0x60, 0xe5, 0xd6, - 0x8f, 0xd3, 0xc8, 0x95, 0xf1, 0x59, 0xb3, 0x2a, 0x07, 0xfb, 0xdf, 0x73, 0xe8, 0xeb, 0x1b, 0x8b, - 0x53, 0x4e, 0x71, 0xe7, 0x2d, 0x02, 0x9b, 0xa0, 0xea, 0x51, 0x2a, 0xd0, 0x39, 0x89, 0x30, 0x57, - 0x39, 0xa1, 0xd4, 0x15, 0x43, 0x6b, 0x4e, 0xc5, 0xb2, 0x22, 0xb9, 0x03, 0x49, 0xc9, 0xcc, 0x7a, - 0xae, 0x18, 0xc2, 0x57, 0x00, 0x8e, 0x62, 0x94, 0x32, 0xea, 0x63, 0xce, 0x29, 0x43, 0x3e, 0xcd, - 0x12, 0x61, 0x95, 0x1b, 0xc6, 0xe6, 0x8c, 0x53, 0x19, 0xc5, 0xbd, 0x82, 0x68, 0x49, 0x1c, 0xda, - 0xa0, 0x3a, 0x8a, 0x51, 0x8c, 0x63, 0xca, 0xc6, 0x88, 0x93, 0x2b, 0x8c, 0x48, 0x82, 0x62, 0xcf, - 0x32, 0x0b, 0xfd, 0xb1, 0xa2, 0xfa, 0xe4, 0x0a, 0x77, 0x93, 0x63, 0x0f, 0xd6, 0x00, 0x78, 0xdd, - 0xfb, 0xe6, 0xec, 0xb0, 0x2d, 0xef, 0xb2, 0x80, 0x0a, 0xe2, 0x1e, 0x02, 0xbf, 0x00, 0xeb, 0xdc, - 0x77, 0x23, 0x8c, 0xfc, 0x34, 0x43, 0x11, 0x89, 0x89, 0xe0, 0x48, 0x50, 0xa4, 0xd3, 0xb2, 0xe6, - 0xd5, 0x9f, 0xfe, 0x54, 0x49, 0x5a, 0x69, 0x76, 0xa4, 0x04, 0x03, 0xaa, 0xeb, 0x00, 0x8f, 0xc1, - 0x07, 0x01, 0x3e, 0x77, 0xb3, 0x48, 0xa0, 0xdb, 0xba, 0x21, 0xee, 0x33, 0x57, 0xf8, 0xc3, 0xdb, - 0xe8, 0x42, 0xcf, 0x5a, 0x50, 0xd1, 0xd5, 0xb5, 0xb6, 0x55, 0x48, 0xfb, 0xb9, 0x32, 0x0f, 0xf6, - 0xb5, 0x07, 0xbf, 0x02, 0xcf, 0x0a, 0xbb, 0x51, 0xfc, 0x98, 0xcf, 0xa2, 0xf2, 0xb1, 0xb4, 0xe8, - 0x2c, 0x7e, 0x68, 0x20, 0x5f, 0xca, 0xd0, 0x65, 0xb8, 0x38, 0x6b, 0x2d, 0xa9, 0xf8, 0x17, 0x14, - 0xa8, 0xc5, 0xb0, 0x01, 0xe6, 0x4f, 0x5a, 0x3d, 0x46, 0x2f, 0xc7, 0x7b, 0x41, 0xc0, 0xac, 0x65, - 0x55, 0x93, 0xfb, 0x10, 0x5c, 0x07, 0x66, 0x44, 0x43, 0x14, 0xe1, 0x11, 0x8e, 0xac, 0x8a, 0xe2, - 0xcb, 0x11, 0x0d, 0x8f, 0xe4, 0x1e, 0x7e, 0x0c, 0x9e, 0x12, 0x8a, 0x18, 0x96, 0x4f, 0x56, 0x36, - 0x0e, 0xcd, 0x84, 0x8c, 0x8e, 0x63, 0xdf, 0x5a, 0x51, 0xe1, 0xad, 0x12, 0xea, 0x48, 0x76, 0x90, - 0x93, 0xdd, 0xa4, 0x8f, 0x7d, 0xf8, 0xb3, 0x71, 0x97, 0xdb, 0x5d, 0xa9, 0xdc, 0x24, 0xa1, 0x42, - 0xbd, 0x1b, 0x6e, 0xc1, 0xc6, 0xd4, 0xe6, 0xfc, 0xee, 0x97, 0xef, 0x6b, 0xa2, 0x77, 0x2b, 0xb8, - 0x77, 0x67, 0xd0, 0x49, 0x64, 0xbf, 0xac, 0x07, 0xff, 0xac, 0x80, 0x9f, 0x00, 0x2b, 0xa1, 0x88, - 0x24, 0x43, 0xcc, 0x88, 0x40, 0x43, 0xca, 0x85, 0xca, 0xe0, 0x8a, 0x26, 0xd8, 0x5a, 0x55, 0x95, - 0xfa, 0x5f, 0x42, 0xbb, 0x39, 0x7d, 0x48, 0xb9, 0x18, 0x68, 0x12, 0x3e, 0x03, 0x80, 0xfb, 0x2c, - 0xf3, 0x50, 0x44, 0x43, 0x6e, 0x55, 0x95, 0xd4, 0x54, 0xc8, 0x11, 0x0d, 0xf9, 0xda, 0x09, 0x68, - 0xbc, 0x2f, 0x30, 0x58, 0x01, 0x53, 0x17, 0x78, 0xac, 0xa6, 0x88, 0xe9, 0xc8, 0xa5, 0x9c, 0x2c, - 0x23, 0x37, 0xca, 0xf2, 0xf1, 0x61, 0x3a, 0xf9, 0xe6, 0xb3, 0x27, 0x9f, 0x1a, 0x1b, 0x2f, 0x81, - 0x79, 0x3b, 0x2d, 0xa0, 0x09, 0x66, 0x4e, 0x7a, 0xdd, 0x5e, 0xa7, 0x52, 0x82, 0x65, 0x30, 0x7d, - 0xd0, 0x3d, 0xea, 0x54, 0x0c, 0x38, 0x07, 0xa6, 0x3a, 0x83, 0x37, 0x95, 0x27, 0x1b, 0x4d, 0x50, - 0x79, 0xd8, 0x94, 0x70, 0x1e, 0xcc, 0xf5, 0x9c, 0xd3, 0x56, 0xa7, 0xdf, 0xaf, 0x94, 0xe0, 0x12, - 0x00, 0x87, 0xdf, 0xf5, 0x3a, 0xce, 0x59, 0xb7, 0x7f, 0xea, 0x54, 0x8c, 0x8d, 0x3f, 0xa6, 0xc0, - 0x92, 0xee, 0xa9, 0x36, 0x16, 0x2e, 0x89, 0xb8, 0xcc, 0x4e, 0xcd, 0x15, 0x94, 0xb8, 0x31, 0xd6, - 0x11, 0x9a, 0x0a, 0x39, 0x71, 0x63, 0x0c, 0x5b, 0x00, 0xf8, 0x0c, 0xbb, 0x02, 0x07, 0xc8, 0x15, - 0x2a, 0xd8, 0xf9, 0xdd, 0x35, 0x3b, 0x9f, 0xa1, 0x76, 0x31, 0x43, 0xed, 0x41, 0x31, 0x43, 0xf7, - 0xcb, 0xd7, 0x37, 0xf5, 0xd2, 0x2f, 0x7f, 0xd6, 0x0d, 0xc7, 0xd4, 0xe7, 0xf6, 0x04, 0xfc, 0x10, - 0xc0, 0x0b, 0xcc, 0x12, 0x1c, 0xa9, 0x8a, 0xa3, 0x9d, 0xed, 0x6d, 0x94, 0x70, 0x35, 0xed, 0xa6, - 0x9d, 0xe5, 0x9c, 0x91, 0x0e, 0x3b, 0xdb, 0xdb, 0x27, 0x1c, 0xda, 0x60, 0x55, 0x77, 0xb8, 0x4f, - 0xe3, 0x98, 0x08, 0xe4, 0x8d, 0x05, 0xe6, 0x6a, 0xec, 0x4d, 0x3b, 0x2b, 0x39, 0xd5, 0x52, 0xcc, - 0xbe, 0x24, 0xe0, 0x01, 0x68, 0x68, 0xfd, 0x8f, 0x94, 0x5d, 0x90, 0x24, 0x44, 0x1c, 0x0b, 0x94, - 0x32, 0x32, 0x72, 0x05, 0xd6, 0x87, 0x67, 0xd4, 0xe1, 0xff, 0xe7, 0xba, 0x37, 0xb9, 0xac, 0x8f, - 0x45, 0x2f, 0x17, 0xe5, 0x3e, 0x6d, 0x50, 0x7f, 0xc4, 0x47, 0x35, 0x4f, 0xa0, 0x6d, 0x66, 0x95, - 0xcd, 0xfa, 0x43, 0x9b, 0xbe, 0xd2, 0xe4, 0x2e, 0xaf, 0x00, 0xd0, 0xd3, 0x0c, 0x91, 0x40, 0xcd, - 0xbd, 0xc5, 0xfd, 0xc5, 0xc9, 0x4d, 0xdd, 0xd4, 0x65, 0xef, 0xb6, 0x1d, 0x53, 0x0b, 0xba, 0x01, - 0x7c, 0x01, 0x2a, 0x19, 0xc7, 0xec, 0x9d, 0xb2, 0x94, 0xd5, 0x25, 0x8b, 0x12, 0xbf, 0x2b, 0xca, - 0x73, 0x30, 0x87, 0x2f, 0xb1, 0x2f, 0x3d, 0xe5, 0xb0, 0x33, 0xf7, 0xc1, 0xe4, 0xa6, 0x3e, 0xdb, - 0xb9, 0xc4, 0x7e, 0xb7, 0xed, 0xcc, 0x4a, 0xaa, 0x1b, 0xec, 0x07, 0xd7, 0x6f, 0x6b, 0xa5, 0xdf, - 0xde, 0xd6, 0x4a, 0x3f, 0x4d, 0x6a, 0xc6, 0xf5, 0xa4, 0x66, 0xfc, 0x3a, 0xa9, 0x19, 0x7f, 0x4d, - 0x6a, 0xc6, 0xf7, 0x5f, 0xdf, 0xfb, 0xe2, 0x1e, 0xff, 0xb7, 0x2f, 0xee, 0xe7, 0xfa, 0xf7, 0xdb, - 0x92, 0x37, 0xab, 0xfe, 0xf7, 0x8f, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x64, 0xc1, 0xed, 0x65, - 0xc8, 0x07, 0x00, 0x00, + 0x4b, 0x6c, 0x9b, 0x65, 0xc9, 0xd0, 0xe7, 0xdb, 0xa3, 0xdd, 0x26, 0x4d, 0x05, 0xa1, 0x09, 0x6f, + 0xe6, 0x88, 0x9d, 0x32, 0x2a, 0x28, 0xac, 0xde, 0xeb, 0x6d, 0x4d, 0x8c, 0x76, 0xd7, 0xab, 0x21, + 0x0d, 0xa9, 0x12, 0x34, 0xe5, 0x2a, 0xd7, 0xae, 0xd7, 0x43, 0x4a, 0xc3, 0x08, 0x37, 0xd5, 0xce, + 0xcb, 0x2e, 0x9a, 0x82, 0xc4, 0x98, 0x0b, 0x37, 0x4e, 0x73, 0xc1, 0xe6, 0xef, 0x26, 0x98, 0x3f, + 0xcb, 0x6f, 0x81, 0x55, 0x30, 0x1b, 0x60, 0x2f, 0x0b, 0x2d, 0xa3, 0x61, 0x6c, 0x95, 0x9d, 0x7c, + 0x03, 0x0f, 0x01, 0x50, 0x0b, 0x24, 0xc6, 0x29, 0xb6, 0xa6, 0x1a, 0xc6, 0xd6, 0xf2, 0xde, 0x73, + 0xfb, 0xb1, 0x18, 0x6c, 0x6d, 0x64, 0xb7, 0xa5, 0x7e, 0x30, 0x4e, 0xb1, 0x63, 0x06, 0xc5, 0x12, + 0x3e, 0x03, 0x4b, 0x0c, 0x87, 0x84, 0x0b, 0x36, 0x46, 0x8c, 0x52, 0x61, 0x4d, 0x37, 0x8c, 0x2d, + 0xd3, 0x59, 0x2c, 0x40, 0x87, 0x52, 0x21, 0x45, 0xdc, 0x4d, 0x02, 0x8f, 0x5e, 0x21, 0x12, 0xbb, + 0x21, 0xb6, 0x66, 0x72, 0x91, 0x06, 0xbb, 0x12, 0x83, 0x2f, 0x40, 0xa5, 0x10, 0xa5, 0x91, 0x2b, + 0x2e, 0x28, 0x8b, 0xad, 0x59, 0xa5, 0x5b, 0xd1, 0x78, 0x4f, 0xc3, 0xf0, 0x07, 0xb0, 0x7a, 0xe7, + 0xc7, 0x69, 0xe4, 0xca, 0xf8, 0xac, 0x39, 0x95, 0x83, 0xfd, 0xef, 0x39, 0xf4, 0xf5, 0x8d, 0xc5, + 0x29, 0xa7, 0xb8, 0xf3, 0x0e, 0x81, 0x4d, 0x50, 0xf5, 0x28, 0x15, 0xe8, 0x82, 0x44, 0x98, 0xab, + 0x9c, 0x50, 0xea, 0x8a, 0xa1, 0x35, 0xaf, 0x62, 0x59, 0x95, 0xdc, 0xa1, 0xa4, 0x64, 0x66, 0x3d, + 0x57, 0x0c, 0xe1, 0x4b, 0x00, 0x47, 0x31, 0x4a, 0x19, 0xf5, 0x31, 0xe7, 0x94, 0x21, 0x9f, 0x66, + 0x89, 0xb0, 0xca, 0x0d, 0x63, 0x6b, 0xd6, 0xa9, 0x8c, 0xe2, 0x5e, 0x41, 0xb4, 0x24, 0x0e, 0x6d, + 0x50, 0x1d, 0xc5, 0x28, 0xc6, 0x31, 0x65, 0x63, 0xc4, 0xc9, 0x35, 0x46, 0x24, 0x41, 0xb1, 0x67, + 0x99, 0x85, 0xfe, 0x44, 0x51, 0x7d, 0x72, 0x8d, 0xbb, 0xc9, 0x89, 0x07, 0x6b, 0x00, 0xbc, 0xea, + 0x7d, 0x73, 0x7e, 0xd4, 0x96, 0x77, 0x59, 0x40, 0x05, 0xf1, 0x16, 0x02, 0xbf, 0x00, 0x1b, 0xdc, + 0x77, 0x23, 0x8c, 0xfc, 0x34, 0x43, 0x11, 0x89, 0x89, 0xe0, 0x48, 0x50, 0xa4, 0xd3, 0xb2, 0x16, + 0xd4, 0x47, 0x7f, 0xa2, 0x24, 0xad, 0x34, 0x3b, 0x56, 0x82, 0x01, 0xd5, 0x75, 0x80, 0x27, 0xe0, + 0x83, 0x00, 0x5f, 0xb8, 0x59, 0x24, 0xd0, 0x5d, 0xdd, 0x10, 0xf7, 0x99, 0x2b, 0xfc, 0xe1, 0x5d, + 0x74, 0xa1, 0x67, 0x2d, 0xaa, 0xe8, 0xea, 0x5a, 0xdb, 0x2a, 0xa4, 0xfd, 0x5c, 0x99, 0x07, 0xfb, + 0xca, 0x83, 0x5f, 0x81, 0xa7, 0x85, 0xdd, 0x28, 0x7e, 0xcc, 0x67, 0x49, 0xf9, 0x58, 0x5a, 0x74, + 0x1e, 0x3f, 0x34, 0x90, 0x2f, 0x65, 0xe8, 0x32, 0x5c, 0x9c, 0xb5, 0x96, 0x55, 0xfc, 0x8b, 0x0a, + 0xd4, 0x62, 0xd8, 0x00, 0x0b, 0xa7, 0xad, 0x1e, 0xa3, 0x57, 0xe3, 0xfd, 0x20, 0x60, 0xd6, 0x8a, + 0xaa, 0xc9, 0xdb, 0x10, 0xdc, 0x00, 0x66, 0x44, 0x43, 0x14, 0xe1, 0x11, 0x8e, 0xac, 0x8a, 0xe2, + 0xcb, 0x11, 0x0d, 0x8f, 0xe5, 0x1e, 0x7e, 0x0c, 0x9e, 0x10, 0x8a, 0x18, 0x96, 0x4f, 0x56, 0x36, + 0x0e, 0xcd, 0x84, 0x8c, 0x8e, 0x63, 0xdf, 0x5a, 0x55, 0xe1, 0xad, 0x11, 0xea, 0x48, 0x76, 0x90, + 0x93, 0xdd, 0xa4, 0x8f, 0x7d, 0xf8, 0xb3, 0x71, 0x9f, 0xdb, 0x7d, 0xa9, 0xdc, 0x24, 0xa1, 0x42, + 0xbd, 0x1b, 0x6e, 0xc1, 0xc6, 0xf4, 0xd6, 0xc2, 0xde, 0x97, 0xef, 0x6b, 0xa2, 0x77, 0x2b, 0xb8, + 0x7f, 0x6f, 0xd0, 0x49, 0x64, 0xbf, 0x6c, 0x04, 0xff, 0xac, 0x80, 0x9f, 0x00, 0x2b, 0xa1, 0x88, + 0x24, 0x43, 0xcc, 0x88, 0x40, 0x43, 0xca, 0x85, 0xca, 0xe0, 0x9a, 0x26, 0xd8, 0x5a, 0x53, 0x95, + 0xfa, 0x5f, 0x42, 0xbb, 0x39, 0x7d, 0x44, 0xb9, 0x18, 0x68, 0x12, 0x3e, 0x05, 0x80, 0xfb, 0x2c, + 0xf3, 0x50, 0x44, 0x43, 0x6e, 0x55, 0x95, 0xd4, 0x54, 0xc8, 0x31, 0x0d, 0xf9, 0xfa, 0x29, 0x68, + 0xbc, 0x2f, 0x30, 0x58, 0x01, 0xd3, 0x97, 0x78, 0xac, 0xa6, 0x88, 0xe9, 0xc8, 0xa5, 0x9c, 0x2c, + 0x23, 0x37, 0xca, 0xf2, 0xf1, 0x61, 0x3a, 0xf9, 0xe6, 0xb3, 0xa9, 0x4f, 0x8d, 0xcd, 0x17, 0xc0, + 0xbc, 0x9b, 0x16, 0xd0, 0x04, 0xb3, 0xa7, 0xbd, 0x6e, 0xaf, 0x53, 0x29, 0xc1, 0x32, 0x98, 0x39, + 0xec, 0x1e, 0x77, 0x2a, 0x06, 0x9c, 0x07, 0xd3, 0x9d, 0xc1, 0xeb, 0xca, 0xd4, 0x66, 0x13, 0x54, + 0x1e, 0x36, 0x25, 0x5c, 0x00, 0xf3, 0x3d, 0xe7, 0xac, 0xd5, 0xe9, 0xf7, 0x2b, 0x25, 0xb8, 0x0c, + 0xc0, 0xd1, 0x77, 0xbd, 0x8e, 0x73, 0xde, 0xed, 0x9f, 0x39, 0x15, 0x63, 0xf3, 0x8f, 0x69, 0xb0, + 0xac, 0x7b, 0xaa, 0x8d, 0x85, 0x4b, 0x22, 0x2e, 0xb3, 0x53, 0x73, 0x05, 0x25, 0x6e, 0x8c, 0x75, + 0x84, 0xa6, 0x42, 0x4e, 0xdd, 0x18, 0xc3, 0x16, 0x00, 0x3e, 0xc3, 0xae, 0xc0, 0x01, 0x72, 0x85, + 0x0a, 0x76, 0x61, 0x6f, 0xdd, 0xce, 0x67, 0xa8, 0x5d, 0xcc, 0x50, 0x7b, 0x50, 0xcc, 0xd0, 0x83, + 0xf2, 0xcd, 0x6d, 0xbd, 0xf4, 0xcb, 0x9f, 0x75, 0xc3, 0x31, 0xf5, 0xb9, 0x7d, 0x01, 0x3f, 0x04, + 0xf0, 0x12, 0xb3, 0x04, 0x47, 0xaa, 0xe2, 0x68, 0x77, 0x67, 0x07, 0x25, 0x5c, 0x4d, 0xbb, 0x19, + 0x67, 0x25, 0x67, 0xa4, 0xc3, 0xee, 0xce, 0xce, 0x29, 0x87, 0x36, 0x58, 0xd3, 0x1d, 0xee, 0xd3, + 0x38, 0x26, 0x02, 0x79, 0x63, 0x81, 0xb9, 0x1a, 0x7b, 0x33, 0xce, 0x6a, 0x4e, 0xb5, 0x14, 0x73, + 0x20, 0x09, 0x78, 0x08, 0x1a, 0x5a, 0xff, 0x23, 0x65, 0x97, 0x24, 0x09, 0x11, 0xc7, 0x02, 0xa5, + 0x8c, 0x8c, 0x5c, 0x81, 0xf5, 0xe1, 0x59, 0x75, 0xf8, 0xff, 0xb9, 0xee, 0x75, 0x2e, 0xeb, 0x63, + 0xd1, 0xcb, 0x45, 0xb9, 0x4f, 0x1b, 0xd4, 0x1f, 0xf1, 0x51, 0xcd, 0x13, 0x68, 0x9b, 0x39, 0x65, + 0xb3, 0xf1, 0xd0, 0xa6, 0xaf, 0x34, 0xb9, 0xcb, 0x4b, 0x00, 0xf4, 0x34, 0x43, 0x24, 0x50, 0x73, + 0x6f, 0xe9, 0x60, 0x69, 0x72, 0x5b, 0x37, 0x75, 0xd9, 0xbb, 0x6d, 0xc7, 0xd4, 0x82, 0x6e, 0x00, + 0x9f, 0x83, 0x4a, 0xc6, 0x31, 0x7b, 0xa7, 0x2c, 0x65, 0x75, 0xc9, 0x92, 0xc4, 0xef, 0x8b, 0xf2, + 0x0c, 0xcc, 0xe3, 0x2b, 0xec, 0x4b, 0x4f, 0x39, 0xec, 0xcc, 0x03, 0x30, 0xb9, 0xad, 0xcf, 0x75, + 0xae, 0xb0, 0xdf, 0x6d, 0x3b, 0x73, 0x92, 0xea, 0x06, 0x07, 0xc1, 0xcd, 0x9b, 0x5a, 0xe9, 0xb7, + 0x37, 0xb5, 0xd2, 0x4f, 0x93, 0x9a, 0x71, 0x33, 0xa9, 0x19, 0xbf, 0x4e, 0x6a, 0xc6, 0x5f, 0x93, + 0x9a, 0xf1, 0xfd, 0xd7, 0xff, 0xfd, 0x1f, 0xf7, 0x73, 0xfd, 0xfb, 0x6d, 0xc9, 0x9b, 0x53, 0xdf, + 0xfd, 0xa3, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xba, 0x6d, 0x7b, 0x04, 0xc8, 0x07, 0x00, 0x00, } func (m *Options) Marshal() (dAtA []byte, err error) { diff --git a/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go b/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go index 0b41b11b0c..9e28127151 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go @@ -11,6 +11,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -26,7 +27,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Statistics struct { // Types that are valid to be assigned to Container: @@ -52,7 +53,7 @@ func (m *Statistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Statistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -78,10 +79,10 @@ type isStatistics_Container interface { } type Statistics_Windows struct { - Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof"` + Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof" json:"windows,omitempty"` } type Statistics_Linux struct { - Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof"` + Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof" json:"linux,omitempty"` } func (*Statistics_Windows) isStatistics_Container() {} @@ -108,80 +109,14 @@ func (m *Statistics) GetLinux() *v1.Metrics { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Statistics) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Statistics_OneofMarshaler, _Statistics_OneofUnmarshaler, _Statistics_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Statistics) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Statistics_Windows)(nil), (*Statistics_Linux)(nil), } } -func _Statistics_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Statistics) - // container - switch x := m.Container.(type) { - case *Statistics_Windows: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Windows); err != nil { - return err - } - case *Statistics_Linux: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Linux); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Statistics.Container has unexpected type %T", x) - } - return nil -} - -func _Statistics_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Statistics) - switch tag { - case 1: // container.windows - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WindowsContainerStatistics) - err := b.DecodeMessage(msg) - m.Container = &Statistics_Windows{msg} - return true, err - case 2: // container.linux - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(v1.Metrics) - err := b.DecodeMessage(msg) - m.Container = &Statistics_Linux{msg} - return true, err - default: - return false, nil - } -} - -func _Statistics_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Statistics) - // container - switch x := m.Container.(type) { - case *Statistics_Windows: - s := proto.Size(x.Windows) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Statistics_Linux: - s := proto.Size(x.Linux) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type WindowsContainerStatistics struct { Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` ContainerStartTime time.Time `protobuf:"bytes,2,opt,name=container_start_time,json=containerStartTime,proto3,stdtime" json:"container_start_time"` @@ -207,7 +142,7 @@ func (m *WindowsContainerStatistics) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_WindowsContainerStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -248,7 +183,7 @@ func (m *WindowsContainerProcessorStatistics) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_WindowsContainerProcessorStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -289,7 +224,7 @@ func (m *WindowsContainerMemoryStatistics) XXX_Marshal(b []byte, deterministic b return xxx_messageInfo_WindowsContainerMemoryStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -331,7 +266,7 @@ func (m *WindowsContainerStorageStatistics) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_WindowsContainerStorageStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -371,7 +306,7 @@ func (m *VirtualMachineStatistics) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_VirtualMachineStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -410,7 +345,7 @@ func (m *VirtualMachineProcessorStatistics) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_VirtualMachineProcessorStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -451,7 +386,7 @@ func (m *VirtualMachineMemoryStatistics) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_VirtualMachineMemoryStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -496,7 +431,7 @@ func (m *VirtualMachineMemory) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_VirtualMachineMemory.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -603,7 +538,7 @@ var fileDescriptor_23217f96da3a05cc = []byte{ func (m *Statistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -611,65 +546,89 @@ func (m *Statistics) Marshal() (dAtA []byte, err error) { } func (m *Statistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Container != nil { - nn1, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VM != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VM.Size())) - n2, err := m.VM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Container != nil { + { + size := m.Container.Size() + i -= size + if _, err := m.Container.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *Statistics_Windows) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics_Windows) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Windows != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Windows.Size())) - n3, err := m.Windows.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Statistics_Linux) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics_Linux) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Linux != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Linux.Size())) - n4, err := m.Linux.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -677,71 +636,83 @@ func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - if m.UptimeNS != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Processor != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size())) - n7, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Storage != nil { + { + size, err := m.Storage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x32 } if m.Memory != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size())) - n8, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x2a } - if m.Storage != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Storage.Size())) - n9, err := m.Storage.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Processor != nil { + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.UptimeNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS)) + i-- + dAtA[i] = 0x18 + } + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintStats(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err8 != nil { + return 0, err8 } - return i, nil + i -= n8 + i = encodeVarintStats(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -749,35 +720,41 @@ func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) } func (m *WindowsContainerProcessorStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerProcessorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.TotalRuntimeNS != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) - } - if m.RuntimeUserNS != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RuntimeKernelNS != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.RuntimeKernelNS)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.RuntimeUserNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS)) + i-- + dAtA[i] = 0x10 + } + if m.TotalRuntimeNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -785,35 +762,41 @@ func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerMemoryStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerMemoryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryUsageCommitBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes)) - } - if m.MemoryUsageCommitPeakBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.MemoryUsagePrivateWorkingSetBytes != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsagePrivateWorkingSetBytes)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryUsageCommitPeakBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.MemoryUsageCommitBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -821,40 +804,46 @@ func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerStorageStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerStorageStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ReadCountNormalized != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ReadSizeBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes)) + if m.WriteSizeBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes)) + i-- + dAtA[i] = 0x20 } if m.WriteCountNormalized != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.WriteCountNormalized)) + i-- + dAtA[i] = 0x18 } - if m.WriteSizeBytes != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes)) + if m.ReadSizeBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ReadCountNormalized != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -862,40 +851,50 @@ func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Processor != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size())) - n10, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Memory != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size())) - n11, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Processor != nil { + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -903,25 +902,31 @@ func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineProcessorStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineProcessorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.TotalRuntimeNS != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -929,40 +934,48 @@ func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineMemoryStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineMemoryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkingSetBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes)) - } - if m.VirtualNodeCount != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VmMemory != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VmMemory.Size())) - n12, err := m.VmMemory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VmMemory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.VirtualNodeCount != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount)) + i-- + dAtA[i] = 0x10 + } + if m.WorkingSetBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -970,74 +983,82 @@ func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineMemory) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineMemory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.AvailableMemory != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory)) - } - if m.AvailableMemoryBuffer != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer)) - } - if m.ReservedMemory != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory)) - } - if m.AssignedMemory != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.SlpActive { - dAtA[i] = 0x28 - i++ - if m.SlpActive { + if m.DmOperationInProgress { + i-- + if m.DmOperationInProgress { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } if m.BalancingEnabled { - dAtA[i] = 0x30 - i++ + i-- if m.BalancingEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - if m.DmOperationInProgress { - dAtA[i] = 0x38 - i++ - if m.DmOperationInProgress { + if m.SlpActive { + i-- + if m.SlpActive { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.AssignedMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory)) + i-- + dAtA[i] = 0x20 + } + if m.ReservedMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory)) + i-- + dAtA[i] = 0x18 + } + if m.AvailableMemoryBuffer != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.AvailableMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintStats(dAtA []byte, offset int, v uint64) int { + offset -= sovStats(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Statistics) Size() (n int) { if m == nil { @@ -1270,14 +1291,7 @@ func (m *VirtualMachineMemory) Size() (n int) { } func sovStats(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozStats(x uint64) (n int) { return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1288,7 +1302,7 @@ func (this *Statistics) String() string { } s := strings.Join([]string{`&Statistics{`, `Container:` + fmt.Sprintf("%v", this.Container) + `,`, - `VM:` + strings.Replace(fmt.Sprintf("%v", this.VM), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`, + `VM:` + strings.Replace(this.VM.String(), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1319,12 +1333,12 @@ func (this *WindowsContainerStatistics) String() string { return "nil" } s := strings.Join([]string{`&WindowsContainerStatistics{`, - `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `ContainerStartTime:` + strings.Replace(strings.Replace(this.ContainerStartTime.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `ContainerStartTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ContainerStartTime), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `UptimeNS:` + fmt.Sprintf("%v", this.UptimeNS) + `,`, - `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`, - `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`, - `Storage:` + strings.Replace(fmt.Sprintf("%v", this.Storage), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`, + `Processor:` + strings.Replace(this.Processor.String(), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`, + `Storage:` + strings.Replace(this.Storage.String(), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1375,8 +1389,8 @@ func (this *VirtualMachineStatistics) String() string { return "nil" } s := strings.Join([]string{`&VirtualMachineStatistics{`, - `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`, - `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`, + `Processor:` + strings.Replace(this.Processor.String(), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1400,7 +1414,7 @@ func (this *VirtualMachineMemoryStatistics) String() string { s := strings.Join([]string{`&VirtualMachineMemoryStatistics{`, `WorkingSetBytes:` + fmt.Sprintf("%v", this.WorkingSetBytes) + `,`, `VirtualNodeCount:` + fmt.Sprintf("%v", this.VirtualNodeCount) + `,`, - `VmMemory:` + strings.Replace(fmt.Sprintf("%v", this.VmMemory), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`, + `VmMemory:` + strings.Replace(this.VmMemory.String(), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1572,10 +1586,7 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -1819,10 +1830,7 @@ func (m *WindowsContainerStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -1930,10 +1938,7 @@ func (m *WindowsContainerProcessorStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2041,10 +2046,7 @@ func (m *WindowsContainerMemoryStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2171,10 +2173,7 @@ func (m *WindowsContainerStorageStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2297,10 +2296,7 @@ func (m *VirtualMachineStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2370,10 +2366,7 @@ func (m *VirtualMachineProcessorStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2498,10 +2491,7 @@ func (m *VirtualMachineMemoryStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2688,10 +2678,7 @@ func (m *VirtualMachineMemory) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2710,6 +2697,7 @@ func (m *VirtualMachineMemory) Unmarshal(dAtA []byte) error { func skipStats(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2741,10 +2729,8 @@ func skipStats(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2765,55 +2751,30 @@ func skipStats(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthStats } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipStats(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStats + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStats = fmt.Errorf("proto: unexpected end of group") ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/computeagent.pb.go b/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/computeagent.pb.go index 8d7236dffd..5ec5e514a1 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/computeagent.pb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/computeagent/computeagent.pb.go @@ -11,6 +11,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -24,7 +25,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AssignPCIInternalRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -49,7 +50,7 @@ func (m *AssignPCIInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_AssignPCIInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -88,7 +89,7 @@ func (m *AssignPCIInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_AssignPCIInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -129,7 +130,7 @@ func (m *RemovePCIInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_RemovePCIInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +168,7 @@ func (m *RemovePCIInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_RemovePCIInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (m *AddNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_AddNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (m *AddNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_AddNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -287,7 +288,7 @@ func (m *ModifyNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ModifyNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -325,7 +326,7 @@ func (m *ModifyNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ModifyNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -366,7 +367,7 @@ func (m *DeleteNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_DeleteNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -404,7 +405,7 @@ func (m *DeleteNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_DeleteNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -445,7 +446,7 @@ func (m *IovSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_IovSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -530,7 +531,7 @@ var fileDescriptor_7f2f03dc308add4c = []byte{ func (m *AssignPCIInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -538,43 +539,52 @@ func (m *AssignPCIInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *AssignPCIInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignPCIInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.DeviceID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x22 } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x18 } - if len(m.NicID) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AssignPCIInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -582,26 +592,33 @@ func (m *AssignPCIInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *AssignPCIInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignPCIInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemovePCIInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -609,37 +626,45 @@ func (m *RemovePCIInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *RemovePCIInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemovePCIInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.DeviceID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RemovePCIInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -647,20 +672,26 @@ func (m *RemovePCIInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *RemovePCIInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemovePCIInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -668,42 +699,52 @@ func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *AddNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n1, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AddNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -711,20 +752,26 @@ func (m *AddNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *AddNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -732,46 +779,57 @@ func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NicID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) - } - if m.Endpoint != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n2, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovPolicySettings.Size())) - n3, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -779,20 +837,26 @@ func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -800,42 +864,52 @@ func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n4, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *DeleteNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -843,20 +917,26 @@ func (m *DeleteNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *IovSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -864,39 +944,47 @@ func (m *IovSettings) Marshal() (dAtA []byte, err error) { } func (m *IovSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IovSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.IovOffloadWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) - } - if m.QueuePairsRequested != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.InterruptModeration != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.InterruptModeration)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.QueuePairsRequested != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.IovOffloadWeight != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintComputeagent(dAtA []byte, offset int, v uint64) int { + offset -= sovComputeagent(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *AssignPCIInternalRequest) Size() (n int) { if m == nil { @@ -1106,14 +1194,7 @@ func (m *IovSettings) Size() (n int) { } func sovComputeagent(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozComputeagent(x uint64) (n int) { return sovComputeagent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1196,7 +1277,7 @@ func (this *ModifyNICInternalRequest) String() string { s := strings.Join([]string{`&ModifyNICInternalRequest{`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Any", "types.Any", 1) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovSettings", "IovSettings", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovSettings", "IovSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1504,10 +1585,7 @@ func (m *AssignPCIInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1590,10 +1668,7 @@ func (m *AssignPCIInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1727,10 +1802,7 @@ func (m *RemovePCIInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1781,10 +1853,7 @@ func (m *RemovePCIInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1935,10 +2004,7 @@ func (m *AddNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1989,10 +2055,7 @@ func (m *AddNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2147,10 +2210,7 @@ func (m *ModifyNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2201,10 +2261,7 @@ func (m *ModifyNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2355,10 +2412,7 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2409,10 +2463,7 @@ func (m *DeleteNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2520,10 +2571,7 @@ func (m *IovSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2542,6 +2590,7 @@ func (m *IovSettings) Unmarshal(dAtA []byte) error { func skipComputeagent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2573,10 +2622,8 @@ func skipComputeagent(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2597,55 +2644,30 @@ func skipComputeagent(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthComputeagent } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthComputeagent - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowComputeagent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipComputeagent(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthComputeagent - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupComputeagent + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthComputeagent + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthComputeagent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowComputeagent = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthComputeagent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowComputeagent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupComputeagent = fmt.Errorf("proto: unexpected end of group") ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/extendedtask/extendedtask.pb.go b/test/vendor/github.com/Microsoft/hcsshim/internal/extendedtask/extendedtask.pb.go index cde41d4a3f..c13f92defb 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/extendedtask/extendedtask.pb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/extendedtask/extendedtask.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ComputeProcessorInfoRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -45,7 +46,7 @@ func (m *ComputeProcessorInfoRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ComputeProcessorInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -84,7 +85,7 @@ func (m *ComputeProcessorInfoResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ComputeProcessorInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -135,7 +136,7 @@ var fileDescriptor_c90988f6b70b2a29 = []byte{ func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -143,26 +144,33 @@ func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) { } func (m *ComputeProcessorInfoRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ComputeProcessorInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintExtendedtask(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -170,29 +178,37 @@ func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) { } func (m *ComputeProcessorInfoResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ComputeProcessorInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Count != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintExtendedtask(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintExtendedtask(dAtA []byte, offset int, v uint64) int { + offset -= sovExtendedtask(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ComputeProcessorInfoRequest) Size() (n int) { if m == nil { @@ -226,14 +242,7 @@ func (m *ComputeProcessorInfoResponse) Size() (n int) { } func sovExtendedtask(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozExtendedtask(x uint64) (n int) { return sovExtendedtask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -369,10 +378,7 @@ func (m *ComputeProcessorInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthExtendedtask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExtendedtask } if (iNdEx + skippy) > l { @@ -442,10 +448,7 @@ func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthExtendedtask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExtendedtask } if (iNdEx + skippy) > l { @@ -464,6 +467,7 @@ func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error { func skipExtendedtask(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -495,10 +499,8 @@ func skipExtendedtask(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -519,55 +521,30 @@ func skipExtendedtask(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthExtendedtask } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedtask - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowExtendedtask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipExtendedtask(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedtask - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupExtendedtask + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthExtendedtask + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupExtendedtask = fmt.Errorf("proto: unexpected end of group") ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/ncproxyttrpc/networkconfigproxy.pb.go b/test/vendor/github.com/Microsoft/hcsshim/internal/ncproxyttrpc/networkconfigproxy.pb.go index a0fa845090..39ac60ed87 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/ncproxyttrpc/networkconfigproxy.pb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/ncproxyttrpc/networkconfigproxy.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RequestTypeInternal int32 @@ -71,7 +72,7 @@ func (m *RegisterComputeAgentRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RegisterComputeAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -109,7 +110,7 @@ func (m *RegisterComputeAgentResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RegisterComputeAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -148,7 +149,7 @@ func (m *UnregisterComputeAgentRequest) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_UnregisterComputeAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -186,7 +187,7 @@ func (m *UnregisterComputeAgentResponse) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_UnregisterComputeAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -226,7 +227,7 @@ func (m *ConfigureNetworkingInternalRequest) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_ConfigureNetworkingInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (m *ConfigureNetworkingInternalResponse) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ConfigureNetworkingInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -332,7 +333,7 @@ var fileDescriptor_11f9efc6dfbf9b45 = []byte{ func (m *RegisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -340,32 +341,40 @@ func (m *RegisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *RegisterComputeAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterComputeAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.AgentAddress) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.AgentAddress))) - i += copy(dAtA[i:], m.AgentAddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.AgentAddress) > 0 { + i -= len(m.AgentAddress) + copy(dAtA[i:], m.AgentAddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.AgentAddress))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RegisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -373,20 +382,26 @@ func (m *RegisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *RegisterComputeAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterComputeAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *UnregisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -394,26 +409,33 @@ func (m *UnregisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *UnregisterComputeAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnregisterComputeAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UnregisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -421,20 +443,26 @@ func (m *UnregisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *UnregisterComputeAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnregisterComputeAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -442,31 +470,38 @@ func (m *ConfigureNetworkingInternalRequest) Marshal() (dAtA []byte, err error) } func (m *ConfigureNetworkingInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RequestType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -474,24 +509,32 @@ func (m *ConfigureNetworkingInternalResponse) Marshal() (dAtA []byte, err error) } func (m *ConfigureNetworkingInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNetworkconfigproxy(dAtA []byte, offset int, v uint64) int { + offset -= sovNetworkconfigproxy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *RegisterComputeAgentRequest) Size() (n int) { if m == nil { @@ -585,14 +628,7 @@ func (m *ConfigureNetworkingInternalResponse) Size() (n int) { } func sovNetworkconfigproxy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNetworkconfigproxy(x uint64) (n int) { return sovNetworkconfigproxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -835,10 +871,7 @@ func (m *RegisterComputeAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -889,10 +922,7 @@ func (m *RegisterComputeAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -975,10 +1005,7 @@ func (m *UnregisterComputeAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1029,10 +1056,7 @@ func (m *UnregisterComputeAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1134,10 +1158,7 @@ func (m *ConfigureNetworkingInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1188,10 +1209,7 @@ func (m *ConfigureNetworkingInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1210,6 +1228,7 @@ func (m *ConfigureNetworkingInternalResponse) Unmarshal(dAtA []byte) error { func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1241,10 +1260,8 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1265,55 +1282,30 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNetworkconfigproxy } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetworkconfigproxy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNetworkconfigproxy(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNetworkconfigproxy + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNetworkconfigproxy = fmt.Errorf("proto: unexpected end of group") ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.pb.go b/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.pb.go index 7a44c3064c..84ca8aa334 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.pb.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/shimdiag/shimdiag.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ExecProcessRequest struct { Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` @@ -50,7 +51,7 @@ func (m *ExecProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ExecProcessRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -89,7 +90,7 @@ func (m *ExecProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ExecProcessResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -127,7 +128,7 @@ func (m *StacksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StacksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +168,7 @@ func (m *StacksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_StacksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (m *ShareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ShareRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (m *ShareResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ShareResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -284,7 +285,7 @@ func (m *PidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PidRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -323,7 +324,7 @@ func (m *PidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -398,7 +399,7 @@ var fileDescriptor_c7933dc6ffbb8784 = []byte{ func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -406,69 +407,73 @@ func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) { } func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Args) > 0 { - for _, s := range m.Args { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Workdir) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Workdir))) - i += copy(dAtA[i:], m.Workdir) + if len(m.Stderr) > 0 { + i -= len(m.Stderr) + copy(dAtA[i:], m.Stderr) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stderr))) + i-- + dAtA[i] = 0x32 + } + if len(m.Stdout) > 0 { + i -= len(m.Stdout) + copy(dAtA[i:], m.Stdout) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdout))) + i-- + dAtA[i] = 0x2a + } + if len(m.Stdin) > 0 { + i -= len(m.Stdin) + copy(dAtA[i:], m.Stdin) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdin))) + i-- + dAtA[i] = 0x22 } if m.Terminal { - dAtA[i] = 0x18 - i++ + i-- if m.Terminal { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.Stdin) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdin))) - i += copy(dAtA[i:], m.Stdin) - } - if len(m.Stdout) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdout))) - i += copy(dAtA[i:], m.Stdout) + i-- + dAtA[i] = 0x18 } - if len(m.Stderr) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stderr))) - i += copy(dAtA[i:], m.Stderr) + if len(m.Workdir) > 0 { + i -= len(m.Workdir) + copy(dAtA[i:], m.Workdir) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Workdir))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -476,25 +481,31 @@ func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) { } func (m *ExecProcessResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ExitCode != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintShimdiag(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StacksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -502,20 +513,26 @@ func (m *StacksRequest) Marshal() (dAtA []byte, err error) { } func (m *StacksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StacksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *StacksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -523,32 +540,40 @@ func (m *StacksResponse) Marshal() (dAtA []byte, err error) { } func (m *StacksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StacksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Stacks) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stacks))) - i += copy(dAtA[i:], m.Stacks) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.GuestStacks) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.GuestStacks) + copy(dAtA[i:], m.GuestStacks) i = encodeVarintShimdiag(dAtA, i, uint64(len(m.GuestStacks))) - i += copy(dAtA[i:], m.GuestStacks) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Stacks) > 0 { + i -= len(m.Stacks) + copy(dAtA[i:], m.Stacks) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stacks))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ShareRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -556,42 +581,50 @@ func (m *ShareRequest) Marshal() (dAtA []byte, err error) { } func (m *ShareRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.HostPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if len(m.UvmPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.UvmPath))) - i += copy(dAtA[i:], m.UvmPath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x18 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.UvmPath) > 0 { + i -= len(m.UvmPath) + copy(dAtA[i:], m.UvmPath) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.UvmPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ShareResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -599,20 +632,26 @@ func (m *ShareResponse) Marshal() (dAtA []byte, err error) { } func (m *ShareResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -620,20 +659,26 @@ func (m *PidRequest) Marshal() (dAtA []byte, err error) { } func (m *PidRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PidResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -641,29 +686,37 @@ func (m *PidResponse) Marshal() (dAtA []byte, err error) { } func (m *PidResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Pid != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintShimdiag(dAtA, i, uint64(m.Pid)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintShimdiag(dAtA []byte, offset int, v uint64) int { + offset -= sovShimdiag(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ExecProcessRequest) Size() (n int) { if m == nil { @@ -812,14 +865,7 @@ func (m *PidResponse) Size() (n int) { } func sovShimdiag(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozShimdiag(x uint64) (n int) { return sovShimdiag(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1222,10 +1268,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1295,10 +1338,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1349,10 +1389,7 @@ func (m *StacksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1467,10 +1504,7 @@ func (m *StacksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1605,10 +1639,7 @@ func (m *ShareRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1659,10 +1690,7 @@ func (m *ShareResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1713,10 +1741,7 @@ func (m *PidRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1786,10 +1811,7 @@ func (m *PidResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1808,6 +1830,7 @@ func (m *PidResponse) Unmarshal(dAtA []byte) error { func skipShimdiag(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1839,10 +1862,8 @@ func skipShimdiag(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1863,55 +1884,30 @@ func skipShimdiag(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthShimdiag } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthShimdiag - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowShimdiag - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipShimdiag(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthShimdiag - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupShimdiag + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthShimdiag + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthShimdiag = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowShimdiag = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthShimdiag = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowShimdiag = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupShimdiag = fmt.Errorf("proto: unexpected end of group") ) From 2957199154505ce5b884004ed4fe51ca68df985e Mon Sep 17 00:00:00 2001 From: Danny Canter <36526702+dcantah@users.noreply.github.com> Date: Thu, 7 Apr 2022 10:00:29 -0700 Subject: [PATCH 5/7] Pin go version for linter to 1.17.x (#1346) Some of the tooling golangci-lint uses doesn't fully support 1.18 yet resulting in a bunch of hard to decode errors. We were using ^1.17.0 as our version listed so we ended up resolving to 1.18 a couple of days ago and finally ran into this. v1.45.0 of golangci-lint has a workaround for this which is disabling some of the problematic linters, but these are some of our most used. This seems like a sane fix for now until the kinks are worked out and things are working on 1.18. Signed-off-by: Daniel Canter --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34b7a8c7c9..6762da403d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,13 +59,14 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: - go-version: '^1.17.0' + go-version: '1.17.8' - name: golangci-lint uses: golangci/golangci-lint-action@v2 with: version: v1.42.1 # Has fixes for stylecheck configuration https://github.com/golangci/golangci-lint/pull/2017/files args: -v + skip-go-installation: true only-new-issues: true verify-main-vendor: @@ -201,4 +202,4 @@ jobs: - name: Build And Test run: | BASE=./base.tar.gz - make all test + make all test \ No newline at end of file From 70b87e3d4b7ca6dd33335a01f2b8241178d1f686 Mon Sep 17 00:00:00 2001 From: Maksim An Date: Thu, 7 Apr 2022 18:07:52 -0700 Subject: [PATCH 6/7] Add tests for security policy enforcement (#1325) Add basic positive and negative tests for security policy enforcement. Hide policy tests behind LCOWIntegrity feature flag. Add ContainerConfigOpt and builder functions for creating security policy configs. Signed-off-by: Maksim An --- pkg/securitypolicy/opts.go | 27 +++ test/cri-containerd/layer_integrity_test.go | 4 +- test/cri-containerd/policy_test.go | 175 ++++++++++++++++-- .../hcsshim/pkg/securitypolicy/opts.go | 27 +++ 4 files changed, 212 insertions(+), 21 deletions(-) create mode 100644 pkg/securitypolicy/opts.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/opts.go diff --git a/pkg/securitypolicy/opts.go b/pkg/securitypolicy/opts.go new file mode 100644 index 0000000000..32885ce666 --- /dev/null +++ b/pkg/securitypolicy/opts.go @@ -0,0 +1,27 @@ +package securitypolicy + +type ContainerConfigOpt func(*ContainerConfig) error + +// WithEnvVarRules adds environment variable constraints to container policy config. +func WithEnvVarRules(envs []EnvRuleConfig) ContainerConfigOpt { + return func(c *ContainerConfig) error { + c.EnvRules = append(c.EnvRules, envs...) + return nil + } +} + +// WithExpectedMounts adds expected mounts to container policy config. +func WithExpectedMounts(em []string) ContainerConfigOpt { + return func(c *ContainerConfig) error { + c.ExpectedMounts = append(c.ExpectedMounts, em...) + return nil + } +} + +// WithWorkingDir sets working directory in container policy config. +func WithWorkingDir(wd string) ContainerConfigOpt { + return func(c *ContainerConfig) error { + c.WorkingDir = wd + return nil + } +} diff --git a/test/cri-containerd/layer_integrity_test.go b/test/cri-containerd/layer_integrity_test.go index b4ae92ea59..b9b8f94457 100644 --- a/test/cri-containerd/layer_integrity_test.go +++ b/test/cri-containerd/layer_integrity_test.go @@ -14,7 +14,7 @@ import ( ) func Test_LCOW_Layer_Integrity(t *testing.T) { - requireFeatures(t, featureLCOWIntegrity, featureLCOW) + requireFeatures(t, featureLCOW, featureLCOWIntegrity) client := newTestRuntimeClient(t) ctx, cancel := context.WithCancel(context.Background()) @@ -85,7 +85,7 @@ func Test_LCOW_Layer_Integrity(t *testing.T) { // Validate that verity target(s) present output := shimDiagExecOutput(ctx, t, podID, []string{"ls", "-l", "/dev/mapper"}) - filtered := filterStrings(strings.Split(output, "\n"), fmt.Sprintf("dm-verity-%s", scenario.layerType)) + filtered := filterStrings(strings.Split(output, "\n"), fmt.Sprintf("verity-%s", scenario.layerType)) if len(filtered) == 0 { t.Fatalf("expected verity targets for %s devices, none found.\n%s\n", scenario.layerType, output) } diff --git a/test/cri-containerd/policy_test.go b/test/cri-containerd/policy_test.go index 2f8d5e8d8b..334ab6012e 100644 --- a/test/cri-containerd/policy_test.go +++ b/test/cri-containerd/policy_test.go @@ -9,25 +9,17 @@ import ( "strings" "testing" + runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" + "github.com/Microsoft/hcsshim/internal/tools/securitypolicy/helpers" "github.com/Microsoft/hcsshim/pkg/annotations" "github.com/Microsoft/hcsshim/pkg/securitypolicy" - "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ) var ( validPolicyAlpineCommand = []string{"ash", "-c", "echo 'Hello'"} ) -type configOpt func(*securitypolicy.ContainerConfig) error - -func withExpectedMounts(em []string) configOpt { - return func(conf *securitypolicy.ContainerConfig) error { - conf.ExpectedMounts = append(conf.ExpectedMounts, em...) - return nil - } -} - func securityPolicyFromContainers(containers []securitypolicy.ContainerConfig) (string, error) { pc, err := helpers.PolicyContainersFromConfigs(containers) if err != nil { @@ -50,7 +42,7 @@ func sandboxSecurityPolicy(t *testing.T) string { return policyString } -func alpineSecurityPolicy(t *testing.T) string { +func alpineSecurityPolicy(t *testing.T, opts ...securitypolicy.ContainerConfigOpt) string { defaultContainers := helpers.DefaultContainerConfigs() alpineContainer := securitypolicy.NewContainerConfig( "alpine:latest", @@ -61,6 +53,12 @@ func alpineSecurityPolicy(t *testing.T) string { []string{}, ) + for _, o := range opts { + if err := o(&alpineContainer); err != nil { + t.Fatalf("failed to apply config opt: %s", err) + } + } + containers := append(defaultContainers, alpineContainer) policyString, err := securityPolicyFromContainers(containers) if err != nil { @@ -69,7 +67,7 @@ func alpineSecurityPolicy(t *testing.T) string { return policyString } -func sandboxRequestWithPolicy(t *testing.T, policy string) *v1alpha2.RunPodSandboxRequest { +func sandboxRequestWithPolicy(t *testing.T, policy string) *runtime.RunPodSandboxRequest { return getRunPodSandboxRequest( t, lcowRuntimeHandler, @@ -82,7 +80,7 @@ func sandboxRequestWithPolicy(t *testing.T, policy string) *v1alpha2.RunPodSandb } func Test_RunPodSandbox_WithPolicy_Allowed(t *testing.T) { - requireFeatures(t, featureLCOW) + requireFeatures(t, featureLCOW, featureLCOWIntegrity) pullRequiredLCOWImages(t, []string{imageLcowK8sPause}) sandboxPolicy := sandboxSecurityPolicy(t) @@ -99,7 +97,7 @@ func Test_RunPodSandbox_WithPolicy_Allowed(t *testing.T) { } func Test_RunSimpleAlpineContainer_WithPolicy_Allowed(t *testing.T) { - requireFeatures(t, featureLCOW) + requireFeatures(t, featureLCOW, featureLCOWIntegrity) pullRequiredLCOWImages(t, []string{imageLcowK8sPause, imageLcowAlpine}) alpinePolicy := alpineSecurityPolicy(t) @@ -148,8 +146,8 @@ func syncContainerConfigs(writePath, waitPath string) (writer, waiter *securityp func syncContainerRequests( writer, waiter *securitypolicy.ContainerConfig, podID string, - podConfig *v1alpha2.PodSandboxConfig, -) (writerReq, waiterReq *v1alpha2.CreateContainerRequest) { + podConfig *runtime.PodSandboxConfig, +) (writerReq, waiterReq *runtime.CreateContainerRequest) { writerReq = getCreateContainerRequest( podID, "alpine-writer", @@ -157,7 +155,7 @@ func syncContainerRequests( writer.Command, podConfig, ) - writerReq.Config.Mounts = append(writerReq.Config.Mounts, &v1alpha2.Mount{ + writerReq.Config.Mounts = append(writerReq.Config.Mounts, &runtime.Mount{ HostPath: "sandbox://host/path", ContainerPath: "/mnt/shared/container-A", }) @@ -169,7 +167,7 @@ func syncContainerRequests( waiter.Command, podConfig, ) - waiterReq.Config.Mounts = append(waiterReq.Config.Mounts, &v1alpha2.Mount{ + waiterReq.Config.Mounts = append(waiterReq.Config.Mounts, &runtime.Mount{ // The HostPath must be the same as for the "writer" container HostPath: "sandbox://host/path", ContainerPath: "/mnt/shared/container-B", @@ -246,7 +244,7 @@ func Test_RunContainers_WithSyncHooks_InvalidWaitPath(t *testing.T) { defer removeContainer(t, client, ctx, cidWriter) defer stopContainer(t, client, ctx, cidWriter) - _, err = client.StartContainer(ctx, &v1alpha2.StartContainerRequest{ + _, err = client.StartContainer(ctx, &runtime.StartContainerRequest{ ContainerId: cidWaiter, }) expectedErrString := "timeout while waiting for path" @@ -260,3 +258,142 @@ func Test_RunContainers_WithSyncHooks_InvalidWaitPath(t *testing.T) { } } } + +func Test_RunContainer_ValidContainerConfigs_Allowed(t *testing.T) { + type sideEffect func(*runtime.CreateContainerRequest) + type config struct { + name string + sf sideEffect + opts []securitypolicy.ContainerConfigOpt + } + + requireFeatures(t, featureLCOW, featureLCOWIntegrity) + pullRequiredLCOWImages(t, []string{imageLcowK8sPause, imageLcowAlpine}) + + client := newTestRuntimeClient(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + for _, testConfig := range []config{ + { + name: "WorkingDir", + sf: func(req *runtime.CreateContainerRequest) { + req.Config.WorkingDir = "/root" + }, + opts: []securitypolicy.ContainerConfigOpt{securitypolicy.WithWorkingDir("/root")}, + }, + { + name: "EnvironmentVariable", + sf: func(req *runtime.CreateContainerRequest) { + req.Config.Envs = append(req.Config.Envs, &runtime.KeyValue{ + Key: "KEY", + Value: "VALUE", + }) + }, + opts: []securitypolicy.ContainerConfigOpt{ + securitypolicy.WithEnvVarRules( + []securitypolicy.EnvRuleConfig{ + { + Strategy: securitypolicy.EnvVarRuleString, + Rule: "KEY=VALUE", + }, + }), + }, + }, + } { + t.Run(testConfig.name, func(t *testing.T) { + alpinePolicy := alpineSecurityPolicy(t, testConfig.opts...) + sandboxRequest := sandboxRequestWithPolicy(t, alpinePolicy) + + podID := runPodSandbox(t, client, ctx, sandboxRequest) + defer removePodSandbox(t, client, ctx, podID) + defer stopPodSandbox(t, client, ctx, podID) + + containerRequest := getCreateContainerRequest( + podID, + "alpine-with-policy", + "alpine:latest", + validPolicyAlpineCommand, + sandboxRequest.Config, + ) + testConfig.sf(containerRequest) + + containerID := createContainer(t, client, ctx, containerRequest) + startContainer(t, client, ctx, containerID) + defer removeContainer(t, client, ctx, containerID) + defer stopContainer(t, client, ctx, containerID) + }) + } +} + +func Test_RunContainer_InvalidContainerConfigs_NotAllowed(t *testing.T) { + type sideEffect func(*runtime.CreateContainerRequest) + type config struct { + name string + sf sideEffect + expectedError string + } + + requireFeatures(t, featureLCOW, featureLCOWIntegrity) + pullRequiredLCOWImages(t, []string{imageLcowK8sPause, imageLcowAlpine}) + + client := newTestRuntimeClient(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + alpinePolicy := alpineSecurityPolicy(t) + for _, testConfig := range []config{ + { + name: "InvalidWorkingDir", + sf: func(req *runtime.CreateContainerRequest) { + req.Config.WorkingDir = "/non/existent" + }, + expectedError: "working_dir \"/non/existent\" unmatched by policy rule", + }, + { + name: "InvalidCommand", + sf: func(req *runtime.CreateContainerRequest) { + req.Config.Command = []string{"ash", "-c", "echo 'invalid command'"} + }, + expectedError: "command [ash -c echo 'invalid command'] doesn't match policy", + }, + { + name: "InvalidEnvironmentVariable", + sf: func(req *runtime.CreateContainerRequest) { + req.Config.Envs = append(req.Config.Envs, &runtime.KeyValue{ + Key: "KEY", + Value: "VALUE", + }) + }, + expectedError: "env variable KEY=VALUE unmatched by policy rule", + }, + } { + t.Run(testConfig.name, func(t *testing.T) { + sandboxRequest := sandboxRequestWithPolicy(t, alpinePolicy) + + podID := runPodSandbox(t, client, ctx, sandboxRequest) + defer removePodSandbox(t, client, ctx, podID) + defer stopPodSandbox(t, client, ctx, podID) + + containerRequest := getCreateContainerRequest( + podID, + "alpine-with-policy", + "alpine:latest", + validPolicyAlpineCommand, + sandboxRequest.Config, + ) + testConfig.sf(containerRequest) + + containerID := createContainer(t, client, ctx, containerRequest) + _, err := client.StartContainer(ctx, &runtime.StartContainerRequest{ + ContainerId: containerID, + }) + if err == nil { + t.Fatal("expected container start failure") + } + if !strings.Contains(err.Error(), testConfig.expectedError) { + t.Fatalf("expected %q in error message, got: %q", testConfig.expectedError, err) + } + }) + } +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/opts.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/opts.go new file mode 100644 index 0000000000..32885ce666 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/opts.go @@ -0,0 +1,27 @@ +package securitypolicy + +type ContainerConfigOpt func(*ContainerConfig) error + +// WithEnvVarRules adds environment variable constraints to container policy config. +func WithEnvVarRules(envs []EnvRuleConfig) ContainerConfigOpt { + return func(c *ContainerConfig) error { + c.EnvRules = append(c.EnvRules, envs...) + return nil + } +} + +// WithExpectedMounts adds expected mounts to container policy config. +func WithExpectedMounts(em []string) ContainerConfigOpt { + return func(c *ContainerConfig) error { + c.ExpectedMounts = append(c.ExpectedMounts, em...) + return nil + } +} + +// WithWorkingDir sets working directory in container policy config. +func WithWorkingDir(wd string) ContainerConfigOpt { + return func(c *ContainerConfig) error { + c.WorkingDir = wd + return nil + } +} From 2028de8b8d5e0516e0e65664f9085dab02a6a5e2 Mon Sep 17 00:00:00 2001 From: Maksim An Date: Sun, 10 Apr 2022 15:10:13 -0700 Subject: [PATCH 7/7] Fix working_dir negative test error expectation (#1348) Signed-off-by: Maksim An --- test/cri-containerd/policy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cri-containerd/policy_test.go b/test/cri-containerd/policy_test.go index 334ab6012e..e4b9421807 100644 --- a/test/cri-containerd/policy_test.go +++ b/test/cri-containerd/policy_test.go @@ -348,7 +348,7 @@ func Test_RunContainer_InvalidContainerConfigs_NotAllowed(t *testing.T) { sf: func(req *runtime.CreateContainerRequest) { req.Config.WorkingDir = "/non/existent" }, - expectedError: "working_dir \"/non/existent\" unmatched by policy rule", + expectedError: "working_dir /non/existent unmatched by policy rule", }, { name: "InvalidCommand",