platformInspectContainerHostConfig: rm dead code
In this code, g.HostSpecific is _always_ false, as it is never set by generate.New and is thus left at the default value (false). Remove dead code. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
		
							parent
							
								
									13b78c9da9
								
							
						
					
					
						commit
						6a91149b53
					
				| 
						 | 
				
			
			@ -11,8 +11,6 @@ import (
 | 
			
		|||
	"github.com/containers/podman/v5/libpod/define"
 | 
			
		||||
	"github.com/containers/podman/v5/pkg/util"
 | 
			
		||||
	spec "github.com/opencontainers/runtime-spec/specs-go"
 | 
			
		||||
	"github.com/opencontainers/runtime-tools/generate"
 | 
			
		||||
	"github.com/opencontainers/runtime-tools/validate/capabilities"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/syndtr/gocapability/capability"
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			@ -152,15 +150,8 @@ func (c *Container) platformInspectContainerHostConfig(ctrSpec *spec.Spec, hostC
 | 
			
		|||
				boundingCaps[cap] = true
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			g, err := generate.New("linux")
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
			// If we are privileged, use all caps.
 | 
			
		||||
			for _, cap := range capability.List() {
 | 
			
		||||
				if g.HostSpecific && cap > capabilities.LastCap() {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
				boundingCaps[fmt.Sprintf("CAP_%s", strings.ToUpper(cap.String()))] = true
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue