mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-04 23:14:19 +01:00
Merge pull request #2223 from tedyu/sandbox-anno
vc: Sandbox#Annotations should use annotationsLock read lock
This commit is contained in:
@@ -225,6 +225,9 @@ func (s *Sandbox) Logger() *logrus.Entry {
|
||||
|
||||
// Annotations returns any annotation that a user could have stored through the sandbox.
|
||||
func (s *Sandbox) Annotations(key string) (string, error) {
|
||||
s.annotationsLock.RLock()
|
||||
defer s.annotationsLock.RUnlock()
|
||||
|
||||
value, exist := s.config.Annotations[key]
|
||||
if !exist {
|
||||
return "", fmt.Errorf("Annotations key %s does not exist", key)
|
||||
|
||||
Reference in New Issue
Block a user