Skip to content

Commit 00fa1a1

Browse files
committed
Add and fix comments for exported types
Mixed bag of comments for exported types. Makes revive happier. Signed-off-by: Markus Lehtonen <[email protected]>
1 parent ac21da7 commit 00fa1a1

7 files changed

Lines changed: 11 additions & 2 deletions

File tree

pkg/adaptation/adaptation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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.
714715
type PluginSyncBlock struct {
715716
r *Adaptation
716717
}

pkg/api/adjustment.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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.
119120
func (a *ContainerAdjustment) AddRlimit(typ string, hard, soft uint64) {
120121
a.initRlimits()
121122
a.Rlimits = append(a.Rlimits, &POSIXRlimit{

pkg/api/container.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package api
1818

1919
import "time"
2020

21+
// GetCreatedAtTime returns the time the container was created at as time.Time.
2122
func (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.
2931
func (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.
3740
func (x *Container) GetFinishedAtTime() time.Time {
3841
t := time.Time{}
3942
if x != nil {

pkg/api/ioprio.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.
5252
func FromOCIIOPriorityClass(o rspec.IOPriorityClass) IOPrioClass {
5353
return IOPrioClass(IOPrioClass_value[string(o)])

pkg/runtime-tools/generate/generate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
448449
func (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.
604606
func (g *Generator) SetProcessIOPriority(ioprio *rspec.LinuxIOPriority) {
605607
g.initConfigProcess()
606608
if ioprio != nil && ioprio.Class == "" {

plugins/default-validator/builtin/plugin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
)
2727

2828
type (
29+
// DefaultValidatorConfig is an alias for DefaultValidatorConfig from main package.
2930
DefaultValidatorConfig = validator.DefaultValidatorConfig
3031
)
3132

plugins/default-validator/default-validator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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.
3334
type DefaultValidatorConfig struct {
3435
// Enable the default validator plugin.
3536
Enable bool `yaml:"enable" toml:"enable"`

0 commit comments

Comments
 (0)