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

fix: correct various typos #19987

Merged
merged 4 commits into from
Nov 11, 2020
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## unreleased

### Bug Fixes

1. [19987](https://github.com/influxdata/influxdb/pull/19987): Fix various typos. Thanks @kumakichi!

## v2.0.1 [2020-11-10]

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions authorization/http_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func TestService_handleGetAuthorization(t *testing.T) {
t.Errorf("%q. handleGetAuthorization() = %v, want %v", tt.name, content, tt.wants.contentType)
}
if diff, err := jsonDiff(string(body), tt.wants.body); err != nil {
t.Errorf("%q, handleGetAuthorization. error unmarshaling json %v", tt.name, err)
t.Errorf("%q, handleGetAuthorization. error unmarshalling json %v", tt.name, err)
} else if tt.wants.body != "" && diff != "" {
t.Errorf("%q. handleGetAuthorization() = -got/+want %s**", tt.name, diff)
}
Expand Down Expand Up @@ -829,7 +829,7 @@ func TestService_handleDeleteAuthorization(t *testing.T) {

if tt.wants.body != "" {
if diff, err := jsonDiff(string(body), tt.wants.body); err != nil {
t.Errorf("%q, handleDeleteAuthorization(). error unmarshaling json %v", tt.name, err)
t.Errorf("%q, handleDeleteAuthorization(). error unmarshalling json %v", tt.name, err)
} else if diff != "" {
t.Errorf("%q. handleDeleteAuthorization() = ***%s***", tt.name, diff)
}
Expand Down
2 changes: 1 addition & 1 deletion authorization/middleware_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (l *AuthLogger) UpdateAuthorization(ctx context.Context, id influxdb.ID, up
l.logger.Debug("failed to update authorization", zap.Error(err), dur)
return
}
l.logger.Debug("authorizationauthorization update", dur)
l.logger.Debug("authorization update", dur)
}(time.Now())
return l.authService.UpdateAuthorization(ctx, id, upd)
}
Expand Down
2 changes: 1 addition & 1 deletion authorization/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (s *Service) FindAuthorizationByToken(ctx context.Context, n string) (*infl
return a, nil
}

// FindAuthorizations retrives all authorizations that match an arbitrary authorization filter.
// FindAuthorizations retrieves all authorizations that match an arbitrary authorization filter.
// Filters using ID, or Token should be efficient.
// Other filters will do a linear scan across all authorizations searching for a match.
func (s *Service) FindAuthorizations(ctx context.Context, filter influxdb.AuthorizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Authorization, int, error) {
Expand Down
2 changes: 1 addition & 1 deletion authorizer/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type AuthorizationService struct {
s influxdb.AuthorizationService
}

// NewAuthorizationService constructs an instance of an authorizing authorization serivce.
// NewAuthorizationService constructs an instance of an authorizing authorization service.
func NewAuthorizationService(s influxdb.AuthorizationService) *AuthorizationService {
return &AuthorizationService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type BucketService struct {
s influxdb.BucketService
}

// NewBucketService constructs an instance of an authorizing bucket serivce.
// NewBucketService constructs an instance of an authorizing bucket service.
func NewBucketService(s influxdb.BucketService) *BucketService {
return &BucketService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type CheckService struct {
influxdb.TaskService
}

// NewCheckService constructs an instance of an authorizing check serivce.
// NewCheckService constructs an instance of an authorizing check service.
func NewCheckService(s influxdb.CheckService, urm influxdb.UserResourceMappingService, org influxdb.OrganizationService) *CheckService {
return &CheckService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type DashboardService struct {
s influxdb.DashboardService
}

// NewDashboardService constructs an instance of an authorizing dashboard serivce.
// NewDashboardService constructs an instance of an authorizing dashboard service.
func NewDashboardService(s influxdb.DashboardService) *DashboardService {
return &DashboardService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type LabelService struct {
orgIDResolver OrgIDResolver
}

// NewLabelServiceWithOrg constructs an instance of an authorizing label serivce.
// NewLabelServiceWithOrg constructs an instance of an authorizing label service.
// Replaces NewLabelService.
func NewLabelServiceWithOrg(s influxdb.LabelService, orgIDResolver OrgIDResolver) *LabelService {
return &LabelService{
Expand Down
2 changes: 1 addition & 1 deletion authorizer/notification_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type NotificationEndpointService struct {
influxdb.OrganizationService
}

// NewNotificationEndpointService constructs an instance of an authorizing notification endpoint serivce.
// NewNotificationEndpointService constructs an instance of an authorizing notification endpoint service.
func NewNotificationEndpointService(
s influxdb.NotificationEndpointService,
urm influxdb.UserResourceMappingService,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/notification_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type NotificationRuleStore struct {
influxdb.OrganizationService
}

// NewNotificationRuleStore constructs an instance of an authorizing notification rule serivce.
// NewNotificationRuleStore constructs an instance of an authorizing notification rule service.
func NewNotificationRuleStore(s influxdb.NotificationRuleStore, urm influxdb.UserResourceMappingService, org influxdb.OrganizationService) *NotificationRuleStore {
return &NotificationRuleStore{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type OrgService struct {
s influxdb.OrganizationService
}

// NewOrgService constructs an instance of an authorizing org serivce.
// NewOrgService constructs an instance of an authorizing org service.
func NewOrgService(s influxdb.OrganizationService) *OrgService {
return &OrgService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/password.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type PasswordService struct {
next influxdb.PasswordsService
}

// NewPasswordService wraps an existing password service with auth middlware.
// NewPasswordService wraps an existing password service with auth middleware.
func NewPasswordService(svc influxdb.PasswordsService) *PasswordService {
return &PasswordService{next: svc}
}
Expand Down
2 changes: 1 addition & 1 deletion authorizer/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type ScraperTargetStoreService struct {
s influxdb.ScraperTargetStoreService
}

// NewScraperTargetStoreService constructs an instance of an authorizing scraper target store serivce.
// NewScraperTargetStoreService constructs an instance of an authorizing scraper target store service.
func NewScraperTargetStoreService(s influxdb.ScraperTargetStoreService,
urm influxdb.UserResourceMappingService,
org influxdb.OrganizationService,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type SecretService struct {
s influxdb.SecretService
}

// NewSecretService constructs an instance of an authorizing secret serivce.
// NewSecretService constructs an instance of an authorizing secret service.
func NewSecretService(s influxdb.SecretService) *SecretService {
return &SecretService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/telegraf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type TelegrafConfigService struct {
influxdb.UserResourceMappingService
}

// NewTelegrafConfigService constructs an instance of an authorizing telegraf serivce.
// NewTelegrafConfigService constructs an instance of an authorizing telegraf service.
func NewTelegrafConfigService(s influxdb.TelegrafConfigStore, urm influxdb.UserResourceMappingService) *TelegrafConfigService {
return &TelegrafConfigService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion authorizer/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type UserService struct {
s influxdb.UserService
}

// NewUserService constructs an instance of an authorizing user serivce.
// NewUserService constructs an instance of an authorizing user service.
func NewUserService(s influxdb.UserService) *UserService {
return &UserService{
s: s,
Expand Down
2 changes: 1 addition & 1 deletion checks/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (s *Service) findCheckByName(ctx context.Context, tx kv.Tx, orgID influxdb.
return chVal.(influxdb.Check), nil
}

// FindCheck retrives a check using an arbitrary check filter.
// FindCheck retrieves a check using an arbitrary check filter.
// Filters using ID, or OrganizationID and check Name should be efficient.
// Other filters will do a linear scan across checks until it finds a match.
func (s *Service) FindCheck(ctx context.Context, filter influxdb.CheckFilter) (influxdb.Check, error) {
Expand Down
2 changes: 1 addition & 1 deletion chronograf/.kapacitor/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestData(t *testing.T) {
q := chronograf.QueryConfig{}
err := json.Unmarshal([]byte(config), &q)
if err != nil {
t.Errorf("Error unmarshaling %v", err)
t.Errorf("Error unmarshalling %v", err)
}
alert := chronograf.AlertRule{
Trigger: "deadman",
Expand Down
4 changes: 2 additions & 2 deletions chronograf/bolt/change_interval_to_duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var up = func(db *bolt.DB) error {

err := proto.Unmarshal(data, board)
if err != nil {
log.Fatal("unmarshaling error: ", err)
log.Fatal("unmarshalling error: ", err)
}

// Migrate the dashboard
Expand Down Expand Up @@ -77,7 +77,7 @@ var down = func(db *bolt.DB) error {
This isolates the migration from the codebase, and prevents a future change
to a type definition from invalidating the migration functions.
*/
var dashboardBucket = []byte("Dashoard")
var dashboardBucket = []byte("Dashoard") // N.B. leave the misspelling for backwards-compat!

type Source struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion chronograf/bolt/dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var _ chronograf.DashboardsStore = &DashboardsStore{}

// DashboardsBucket is the bolt bucket dashboards are stored in
var DashboardsBucket = []byte("Dashoard")
var DashboardsBucket = []byte("Dashoard") // N.B. leave the misspelling for backwards-compat!

// DashboardsStore is the bolt implementation of storing dashboards
type DashboardsStore struct {
Expand Down
8 changes: 4 additions & 4 deletions chronograf/bolt/internal/internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func Test_MarshalDashboard(t *testing.T) {
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
t.Fatal("Error marshaling dashboard: err", err)
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
t.Fatal("Error unmarshaling dashboard: err:", err)
t.Fatal("Error unmarshalling dashboard: err:", err)
} else if !cmp.Equal(dashboard, actual) {
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(dashboard, actual))
}
Expand Down Expand Up @@ -330,7 +330,7 @@ func Test_MarshalDashboard_WithLegacyBounds(t *testing.T) {
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
t.Fatal("Error marshaling dashboard: err", err)
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
t.Fatal("Error unmarshaling dashboard: err:", err)
t.Fatal("Error unmarshalling dashboard: err:", err)
} else if !cmp.Equal(expected, actual) {
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(expected, actual))
}
Expand Down Expand Up @@ -445,7 +445,7 @@ func Test_MarshalDashboard_WithEmptyLegacyBounds(t *testing.T) {
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
t.Fatal("Error marshaling dashboard: err", err)
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
t.Fatal("Error unmarshaling dashboard: err:", err)
t.Fatal("Error unmarshalling dashboard: err:", err)
} else if !cmp.Equal(expected, actual) {
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(expected, actual))
}
Expand Down Expand Up @@ -481,7 +481,7 @@ func Test_MarshalDashboard_WithEmptyCellType(t *testing.T) {
if buf, err := internal.MarshalDashboard(dashboard); err != nil {
t.Fatal("Error marshaling dashboard: err", err)
} else if err := internal.UnmarshalDashboard(buf, &actual); err != nil {
t.Fatal("Error unmarshaling dashboard: err:", err)
t.Fatal("Error unmarshalling dashboard: err:", err)
} else if !cmp.Equal(expected, actual) {
t.Fatalf("Dashboard protobuf copy error: diff follows:\n%s", cmp.Diff(expected, actual))
}
Expand Down
2 changes: 1 addition & 1 deletion chronograf/bolt/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (s *SourcesStore) get(ctx context.Context, id int, tx *bolt.Tx) (chronograf
}

func (s *SourcesStore) update(ctx context.Context, src chronograf.Source, tx *bolt.Tx) error {
// Get an existing soource with the same ID.
// Get an existing source with the same ID.
b := tx.Bucket(SourcesBucket)
if v := b.Get(itob(src.ID)); v == nil {
return chronograf.ErrSourceNotFound
Expand Down
2 changes: 1 addition & 1 deletion chronograf/chronograf.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ type OrganizationQuery struct {
//
// While not necessary for the app to function correctly, it is
// expected that Implementors of the OrganizationsStore will take
// care to guarantee that the Organization.Name is unqiue. Allowing
// care to guarantee that the Organization.Name is unique. Allowing
// for duplicate names creates a confusing UX experience for the User.
type OrganizationsStore interface {
// Add creates a new Organization.
Expand Down
2 changes: 1 addition & 1 deletion chronograf/docs/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Older chronograf dashboards had the following features:
* View Dashboard
* Add new visualization to dashboard
* Add existing visualization to dashboard
* Remove visualizatoin from dashboard
* Remove visualization from dashboard
* Naming of dashboards
* Delete dashboard
* Edit visualization in dashboard
Expand Down
6 changes: 3 additions & 3 deletions chronograf/enterprise/enterprise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func Test_Enterprise_NewClientWithURL(t *testing.T) {
url: "http://localhost:8086",
},
{
name: "tls sholuld have no error",
name: "tls should have no error",
url: "https://localhost:8086",
},
{
Expand Down Expand Up @@ -192,11 +192,11 @@ func Test_Enterprise_ComplainsIfNotOpened(t *testing.T) {
},
false, false, chronograf.TimeSeries(m1))
if err != nil {
t.Error("Expected ErrUnitialized, but was this err:", err)
t.Error("Expected nil, but was this err:", err)
}
_, err = cl.Query(context.Background(), chronograf.Query{Command: "show shards", DB: "_internal", RP: "autogen"})
if err != chronograf.ErrUninitialized {
t.Error("Expected ErrUnitialized, but was this err:", err)
t.Error("Expected ErrUninitialized, but was this err:", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion chronograf/filestore/dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var _ chronograf.DashboardsStore = &Dashboards{}
// Dashboards are JSON dashboards stored in the filesystem
type Dashboards struct {
Dir string // Dir is the directory containing the dashboards.
Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface
Load func(string, interface{}) error // Load loads string name and dashboard passed in as interface
Create func(string, interface{}) error // Create will write dashboard to file.
ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
Remove func(name string) error // Remove file
Expand Down
2 changes: 1 addition & 1 deletion chronograf/filestore/kapacitors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ chronograf.ServersStore = &Kapacitors{}
// Kapacitors are JSON kapacitors stored in the filesystem
type Kapacitors struct {
Dir string // Dir is the directory containing the kapacitors.
Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface
Load func(string, interface{}) error // Load loads string name and dashboard passed in as interface
Create func(string, interface{}) error // Create will write kapacitor to file.
ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
Remove func(name string) error // Remove file
Expand Down
2 changes: 1 addition & 1 deletion chronograf/filestore/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ chronograf.SourcesStore = &Sources{}
// Sources are JSON sources stored in the filesystem
type Sources struct {
Dir string // Dir is the directory containing the sources.
Load func(string, interface{}) error // Load loads string name and dashbaord passed in as interface
Load func(string, interface{}) error // Load loads string name and dashboard passed in as interface
Create func(string, interface{}) error // Create will write source to file.
ReadDir func(dirname string) ([]os.FileInfo, error) // ReadDir reads the directory named by dirname and returns a list of directory entries sorted by filename.
Remove func(name string) error // Remove file
Expand Down
2 changes: 1 addition & 1 deletion chronograf/influx/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/influxdata/influxql"
)

// TimeRangeAsEpochNano extracs the min and max epoch times from the expression
// TimeRangeAsEpochNano extracts the min and max epoch times from the expression
func TimeRangeAsEpochNano(expr influxql.Expr, now time.Time) (min, max int64, err error) {
// TODO(desa): is this OK?
_, trange, err := influxql.ConditionExpr(expr, nil)
Expand Down
2 changes: 1 addition & 1 deletion chronograf/kapacitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type AlertNodes struct {
Posts []*Post `json:"post"` // HTTPPost will post the JSON alert data to the specified URLs.
TCPs []*TCP `json:"tcp"` // TCP will send the JSON alert data to the specified endpoint via TCP.
Email []*Email `json:"email"` // Email will send alert data to the specified emails.
Exec []*Exec `json:"exec"` // Exec will run shell commandss when an alert triggers
Exec []*Exec `json:"exec"` // Exec will run shell commands when an alert triggers
Log []*Log `json:"log"` // Log will log JSON alert data to files in JSON lines format.
VictorOps []*VictorOps `json:"victorOps"` // VictorOps will send alert to all VictorOps
PagerDuty []*PagerDuty `json:"pagerDuty"` // PagerDuty will send alert to all PagerDuty
Expand Down
2 changes: 1 addition & 1 deletion chronograf/memdb/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (store *SourcesStore) All(ctx context.Context) ([]chronograf.Source, error)
return nil, nil
}

// Delete removes the SourcesStore.Soruce if it matches the provided Source
// Delete removes the SourcesStore.Source if it matches the provided Source
func (store *SourcesStore) Delete(ctx context.Context, src chronograf.Source) error {
if store.Source == nil || store.Source.ID != src.ID {
return fmt.Errorf("unable to find Source with id %d", src.ID)
Expand Down
8 changes: 4 additions & 4 deletions chronograf/oauth2/generic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestGenericGroup_withNotEmail(t *testing.T) {

got, err := prov.Group(tc)
if err != nil {
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
}

want := "pinheads.rok"
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestGenericGroup_withEmail(t *testing.T) {

got, err := prov.Group(tc)
if err != nil {
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
}

want := "pinheads.rok"
Expand Down Expand Up @@ -139,7 +139,7 @@ func TestGenericPrincipalID(t *testing.T) {

got, err := prov.PrincipalID(tc)
if err != nil {
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
}

want := "martymcfly@pinheads.rok"
Expand Down Expand Up @@ -191,7 +191,7 @@ func TestGenericPrincipalIDDomain(t *testing.T) {

got, err := prov.PrincipalID(tc)
if err != nil {
t.Fatal("Unexpected error while retrieiving PrincipalID: err:", err)
t.Fatal("Unexpected error while retrieving PrincipalID: err:", err)
}
want := "martymcfly@pinheads.rok"
if got != want {
Expand Down
Loading