From 13ca8125a795e2fa1281c5ee7a491980595a9e74 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 10 Oct 2025 21:52:55 -0700 Subject: [PATCH 01/15] Add UniqueId to VirtualHardDiskProperties --- services/storage/storage.go | 2 ++ services/storage/virtualharddisk/virtualharddisk.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/services/storage/storage.go b/services/storage/storage.go index 5f1a2957..86b71144 100644 --- a/services/storage/storage.go +++ b/services/storage/storage.go @@ -41,6 +41,8 @@ type VirtualHardDiskProperties struct { CloudInitDataSource common.CloudInitDataSource `json:"cloudInitDataSource,omitempty"` // Container name ContainerName *string `json:"containername,omitempty"` + // UniqueId of the VHD + UniqueId *string `json:"uniqueId,omitempty"` } // VirtualHardDisk defines the structure of a VHD diff --git a/services/storage/virtualharddisk/virtualharddisk.go b/services/storage/virtualharddisk/virtualharddisk.go index 150bcad3..4e9399d1 100644 --- a/services/storage/virtualharddisk/virtualharddisk.go +++ b/services/storage/virtualharddisk/virtualharddisk.go @@ -61,6 +61,10 @@ func getWssdVirtualHardDisk(c *storage.VirtualHardDisk, groupName, containerName wssdvhd.DiskFileFormat = c.DiskFileFormat wssdvhd.CloudInitDataSource = c.CloudInitDataSource + + if c.UniqueId != nil { + wssdvhd.UniqueId = *c.UniqueId + } } return wssdvhd, nil } @@ -86,6 +90,7 @@ func getVirtualHardDisk(c *wssdcloudstorage.VirtualHardDisk, group string) *stor HyperVGeneration: c.HyperVGeneration, DiskFileFormat: c.DiskFileFormat, ContainerName: &c.ContainerName, + UniqueId: &c.UniqueId, }, Tags: tags.ProtoToMap(c.Tags), } From dff10daf8ad93bce905697e4857581b3f6c7f0aa Mon Sep 17 00:00:00 2001 From: yuanzh Date: Tue, 14 Oct 2025 14:20:18 -0700 Subject: [PATCH 02/15] Rename UniqueId to PlatformDiskId --- go.mod | 21 ++++++++------- go.sum | 27 ++++++++++--------- services/storage/storage.go | 4 +-- .../virtualharddisk/virtualharddisk.go | 6 ++--- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index cc199202..67222284 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,14 @@ module github.com/microsoft/moc-sdk-for-go -go 1.23.0 +go 1.24.0 + +toolchain go1.24.7 require ( code.cloudfoundry.org/bytefmt v0.0.0-20210608160410-67692ebc98de github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/date v0.3.0 - github.com/google/go-cmp v0.6.0 + github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 github.com/microsoft/moc v0.35.3 google.golang.org/grpc v1.72.0 @@ -26,7 +28,7 @@ require ( github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.23.0 // indirect @@ -61,14 +63,14 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/crypto v0.37.0 // indirect - golang.org/x/net v0.39.0 // indirect + golang.org/x/net v0.41.0 // indirect golang.org/x/oauth2 v0.26.0 // indirect - golang.org/x/sync v0.13.0 // indirect + golang.org/x/sync v0.17.0 // indirect golang.org/x/term v0.31.0 // indirect - golang.org/x/text v0.24.0 // indirect + golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.7.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -94,8 +96,8 @@ require ( github.com/stretchr/testify v1.9.0 go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect - golang.org/x/sys v0.32.0 // indirect - google.golang.org/protobuf v1.36.9 + golang.org/x/sys v0.33.0 // indirect + google.golang.org/protobuf v1.36.10 ) replace ( @@ -103,6 +105,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-retryablehttp => github.com/hashicorp/go-retryablehttp v0.7.7 + github.com/microsoft/moc => github.com/YuanMSFT/moc v0.0.0-20251014172948-b76a852dd9e8 github.com/miekg/dns => github.com/miekg/dns v1.1.25 github.com/nats-io/nkeys => github.com/nats-io/nkeys v0.4.6 golang.org/x/crypto => golang.org/x/crypto v0.37.0 diff --git a/go.sum b/go.sum index d78f7ec4..954987e2 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyT github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= @@ -87,8 +87,9 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -122,8 +123,6 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/microsoft/moc v0.35.3 h1:FYdaYlbWJb/tpM3CH+iAmxePDNsbKLsWfTg7pbPrbsg= -github.com/microsoft/moc v0.35.3/go.mod h1:UzCniwjpnp5sR/JsjAZtb3sTEh+S/qB6Kd67FQHpeD0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -241,8 +240,9 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= +golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 h1:TyKJRhyo17yWxOMCTHKWrc5rddHORMlnZ/j57umaUd8= golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= @@ -252,8 +252,9 @@ golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -265,16 +266,16 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= -golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE= +golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 h1:h6p3mQqrmT1XkHVTfzLdNz1u7IhINeZkz67/xTbOuWs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff h1:A90eA31Wq6HOMIQlLfzFwzqGKBTuaVztYu/g8sn+8Zc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -285,8 +286,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= -google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE= +google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/services/storage/storage.go b/services/storage/storage.go index 86b71144..bd6c3e56 100644 --- a/services/storage/storage.go +++ b/services/storage/storage.go @@ -41,8 +41,8 @@ type VirtualHardDiskProperties struct { CloudInitDataSource common.CloudInitDataSource `json:"cloudInitDataSource,omitempty"` // Container name ContainerName *string `json:"containername,omitempty"` - // UniqueId of the VHD - UniqueId *string `json:"uniqueId,omitempty"` + // PlatformDiskId of the VHD + PlatformDiskId *string `json:"platformDiskId,omitempty"` } // VirtualHardDisk defines the structure of a VHD diff --git a/services/storage/virtualharddisk/virtualharddisk.go b/services/storage/virtualharddisk/virtualharddisk.go index 4e9399d1..92c85535 100644 --- a/services/storage/virtualharddisk/virtualharddisk.go +++ b/services/storage/virtualharddisk/virtualharddisk.go @@ -62,8 +62,8 @@ func getWssdVirtualHardDisk(c *storage.VirtualHardDisk, groupName, containerName wssdvhd.CloudInitDataSource = c.CloudInitDataSource - if c.UniqueId != nil { - wssdvhd.UniqueId = *c.UniqueId + if c.PlatformDiskId != nil { + wssdvhd.PlatformDiskId = *c.PlatformDiskId } } return wssdvhd, nil @@ -90,7 +90,7 @@ func getVirtualHardDisk(c *wssdcloudstorage.VirtualHardDisk, group string) *stor HyperVGeneration: c.HyperVGeneration, DiskFileFormat: c.DiskFileFormat, ContainerName: &c.ContainerName, - UniqueId: &c.UniqueId, + PlatformDiskId: &c.PlatformDiskId, }, Tags: tags.ProtoToMap(c.Tags), } From 2cf75225d9687f4bdcea20a5fdd58f4cb743c8cc Mon Sep 17 00:00:00 2001 From: yuanzh Date: Tue, 14 Oct 2025 16:48:41 -0700 Subject: [PATCH 03/15] fix test log --- services/security/identity/identity_test.go | 6 +++--- services/security/role/role_test.go | 4 ++-- .../security/roleassignment/roleassignment_test.go | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/services/security/identity/identity_test.go b/services/security/identity/identity_test.go index 2dd9086f..995f2c51 100644 --- a/services/security/identity/identity_test.go +++ b/services/security/identity/identity_test.go @@ -127,11 +127,11 @@ func Test_getWssdIdeneityValid(t *testing.T) { var err error _, err = getWssdIdentity(&expectedIdenityAutoRotateDisabled) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } _, err = getWssdIdentity(&expectedIdenityAutoRotateEnabledEmptyPath) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } if runtime.GOOS == "windows" { expectedIdenityAutoRotateEnabledAbsolutePath.LoginFilePath = &LoginFilePathAbsoluteWindows @@ -140,7 +140,7 @@ func Test_getWssdIdeneityValid(t *testing.T) { } _, err = getWssdIdentity(&expectedIdenityAutoRotateEnabledAbsolutePath) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } } diff --git a/services/security/role/role_test.go b/services/security/role/role_test.go index 6d4b5fed..56e53dad 100644 --- a/services/security/role/role_test.go +++ b/services/security/role/role_test.go @@ -124,7 +124,7 @@ func Test_getMocRole(t *testing.T) { mocRole, err := getMocRole(&expectedRole) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } if mocRole.Name != expectedMocRole.Name { @@ -179,7 +179,7 @@ func Test_getRole(t *testing.T) { role, err := getRole(&inputMocRole) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } if *role.ID != *outRole.ID { diff --git a/services/security/roleassignment/roleassignment_test.go b/services/security/roleassignment/roleassignment_test.go index 520ff673..0624b4bd 100644 --- a/services/security/roleassignment/roleassignment_test.go +++ b/services/security/roleassignment/roleassignment_test.go @@ -58,10 +58,10 @@ var ( func Test_getMocRoleAssignmentNoName(t *testing.T) { mocRA, err := getMocRoleAssignment(&expectedRA) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } if err := compareMocRas(mocRA, &expectedMocRA); err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } } @@ -73,11 +73,11 @@ func Test_getMocRoleAssignment(t *testing.T) { mocRA, err := getMocRoleAssignment(&inputRA) if err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } if err := compareMocRas(mocRA, &outMocRA); err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } } @@ -91,7 +91,7 @@ func Test_getRoleAssignmentNoName(t *testing.T) { ra := getRoleAssignment(&inputMocRA) if err := compareRas(ra, &outRA); err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } } @@ -105,7 +105,7 @@ func Test_getRoleAssignment(t *testing.T) { ra := getRoleAssignment(&inputMocRA) if err := compareRas(ra, &outRA); err != nil { - t.Errorf(err.Error()) + t.Errorf(err.Error(), "error") } } From ab9fc552c2408d5052351102c429e570e1633fe1 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Tue, 14 Oct 2025 16:58:01 -0700 Subject: [PATCH 04/15] fix test log --- go.mod | 6 ++-- go.sum | 28 +++++++++++-------- services/security/identity/identity_test.go | 6 ++-- services/security/role/role_test.go | 4 +-- .../roleassignment/roleassignment_test.go | 12 ++++---- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 67222284..847c930a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 github.com/microsoft/moc v0.35.3 - google.golang.org/grpc v1.72.0 + google.golang.org/grpc v1.75.1 k8s.io/klog v1.0.0 sigs.k8s.io/controller-runtime v0.20.4 ) @@ -62,9 +62,9 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/crypto v0.37.0 // indirect + golang.org/x/crypto v0.39.0 // indirect golang.org/x/net v0.41.0 // indirect - golang.org/x/oauth2 v0.26.0 // indirect + golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sync v0.17.0 // indirect golang.org/x/term v0.31.0 // indirect golang.org/x/text v0.30.0 // indirect diff --git a/go.sum b/go.sum index 954987e2..913ef5de 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/YuanMSFT/moc v0.0.0-20251014172948-b76a852dd9e8 h1:8qLpA6R5Ye7PlgwEO1forpZZZM8EH9YxX88GXU5aUzE= +github.com/YuanMSFT/moc v0.0.0-20251014172948-b76a852dd9e8/go.mod h1:4oNUacJLu/VuJqPjUe+xCegxmfI/kBT7THVtst22FkA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -200,16 +202,16 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= -go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= -go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= -go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= -go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= -go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= -go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= +go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= +go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= +go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= +go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -274,10 +276,12 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff h1:A90eA31Wq6HOMIQlLfzFwzqGKBTuaVztYu/g8sn+8Zc= google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= -google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= -google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= +google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/services/security/identity/identity_test.go b/services/security/identity/identity_test.go index 995f2c51..91334aa1 100644 --- a/services/security/identity/identity_test.go +++ b/services/security/identity/identity_test.go @@ -127,11 +127,11 @@ func Test_getWssdIdeneityValid(t *testing.T) { var err error _, err = getWssdIdentity(&expectedIdenityAutoRotateDisabled) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } _, err = getWssdIdentity(&expectedIdenityAutoRotateEnabledEmptyPath) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } if runtime.GOOS == "windows" { expectedIdenityAutoRotateEnabledAbsolutePath.LoginFilePath = &LoginFilePathAbsoluteWindows @@ -140,7 +140,7 @@ func Test_getWssdIdeneityValid(t *testing.T) { } _, err = getWssdIdentity(&expectedIdenityAutoRotateEnabledAbsolutePath) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } } diff --git a/services/security/role/role_test.go b/services/security/role/role_test.go index 56e53dad..3df38108 100644 --- a/services/security/role/role_test.go +++ b/services/security/role/role_test.go @@ -124,7 +124,7 @@ func Test_getMocRole(t *testing.T) { mocRole, err := getMocRole(&expectedRole) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } if mocRole.Name != expectedMocRole.Name { @@ -179,7 +179,7 @@ func Test_getRole(t *testing.T) { role, err := getRole(&inputMocRole) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } if *role.ID != *outRole.ID { diff --git a/services/security/roleassignment/roleassignment_test.go b/services/security/roleassignment/roleassignment_test.go index 0624b4bd..25836e37 100644 --- a/services/security/roleassignment/roleassignment_test.go +++ b/services/security/roleassignment/roleassignment_test.go @@ -58,10 +58,10 @@ var ( func Test_getMocRoleAssignmentNoName(t *testing.T) { mocRA, err := getMocRoleAssignment(&expectedRA) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } if err := compareMocRas(mocRA, &expectedMocRA); err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } } @@ -73,11 +73,11 @@ func Test_getMocRoleAssignment(t *testing.T) { mocRA, err := getMocRoleAssignment(&inputRA) if err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } if err := compareMocRas(mocRA, &outMocRA); err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } } @@ -91,7 +91,7 @@ func Test_getRoleAssignmentNoName(t *testing.T) { ra := getRoleAssignment(&inputMocRA) if err := compareRas(ra, &outRA); err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } } @@ -105,7 +105,7 @@ func Test_getRoleAssignment(t *testing.T) { ra := getRoleAssignment(&inputMocRA) if err := compareRas(ra, &outRA); err != nil { - t.Errorf(err.Error(), "error") + t.Error(err.Error()) } } From 95ad0e14f45524a3ccae9f5e61c51a5047517e94 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Tue, 14 Oct 2025 17:33:37 -0700 Subject: [PATCH 05/15] Fix build --- .pipelines/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index d2a2ab9c..918c7517 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -49,10 +49,10 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Build' - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'SBOM Generation' - inputs: - BuildDropPath: $(System.DefaultWorkingDirectory)/manifest + - #task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + #displayName: 'SBOM Generation' + #inputs: + # BuildDropPath: $(System.DefaultWorkingDirectory)/manifest - publish: $(System.DefaultWorkingDirectory)/bin artifact: binaries From 712e1392a431b8f84775c0483337fe31ea5b637f Mon Sep 17 00:00:00 2001 From: yuanzh Date: Tue, 14 Oct 2025 17:40:31 -0700 Subject: [PATCH 06/15] Fix build --- .pipelines/build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index 918c7517..cb2d8bd5 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -49,10 +49,10 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Build' - - #task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - #displayName: 'SBOM Generation' - #inputs: - # BuildDropPath: $(System.DefaultWorkingDirectory)/manifest + #- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + # displayName: 'SBOM Generation' + # inputs: + # BuildDropPath: $(System.DefaultWorkingDirectory)/manifest - publish: $(System.DefaultWorkingDirectory)/bin artifact: binaries From d74efcd8a8c5792da00fbc8efeedb6de0d9e4f59 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Sun, 19 Oct 2025 14:41:28 -0700 Subject: [PATCH 07/15] Bump moc ref version --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 847c930a..23d68a3d 100644 --- a/go.mod +++ b/go.mod @@ -70,7 +70,7 @@ require ( golang.org/x/text v0.30.0 // indirect golang.org/x/time v0.7.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -105,7 +105,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-retryablehttp => github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/microsoft/moc => github.com/YuanMSFT/moc v0.0.0-20251014172948-b76a852dd9e8 + github.com/microsoft/moc => github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 github.com/miekg/dns => github.com/miekg/dns v1.1.25 github.com/nats-io/nkeys => github.com/nats-io/nkeys v0.4.6 golang.org/x/crypto => golang.org/x/crypto v0.37.0 diff --git a/go.sum b/go.sum index 913ef5de..1e8d55af 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/YuanMSFT/moc v0.0.0-20251014172948-b76a852dd9e8 h1:8qLpA6R5Ye7PlgwEO1forpZZZM8EH9YxX88GXU5aUzE= -github.com/YuanMSFT/moc v0.0.0-20251014172948-b76a852dd9e8/go.mod h1:4oNUacJLu/VuJqPjUe+xCegxmfI/kBT7THVtst22FkA= +github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 h1:cRlIYUJ9n7P1sNZGmsQvlhFC0WWkaBGSNkYYCvtK6xk= +github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -278,8 +278,8 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff h1:A90eA31Wq6HOMIQlLfzFwzqGKBTuaVztYu/g8sn+8Zc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20251007200510-49b9836ed3ff/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f h1:1FTH6cpXFsENbPR5Bu8NQddPSaUUE6NA2XdZdDSAJK4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251014184007-4626949a642f/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI= google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= From 37dc2c2f7dc78ec49d82199e2e6d450ecebd6df1 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Thu, 23 Oct 2025 16:37:21 -0700 Subject: [PATCH 08/15] Update moc version --- go.mod | 3 +-- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 23d68a3d..beee28f7 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/microsoft/moc v0.35.3 + github.com/microsoft/moc v0.35.4 google.golang.org/grpc v1.75.1 k8s.io/klog v1.0.0 sigs.k8s.io/controller-runtime v0.20.4 @@ -105,7 +105,6 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-retryablehttp => github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/microsoft/moc => github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 github.com/miekg/dns => github.com/miekg/dns v1.1.25 github.com/nats-io/nkeys => github.com/nats-io/nkeys v0.4.6 golang.org/x/crypto => golang.org/x/crypto v0.37.0 diff --git a/go.sum b/go.sum index 1e8d55af..9e00ad6c 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,6 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 h1:cRlIYUJ9n7P1sNZGmsQvlhFC0WWkaBGSNkYYCvtK6xk= -github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -125,6 +123,8 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/microsoft/moc v0.35.4 h1:TZ3tf/qCa23Ob7YLKTLJS85RUktB8UfYSjuusTMlVwE= +github.com/microsoft/moc v0.35.4/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= From 29d31793d5c962fcfabe54bcbdbad47f1148b477 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 00:40:06 -0700 Subject: [PATCH 09/15] Fix build --- .pipelines/build.yaml | 10 +++++----- go.mod | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index cb2d8bd5..0f823d79 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -49,10 +49,10 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Build' - #- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - # displayName: 'SBOM Generation' - # inputs: - # BuildDropPath: $(System.DefaultWorkingDirectory)/manifest + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'SBOM Generation' + inputs: + BuildDropPath: $(System.DefaultWorkingDirectory)/manifest - publish: $(System.DefaultWorkingDirectory)/bin artifact: binaries @@ -78,4 +78,4 @@ jobs: - script: | make golangci-lint displayName: 'Run GolangCI-Lint' - workingDirectory: '$(System.DefaultWorkingDirectory)' + workingDirectory: '$(System.DefaultWorkingDirectory)' \ No newline at end of file diff --git a/go.mod b/go.mod index beee28f7..05a8b4a0 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/microsoft/moc-sdk-for-go go 1.24.0 -toolchain go1.24.7 - require ( code.cloudfoundry.org/bytefmt v0.0.0-20210608160410-67692ebc98de github.com/Azure/go-autorest/autorest v0.11.29 From 27089367870ba2c010071d3444ca4a03707e9231 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 01:07:12 -0700 Subject: [PATCH 10/15] Revert "Fix build" This reverts commit 29d31793d5c962fcfabe54bcbdbad47f1148b477. --- .pipelines/build.yaml | 10 +++++----- go.mod | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index 0f823d79..cb2d8bd5 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -49,10 +49,10 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Build' - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'SBOM Generation' - inputs: - BuildDropPath: $(System.DefaultWorkingDirectory)/manifest + #- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + # displayName: 'SBOM Generation' + # inputs: + # BuildDropPath: $(System.DefaultWorkingDirectory)/manifest - publish: $(System.DefaultWorkingDirectory)/bin artifact: binaries @@ -78,4 +78,4 @@ jobs: - script: | make golangci-lint displayName: 'Run GolangCI-Lint' - workingDirectory: '$(System.DefaultWorkingDirectory)' \ No newline at end of file + workingDirectory: '$(System.DefaultWorkingDirectory)' diff --git a/go.mod b/go.mod index 05a8b4a0..beee28f7 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/microsoft/moc-sdk-for-go go 1.24.0 +toolchain go1.24.7 + require ( code.cloudfoundry.org/bytefmt v0.0.0-20210608160410-67692ebc98de github.com/Azure/go-autorest/autorest v0.11.29 From 0fb7b0be889b4a21c87642960c40f7f5936b2603 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 01:08:35 -0700 Subject: [PATCH 11/15] Revert "Update moc version" This reverts commit 37dc2c2f7dc78ec49d82199e2e6d450ecebd6df1. --- go.mod | 3 ++- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index beee28f7..23d68a3d 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/microsoft/moc v0.35.4 + github.com/microsoft/moc v0.35.3 google.golang.org/grpc v1.75.1 k8s.io/klog v1.0.0 sigs.k8s.io/controller-runtime v0.20.4 @@ -105,6 +105,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-retryablehttp => github.com/hashicorp/go-retryablehttp v0.7.7 + github.com/microsoft/moc => github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 github.com/miekg/dns => github.com/miekg/dns v1.1.25 github.com/nats-io/nkeys => github.com/nats-io/nkeys v0.4.6 golang.org/x/crypto => golang.org/x/crypto v0.37.0 diff --git a/go.sum b/go.sum index 9e00ad6c..1e8d55af 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,8 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 h1:cRlIYUJ9n7P1sNZGmsQvlhFC0WWkaBGSNkYYCvtK6xk= +github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -123,8 +125,6 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/microsoft/moc v0.35.4 h1:TZ3tf/qCa23Ob7YLKTLJS85RUktB8UfYSjuusTMlVwE= -github.com/microsoft/moc v0.35.4/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= From fe53ddc922193f53c4b29046fe084d33f7e04dd1 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 01:22:46 -0700 Subject: [PATCH 12/15] Update moc version --- .pipelines/build.yaml | 8 ++++---- go.mod | 3 +-- go.sum | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index cb2d8bd5..d2a2ab9c 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -49,10 +49,10 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Build' - #- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - # displayName: 'SBOM Generation' - # inputs: - # BuildDropPath: $(System.DefaultWorkingDirectory)/manifest + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'SBOM Generation' + inputs: + BuildDropPath: $(System.DefaultWorkingDirectory)/manifest - publish: $(System.DefaultWorkingDirectory)/bin artifact: binaries diff --git a/go.mod b/go.mod index 23d68a3d..beee28f7 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/microsoft/moc v0.35.3 + github.com/microsoft/moc v0.35.4 google.golang.org/grpc v1.75.1 k8s.io/klog v1.0.0 sigs.k8s.io/controller-runtime v0.20.4 @@ -105,7 +105,6 @@ replace ( github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/hashicorp/go-retryablehttp => github.com/hashicorp/go-retryablehttp v0.7.7 - github.com/microsoft/moc => github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 github.com/miekg/dns => github.com/miekg/dns v1.1.25 github.com/nats-io/nkeys => github.com/nats-io/nkeys v0.4.6 golang.org/x/crypto => golang.org/x/crypto v0.37.0 diff --git a/go.sum b/go.sum index 1e8d55af..9e00ad6c 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,6 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130 h1:cRlIYUJ9n7P1sNZGmsQvlhFC0WWkaBGSNkYYCvtK6xk= -github.com/YuanMSFT/moc v0.0.0-20251019194434-4b0c7279f130/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -125,6 +123,8 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/microsoft/moc v0.35.4 h1:TZ3tf/qCa23Ob7YLKTLJS85RUktB8UfYSjuusTMlVwE= +github.com/microsoft/moc v0.35.4/go.mod h1:Z19DHc5ziqJ8BYKOw3RksDBH7vrdvxPw0PHrG+MzCtA= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= From 72704cae28d278d3db3c24bd4fdbcc228ad22505 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 02:08:42 -0700 Subject: [PATCH 13/15] Fix build --- .pipelines/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index d2a2ab9c..bea47ec2 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -26,6 +26,7 @@ jobs: sshKeySecureFile: 'azure-pipelines-ssh-key-new' - script: | git config --global url.ssh://git@github.com/.insteadOf https://github.com/ + git config --global url."msazure@vs-ssh.visualstudio.com:v3".insteadOf https://msazure.visualstudio.com displayName: 'Set up the Go workspace' - script: | From 911daa6a764166495adefe0d5b4cd7f684fb1d78 Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 02:26:34 -0700 Subject: [PATCH 14/15] Fix build --- .pipelines/build.yaml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index bea47ec2..22901717 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -21,13 +21,30 @@ jobs: version: '1.22.5' - task: InstallSSHKey@0 inputs: - knownHostsEntry: '$(KNOWN_HOST)' + knownHostsEntry: | + $(KNOWN_HOST_GITHUB) + $(KNOWN_HOST_GITHUB_ECDSA) + $(KNOWN_HOST_GITHUB_Ed25519) sshPublicKey: '$(SSH_PUBLIC_KEY)' sshKeySecureFile: 'azure-pipelines-ssh-key-new' - - script: | - git config --global url.ssh://git@github.com/.insteadOf https://github.com/ - git config --global url."msazure@vs-ssh.visualstudio.com:v3".insteadOf https://msazure.visualstudio.com - displayName: 'Set up the Go workspace' + + - task: AzureCLI@2 + inputs: + azureSubscription: 'kva-azuredevops-gcm' + scriptType: 'bash' + scriptLocation: 'inlineScript' + inlineScript: | + + # Note that the resource is specified to limit the token to Azure DevOps + aadToken=$(az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv) + + # uncomment these for more debugging spew + # GIT_TRACE=1 + # GIT_CURL_VERBOSE=1 + + git config --global http.extraheader "AUTHORIZATION: bearer $aadToken" + git config --global url."ssh://git@github.com/".insteadOf "https://github.com/" + displayName: 'Set git config' - script: | sudo apt-get install gcc-mingw-w64 From f1aea849b22df79d24d97f13d7d37fed8e618e1f Mon Sep 17 00:00:00 2001 From: yuanzh Date: Fri, 24 Oct 2025 03:03:25 -0700 Subject: [PATCH 15/15] Fix build --- .pipelines/build.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/build.yaml b/.pipelines/build.yaml index 22901717..8146bc52 100644 --- a/.pipelines/build.yaml +++ b/.pipelines/build.yaml @@ -67,15 +67,15 @@ jobs: workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Build' - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: 'SBOM Generation' - inputs: - BuildDropPath: $(System.DefaultWorkingDirectory)/manifest +# - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 +# displayName: 'SBOM Generation' +# inputs: +# BuildDropPath: $(System.DefaultWorkingDirectory)/manifest - publish: $(System.DefaultWorkingDirectory)/bin artifact: binaries - - publish: $(System.DefaultWorkingDirectory)/manifest - artifact: manifest +# - publish: $(System.DefaultWorkingDirectory)/manifest +# artifact: manifest - job: Lint displayName: 'Lint'