瀏覽代碼

Replace uses of blacklist/whitelist

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 年之前
父節點
當前提交
3895dd585f
共有 3 個文件被更改,包括 7 次插入7 次删除
  1. 2 2
      builder/dockerfile/copy_windows.go
  2. 4 4
      plugin/manager.go
  3. 1 1
      profiles/seccomp/seccomp_default.go

+ 2 - 2
builder/dockerfile/copy_windows.go

@@ -14,7 +14,7 @@ import (
 	"golang.org/x/sys/windows"
 )
 
-var pathBlacklist = map[string]bool{
+var pathDenyList = map[string]bool{
 	"c:\\":        true,
 	"c:\\windows": true,
 }
@@ -98,7 +98,7 @@ func validateCopySourcePath(imageSource *imageMount, origPath, platform string)
 			p = filepath.Join("c:\\", p)
 		}
 	}
-	if _, blacklisted := pathBlacklist[p]; blacklisted {
+	if _, ok := pathDenyList[p]; ok {
 		return errors.New("copy from c:\\ or c:\\windows is not allowed on windows")
 	}
 	return nil

+ 4 - 4
plugin/manager.go

@@ -298,17 +298,17 @@ func (pm *Manager) GC() {
 	pm.muGC.Lock()
 	defer pm.muGC.Unlock()
 
-	whitelist := make(map[digest.Digest]struct{})
+	used := make(map[digest.Digest]struct{})
 	for _, p := range pm.config.Store.GetAll() {
-		whitelist[p.Config] = struct{}{}
+		used[p.Config] = struct{}{}
 		for _, b := range p.Blobsums {
-			whitelist[b] = struct{}{}
+			used[b] = struct{}{}
 		}
 	}
 
 	ctx := context.TODO()
 	pm.blobStore.Walk(ctx, func(info content.Info) error {
-		_, ok := whitelist[info.Digest]
+		_, ok := used[info.Digest]
 		if ok {
 			return nil
 		}

+ 1 - 1
profiles/seccomp/seccomp_default.go

@@ -40,7 +40,7 @@ func arches() []types.Architecture {
 	}
 }
 
-// DefaultProfile defines the whitelist for the default seccomp profile.
+// DefaultProfile defines the allowed syscalls for the default seccomp profile.
 func DefaultProfile() *types.Seccomp {
 	syscalls := []*types.Syscall{
 		{