Skip to content

Commit d0e0571

Browse files
authored
Merge pull request #28384 from EDuToit/seccomp
Address seccomp profile todo:
2 parents 9df3dd9 + e58ec4d commit d0e0571

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

pkg/api/handlers/compat/info.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func GetInfo(w http.ResponseWriter, r *http.Request) {
110110
RegistryConfig: getServiceConfig(runtime),
111111
RuncCommit: dockerSystem.Commit{},
112112
Runtimes: getRuntimes(configInfo),
113-
SecurityOptions: getSecOpts(sysInfo),
113+
SecurityOptions: getSecOpts(sysInfo, configInfo),
114114
ServerVersion: versionInfo.Version,
115115
SwapLimit: sysInfo.SwapLimit,
116116
Swarm: swarm.Info{
@@ -169,14 +169,17 @@ func getGraphStatus(storeInfo map[string]string) [][2]string {
169169
return graphStatus
170170
}
171171

172-
func getSecOpts(sysInfo *sysinfo.SysInfo) []string {
172+
func getSecOpts(sysInfo *sysinfo.SysInfo, c *config.Config) []string {
173173
var secOpts []string
174174
if sysInfo.AppArmor {
175175
secOpts = append(secOpts, "name=apparmor")
176176
}
177177
if sysInfo.Seccomp {
178-
// FIXME: get profile name...
179-
secOpts = append(secOpts, fmt.Sprintf("name=seccomp,profile=%s", "default"))
178+
profile := "default"
179+
if c.Containers.SeccompProfile != "" && c.Containers.SeccompProfile != config.SeccompDefaultPath {
180+
profile = c.Containers.SeccompProfile
181+
}
182+
secOpts = append(secOpts, fmt.Sprintf("name=seccomp,profile=%s", profile))
180183
}
181184
if rootless.IsRootless() {
182185
secOpts = append(secOpts, "name=rootless")

0 commit comments

Comments
 (0)