Skip to content

Commit 51567e2

Browse files
committed
Fix usage of IsSNP() to handle the new error return value
Signed-off-by: Tingmao Wang <tingmaowang@microsoft.com>
1 parent facd0cf commit 51567e2

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

cmd/gcs/main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,22 @@ func main() {
360360
logrus.WithError(err).Fatal("failed to initialize new runc runtime")
361361
}
362362
mux := bridge.NewBridgeMux()
363+
364+
forceSequential, err := amdsevsnp.IsSNP()
365+
if err != nil {
366+
// IsSNP cannot fail on LCOW
367+
logrus.Errorf("Got unexpected error from IsSNP(): %v", err)
368+
// If it fails, we proceed with forceSequential enabled to be safe
369+
forceSequential = true
370+
}
371+
363372
b := bridge.Bridge{
364373
Handler: mux,
365374
EnableV4: *v4,
366375

367376
// For confidential containers, we protect ourselves against attacks caused
368377
// by concurrent modifications, by processing one request at a time.
369-
ForceSequential: amdsevsnp.IsSNP(),
378+
ForceSequential: forceSequential,
370379
}
371380
h := hcsv2.NewHost(rtime, tport, initialEnforcer, logWriter)
372381
// Initialize virtual pod support in the host

0 commit comments

Comments
 (0)