File tree Expand file tree Collapse file tree
plugins/default-validator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ const (
4343 DefaultPluginPath = "/opt/nri/plugins"
4444 // DefaultSocketPath is the default socket path for external plugins.
4545 DefaultSocketPath = api .DefaultSocketPath
46- // PluginConfigDir is the drop-in directory for NRI-launched plugin configuration.
46+ // DefaultPluginConfigPath is the drop-in directory for NRI-launched plugin configuration.
4747 DefaultPluginConfigPath = "/etc/nri/conf.d"
4848)
4949
@@ -711,6 +711,7 @@ func (r *Adaptation) finishedPluginSync() {
711711 r .syncLock .Unlock ()
712712}
713713
714+ // PluginSyncBlock is a handle for blocking plugin synchronization.
714715type PluginSyncBlock struct {
715716 r * Adaptation
716717}
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ func (a *ContainerAdjustment) AddHooks(h *Hooks) {
116116 }
117117}
118118
119+ // AddRlimit records the addition of rlimit (POSIX resource limits) to a container.
119120func (a * ContainerAdjustment ) AddRlimit (typ string , hard , soft uint64 ) {
120121 a .initRlimits ()
121122 a .Rlimits = append (a .Rlimits , & POSIXRlimit {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package api
1818
1919import "time"
2020
21+ // GetCreatedAtTime returns the time the container was created at as time.Time.
2122func (x * Container ) GetCreatedAtTime () time.Time {
2223 t := time.Time {}
2324 if x != nil {
@@ -26,6 +27,7 @@ func (x *Container) GetCreatedAtTime() time.Time {
2627 return t
2728}
2829
30+ // GetStartedAtTime returns the time the container was started at as time.Time.
2931func (x * Container ) GetStartedAtTime () time.Time {
3032 t := time.Time {}
3133 if x != nil {
@@ -34,6 +36,7 @@ func (x *Container) GetStartedAtTime() time.Time {
3436 return t
3537}
3638
39+ // GetFinishedAtTime returns the time the container was finished at as time.Time.
3740func (x * Container ) GetFinishedAtTime () time.Time {
3841 t := time.Time {}
3942 if x != nil {
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ func (ioprio *LinuxIOPriority) ToOCI() *rspec.LinuxIOPriority {
4747 }
4848}
4949
50- // FromOCIIOPrioClass returns the IOPrioClass corresponding the the given
50+ // FromOCIIOPriorityClass returns the IOPrioClass corresponding the the given
5151// OCI IOPriorityClass.
5252func FromOCIIOPriorityClass (o rspec.IOPriorityClass ) IOPrioClass {
5353 return IOPrioClass (IOPrioClass_value [string (o )])
Original file line number Diff line number Diff line change @@ -445,6 +445,7 @@ func (g *Generator) InjectCDIDevices(devices []*nri.CDIDevice) error {
445445 return g .injectCDIDevices (g .Config , names )
446446}
447447
448+ // AdjustRlimits adjusts the (Linux) POSIX resource limits in the OCI Spec.
448449func (g * Generator ) AdjustRlimits (rlimits []* nri.POSIXRlimit ) error {
449450 for _ , l := range rlimits {
450451 if l == nil {
@@ -601,6 +602,7 @@ func (g *Generator) SetLinuxResourcesBlockIO(blockIO *rspec.LinuxBlockIO) {
601602 g .Config .Linux .Resources .BlockIO = blockIO
602603}
603604
605+ // SetProcessIOPriority sets the (Linux) IO priority of the container.
604606func (g * Generator ) SetProcessIOPriority (ioprio * rspec.LinuxIOPriority ) {
605607 g .initConfigProcess ()
606608 if ioprio != nil && ioprio .Class == "" {
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
2626)
2727
2828type (
29+ // DefaultValidatorConfig is an alias for DefaultValidatorConfig from main package.
2930 DefaultValidatorConfig = validator.DefaultValidatorConfig
3031)
3132
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import (
3030 yaml "gopkg.in/yaml.v3"
3131)
3232
33+ // DefaultValidatorConfig is the configuration for the default validator plugin.
3334type DefaultValidatorConfig struct {
3435 // Enable the default validator plugin.
3536 Enable bool `yaml:"enable" toml:"enable"`
You can’t perform that action at this time.
0 commit comments