Skip to content

Commit

Permalink
set spac cgroup option
Browse files Browse the repository at this point in the history
Signed-off-by: karta0807913 <[email protected]>
  • Loading branch information
karta0807913 authored Nov 26, 2022
1 parent 779333e commit 4527b5e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/specgen/generate/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/containers/common/libimage"
"github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/parse"
"github.com/containers/common/pkg/secrets"
cutil "github.com/containers/common/pkg/util"
Expand Down Expand Up @@ -145,6 +146,16 @@ type CtrSpecGenOptions struct {
func ToSpecGen(ctx context.Context, opts *CtrSpecGenOptions) (*specgen.SpecGenerator, error) {
s := specgen.NewSpecGenerator(opts.Container.Image, false)

rtc, err := config.Default()
if err != nil {
return nil, err
}

if s.CgroupsMode == "" {
s.CgroupsMode = rtc.Cgroups()
}


// pod name should be non-empty for Deployment objects to be able to create
// multiple pods having containers with unique names
if len(opts.PodName) < 1 {
Expand Down

0 comments on commit 4527b5e

Please sign in to comment.