@@ -244,10 +244,9 @@ func (g *Generator) ClearAnnotations() {
244244}
245245
246246// AddAnnotation adds an annotation into g.spec.Annotations.
247- func (g * Generator ) AddAnnotation (key , value string ) error {
247+ func (g * Generator ) AddAnnotation (key , value string ) {
248248 g .initSpecAnnotations ()
249249 g .spec .Annotations [key ] = value
250- return nil
251250}
252251
253252// RemoveAnnotation remove an annotation from g.spec.Annotations.
@@ -456,10 +455,9 @@ func (g *Generator) ClearLinuxSysctl() {
456455}
457456
458457// AddLinuxSysctl adds a new sysctl config into g.spec.Linux.Sysctl.
459- func (g * Generator ) AddLinuxSysctl (key , value string ) error {
458+ func (g * Generator ) AddLinuxSysctl (key , value string ) {
460459 g .initSpecLinuxSysctl ()
461460 g .spec .Linux .Sysctl [key ] = value
462- return nil
463461}
464462
465463// RemoveLinuxSysctl removes a sysctl config from g.spec.Linux.Sysctl.
@@ -751,7 +749,7 @@ func (g *Generator) ClearLinuxUIDMappings() {
751749}
752750
753751// AddLinuxUIDMapping adds uidMap into g.spec.Linux.UIDMappings.
754- func (g * Generator ) AddLinuxUIDMapping (hid , cid , size uint32 ) error {
752+ func (g * Generator ) AddLinuxUIDMapping (hid , cid , size uint32 ) {
755753 idMapping := rspec.IDMapping {
756754 HostID : hid ,
757755 ContainerID : cid ,
@@ -760,7 +758,6 @@ func (g *Generator) AddLinuxUIDMapping(hid, cid, size uint32) error {
760758
761759 g .initSpecLinux ()
762760 g .spec .Linux .UIDMappings = append (g .spec .Linux .UIDMappings , idMapping )
763- return nil
764761}
765762
766763// ClearLinuxGIDMappings clear g.spec.Linux.GIDMappings.
@@ -772,7 +769,7 @@ func (g *Generator) ClearLinuxGIDMappings() {
772769}
773770
774771// AddLinuxGIDMapping adds gidMap into g.spec.Linux.GIDMappings.
775- func (g * Generator ) AddLinuxGIDMapping (hid , cid , size uint32 ) error {
772+ func (g * Generator ) AddLinuxGIDMapping (hid , cid , size uint32 ) {
776773 idMapping := rspec.IDMapping {
777774 HostID : hid ,
778775 ContainerID : cid ,
@@ -781,7 +778,6 @@ func (g *Generator) AddLinuxGIDMapping(hid, cid, size uint32) error {
781778
782779 g .initSpecLinux ()
783780 g .spec .Linux .GIDMappings = append (g .spec .Linux .GIDMappings , idMapping )
784- return nil
785781}
786782
787783// SetLinuxRootPropagation sets g.spec.Linux.RootfsPropagation.
@@ -811,11 +807,10 @@ func (g *Generator) ClearPreStartHooks() {
811807}
812808
813809// AddPreStartHook add a prestart hook into g.spec.Hooks.Prestart.
814- func (g * Generator ) AddPreStartHook (path string , args []string ) error {
810+ func (g * Generator ) AddPreStartHook (path string , args []string ) {
815811 g .initSpec ()
816812 hook := rspec.Hook {Path : path , Args : args }
817813 g .spec .Hooks .Prestart = append (g .spec .Hooks .Prestart , hook )
818- return nil
819814}
820815
821816// ClearPostStopHooks clear g.spec.Hooks.Poststop.
@@ -827,11 +822,10 @@ func (g *Generator) ClearPostStopHooks() {
827822}
828823
829824// AddPostStopHook adds a poststop hook into g.spec.Hooks.Poststop.
830- func (g * Generator ) AddPostStopHook (path string , args []string ) error {
825+ func (g * Generator ) AddPostStopHook (path string , args []string ) {
831826 g .initSpec ()
832827 hook := rspec.Hook {Path : path , Args : args }
833828 g .spec .Hooks .Poststop = append (g .spec .Hooks .Poststop , hook )
834- return nil
835829}
836830
837831// ClearPostStartHooks clear g.spec.Hooks.Poststart.
@@ -843,15 +837,14 @@ func (g *Generator) ClearPostStartHooks() {
843837}
844838
845839// AddPostStartHook adds a poststart hook into g.spec.Hooks.Poststart.
846- func (g * Generator ) AddPostStartHook (path string , args []string ) error {
840+ func (g * Generator ) AddPostStartHook (path string , args []string ) {
847841 g .initSpec ()
848842 hook := rspec.Hook {Path : path , Args : args }
849843 g .spec .Hooks .Poststart = append (g .spec .Hooks .Poststart , hook )
850- return nil
851844}
852845
853846// AddTmpfsMount adds a tmpfs mount into g.spec.Mounts.
854- func (g * Generator ) AddTmpfsMount (dest string , options []string ) error {
847+ func (g * Generator ) AddTmpfsMount (dest string , options []string ) {
855848 mnt := rspec.Mount {
856849 Destination : dest ,
857850 Type : "tmpfs" ,
@@ -861,7 +854,6 @@ func (g *Generator) AddTmpfsMount(dest string, options []string) error {
861854
862855 g .initSpec ()
863856 g .spec .Mounts = append (g .spec .Mounts , mnt )
864- return nil
865857}
866858
867859// AddCgroupsMount adds a cgroup mount into g.spec.Mounts.
@@ -888,7 +880,7 @@ func (g *Generator) AddCgroupsMount(mountCgroupOption string) error {
888880}
889881
890882// AddBindMount adds a bind mount into g.spec.Mounts.
891- func (g * Generator ) AddBindMount (source , dest , options string ) error {
883+ func (g * Generator ) AddBindMount (source , dest , options string ) {
892884 if options == "" {
893885 options = "ro"
894886 }
@@ -903,7 +895,6 @@ func (g *Generator) AddBindMount(source, dest, options string) error {
903895 }
904896 g .initSpec ()
905897 g .spec .Mounts = append (g .spec .Mounts , mnt )
906- return nil
907898}
908899
909900// SetupPrivileged sets up the priviledge-related fields inside g.spec.
0 commit comments