Skip to content

Commit 0ed9bd0

Browse files
committed
pr feedback: add comment for mutex lock, sizeKB debug field name
Signed-off-by: Maksim An <[email protected]>
1 parent a1de02a commit 0ed9bd0

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

internal/guest/runtime/hcsv2/spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func applyAnnotationsToSpec(ctx context.Context, spec *oci.Spec) error {
197197
}
198198
spec.Mounts = removeMount("/dev/shm", spec.Mounts)
199199
spec.Mounts = append(spec.Mounts, *mt)
200-
log.G(ctx).WithField("size in KB", val).Debug("set custom /dev/shm size")
200+
log.G(ctx).WithField("sizeKB", val).Debug("set custom /dev/shm size")
201201
}
202202

203203
// Check if we need to do any capability/device mappings

pkg/securitypolicy/securitypolicyenforcer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ func envIsMatchedByRule(envVariable string, rules []EnvRuleConfig) bool {
590590
return false
591591
}
592592

593+
// StandardSecurityPolicyEnforcer.mutex lock must be held prior to calling this function.
593594
func (pe *StandardSecurityPolicyEnforcer) expandMatchesForContainerIndex(index int, idToAdd string) {
594595
_, keyExists := pe.ContainerIndexToContainerIds[index]
595596
if !keyExists {
@@ -599,6 +600,7 @@ func (pe *StandardSecurityPolicyEnforcer) expandMatchesForContainerIndex(index i
599600
pe.ContainerIndexToContainerIds[index][idToAdd] = struct{}{}
600601
}
601602

603+
// StandardSecurityPolicyEnforcer.mutex lock must be held prior to calling this function.
602604
func (pe *StandardSecurityPolicyEnforcer) narrowMatchesForContainerIndex(index int, idToRemove string) {
603605
delete(pe.ContainerIndexToContainerIds[index], idToRemove)
604606
}
@@ -620,6 +622,7 @@ func equalForOverlay(a1 []string, a2 []string) bool {
620622
return true
621623
}
622624

625+
// StandardSecurityPolicyEnforcer.mutex lock must be held prior to calling this function.
623626
func (pe *StandardSecurityPolicyEnforcer) possibleIndicesForID(containerID string) []int {
624627
var possibleIndices []int
625628
for index, ids := range pe.ContainerIndexToContainerIds {

test/vendor/github.com/Microsoft/hcsshim/pkg/securitypolicy/securitypolicyenforcer.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)