Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Elastic Agent] Fix some typos #29890

Merged
merged 2 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev-tools/mage/crossbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const defaultCrossBuildTarget = "golangCrossBuild"
// See NewPlatformList for details about platform filtering expressions.
var Platforms = BuildPlatforms.Defaults()

// Types is the list of package types
var SelectedPackageTypes []PackageType
// SelectedPackageTypes is the list of package types
var SelectedPackageTypes []PackageType = []PackageType{TarGz}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? The description mentioned comments only, but this is code?

I see failures in the packaging

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a mistake, but it's been fixed already by #30007.


func init() {
// Allow overriding via PLATFORMS.
Expand Down
4 changes: 2 additions & 2 deletions libbeat/common/backoff/equal_jitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ func NewEqualJitterBackoff(done <-chan struct{}, init, max time.Duration) Backof

// Reset resets the duration of the backoff.
func (b *EqualJitterBackoff) Reset() {
// Allow to sleep at least the init period on the first wait.
// Allow sleeping at least the init period on the first wait.
b.duration = b.init * 2
}

// Wait block until either the timer is completed or channel is done.
// Wait blocks until either the timer is completed or channel is done.
func (b *EqualJitterBackoff) Wait() bool {
// Make sure we have always some minimal back off and jitter.
temp := int64(b.duration / 2)
Expand Down
2 changes: 1 addition & 1 deletion libbeat/logp/configure/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Logging(beatName string, cfg *common.Config) error {
return logp.Configure(config)
}

// Logging builds a logp.Config based on the given common.Config and the specified
// LoggingWithOutputs builds a logp.Config based on the given common.Config and the specified
// CLI flags along with the given outputs.
func LoggingWithOutputs(beatName string, cfg *common.Config, outputs ...zapcore.Core) error {
config := logp.DefaultConfig(environment)
Expand Down
2 changes: 1 addition & 1 deletion libbeat/logp/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func Configure(cfg Config) error {
return ConfigureWithOutputs(cfg)
}

// XXX: ConfigureWithOutputs is used by elastic-agent only (See file: x-pack/elastic-agent/pkg/core/logger/logger.go).
// ConfigureWithOutputs XXX: is used by elastic-agent only (See file: x-pack/elastic-agent/pkg/core/logger/logger.go).
// The agent requires that the output specified in the config object is configured and merged with the
// logging outputs given.
func ConfigureWithOutputs(cfg Config, outputs ...zapcore.Core) error {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func runAgent(env map[string]string) error {
return err
}

// docker does not exists for this commit, build it
// docker does not exist for this commit, build it
if !strings.Contains(dockerImageOut, tag) {
// produce docker package
packageAgent([]string{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ func newFleetGatewayWithScheduler(
stateStore stateStore,
) (gateway.FleetGateway, error) {

// Backoff implementation doesn't support the using context as the shutdown mechanism.
// Backoff implementation doesn't support the use of a context [cancellation]
// as the shutdown mechanism.
// So we keep a done channel that will be closed when the current context is shutdown.
done := make(chan struct{})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var DefaultRK = "default"
// RoutingKey is used for routing as pipeline id.
type RoutingKey = string

// Router is an interace routes programs to correspongind stream
// Router is an interface routing programs to the corresponding stream.
type Router interface {
Routes() *sorted.Set
Route(id string, grpProg map[RoutingKey][]program.Program) error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (m *manager) ReExec(shutdownCallback ShutdownCallbackFn, argOverrides ...st
if shutdownCallback != nil {
if err := shutdownCallback(); err != nil {
// panic; because there is no going back, everything is shutdown
panic(errors.New(errors.TypeUnexpected, err, "failure occured during shutdown cleanup"))
panic(errors.New(errors.TypeUnexpected, err, "failure occurred during shutdown cleanup"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/core/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func (as *ApplicationState) Stop(timeout time.Duration) error {
doneChan := as.checkinDone
as.checkinLock.RUnlock()
if (wasConn && doneChan == nil) || (!wasConn && s == proto.StateObserved_STOPPING && doneChan == nil) {
// either occurred
// either occurred:
// * client was connected then disconnected on stop
// * client was not connected; connected; received stopping; then disconnected
as.Destroy()
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/core/status/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (r *reporter) Update(s state.Status, message string, payload map[string]int
}
}

// Unregister unregister status from reporter. Reporter will no longer be taken into consideration
// Unregister unregisters status from reporter. Reporter will no longer be taken into consideration
// for overall status computation.
func (r *reporter) Unregister() {
r.mx.Lock()
Expand Down