Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING CHANGE] seccomp_profile is no longer configurable #53

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cmd/yukid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ repo_config_dir = ["/path/to/config-dir"]
## 如果为 0 的话则不会超时。注意修改的配置仅对新启动的同步容器生效
## 默认值为 0
#sync_timeout = "48h"

## 修改同步时的 seccomp profile,用于特殊用途的容器
## 例如,使用 seccomp user notify 的程序需要放行一些相关的系统调用
## 留空时使用 docker daemon 默认的 seccomp 配置
## 默认值为空
#seccomp_profile = "/path/to/seccomp/profile.json"
```

### Repo Configuration
Expand Down
6 changes: 2 additions & 4 deletions pkg/docker/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ type RunContainerConfig struct {
Name string

// HostConfig
SecurityOpt []string
Binds []string
Binds []string

// NetworkingConfig
Network string
Expand Down Expand Up @@ -80,8 +79,7 @@ func (c *clientImpl) RunContainer(ctx context.Context, config RunContainerConfig
}

cfg.Spec.HostConfig = containerapi.HostConfig{
Binds: config.Binds,
SecurityOpt: config.SecurityOpt,
Binds: config.Binds,
}
cfg.Spec.HostConfig.Mounts = []mount.Mount{
{
Expand Down
1 change: 0 additions & 1 deletion pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Config struct {
PostSync []string `mapstructure:"post_sync"`
ImagesUpgradeInterval time.Duration `mapstructure:"images_upgrade_interval" validate:"min=0"`
SyncTimeout time.Duration `mapstructure:"sync_timeout" validate:"min=0"`
SeccompProfile string `mapstructure:"seccomp_profile" validate:"omitempty,filepath"`
}

var DefaultConfig = Config{
Expand Down
16 changes: 5 additions & 11 deletions pkg/server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,6 @@ func (s *Server) syncRepo(ctx context.Context, name string, debug bool) error {
repo.User = s.config.Owner
}

var securityOpt []string
if len(s.config.SeccompProfile) > 0 {
securityOpt = append(securityOpt, "seccomp="+s.config.SeccompProfile)
}

envMap := repo.Envs
if len(envMap) == 0 {
envMap = make(map[string]string)
Expand Down Expand Up @@ -425,12 +420,11 @@ func (s *Server) syncRepo(ctx context.Context, name string, debug bool) error {
api.LabelRepoName: repo.Name,
api.LabelStorageDir: repo.StorageDir,
},
Env: envs,
Image: repo.Image,
Name: ctName,
SecurityOpt: securityOpt,
Binds: binds,
Network: repo.Network,
Env: envs,
Image: repo.Image,
Name: ctName,
Binds: binds,
Network: repo.Network,
},
)
if err != nil {
Expand Down