From 78d741911e62c5acd84516e410f23af7d706fda5 Mon Sep 17 00:00:00 2001 From: Daniel Canter Date: Wed, 6 Oct 2021 12:52:39 -0700 Subject: [PATCH] Set default time zone for WCOW UVM For the v2 hcs code paths it seems the only time a time zone is set is if a new field on the guest connection settings is present (which we don't have) while using the internal guest connection (shim -> hcs -> gcs). Otherwise the guest is just left without a time zone set, so things like tzutil or the get-timezone powershell cmdlet will return an invalid time zone set. We swapped to always using the external guest connection we maintain in the shim so we need to set a time zone explicitly. This change issues a request to the gcs to set a timezone via the same method that hcs uses internally. It sets the guests time zone to whatever is present on the host which is the docker behavior, and then all containers in the vm should inherit this. Additionally expose an option to override this behavior and just set the time zone to GMT. If the container wants to change its timezone to something else, it is free to on supported images. See https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/virtual-time-zone Signed-off-by: Daniel Canter --- .../options/runhcs.pb.go | 601 ++++++++++-------- .../options/runhcs.proto | 6 +- internal/gcs/guestconnection.go | 28 +- internal/gcs/protocol.go | 3 +- internal/hcs/schema2/system_time.go | 28 + internal/hcs/schema2/time_zone_information.go | 26 + internal/oci/uvm.go | 1 + internal/uvm/create_wcow.go | 4 + internal/uvm/start.go | 26 +- internal/uvm/timezone.go | 58 ++ internal/uvm/types.go | 4 + pkg/annotations/annotations.go | 4 + test/cri-containerd/main_test.go | 3 +- test/cri-containerd/runpodsandbox_test.go | 140 ++++ .../test-images/timezone/dockerfile | 10 + .../test-images/timezone/main.go | 17 + .../options/runhcs.pb.go | 601 ++++++++++-------- .../options/runhcs.proto | 6 +- .../hcsshim/internal/gcs/guestconnection.go | 28 +- .../hcsshim/internal/gcs/protocol.go | 3 +- .../internal/hcs/schema2/system_time.go | 28 + .../hcs/schema2/time_zone_information.go | 26 + .../Microsoft/hcsshim/internal/oci/uvm.go | 1 + .../hcsshim/internal/uvm/create_wcow.go | 4 + .../Microsoft/hcsshim/internal/uvm/start.go | 26 +- .../hcsshim/internal/uvm/timezone.go | 58 ++ .../Microsoft/hcsshim/internal/uvm/types.go | 4 + .../hcsshim/pkg/annotations/annotations.go | 4 + 28 files changed, 1173 insertions(+), 575 deletions(-) create mode 100644 internal/hcs/schema2/system_time.go create mode 100644 internal/hcs/schema2/time_zone_information.go create mode 100644 internal/uvm/timezone.go create mode 100644 test/cri-containerd/test-images/timezone/dockerfile create mode 100644 test/cri-containerd/test-images/timezone/main.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/system_time.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/time_zone_information.go create mode 100644 test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index ff04b224fe..f3b8ca404b 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -11,7 +11,6 @@ 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" @@ -27,7 +26,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.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Options_DebugType int32 @@ -148,9 +147,12 @@ type Options struct { IoRetryTimeoutInSec int32 `protobuf:"varint,17,opt,name=io_retry_timeout_in_sec,json=ioRetryTimeoutInSec,proto3" json:"io_retry_timeout_in_sec,omitempty"` // default_container_annotations specifies a set of annotations that should be set for every workload container DefaultContainerAnnotations map[string]string `protobuf:"bytes,18,rep,name=default_container_annotations,json=defaultContainerAnnotations,proto3" json:"default_container_annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // no_inherit_host_timezone specifies to skip inheriting the hosts time zone for WCOW UVMs and instead default to + // UTC. + NoInheritHostTimezone bool `protobuf:"varint,19,opt,name=no_inherit_host_timezone,json=noInheritHostTimezone,proto3" json:"no_inherit_host_timezone,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Options) Reset() { *m = Options{} } @@ -166,7 +168,7 @@ func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Options.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -215,7 +217,7 @@ func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -247,77 +249,80 @@ func init() { } var fileDescriptor_b643df6839c75082 = []byte{ - // 1022 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4b, 0x6f, 0xdb, 0x46, - 0x17, 0x15, 0xfd, 0x14, 0xaf, 0x5f, 0xf4, 0xc4, 0x40, 0x08, 0xfb, 0x8b, 0x24, 0x38, 0x1f, 0x10, - 0x07, 0x8d, 0x49, 0xdb, 0xed, 0xa2, 0x68, 0x8b, 0x16, 0xb6, 0x24, 0x27, 0x2a, 0xfc, 0x10, 0x28, - 0xd7, 0xe9, 0x63, 0x31, 0xe0, 0x63, 0x4c, 0x11, 0x26, 0x39, 0x04, 0x67, 0xa8, 0x5a, 0x59, 0xb5, - 0xfd, 0x05, 0xfd, 0x59, 0x5e, 0x76, 0x59, 0xa0, 0x80, 0xdb, 0xe8, 0x97, 0x14, 0x33, 0x1c, 0xda, - 0x89, 0xe1, 0x36, 0x8b, 0xae, 0x34, 0x73, 0xce, 0x99, 0x33, 0xf7, 0x5e, 0xce, 0xbd, 0x82, 0xd3, - 0x30, 0xe2, 0xc3, 0xc2, 0xb3, 0x7c, 0x9a, 0xd8, 0xc7, 0x91, 0x9f, 0x53, 0x46, 0x2f, 0xb8, 0x3d, - 0xf4, 0x19, 0x1b, 0x46, 0x89, 0xed, 0x27, 0x81, 0xed, 0xd3, 0x94, 0xbb, 0x51, 0x4a, 0xf2, 0x60, - 0x5b, 0x60, 0xdb, 0x79, 0x91, 0x0e, 0x7d, 0xb6, 0x3d, 0xda, 0xb5, 0x69, 0xc6, 0x23, 0x9a, 0x32, - 0xbb, 0x44, 0xac, 0x2c, 0xa7, 0x9c, 0xa2, 0xb5, 0x3b, 0xbd, 0xa5, 0x88, 0xd1, 0xee, 0xfa, 0x5a, - 0x48, 0x43, 0x2a, 0x05, 0xb6, 0x58, 0x95, 0xda, 0xf5, 0x66, 0x48, 0x69, 0x18, 0x13, 0x5b, 0xee, - 0xbc, 0xe2, 0xc2, 0xe6, 0x51, 0x42, 0x18, 0x77, 0x93, 0xac, 0x14, 0x6c, 0xfe, 0xac, 0xc3, 0xfc, - 0x69, 0x79, 0x0b, 0x5a, 0x83, 0xd9, 0x80, 0x78, 0x45, 0x68, 0x6a, 0x2d, 0x6d, 0xab, 0xee, 0x94, - 0x1b, 0x74, 0x08, 0x20, 0x17, 0x98, 0x8f, 0x33, 0x62, 0x4e, 0xb5, 0xb4, 0xad, 0xe5, 0xbd, 0x67, - 0xd6, 0x43, 0x31, 0x58, 0xca, 0xc8, 0xea, 0x08, 0xfd, 0xd9, 0x38, 0x23, 0x8e, 0x1e, 0x54, 0x4b, - 0xf4, 0x14, 0x96, 0x72, 0x12, 0x46, 0x8c, 0xe7, 0x63, 0x9c, 0x53, 0xca, 0xcd, 0xe9, 0x96, 0xb6, - 0xa5, 0x3b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0x49, 0x43, 0xfb, - 0xfe, 0xeb, 0xff, 0xfe, 0xcf, 0xf8, 0xb9, 0xfa, 0xfd, 0xb6, 0xe6, 0xcd, 0xc9, 0xef, 0xfe, 0xf1, - 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x5f, 0x16, 0x8d, 0x70, 0x07, 0x00, 0x00, + // 1058 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x5d, 0x4f, 0x23, 0x37, + 0x17, 0xce, 0x2c, 0x5f, 0x99, 0xc3, 0x02, 0xc1, 0xf0, 0x6a, 0x47, 0xf0, 0x6e, 0x12, 0xb1, 0x95, + 0x96, 0x55, 0x97, 0x09, 0xd0, 0x4a, 0xad, 0xda, 0xaa, 0x15, 0x24, 0x61, 0x49, 0xc5, 0x47, 0x34, + 0x49, 0xd9, 0x7e, 0x5c, 0x58, 0x93, 0x19, 0x33, 0xb1, 0x98, 0x19, 0x47, 0xb6, 0x93, 0x12, 0xae, + 0xaa, 0xfe, 0x82, 0xfe, 0x9e, 0xfe, 0x02, 0x2e, 0x7b, 0x59, 0xa9, 0x12, 0xed, 0xe6, 0x97, 0x54, + 0xf6, 0x78, 0x60, 0x17, 0xd1, 0xee, 0x45, 0xaf, 0x62, 0x3f, 0xcf, 0xe3, 0xc7, 0xe7, 0x9c, 0xf1, + 0x39, 0x81, 0xd3, 0x88, 0xca, 0xfe, 0xb0, 0xe7, 0x06, 0x2c, 0xa9, 0x1d, 0xd3, 0x80, 0x33, 0xc1, + 0xce, 0x65, 0xad, 0x1f, 0x08, 0xd1, 0xa7, 0x49, 0x2d, 0x48, 0xc2, 0x5a, 0xc0, 0x52, 0xe9, 0xd3, + 0x94, 0xf0, 0x70, 0x4b, 0x61, 0x5b, 0x7c, 0x98, 0xf6, 0x03, 0xb1, 0x35, 0xda, 0xa9, 0xb1, 0x81, + 0xa4, 0x2c, 0x15, 0xb5, 0x0c, 0x71, 0x07, 0x9c, 0x49, 0x86, 0x56, 0xef, 0xf4, 0xae, 0x21, 0x46, + 0x3b, 0x6b, 0xab, 0x11, 0x8b, 0x98, 0x16, 0xd4, 0xd4, 0x2a, 0xd3, 0xae, 0x55, 0x22, 0xc6, 0xa2, + 0x98, 0xd4, 0xf4, 0xae, 0x37, 0x3c, 0xaf, 0x49, 0x9a, 0x10, 0x21, 0xfd, 0x64, 0x90, 0x09, 0x36, + 0x7e, 0xb5, 0x61, 0xee, 0x34, 0xbb, 0x05, 0xad, 0xc2, 0x4c, 0x48, 0x7a, 0xc3, 0xc8, 0xb1, 0xaa, + 0xd6, 0x66, 0xd1, 0xcb, 0x36, 0xe8, 0x00, 0x40, 0x2f, 0xb0, 0x1c, 0x0f, 0x88, 0xf3, 0xa8, 0x6a, + 0x6d, 0x2e, 0xee, 0x3e, 0x77, 0x1f, 0x8a, 0xc1, 0x35, 0x46, 0x6e, 0x43, 0xe9, 0xbb, 0xe3, 0x01, + 0xf1, 0xec, 0x30, 0x5f, 0xa2, 0x67, 0xb0, 0xc0, 0x49, 0x44, 0x85, 0xe4, 0x63, 0xcc, 0x19, 0x93, + 0xce, 0x54, 0xd5, 0xda, 0xb4, 0xbd, 0xc7, 0x39, 0xe8, 0x31, 0x26, 0x95, 0x48, 0xf8, 0x69, 0xd8, + 0x63, 0x97, 0x98, 0x26, 0x7e, 0x44, 0x9c, 0xe9, 0x4c, 0x64, 0xc0, 0x96, 0xc2, 0xd0, 0x0b, 0x28, + 0xe5, 0xa2, 0x41, 0xec, 0xcb, 0x73, 0xc6, 0x13, 0x67, 0x46, 0xeb, 0x96, 0x0c, 0xde, 0x36, 0x30, + 0xfa, 0x01, 0x96, 0x6f, 0xfd, 0x04, 0x8b, 0x7d, 0x15, 0x9f, 0x33, 0xab, 0x73, 0x70, 0xff, 0x3d, + 0x87, 0x8e, 0xb9, 0x31, 0x3f, 0xe5, 0xe5, 0x77, 0xde, 0x22, 0xa8, 0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marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -325,165 +330,162 @@ func (m *Options) Marshal() (dAtA []byte, err error) { } func (m *Options) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DefaultContainerAnnotations) > 0 { - for k := range m.DefaultContainerAnnotations { - v := m.DefaultContainerAnnotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRunhcs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRunhcs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRunhcs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + if m.Debug { + dAtA[i] = 0x8 + i++ + if m.Debug { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i++ } - if m.IoRetryTimeoutInSec != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 + if m.DebugType != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) } - if len(m.LogLevel) > 0 { - i -= len(m.LogLevel) - copy(dAtA[i:], m.LogLevel) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.LogLevel))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + if len(m.RegistryRoot) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) + i += copy(dAtA[i:], m.RegistryRoot) } - if len(m.NCProxyAddr) > 0 { - i -= len(m.NCProxyAddr) - copy(dAtA[i:], m.NCProxyAddr) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.NCProxyAddr))) - i-- - dAtA[i] = 0x7a + if len(m.SandboxImage) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) + i += copy(dAtA[i:], m.SandboxImage) } - if m.ShareScratch { - i-- - if m.ShareScratch { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 + if len(m.SandboxPlatform) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform))) + i += copy(dAtA[i:], m.SandboxPlatform) } - if m.DefaultVmScratchSizeInGb != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) - i-- - dAtA[i] = 0x68 + if m.SandboxIsolation != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) } - if m.DefaultContainerScratchSizeInGb != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) - i-- - dAtA[i] = 0x60 + if len(m.BootFilesRootPath) > 0 { + dAtA[i] = 0x3a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) + i += copy(dAtA[i:], m.BootFilesRootPath) + } + if m.VmProcessorCount != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) + } + if m.VmMemorySizeInMb != 0 { + dAtA[i] = 0x48 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) + } + if len(m.GPUVHDPath) > 0 { + dAtA[i] = 0x52 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) + i += copy(dAtA[i:], m.GPUVHDPath) } if m.ScaleCpuLimitsToSandbox { - i-- + dAtA[i] = 0x58 + i++ if m.ScaleCpuLimitsToSandbox { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x58 - } - if len(m.GPUVHDPath) > 0 { - i -= len(m.GPUVHDPath) - copy(dAtA[i:], m.GPUVHDPath) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) - i-- - dAtA[i] = 0x52 + i++ } - if m.VmMemorySizeInMb != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) - i-- - dAtA[i] = 0x48 - } - if m.VmProcessorCount != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) - i-- - dAtA[i] = 0x40 + if m.DefaultContainerScratchSizeInGb != 0 { + dAtA[i] = 0x60 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) } - if len(m.BootFilesRootPath) > 0 { - i -= len(m.BootFilesRootPath) - copy(dAtA[i:], m.BootFilesRootPath) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) - i-- - dAtA[i] = 0x3a + if m.DefaultVmScratchSizeInGb != 0 { + dAtA[i] = 0x68 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) } - if m.SandboxIsolation != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) - i-- - dAtA[i] = 0x30 + if m.ShareScratch { + dAtA[i] = 0x70 + i++ + if m.ShareScratch { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - if len(m.SandboxPlatform) > 0 { - i -= len(m.SandboxPlatform) - copy(dAtA[i:], m.SandboxPlatform) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform))) - i-- - dAtA[i] = 0x2a + if len(m.NCProxyAddr) > 0 { + dAtA[i] = 0x7a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.NCProxyAddr))) + i += copy(dAtA[i:], m.NCProxyAddr) } - if len(m.SandboxImage) > 0 { - i -= len(m.SandboxImage) - copy(dAtA[i:], m.SandboxImage) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) - i-- - dAtA[i] = 0x22 + if len(m.LogLevel) > 0 { + dAtA[i] = 0x82 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.LogLevel))) + i += copy(dAtA[i:], m.LogLevel) } - if len(m.RegistryRoot) > 0 { - i -= len(m.RegistryRoot) - copy(dAtA[i:], m.RegistryRoot) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) - i-- - dAtA[i] = 0x1a + if m.IoRetryTimeoutInSec != 0 { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) } - if m.DebugType != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) - i-- - dAtA[i] = 0x10 + if len(m.DefaultContainerAnnotations) > 0 { + for k, _ := range m.DefaultContainerAnnotations { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x1 + i++ + v := m.DefaultContainerAnnotations[k] + mapSize := 1 + len(k) + sovRunhcs(uint64(len(k))) + 1 + len(v) + sovRunhcs(uint64(len(v))) + i = encodeVarintRunhcs(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } } - if m.Debug { - i-- - if m.Debug { + if m.NoInheritHostTimezone { + dAtA[i] = 0x98 + i++ + dAtA[i] = 0x1 + i++ + if m.NoInheritHostTimezone { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x8 + i++ } - return len(dAtA) - i, nil + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil } func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -491,84 +493,74 @@ func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { } func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProcessDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ExecID) > 0 { - i -= len(m.ExecID) - copy(dAtA[i:], m.ExecID) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) - i-- - dAtA[i] = 0x4a + if len(m.ImageName) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName))) + i += copy(dAtA[i:], m.ImageName) } - if m.UserTime_100Ns != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns)) - i-- - dAtA[i] = 0x40 + dAtA[i] = 0x12 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) + n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) + if err != nil { + return 0, err } - if m.ProcessID != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID)) - i-- - dAtA[i] = 0x38 + i += n1 + if m.KernelTime_100Ns != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns)) } - if m.MemoryWorkingSetSharedBytes != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes)) - i-- - dAtA[i] = 0x30 + if m.MemoryCommitBytes != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes)) } if m.MemoryWorkingSetPrivateBytes != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) - i-- dAtA[i] = 0x28 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) } - if m.MemoryCommitBytes != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes)) - i-- - dAtA[i] = 0x20 + if m.MemoryWorkingSetSharedBytes != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes)) } - if m.KernelTime_100Ns != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns)) - i-- - dAtA[i] = 0x18 + if m.ProcessID != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID)) } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) - if err1 != nil { - return 0, err1 + if m.UserTime_100Ns != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns)) } - i -= n1 - i = encodeVarintRunhcs(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - if len(m.ImageName) > 0 { - i -= len(m.ImageName) - copy(dAtA[i:], m.ImageName) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName))) - i-- - dAtA[i] = 0xa + if len(m.ExecID) > 0 { + dAtA[i] = 0x4a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) } - return len(dAtA) - i, nil + return i, nil } func encodeVarintRunhcs(dAtA []byte, offset int, v uint64) int { - offset -= sovRunhcs(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *Options) Size() (n int) { if m == nil { @@ -642,6 +634,9 @@ func (m *Options) Size() (n int) { n += mapEntrySize + 2 + sovRunhcs(uint64(mapEntrySize)) } } + if m.NoInheritHostTimezone { + n += 3 + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -689,7 +684,14 @@ func (m *ProcessDetails) Size() (n int) { } func sovRunhcs(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozRunhcs(x uint64) (n int) { return sovRunhcs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -727,6 +729,7 @@ func (this *Options) String() string { `LogLevel:` + fmt.Sprintf("%v", this.LogLevel) + `,`, `IoRetryTimeoutInSec:` + fmt.Sprintf("%v", this.IoRetryTimeoutInSec) + `,`, `DefaultContainerAnnotations:` + mapStringForDefaultContainerAnnotations + `,`, + `NoInheritHostTimezone:` + fmt.Sprintf("%v", this.NoInheritHostTimezone) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -738,7 +741,7 @@ func (this *ProcessDetails) String() string { } s := strings.Join([]string{`&ProcessDetails{`, `ImageName:` + fmt.Sprintf("%v", this.ImageName) + `,`, - `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `KernelTime_100Ns:` + fmt.Sprintf("%v", this.KernelTime_100Ns) + `,`, `MemoryCommitBytes:` + fmt.Sprintf("%v", this.MemoryCommitBytes) + `,`, `MemoryWorkingSetPrivateBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetPrivateBytes) + `,`, @@ -1321,7 +1324,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > postIndex { @@ -1332,13 +1335,36 @@ func (m *Options) Unmarshal(dAtA []byte) error { } m.DefaultContainerAnnotations[mapkey] = mapvalue iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoInheritHostTimezone", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRunhcs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoInheritHostTimezone = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRunhcs(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthRunhcs + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > l { @@ -1600,7 +1626,10 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthRunhcs + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > l { @@ -1619,7 +1648,6 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { func skipRunhcs(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 { @@ -1651,8 +1679,10 @@ func skipRunhcs(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 { @@ -1673,30 +1703,55 @@ func skipRunhcs(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRunhcs } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRunhcs + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRunhcs + } + 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 := skipRunhcs(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthRunhcs - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRunhcs = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") ) diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.proto b/cmd/containerd-shim-runhcs-v1/options/runhcs.proto index 95b04afeb8..69ac25a502 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.proto +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.proto @@ -98,9 +98,13 @@ message Options { // The typical example is if Containerd has restarted but is expected to come back online. A 0 for this field is interpreted as an infinite // timeout. int32 io_retry_timeout_in_sec = 17; - + // default_container_annotations specifies a set of annotations that should be set for every workload container map default_container_annotations = 18; + + // no_inherit_host_timezone specifies to skip inheriting the hosts time zone for WCOW UVMs and instead default to + // UTC. + bool no_inherit_host_timezone = 19; } // ProcessDetails contains additional information about a process. This is the additional diff --git a/internal/gcs/guestconnection.go b/internal/gcs/guestconnection.go index f01b97939b..bdf796010c 100644 --- a/internal/gcs/guestconnection.go +++ b/internal/gcs/guestconnection.go @@ -5,7 +5,6 @@ import ( "encoding/base64" "encoding/hex" "encoding/json" - "errors" "fmt" "io" "net" @@ -16,9 +15,11 @@ import ( "github.com/Microsoft/go-winio/pkg/guid" "github.com/Microsoft/hcsshim/internal/cow" "github.com/Microsoft/hcsshim/internal/hcs/schema1" + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/log" "github.com/Microsoft/hcsshim/internal/logfields" "github.com/Microsoft/hcsshim/internal/oc" + "github.com/pkg/errors" "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -45,6 +46,11 @@ func HvsockIoListen(vmID guid.GUID) IoListenFunc { } } +type InitialGuestState struct { + // Timezone is only honored for Windows guests. + Timezone *hcsschema.TimeZoneInformation +} + // GuestConnectionConfig contains options for creating a guest connection. type GuestConnectionConfig struct { // Conn specifies the connection to use for the bridge. It will be closed @@ -54,6 +60,8 @@ type GuestConnectionConfig struct { Log *logrus.Entry // IoListen is the function to use to create listeners for the stdio connections. IoListen IoListenFunc + // InitGuestState specifies settings to apply to the guest on creation/start. This includes things such as the timezone for the VM. + InitGuestState *InitialGuestState } // Connect establishes a GCS connection. `gcc.Conn` will be closed by this function. @@ -73,7 +81,7 @@ func (gcc *GuestConnectionConfig) Connect(ctx context.Context, isColdStart bool) _ = gc.brdg.Wait() gc.clearNotifies() }() - err = gc.connect(ctx, isColdStart) + err = gc.connect(ctx, isColdStart, gcc.InitGuestState) if err != nil { gc.Close() return nil, err @@ -108,7 +116,7 @@ func (gc *GuestConnection) Protocol() uint32 { // isColdStart should be true when the UVM is being connected to for the first time post-boot. // It should be false for subsequent connections (e.g. when connecting to a UVM that has // been cloned). -func (gc *GuestConnection) connect(ctx context.Context, isColdStart bool) (err error) { +func (gc *GuestConnection) connect(ctx context.Context, isColdStart bool, initGuestState *InitialGuestState) (err error) { req := negotiateProtocolRequest{ MinimumVersion: protocolVersion, MaximumVersion: protocolVersion, @@ -127,11 +135,15 @@ func (gc *GuestConnection) connect(ctx context.Context, isColdStart bool) (err e gc.os = "windows" } if isColdStart && resp.Capabilities.SendHostCreateMessage { + conf := &uvmConfig{ + SystemType: "Container", + } + if initGuestState != nil && initGuestState.Timezone != nil { + conf.TimeZoneInformation = initGuestState.Timezone + } createReq := containerCreate{ - requestBase: makeRequest(ctx, nullContainerID), - ContainerConfig: anyInString{&uvmConfig{ - SystemType: "Container", - }}, + requestBase: makeRequest(ctx, nullContainerID), + ContainerConfig: anyInString{conf}, } var createResp responseBase err = gc.brdg.RPC(ctx, rpcCreate, &createReq, &createResp, true) @@ -173,9 +185,7 @@ func (gc *GuestConnection) DumpStacks(ctx context.Context) (response string, err req := dumpStacksRequest{ requestBase: makeRequest(ctx, nullContainerID), } - var resp dumpStacksResponse - err = gc.brdg.RPC(ctx, rpcDumpStacks, &req, &resp, false) return resp.GuestStacks, err } diff --git a/internal/gcs/protocol.go b/internal/gcs/protocol.go index d559a86364..840dcb2392 100644 --- a/internal/gcs/protocol.go +++ b/internal/gcs/protocol.go @@ -220,7 +220,8 @@ type containerCreate struct { } type uvmConfig struct { - SystemType string // must be "Container" + SystemType string // must be "Container" + TimeZoneInformation *hcsschema.TimeZoneInformation } type containerNotification struct { diff --git a/internal/hcs/schema2/system_time.go b/internal/hcs/schema2/system_time.go new file mode 100644 index 0000000000..72de801493 --- /dev/null +++ b/internal/hcs/schema2/system_time.go @@ -0,0 +1,28 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.1 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SystemTime struct { + Year int32 `json:"Year,omitempty"` + + Month int32 `json:"Month,omitempty"` + + DayOfWeek int32 `json:"DayOfWeek,omitempty"` + + Day int32 `json:"Day,omitempty"` + + Hour int32 `json:"Hour,omitempty"` + + Minute int32 `json:"Minute,omitempty"` + + Second int32 `json:"Second,omitempty"` + + Milliseconds int32 `json:"Milliseconds,omitempty"` +} diff --git a/internal/hcs/schema2/time_zone_information.go b/internal/hcs/schema2/time_zone_information.go new file mode 100644 index 0000000000..529743d753 --- /dev/null +++ b/internal/hcs/schema2/time_zone_information.go @@ -0,0 +1,26 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.1 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type TimeZoneInformation struct { + Bias int32 `json:"Bias,omitempty"` + + StandardName string `json:"StandardName,omitempty"` + + StandardDate *SystemTime `json:"StandardDate,omitempty"` + + StandardBias int32 `json:"StandardBias,omitempty"` + + DaylightName string `json:"DaylightName,omitempty"` + + DaylightDate *SystemTime `json:"DaylightDate,omitempty"` + + DaylightBias int32 `json:"DaylightBias,omitempty"` +} diff --git a/internal/oci/uvm.go b/internal/oci/uvm.go index 0782a9cf5c..97b156ba5b 100644 --- a/internal/oci/uvm.go +++ b/internal/oci/uvm.go @@ -391,6 +391,7 @@ func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) ( wopts.NetworkConfigProxy = parseAnnotationsString(s.Annotations, annotations.NetworkConfigProxy, wopts.NetworkConfigProxy) wopts.NoDirectMap = parseAnnotationsBool(ctx, s.Annotations, annotations.VSMBNoDirectMap, wopts.NoDirectMap) wopts.ProcessDumpLocation = parseAnnotationsString(s.Annotations, annotations.ContainerProcessDumpLocation, wopts.ProcessDumpLocation) + wopts.NoInheritHostTimezone = parseAnnotationsBool(ctx, s.Annotations, annotations.NoInheritHostTimezone, wopts.NoInheritHostTimezone) handleAnnotationFullyPhysicallyBacked(ctx, s.Annotations, wopts) if err := handleCloneAnnotations(ctx, s.Annotations, wopts); err != nil { return nil, err diff --git a/internal/uvm/create_wcow.go b/internal/uvm/create_wcow.go index da414bd2a8..e4a4197078 100644 --- a/internal/uvm/create_wcow.go +++ b/internal/uvm/create_wcow.go @@ -47,6 +47,9 @@ type OptionsWCOW struct { // NoDirectMap specifies that no direct mapping should be used for any VSMBs added to the UVM NoDirectMap bool + + // NoInheritHostTimezone specifies whether to not inherit the hosts timezone for the UVM. UTC will be set as the default for the VM instead. + NoInheritHostTimezone bool } // NewDefaultOptionsWCOW creates the default options for a bootable version of @@ -249,6 +252,7 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error vsmbDirShares: make(map[string]*VSMBShare), vsmbFileShares: make(map[string]*VSMBShare), vpciDevices: make(map[VPCIDeviceKey]*VPCIDevice), + noInheritHostTimezone: opts.NoInheritHostTimezone, physicallyBacked: !opts.AllowOvercommit, devicesPhysicallyBacked: opts.FullyPhysicallyBacked, vsmbNoDirectMap: opts.NoDirectMap, diff --git a/internal/uvm/start.go b/internal/uvm/start.go index ef76b39ae1..7fd6682cb4 100644 --- a/internal/uvm/start.go +++ b/internal/uvm/start.go @@ -229,11 +229,31 @@ func (uvm *UtilityVM) Start(ctx context.Context) (err error) { if err != nil { return fmt.Errorf("failed to connect to GCS: %s", err) } + + var initGuestState *gcs.InitialGuestState + if uvm.OS() == "windows" { + // Default to setting the time zone in the UVM to the hosts time zone unless the client asked to avoid this behavior. If so, assign + // to UTC. + if uvm.noInheritHostTimezone { + initGuestState = &gcs.InitialGuestState{ + Timezone: utcTimezone, + } + } else { + tz, err := getTimezone() + if err != nil { + return err + } + initGuestState = &gcs.InitialGuestState{ + Timezone: tz, + } + } + } // Start the GCS protocol. gcc := &gcs.GuestConnectionConfig{ - Conn: conn, - Log: log.G(ctx).WithField(logfields.UVMID, uvm.id), - IoListen: gcs.HvsockIoListen(uvm.runtimeID), + Conn: conn, + Log: log.G(ctx).WithField(logfields.UVMID, uvm.id), + IoListen: gcs.HvsockIoListen(uvm.runtimeID), + InitGuestState: initGuestState, } uvm.gc, err = gcc.Connect(ctx, !uvm.IsClone) if err != nil { diff --git a/internal/uvm/timezone.go b/internal/uvm/timezone.go new file mode 100644 index 0000000000..18c191cf4a --- /dev/null +++ b/internal/uvm/timezone.go @@ -0,0 +1,58 @@ +package uvm + +import ( + "fmt" + + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" + "golang.org/x/sys/windows" +) + +// UTC has everything set to 0's. Just need to fill in the pointer fields and string identifiers. +var utcTimezone = &hcsschema.TimeZoneInformation{ + StandardName: "Coordinated Universal Time", + DaylightName: "Coordinated Universal Time", + StandardDate: &hcsschema.SystemTime{}, + DaylightDate: &hcsschema.SystemTime{}, +} + +// getTimezone returns the hosts timezone in an HCS TimeZoneInformation structure and an error if there +// is one. +func getTimezone() (*hcsschema.TimeZoneInformation, error) { + var tz windows.Timezoneinformation + _, err := windows.GetTimeZoneInformation(&tz) + if err != nil { + return nil, fmt.Errorf("failed to get time zone information: %w", err) + } + return tziToHCSSchema(&tz), nil +} + +// TZIToHCSSchema converts a windows.TimeZoneInformation (TIME_ZONE_INFORMATION) to the hcs schema equivalent. +func tziToHCSSchema(tzi *windows.Timezoneinformation) *hcsschema.TimeZoneInformation { + return &hcsschema.TimeZoneInformation{ + Bias: tzi.Bias, + StandardName: windows.UTF16ToString(tzi.StandardName[:]), + StandardDate: &hcsschema.SystemTime{ + Year: int32(tzi.StandardDate.Year), + Month: int32(tzi.StandardDate.Month), + DayOfWeek: int32(tzi.StandardDate.DayOfWeek), + Day: int32(tzi.StandardDate.Day), + Hour: int32(tzi.StandardDate.Hour), + Second: int32(tzi.StandardDate.Second), + Minute: int32(tzi.StandardDate.Minute), + Milliseconds: int32(tzi.StandardDate.Milliseconds), + }, + StandardBias: tzi.StandardBias, + DaylightName: windows.UTF16ToString(tzi.DaylightName[:]), + DaylightDate: &hcsschema.SystemTime{ + Year: int32(tzi.DaylightDate.Year), + Month: int32(tzi.DaylightDate.Month), + DayOfWeek: int32(tzi.DaylightDate.DayOfWeek), + Day: int32(tzi.DaylightDate.Day), + Hour: int32(tzi.DaylightDate.Hour), + Second: int32(tzi.DaylightDate.Second), + Minute: int32(tzi.DaylightDate.Minute), + Milliseconds: int32(tzi.DaylightDate.Milliseconds), + }, + DaylightBias: tzi.DaylightBias, + } +} diff --git a/internal/uvm/types.go b/internal/uvm/types.go index bf0587421f..065f61c0ba 100644 --- a/internal/uvm/types.go +++ b/internal/uvm/types.go @@ -135,4 +135,8 @@ type UtilityVM struct { // networkSetup handles the logic for setting up and tearing down any network configuration // for the Utility VM. networkSetup NetworkSetup + + // noInheritHostTimezone specifies whether to not inherit the hosts timezone for the UVM. UTC will be set as the default instead. + // This only applies for WCOW. + noInheritHostTimezone bool } diff --git a/pkg/annotations/annotations.go b/pkg/annotations/annotations.go index 4202c56aba..88b6d810bb 100644 --- a/pkg/annotations/annotations.go +++ b/pkg/annotations/annotations.go @@ -261,4 +261,8 @@ const ( // AnnotationDisableLCOWTimeSyncService is used to disable the chronyd time // synchronization service inside the LCOW UVM. DisableLCOWTimeSyncService = "io.microsoft.virtualmachine.lcow.timesync.disable" + + // NoInheritHostTimezone specifies for the hosts timezone to not be inherited by the WCOW UVM. The UVM will be set to UTC time + // as a default. + NoInheritHostTimezone = "io.microsoft.virtualmachine.wcow.timezone.noinherit" ) diff --git a/test/cri-containerd/main_test.go b/test/cri-containerd/main_test.go index 5c362b1acd..a040846358 100644 --- a/test/cri-containerd/main_test.go +++ b/test/cri-containerd/main_test.go @@ -50,9 +50,10 @@ const ( imageLcowK8sPause = "k8s.gcr.io/pause:3.1" imageLcowAlpine = "docker.io/library/alpine:latest" imageLcowAlpineCoreDump = "cplatpublic.azurecr.io/stackoverflow-alpine:latest" - imageWindowsProcessDump = "cplatpublic.azurecr.io/crashdump:latest" imageLcowCosmos = "cosmosarno/spark-master:2.4.1_2019-04-18_8e864ce" imageLcowCustomUser = "cplatpublic.azurecr.io/linux_custom_user:latest" + imageWindowsProcessDump = "cplatpublic.azurecr.io/crashdump:latest" + imageWindowsTimezone = "cplatpublic.azurecr.io/timezone:latest" imageJobContainerHNS = "cplatpublic.azurecr.io/jobcontainer_hns:latest" imageJobContainerETW = "cplatpublic.azurecr.io/jobcontainer_etw:latest" imageJobContainerVHD = "cplatpublic.azurecr.io/jobcontainer_vhd:latest" diff --git a/test/cri-containerd/runpodsandbox_test.go b/test/cri-containerd/runpodsandbox_test.go index 4c96710545..6af9a5a784 100644 --- a/test/cri-containerd/runpodsandbox_test.go +++ b/test/cri-containerd/runpodsandbox_test.go @@ -1,3 +1,4 @@ +//go:build functional // +build functional package cri_containerd @@ -25,6 +26,7 @@ import ( "github.com/Microsoft/hcsshim/pkg/annotations" testutilities "github.com/Microsoft/hcsshim/test/functional/utilities" "github.com/containerd/containerd/log" + "golang.org/x/sys/windows" runtime "k8s.io/cri-api/pkg/apis/runtime/v1alpha2" ) @@ -1601,6 +1603,144 @@ func Test_RunPodSandbox_ProcessDump_WCOW_Hypervisor(t *testing.T) { } } +func Test_RunPodSandbox_Timezone_Inherit_WCOW_Hypervisor(t *testing.T) { + requireFeatures(t, featureWCOWHypervisor) + + pullRequiredImages(t, []string{imageWindowsTimezone}) + + client := newTestRuntimeClient(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + sbRequest := getRunPodSandboxRequest( + t, + wcowHypervisor17763RuntimeHandler, + ) + + podID := runPodSandbox(t, client, ctx, sbRequest) + defer removePodSandbox(t, client, ctx, podID) + defer stopPodSandbox(t, client, ctx, podID) + + cRequest := &runtime.CreateContainerRequest{ + Config: &runtime.ContainerConfig{ + Metadata: &runtime.ContainerMetadata{ + Name: t.Name() + "-Container", + }, + Image: &runtime.ImageSpec{ + Image: imageWindowsTimezone, + }, + Command: []string{ + "cmd", + "/c", + "ping", + "-t", + "127.0.0.1", + }, + }, + PodSandboxId: podID, + SandboxConfig: sbRequest.Config, + } + + containerID := createContainer(t, client, ctx, cRequest) + defer removeContainer(t, client, ctx, containerID) + + startContainer(t, client, ctx, containerID) + defer stopContainer(t, client, ctx, containerID) + + // Run the binary in the image that simply prints the standard name of the time zone + execCommand := []string{ + "C:\\go\\src\\timezone\\timezone.exe", + } + execRequest := &runtime.ExecSyncRequest{ + ContainerId: containerID, + Cmd: execCommand, + Timeout: 20, + } + + var tz windows.Timezoneinformation + _, err := windows.GetTimeZoneInformation(&tz) + if err != nil { + t.Fatal(err) + } + tzStd := windows.UTF16ToString(tz.StandardName[:]) + + r := execSync(t, client, ctx, execRequest) + if r.ExitCode != 0 { + t.Fatalf("failed with exit code %d: %s", r.ExitCode, string(r.Stderr)) + } + + if string(r.Stdout) != tzStd { + t.Fatalf("expected %s for time zone, got: %s", tzStd, string(r.Stdout)) + } +} + +func Test_RunPodSandbox_Timezone_NoInherit_WCOW_Hypervisor(t *testing.T) { + requireFeatures(t, featureWCOWHypervisor) + + pullRequiredImages(t, []string{imageWindowsTimezone}) + + client := newTestRuntimeClient(t) + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + sbRequest := getRunPodSandboxRequest( + t, + wcowHypervisor17763RuntimeHandler, + WithSandboxAnnotations(map[string]string{ + annotations.NoInheritHostTimezone: "true", + }), + ) + + podID := runPodSandbox(t, client, ctx, sbRequest) + defer removePodSandbox(t, client, ctx, podID) + defer stopPodSandbox(t, client, ctx, podID) + + cRequest := &runtime.CreateContainerRequest{ + Config: &runtime.ContainerConfig{ + Metadata: &runtime.ContainerMetadata{ + Name: t.Name() + "-Container", + }, + Image: &runtime.ImageSpec{ + Image: imageWindowsTimezone, + }, + Command: []string{ + "cmd", + "/c", + "ping", + "-t", + "127.0.0.1", + }, + }, + PodSandboxId: podID, + SandboxConfig: sbRequest.Config, + } + + containerID := createContainer(t, client, ctx, cRequest) + defer removeContainer(t, client, ctx, containerID) + + startContainer(t, client, ctx, containerID) + defer stopContainer(t, client, ctx, containerID) + + // Run the binary in the image that simply prints the standard name of the time zone + execCommand := []string{ + "C:\\go\\src\\timezone\\timezone.exe", + } + execRequest := &runtime.ExecSyncRequest{ + ContainerId: containerID, + Cmd: execCommand, + Timeout: 20, + } + + r := execSync(t, client, ctx, execRequest) + if r.ExitCode != 0 { + t.Fatalf("failed with exit code %d: %s", r.ExitCode, string(r.Stderr)) + } + + if string(r.Stdout) != "Coordinated Universal Time" { + t.Fatalf("expected 'Coordinated Universal Time' for time zone, got: %s", string(r.Stdout)) + } +} + func createSandboxContainerAndExecForCustomScratch(t *testing.T, annots map[string]string) (string, string, int) { cmd := []string{ "df", diff --git a/test/cri-containerd/test-images/timezone/dockerfile b/test/cri-containerd/test-images/timezone/dockerfile new file mode 100644 index 0000000000..e7d516e8ac --- /dev/null +++ b/test/cri-containerd/test-images/timezone/dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.15.10-nanoserver-1809 + +# Get administrator privileges +USER containeradministrator + +WORKDIR C:\\go\\src\\timezone +COPY . . + +RUN go get -d -v ./... +RUN go build -mod=mod \ No newline at end of file diff --git a/test/cri-containerd/test-images/timezone/main.go b/test/cri-containerd/test-images/timezone/main.go new file mode 100644 index 0000000000..1cca744fca --- /dev/null +++ b/test/cri-containerd/test-images/timezone/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "log" + + "golang.org/x/sys/windows" +) + +func main() { + var tz windows.Timezoneinformation + _, err := windows.GetTimeZoneInformation(&tz) + if err != nil { + log.Fatal(err) + } + fmt.Printf(windows.UTF16ToString(tz.StandardName[:])) +} 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 ff04b224fe..f3b8ca404b 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 @@ -11,7 +11,6 @@ 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" @@ -27,7 +26,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.GoGoProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Options_DebugType int32 @@ -148,9 +147,12 @@ type Options struct { IoRetryTimeoutInSec int32 `protobuf:"varint,17,opt,name=io_retry_timeout_in_sec,json=ioRetryTimeoutInSec,proto3" json:"io_retry_timeout_in_sec,omitempty"` // default_container_annotations specifies a set of annotations that should be set for every workload container DefaultContainerAnnotations map[string]string `protobuf:"bytes,18,rep,name=default_container_annotations,json=defaultContainerAnnotations,proto3" json:"default_container_annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // no_inherit_host_timezone specifies to skip inheriting the hosts time zone for WCOW UVMs and instead default to + // UTC. + NoInheritHostTimezone bool `protobuf:"varint,19,opt,name=no_inherit_host_timezone,json=noInheritHostTimezone,proto3" json:"no_inherit_host_timezone,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Options) Reset() { *m = Options{} } @@ -166,7 +168,7 @@ func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Options.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -215,7 +217,7 @@ func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -247,77 +249,80 @@ func init() { } var fileDescriptor_b643df6839c75082 = []byte{ - // 1022 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4b, 0x6f, 0xdb, 0x46, - 0x17, 0x15, 0xfd, 0x14, 0xaf, 0x5f, 0xf4, 0xc4, 0x40, 0x08, 0xfb, 0x8b, 0x24, 0x38, 0x1f, 0x10, - 0x07, 0x8d, 0x49, 0xdb, 0xed, 0xa2, 0x68, 0x8b, 0x16, 0xb6, 0x24, 0x27, 0x2a, 0xfc, 0x10, 0x28, - 0xd7, 0xe9, 0x63, 0x31, 0xe0, 0x63, 0x4c, 0x11, 0x26, 0x39, 0x04, 0x67, 0xa8, 0x5a, 0x59, 0xb5, - 0xfd, 0x05, 0xfd, 0x59, 0x5e, 0x76, 0x59, 0xa0, 0x80, 0xdb, 0xe8, 0x97, 0x14, 0x33, 0x1c, 0xda, - 0x89, 0xe1, 0x36, 0x8b, 0xae, 0x34, 0x73, 0xce, 0x99, 0x33, 0xf7, 0x5e, 0xce, 0xbd, 0x82, 0xd3, - 0x30, 0xe2, 0xc3, 0xc2, 0xb3, 0x7c, 0x9a, 0xd8, 0xc7, 0x91, 0x9f, 0x53, 0x46, 0x2f, 0xb8, 0x3d, - 0xf4, 0x19, 0x1b, 0x46, 0x89, 0xed, 0x27, 0x81, 0xed, 0xd3, 0x94, 0xbb, 0x51, 0x4a, 0xf2, 0x60, - 0x5b, 0x60, 0xdb, 0x79, 0x91, 0x0e, 0x7d, 0xb6, 0x3d, 0xda, 0xb5, 0x69, 0xc6, 0x23, 0x9a, 0x32, - 0xbb, 0x44, 0xac, 0x2c, 0xa7, 0x9c, 0xa2, 0xb5, 0x3b, 0xbd, 0xa5, 0x88, 0xd1, 0xee, 0xfa, 0x5a, - 0x48, 0x43, 0x2a, 0x05, 0xb6, 0x58, 0x95, 0xda, 0xf5, 0x66, 0x48, 0x69, 0x18, 0x13, 0x5b, 0xee, - 0xbc, 0xe2, 0xc2, 0xe6, 0x51, 0x42, 0x18, 0x77, 0x93, 0xac, 0x14, 0x6c, 0xfe, 0xac, 0xc3, 0xfc, - 0x69, 0x79, 0x0b, 0x5a, 0x83, 0xd9, 0x80, 0x78, 0x45, 0x68, 0x6a, 0x2d, 0x6d, 0xab, 0xee, 0x94, - 0x1b, 0x74, 0x08, 0x20, 0x17, 0x98, 0x8f, 0x33, 0x62, 0x4e, 0xb5, 0xb4, 0xad, 0xe5, 0xbd, 0x67, - 0xd6, 0x43, 0x31, 0x58, 0xca, 0xc8, 0xea, 0x08, 0xfd, 0xd9, 0x38, 0x23, 0x8e, 0x1e, 0x54, 0x4b, - 0xf4, 0x14, 0x96, 0x72, 0x12, 0x46, 0x8c, 0xe7, 0x63, 0x9c, 0x53, 0xca, 0xcd, 0xe9, 0x96, 0xb6, - 0xa5, 0x3b, 0x8b, 0x15, 0xe8, 0x50, 0xca, 0x85, 0x88, 0xb9, 0x69, 0xe0, 0xd1, 0x2b, 0x1c, 0x25, - 0x6e, 0x48, 0xcc, 0x99, 0x52, 0xa4, 0xc0, 0x9e, 0xc0, 0xd0, 0x73, 0x30, 0x2a, 0x51, 0x16, 0xbb, - 0xfc, 0x82, 0xe6, 0x89, 0x39, 0x2b, 0x75, 0x2b, 0x0a, 0xef, 0x2b, 0x18, 0xfd, 0x00, 0xab, 0xb7, - 0x7e, 0x8c, 0xc6, 0xae, 0x88, 0xcf, 0x9c, 0x93, 0x39, 0x58, 0xff, 0x9e, 0xc3, 0x40, 0xdd, 0x58, - 0x9d, 0x72, 0xaa, 0x3b, 0x6f, 0x11, 0x64, 0xc3, 0x9a, 0x47, 0x29, 0xc7, 0x17, 0x51, 0x4c, 0x98, - 0xcc, 0x09, 0x67, 0x2e, 0x1f, 0x9a, 0xf3, 0x32, 0x96, 0x55, 0xc1, 0x1d, 0x0a, 0x4a, 0x64, 0xd6, - 0x77, 0xf9, 0x10, 0xbd, 0x00, 0x34, 0x4a, 0x70, 0x96, 0x53, 0x9f, 0x30, 0x46, 0x73, 0xec, 0xd3, - 0x22, 0xe5, 0x66, 0xbd, 0xa5, 0x6d, 0xcd, 0x3a, 0xc6, 0x28, 0xe9, 0x57, 0x44, 0x5b, 0xe0, 0xc8, - 0x82, 0xb5, 0x51, 0x82, 0x13, 0x92, 0xd0, 0x7c, 0x8c, 0x59, 0xf4, 0x86, 0xe0, 0x28, 0xc5, 0x89, - 0x67, 0xea, 0x95, 0xfe, 0x58, 0x52, 0x83, 0xe8, 0x0d, 0xe9, 0xa5, 0xc7, 0x1e, 0x6a, 0x00, 0xbc, - 0xec, 0x7f, 0x73, 0xfe, 0xaa, 0x23, 0xee, 0x32, 0x41, 0x06, 0xf1, 0x0e, 0x82, 0xbe, 0x80, 0x0d, - 0xe6, 0xbb, 0x31, 0xc1, 0x7e, 0x56, 0xe0, 0x38, 0x4a, 0x22, 0xce, 0x30, 0xa7, 0x58, 0xa5, 0x65, - 0x2e, 0xc8, 0x8f, 0xfe, 0x58, 0x4a, 0xda, 0x59, 0x71, 0x24, 0x05, 0x67, 0x54, 0xd5, 0x01, 0x1d, - 0xc3, 0xff, 0x03, 0x72, 0xe1, 0x16, 0x31, 0xc7, 0xb7, 0x75, 0xc3, 0xcc, 0xcf, 0x5d, 0xee, 0x0f, - 0x6f, 0xa3, 0x0b, 0x3d, 0x73, 0x51, 0x46, 0xd7, 0x54, 0xda, 0x76, 0x25, 0x1d, 0x94, 0xca, 0x32, - 0xd8, 0x97, 0x1e, 0xfa, 0x0a, 0x9e, 0x54, 0x76, 0xa3, 0xe4, 0x21, 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0x8e, - 0xba, 0x86, 0x86, 0xe6, 0x61, 0xba, 0x7b, 0xf6, 0xda, 0x98, 0xda, 0xb4, 0xc1, 0xb8, 0xdf, 0x3c, - 0x68, 0x01, 0xe6, 0xfb, 0xce, 0x69, 0xbb, 0x3b, 0x18, 0x18, 0x35, 0xb4, 0x0c, 0xf0, 0xea, 0xbb, - 0x7e, 0xd7, 0x39, 0xef, 0x0d, 0x4e, 0x1d, 0x43, 0xdb, 0xfc, 0x63, 0x1a, 0x96, 0xd5, 0xdb, 0xef, - 0x10, 0xee, 0x46, 0x31, 0x43, 0x4f, 0x00, 0x64, 0xff, 0xe3, 0xd4, 0x4d, 0x88, 0x8a, 0x50, 0x97, - 0xc8, 0x89, 0x9b, 0x10, 0xd4, 0x06, 0xf0, 0x73, 0xe2, 0x72, 0x12, 0x60, 0x97, 0xcb, 0x60, 0x17, - 0xf6, 0xd6, 0xad, 0x72, 0xd6, 0x59, 0xd5, 0xac, 0xb3, 0xce, 0xaa, 0x59, 0x77, 0x50, 0xbf, 0xbe, - 0x69, 0xd6, 0x7e, 0xfd, 0xb3, 0xa9, 0x39, 0xba, 0x3a, 0xb7, 0xcf, 0xd1, 0x47, 0x80, 0x2e, 0x49, - 0x9e, 0x92, 0x58, 0x7e, 0x5b, 0xbc, 0xbb, 0xb3, 0x83, 0x53, 0x26, 0xa7, 0xd2, 0x8c, 0xb3, 0x52, - 0x32, 0xc2, 0x61, 0x77, 0x67, 0xe7, 0x84, 0x21, 0x0b, 0x1e, 0xa9, 0x4e, 0xf4, 0x69, 0x92, 0x44, - 0x1c, 0x7b, 0x63, 0x4e, 0x98, 0x1c, 0x4f, 0x33, 0xce, 0x6a, 0x49, 0xb5, 0x25, 0x73, 0x20, 0x08, - 0x74, 0x08, 0x2d, 0xa5, 0xff, 0x91, 0xe6, 0x97, 0x51, 0x1a, 0x62, 0x46, 0x38, 0xce, 0xf2, 0x68, - 0xe4, 0x72, 0xa2, 0x0e, 0xcf, 0xca, 0xc3, 0xff, 0x2b, 0x75, 0xaf, 0x4b, 0xd9, 0x80, 0xf0, 0x7e, - 0x29, 0x2a, 0x7d, 0x3a, 0xd0, 0x7c, 0xc0, 0x47, 0x3e, 0xf2, 0x40, 0xd9, 0xcc, 0x49, 0x9b, 0x8d, - 0xfb, 0x36, 0x03, 0xa9, 0x29, 0x5d, 0x5e, 0x00, 0xa8, 0xa9, 0x83, 0xa3, 0x40, 0xce, 0xa7, 0xa5, - 0x83, 0xa5, 0xc9, 0x4d, 0x53, 0x57, 0x65, 0xef, 0x75, 0x1c, 0x5d, 0x09, 0x7a, 0x01, 0x7a, 0x06, - 0x46, 0xc1, 0x48, 0xfe, 0x5e, 0x59, 0xea, 0xf2, 0x92, 0x25, 0x81, 0xdf, 0x15, 0xe5, 0x29, 0xcc, - 0x93, 0x2b, 0xe2, 0x0b, 0x4f, 0x31, 0x94, 0xf4, 0x03, 0x98, 0xdc, 0x34, 0xe7, 0xba, 0x57, 0xc4, - 0xef, 0x75, 0x9c, 0x39, 0x41, 0xf5, 0x82, 0x83, 0xe0, 0xfa, 0x6d, 0xa3, 0xf6, 0xfb, 0xdb, 0x46, - 0xed, 0xa7, 0x49, 0x43, 0xbb, 0x9e, 0x34, 0xb4, 0xdf, 0x26, 0x0d, 0xed, 0xaf, 0x49, 0x43, 0xfb, - 0xfe, 0xeb, 0xff, 0xfe, 0xcf, 0xf8, 0xb9, 0xfa, 0xfd, 0xb6, 0xe6, 0xcd, 0xc9, 0xef, 0xfe, 0xf1, - 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf2, 0x5f, 0x16, 0x8d, 0x70, 0x07, 0x00, 0x00, + // 1058 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x5d, 0x4f, 0x23, 0x37, + 0x17, 0xce, 0x2c, 0x5f, 0x99, 0xc3, 0x02, 0xc1, 0xf0, 0x6a, 0x47, 0xf0, 0x6e, 0x12, 0xb1, 0x95, + 0x96, 0x55, 0x97, 0x09, 0xd0, 0x4a, 0xad, 0xda, 0xaa, 0x15, 0x24, 0x61, 0x49, 0xc5, 0x47, 0x34, + 0x49, 0xd9, 0x7e, 0x5c, 0x58, 0x93, 0x19, 0x33, 0xb1, 0x98, 0x19, 0x47, 0xb6, 0x93, 0x12, 0xae, + 0xaa, 0xfe, 0x82, 0xfe, 0x9e, 0xfe, 0x02, 0x2e, 0x7b, 0x59, 0xa9, 0x12, 0xed, 0xe6, 0x97, 0x54, + 0xf6, 0x78, 0x60, 0x17, 0xd1, 0xee, 0x45, 0xaf, 0x62, 0x3f, 0xcf, 0xe3, 0xc7, 0xe7, 0x9c, 0xf1, + 0x39, 0x81, 0xd3, 0x88, 0xca, 0xfe, 0xb0, 0xe7, 0x06, 0x2c, 0xa9, 0x1d, 0xd3, 0x80, 0x33, 0xc1, + 0xce, 0x65, 0xad, 0x1f, 0x08, 0xd1, 0xa7, 0x49, 0x2d, 0x48, 0xc2, 0x5a, 0xc0, 0x52, 0xe9, 0xd3, + 0x94, 0xf0, 0x70, 0x4b, 0x61, 0x5b, 0x7c, 0x98, 0xf6, 0x03, 0xb1, 0x35, 0xda, 0xa9, 0xb1, 0x81, + 0xa4, 0x2c, 0x15, 0xb5, 0x0c, 0x71, 0x07, 0x9c, 0x49, 0x86, 0x56, 0xef, 0xf4, 0xae, 0x21, 0x46, + 0x3b, 0x6b, 0xab, 0x11, 0x8b, 0x98, 0x16, 0xd4, 0xd4, 0x2a, 0xd3, 0xae, 0x55, 0x22, 0xc6, 0xa2, + 0x98, 0xd4, 0xf4, 0xae, 0x37, 0x3c, 0xaf, 0x49, 0x9a, 0x10, 0x21, 0xfd, 0x64, 0x90, 0x09, 0x36, + 0x7e, 0xb5, 0x61, 0xee, 0x34, 0xbb, 0x05, 0xad, 0xc2, 0x4c, 0x48, 0x7a, 0xc3, 0xc8, 0xb1, 0xaa, + 0xd6, 0x66, 0xd1, 0xcb, 0x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xd3, + 0x50, 0x0f, 0xb6, 0x85, 0xfd, 0x85, 0xc9, 0x4d, 0xc5, 0x36, 0x65, 0x6f, 0x35, 0x3c, 0xdb, 0x08, + 0x5a, 0x21, 0x7a, 0x0e, 0xa5, 0xa1, 0x20, 0xfc, 0x9d, 0xb2, 0x14, 0xf5, 0x25, 0x0b, 0x0a, 0xbf, + 0x2b, 0xca, 0x33, 0x98, 0x23, 0x97, 0x24, 0x50, 0x9e, 0x6a, 0x9a, 0xd9, 0xfb, 0x30, 0xb9, 0xa9, + 0xcc, 0x36, 0x2f, 0x49, 0xd0, 0x6a, 0x78, 0xb3, 0x8a, 0x6a, 0x85, 0xfb, 0xe1, 0xf5, 0x9b, 0x72, + 0xe1, 0xf7, 0x37, 0xe5, 0xc2, 0x4f, 0x93, 0xb2, 0x75, 0x3d, 0x29, 0x5b, 0xbf, 0x4d, 0xca, 0xd6, + 0x5f, 0x93, 0xb2, 0xf5, 0xfd, 0xd7, 0xff, 0xfd, 0x2f, 0xf5, 0x73, 0xf3, 0xfb, 0x6d, 0xa1, 0x37, + 0xab, 0xbf, 0xfb, 0x47, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x36, 0xb1, 0x82, 0xa9, 0x07, + 0x00, 0x00, } func (m *Options) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -325,165 +330,162 @@ func (m *Options) Marshal() (dAtA []byte, err error) { } func (m *Options) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.DefaultContainerAnnotations) > 0 { - for k := range m.DefaultContainerAnnotations { - v := m.DefaultContainerAnnotations[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintRunhcs(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintRunhcs(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintRunhcs(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + if m.Debug { + dAtA[i] = 0x8 + i++ + if m.Debug { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i++ } - if m.IoRetryTimeoutInSec != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x88 + if m.DebugType != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) } - if len(m.LogLevel) > 0 { - i -= len(m.LogLevel) - copy(dAtA[i:], m.LogLevel) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.LogLevel))) - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x82 + if len(m.RegistryRoot) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) + i += copy(dAtA[i:], m.RegistryRoot) } - if len(m.NCProxyAddr) > 0 { - i -= len(m.NCProxyAddr) - copy(dAtA[i:], m.NCProxyAddr) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.NCProxyAddr))) - i-- - dAtA[i] = 0x7a + if len(m.SandboxImage) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) + i += copy(dAtA[i:], m.SandboxImage) } - if m.ShareScratch { - i-- - if m.ShareScratch { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x70 + if len(m.SandboxPlatform) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform))) + i += copy(dAtA[i:], m.SandboxPlatform) } - if m.DefaultVmScratchSizeInGb != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) - i-- - dAtA[i] = 0x68 + if m.SandboxIsolation != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) } - if m.DefaultContainerScratchSizeInGb != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) - i-- - dAtA[i] = 0x60 + if len(m.BootFilesRootPath) > 0 { + dAtA[i] = 0x3a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) + i += copy(dAtA[i:], m.BootFilesRootPath) + } + if m.VmProcessorCount != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) + } + if m.VmMemorySizeInMb != 0 { + dAtA[i] = 0x48 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) + } + if len(m.GPUVHDPath) > 0 { + dAtA[i] = 0x52 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) + i += copy(dAtA[i:], m.GPUVHDPath) } if m.ScaleCpuLimitsToSandbox { - i-- + dAtA[i] = 0x58 + i++ if m.ScaleCpuLimitsToSandbox { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x58 - } - if len(m.GPUVHDPath) > 0 { - i -= len(m.GPUVHDPath) - copy(dAtA[i:], m.GPUVHDPath) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) - i-- - dAtA[i] = 0x52 + i++ } - if m.VmMemorySizeInMb != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) - i-- - dAtA[i] = 0x48 - } - if m.VmProcessorCount != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) - i-- - dAtA[i] = 0x40 + if m.DefaultContainerScratchSizeInGb != 0 { + dAtA[i] = 0x60 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) } - if len(m.BootFilesRootPath) > 0 { - i -= len(m.BootFilesRootPath) - copy(dAtA[i:], m.BootFilesRootPath) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) - i-- - dAtA[i] = 0x3a + if m.DefaultVmScratchSizeInGb != 0 { + dAtA[i] = 0x68 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) } - if m.SandboxIsolation != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) - i-- - dAtA[i] = 0x30 + if m.ShareScratch { + dAtA[i] = 0x70 + i++ + if m.ShareScratch { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ } - if len(m.SandboxPlatform) > 0 { - i -= len(m.SandboxPlatform) - copy(dAtA[i:], m.SandboxPlatform) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform))) - i-- - dAtA[i] = 0x2a + if len(m.NCProxyAddr) > 0 { + dAtA[i] = 0x7a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.NCProxyAddr))) + i += copy(dAtA[i:], m.NCProxyAddr) } - if len(m.SandboxImage) > 0 { - i -= len(m.SandboxImage) - copy(dAtA[i:], m.SandboxImage) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) - i-- - dAtA[i] = 0x22 + if len(m.LogLevel) > 0 { + dAtA[i] = 0x82 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.LogLevel))) + i += copy(dAtA[i:], m.LogLevel) } - if len(m.RegistryRoot) > 0 { - i -= len(m.RegistryRoot) - copy(dAtA[i:], m.RegistryRoot) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) - i-- - dAtA[i] = 0x1a + if m.IoRetryTimeoutInSec != 0 { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) } - if m.DebugType != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) - i-- - dAtA[i] = 0x10 + if len(m.DefaultContainerAnnotations) > 0 { + for k, _ := range m.DefaultContainerAnnotations { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x1 + i++ + v := m.DefaultContainerAnnotations[k] + mapSize := 1 + len(k) + sovRunhcs(uint64(len(k))) + 1 + len(v) + sovRunhcs(uint64(len(v))) + i = encodeVarintRunhcs(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } } - if m.Debug { - i-- - if m.Debug { + if m.NoInheritHostTimezone { + dAtA[i] = 0x98 + i++ + dAtA[i] = 0x1 + i++ + if m.NoInheritHostTimezone { dAtA[i] = 1 } else { dAtA[i] = 0 } - i-- - dAtA[i] = 0x8 + i++ } - return len(dAtA) - i, nil + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil } func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) + n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } @@ -491,84 +493,74 @@ func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { } func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProcessDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) + var i int _ = i var l int _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ExecID) > 0 { - i -= len(m.ExecID) - copy(dAtA[i:], m.ExecID) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) - i-- - dAtA[i] = 0x4a + if len(m.ImageName) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName))) + i += copy(dAtA[i:], m.ImageName) } - if m.UserTime_100Ns != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns)) - i-- - dAtA[i] = 0x40 + dAtA[i] = 0x12 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) + n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) + if err != nil { + return 0, err } - if m.ProcessID != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID)) - i-- - dAtA[i] = 0x38 + i += n1 + if m.KernelTime_100Ns != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns)) } - if m.MemoryWorkingSetSharedBytes != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes)) - i-- - dAtA[i] = 0x30 + if m.MemoryCommitBytes != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes)) } if m.MemoryWorkingSetPrivateBytes != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) - i-- dAtA[i] = 0x28 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) } - if m.MemoryCommitBytes != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes)) - i-- - dAtA[i] = 0x20 + if m.MemoryWorkingSetSharedBytes != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes)) } - if m.KernelTime_100Ns != 0 { - i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns)) - i-- - dAtA[i] = 0x18 + if m.ProcessID != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID)) } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) - if err1 != nil { - return 0, err1 + if m.UserTime_100Ns != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns)) } - i -= n1 - i = encodeVarintRunhcs(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - if len(m.ImageName) > 0 { - i -= len(m.ImageName) - copy(dAtA[i:], m.ImageName) - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName))) - i-- - dAtA[i] = 0xa + if len(m.ExecID) > 0 { + dAtA[i] = 0x4a + i++ + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) + i += copy(dAtA[i:], m.ExecID) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) } - return len(dAtA) - i, nil + return i, nil } func encodeVarintRunhcs(dAtA []byte, offset int, v uint64) int { - offset -= sovRunhcs(v) - base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return base + return offset + 1 } func (m *Options) Size() (n int) { if m == nil { @@ -642,6 +634,9 @@ func (m *Options) Size() (n int) { n += mapEntrySize + 2 + sovRunhcs(uint64(mapEntrySize)) } } + if m.NoInheritHostTimezone { + n += 3 + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -689,7 +684,14 @@ func (m *ProcessDetails) Size() (n int) { } func sovRunhcs(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n } func sozRunhcs(x uint64) (n int) { return sovRunhcs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -727,6 +729,7 @@ func (this *Options) String() string { `LogLevel:` + fmt.Sprintf("%v", this.LogLevel) + `,`, `IoRetryTimeoutInSec:` + fmt.Sprintf("%v", this.IoRetryTimeoutInSec) + `,`, `DefaultContainerAnnotations:` + mapStringForDefaultContainerAnnotations + `,`, + `NoInheritHostTimezone:` + fmt.Sprintf("%v", this.NoInheritHostTimezone) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -738,7 +741,7 @@ func (this *ProcessDetails) String() string { } s := strings.Join([]string{`&ProcessDetails{`, `ImageName:` + fmt.Sprintf("%v", this.ImageName) + `,`, - `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `KernelTime_100Ns:` + fmt.Sprintf("%v", this.KernelTime_100Ns) + `,`, `MemoryCommitBytes:` + fmt.Sprintf("%v", this.MemoryCommitBytes) + `,`, `MemoryWorkingSetPrivateBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetPrivateBytes) + `,`, @@ -1321,7 +1324,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > postIndex { @@ -1332,13 +1335,36 @@ func (m *Options) Unmarshal(dAtA []byte) error { } m.DefaultContainerAnnotations[mapkey] = mapvalue iNdEx = postIndex + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NoInheritHostTimezone", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRunhcs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.NoInheritHostTimezone = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRunhcs(dAtA[iNdEx:]) if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthRunhcs + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > l { @@ -1600,7 +1626,10 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { if err != nil { return err } - if (skippy < 0) || (iNdEx+skippy) < 0 { + if skippy < 0 { + return ErrInvalidLengthRunhcs + } + if (iNdEx + skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > l { @@ -1619,7 +1648,6 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { func skipRunhcs(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 { @@ -1651,8 +1679,10 @@ func skipRunhcs(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 { @@ -1673,30 +1703,55 @@ func skipRunhcs(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRunhcs } iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } + return iNdEx, nil case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupRunhcs + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowRunhcs + } + 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 := skipRunhcs(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } } - depth-- + return iNdEx, nil + case 4: + return iNdEx, nil case 5: iNdEx += 4 + return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } - if iNdEx < 0 { - return 0, ErrInvalidLengthRunhcs - } - if depth == 0 { - return iNdEx, nil - } } - return 0, io.ErrUnexpectedEOF + panic("unreachable") } var ( - ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupRunhcs = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") ) diff --git a/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto b/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto index 95b04afeb8..69ac25a502 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto +++ b/test/vendor/github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options/runhcs.proto @@ -98,9 +98,13 @@ message Options { // The typical example is if Containerd has restarted but is expected to come back online. A 0 for this field is interpreted as an infinite // timeout. int32 io_retry_timeout_in_sec = 17; - + // default_container_annotations specifies a set of annotations that should be set for every workload container map default_container_annotations = 18; + + // no_inherit_host_timezone specifies to skip inheriting the hosts time zone for WCOW UVMs and instead default to + // UTC. + bool no_inherit_host_timezone = 19; } // ProcessDetails contains additional information about a process. This is the additional 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 f01b97939b..bdf796010c 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/guestconnection.go @@ -5,7 +5,6 @@ import ( "encoding/base64" "encoding/hex" "encoding/json" - "errors" "fmt" "io" "net" @@ -16,9 +15,11 @@ import ( "github.com/Microsoft/go-winio/pkg/guid" "github.com/Microsoft/hcsshim/internal/cow" "github.com/Microsoft/hcsshim/internal/hcs/schema1" + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" "github.com/Microsoft/hcsshim/internal/log" "github.com/Microsoft/hcsshim/internal/logfields" "github.com/Microsoft/hcsshim/internal/oc" + "github.com/pkg/errors" "github.com/sirupsen/logrus" "go.opencensus.io/trace" ) @@ -45,6 +46,11 @@ func HvsockIoListen(vmID guid.GUID) IoListenFunc { } } +type InitialGuestState struct { + // Timezone is only honored for Windows guests. + Timezone *hcsschema.TimeZoneInformation +} + // GuestConnectionConfig contains options for creating a guest connection. type GuestConnectionConfig struct { // Conn specifies the connection to use for the bridge. It will be closed @@ -54,6 +60,8 @@ type GuestConnectionConfig struct { Log *logrus.Entry // IoListen is the function to use to create listeners for the stdio connections. IoListen IoListenFunc + // InitGuestState specifies settings to apply to the guest on creation/start. This includes things such as the timezone for the VM. + InitGuestState *InitialGuestState } // Connect establishes a GCS connection. `gcc.Conn` will be closed by this function. @@ -73,7 +81,7 @@ func (gcc *GuestConnectionConfig) Connect(ctx context.Context, isColdStart bool) _ = gc.brdg.Wait() gc.clearNotifies() }() - err = gc.connect(ctx, isColdStart) + err = gc.connect(ctx, isColdStart, gcc.InitGuestState) if err != nil { gc.Close() return nil, err @@ -108,7 +116,7 @@ func (gc *GuestConnection) Protocol() uint32 { // isColdStart should be true when the UVM is being connected to for the first time post-boot. // It should be false for subsequent connections (e.g. when connecting to a UVM that has // been cloned). -func (gc *GuestConnection) connect(ctx context.Context, isColdStart bool) (err error) { +func (gc *GuestConnection) connect(ctx context.Context, isColdStart bool, initGuestState *InitialGuestState) (err error) { req := negotiateProtocolRequest{ MinimumVersion: protocolVersion, MaximumVersion: protocolVersion, @@ -127,11 +135,15 @@ func (gc *GuestConnection) connect(ctx context.Context, isColdStart bool) (err e gc.os = "windows" } if isColdStart && resp.Capabilities.SendHostCreateMessage { + conf := &uvmConfig{ + SystemType: "Container", + } + if initGuestState != nil && initGuestState.Timezone != nil { + conf.TimeZoneInformation = initGuestState.Timezone + } createReq := containerCreate{ - requestBase: makeRequest(ctx, nullContainerID), - ContainerConfig: anyInString{&uvmConfig{ - SystemType: "Container", - }}, + requestBase: makeRequest(ctx, nullContainerID), + ContainerConfig: anyInString{conf}, } var createResp responseBase err = gc.brdg.RPC(ctx, rpcCreate, &createReq, &createResp, true) @@ -173,9 +185,7 @@ func (gc *GuestConnection) DumpStacks(ctx context.Context) (response string, err req := dumpStacksRequest{ requestBase: makeRequest(ctx, nullContainerID), } - var resp dumpStacksResponse - err = gc.brdg.RPC(ctx, rpcDumpStacks, &req, &resp, false) return resp.GuestStacks, err } 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 d559a86364..840dcb2392 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/gcs/protocol.go @@ -220,7 +220,8 @@ type containerCreate struct { } type uvmConfig struct { - SystemType string // must be "Container" + SystemType string // must be "Container" + TimeZoneInformation *hcsschema.TimeZoneInformation } type containerNotification struct { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/system_time.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/system_time.go new file mode 100644 index 0000000000..72de801493 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/system_time.go @@ -0,0 +1,28 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.1 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type SystemTime struct { + Year int32 `json:"Year,omitempty"` + + Month int32 `json:"Month,omitempty"` + + DayOfWeek int32 `json:"DayOfWeek,omitempty"` + + Day int32 `json:"Day,omitempty"` + + Hour int32 `json:"Hour,omitempty"` + + Minute int32 `json:"Minute,omitempty"` + + Second int32 `json:"Second,omitempty"` + + Milliseconds int32 `json:"Milliseconds,omitempty"` +} diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/time_zone_information.go b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/time_zone_information.go new file mode 100644 index 0000000000..529743d753 --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/hcs/schema2/time_zone_information.go @@ -0,0 +1,26 @@ +/* + * HCS API + * + * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) + * + * API version: 2.1 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package hcsschema + +type TimeZoneInformation struct { + Bias int32 `json:"Bias,omitempty"` + + StandardName string `json:"StandardName,omitempty"` + + StandardDate *SystemTime `json:"StandardDate,omitempty"` + + StandardBias int32 `json:"StandardBias,omitempty"` + + DaylightName string `json:"DaylightName,omitempty"` + + DaylightDate *SystemTime `json:"DaylightDate,omitempty"` + + DaylightBias int32 `json:"DaylightBias,omitempty"` +} 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 0782a9cf5c..97b156ba5b 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/oci/uvm.go @@ -391,6 +391,7 @@ func SpecToUVMCreateOpts(ctx context.Context, s *specs.Spec, id, owner string) ( wopts.NetworkConfigProxy = parseAnnotationsString(s.Annotations, annotations.NetworkConfigProxy, wopts.NetworkConfigProxy) wopts.NoDirectMap = parseAnnotationsBool(ctx, s.Annotations, annotations.VSMBNoDirectMap, wopts.NoDirectMap) wopts.ProcessDumpLocation = parseAnnotationsString(s.Annotations, annotations.ContainerProcessDumpLocation, wopts.ProcessDumpLocation) + wopts.NoInheritHostTimezone = parseAnnotationsBool(ctx, s.Annotations, annotations.NoInheritHostTimezone, wopts.NoInheritHostTimezone) handleAnnotationFullyPhysicallyBacked(ctx, s.Annotations, wopts) if err := handleCloneAnnotations(ctx, s.Annotations, wopts); 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 da414bd2a8..e4a4197078 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 @@ -47,6 +47,9 @@ type OptionsWCOW struct { // NoDirectMap specifies that no direct mapping should be used for any VSMBs added to the UVM NoDirectMap bool + + // NoInheritHostTimezone specifies whether to not inherit the hosts timezone for the UVM. UTC will be set as the default for the VM instead. + NoInheritHostTimezone bool } // NewDefaultOptionsWCOW creates the default options for a bootable version of @@ -249,6 +252,7 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error vsmbDirShares: make(map[string]*VSMBShare), vsmbFileShares: make(map[string]*VSMBShare), vpciDevices: make(map[VPCIDeviceKey]*VPCIDevice), + noInheritHostTimezone: opts.NoInheritHostTimezone, physicallyBacked: !opts.AllowOvercommit, devicesPhysicallyBacked: opts.FullyPhysicallyBacked, vsmbNoDirectMap: opts.NoDirectMap, 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 ef76b39ae1..7fd6682cb4 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/start.go @@ -229,11 +229,31 @@ func (uvm *UtilityVM) Start(ctx context.Context) (err error) { if err != nil { return fmt.Errorf("failed to connect to GCS: %s", err) } + + var initGuestState *gcs.InitialGuestState + if uvm.OS() == "windows" { + // Default to setting the time zone in the UVM to the hosts time zone unless the client asked to avoid this behavior. If so, assign + // to UTC. + if uvm.noInheritHostTimezone { + initGuestState = &gcs.InitialGuestState{ + Timezone: utcTimezone, + } + } else { + tz, err := getTimezone() + if err != nil { + return err + } + initGuestState = &gcs.InitialGuestState{ + Timezone: tz, + } + } + } // Start the GCS protocol. gcc := &gcs.GuestConnectionConfig{ - Conn: conn, - Log: log.G(ctx).WithField(logfields.UVMID, uvm.id), - IoListen: gcs.HvsockIoListen(uvm.runtimeID), + Conn: conn, + Log: log.G(ctx).WithField(logfields.UVMID, uvm.id), + IoListen: gcs.HvsockIoListen(uvm.runtimeID), + InitGuestState: initGuestState, } uvm.gc, err = gcc.Connect(ctx, !uvm.IsClone) if err != nil { diff --git a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go new file mode 100644 index 0000000000..18c191cf4a --- /dev/null +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/timezone.go @@ -0,0 +1,58 @@ +package uvm + +import ( + "fmt" + + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" + "golang.org/x/sys/windows" +) + +// UTC has everything set to 0's. Just need to fill in the pointer fields and string identifiers. +var utcTimezone = &hcsschema.TimeZoneInformation{ + StandardName: "Coordinated Universal Time", + DaylightName: "Coordinated Universal Time", + StandardDate: &hcsschema.SystemTime{}, + DaylightDate: &hcsschema.SystemTime{}, +} + +// getTimezone returns the hosts timezone in an HCS TimeZoneInformation structure and an error if there +// is one. +func getTimezone() (*hcsschema.TimeZoneInformation, error) { + var tz windows.Timezoneinformation + _, err := windows.GetTimeZoneInformation(&tz) + if err != nil { + return nil, fmt.Errorf("failed to get time zone information: %w", err) + } + return tziToHCSSchema(&tz), nil +} + +// TZIToHCSSchema converts a windows.TimeZoneInformation (TIME_ZONE_INFORMATION) to the hcs schema equivalent. +func tziToHCSSchema(tzi *windows.Timezoneinformation) *hcsschema.TimeZoneInformation { + return &hcsschema.TimeZoneInformation{ + Bias: tzi.Bias, + StandardName: windows.UTF16ToString(tzi.StandardName[:]), + StandardDate: &hcsschema.SystemTime{ + Year: int32(tzi.StandardDate.Year), + Month: int32(tzi.StandardDate.Month), + DayOfWeek: int32(tzi.StandardDate.DayOfWeek), + Day: int32(tzi.StandardDate.Day), + Hour: int32(tzi.StandardDate.Hour), + Second: int32(tzi.StandardDate.Second), + Minute: int32(tzi.StandardDate.Minute), + Milliseconds: int32(tzi.StandardDate.Milliseconds), + }, + StandardBias: tzi.StandardBias, + DaylightName: windows.UTF16ToString(tzi.DaylightName[:]), + DaylightDate: &hcsschema.SystemTime{ + Year: int32(tzi.DaylightDate.Year), + Month: int32(tzi.DaylightDate.Month), + DayOfWeek: int32(tzi.DaylightDate.DayOfWeek), + Day: int32(tzi.DaylightDate.Day), + Hour: int32(tzi.DaylightDate.Hour), + Second: int32(tzi.DaylightDate.Second), + Minute: int32(tzi.DaylightDate.Minute), + Milliseconds: int32(tzi.DaylightDate.Milliseconds), + }, + DaylightBias: tzi.DaylightBias, + } +} 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 bf0587421f..065f61c0ba 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go +++ b/test/vendor/github.com/Microsoft/hcsshim/internal/uvm/types.go @@ -135,4 +135,8 @@ type UtilityVM struct { // networkSetup handles the logic for setting up and tearing down any network configuration // for the Utility VM. networkSetup NetworkSetup + + // noInheritHostTimezone specifies whether to not inherit the hosts timezone for the UVM. UTC will be set as the default instead. + // This only applies for WCOW. + noInheritHostTimezone bool } diff --git a/test/vendor/github.com/Microsoft/hcsshim/pkg/annotations/annotations.go b/test/vendor/github.com/Microsoft/hcsshim/pkg/annotations/annotations.go index 4202c56aba..88b6d810bb 100644 --- a/test/vendor/github.com/Microsoft/hcsshim/pkg/annotations/annotations.go +++ b/test/vendor/github.com/Microsoft/hcsshim/pkg/annotations/annotations.go @@ -261,4 +261,8 @@ const ( // AnnotationDisableLCOWTimeSyncService is used to disable the chronyd time // synchronization service inside the LCOW UVM. DisableLCOWTimeSyncService = "io.microsoft.virtualmachine.lcow.timesync.disable" + + // NoInheritHostTimezone specifies for the hosts timezone to not be inherited by the WCOW UVM. The UVM will be set to UTC time + // as a default. + NoInheritHostTimezone = "io.microsoft.virtualmachine.wcow.timezone.noinherit" )