File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ func (g *Generator) initConfigLinuxResourcesPids() {
123123 }
124124}
125125
126+ func (g * Generator ) initConfigLinuxResourcesUnified () {
127+ g .initConfigLinuxResources ()
128+ if g .Config .Linux .Resources .Unified == nil {
129+ g .Config .Linux .Resources .Unified = map [string ]string {}
130+ }
131+ }
132+
126133func (g * Generator ) initConfigSolaris () {
127134 g .initConfig ()
128135 if g .Config .Solaris == nil {
Original file line number Diff line number Diff line change @@ -857,6 +857,28 @@ func (g *Generator) DropLinuxResourcesHugepageLimit(pageSize string) {
857857 }
858858}
859859
860+ // AddLinuxResourcesUnified sets the g.Config.Linux.Resources.Unified
861+ func (g * Generator ) SetLinuxResourcesUnified (unified map [string ]string ) {
862+ g .initConfigLinuxResourcesUnified ()
863+ for k , v := range unified {
864+ g .Config .Linux .Resources .Unified [k ] = v
865+ }
866+ }
867+
868+ // AddLinuxResourcesUnified adds or updates the key-value pair from g.Config.Linux.Resources.Unified
869+ func (g * Generator ) AddLinuxResourcesUnified (key , val string ) {
870+ g .initConfigLinuxResourcesUnified ()
871+ g .Config .Linux .Resources .Unified [key ] = val
872+ }
873+
874+ // DropLinuxResourcesUnified drops a key-value pair from g.Config.Linux.Resources.Unified
875+ func (g * Generator ) DropLinuxResourcesUnified (key string ) {
876+ if g .Config == nil || g .Config .Linux == nil || g .Config .Linux .Resources == nil || g .Config .Linux .Resources .Unified == nil {
877+ return
878+ }
879+ delete (g .Config .Linux .Resources .Unified , key )
880+ }
881+
860882// SetLinuxResourcesMemoryLimit sets g.Config.Linux.Resources.Memory.Limit.
861883func (g * Generator ) SetLinuxResourcesMemoryLimit (limit int64 ) {
862884 g .initConfigLinuxResourcesMemory ()
You can’t perform that action at this time.
0 commit comments