Skip to content

Commit 661a0df

Browse files
fixup! Merged PR 12588213: Various enforcement fixes
Suggested-by: Hamza El-Saawy Co-authored-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
1 parent 44e0616 commit 661a0df

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

  • internal/guest/runtime/hcsv2

internal/guest/runtime/hcsv2/uvm.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,11 @@ var validContainerIDRegex = regexp.MustCompile("^" + validContainerIDRegexRaw +
6666

6767
// idType just changes the error message
6868
func checkValidContainerID(id string, idType string) error {
69-
if id == UVMContainerID {
69+
if id == UVMContainerID || validContainerIDRegex.MatchString(id){
7070
return nil
7171
}
7272

73-
if !validContainerIDRegex.MatchString(id) {
74-
return errors.Errorf("invalid %s id: %s (must match %s)", idType, id, validContainerIDRegex.String())
75-
}
76-
77-
return nil
73+
return errors.Errorf("invalid %s id: %s (must match %s)", idType, id, validContainerIDRegex.String())
7874
}
7975

8076
// VirtualPod represents a virtual pod that shares a UVM/Sandbox with other pods

0 commit comments

Comments
 (0)