Skip to content

Commit

Permalink
Moved to allowlist naming; added contributing naming rule about poten…
Browse files Browse the repository at this point in the history
…tially offensive terminology.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
  • Loading branch information
bwplotka committed Jun 8, 2020
1 parent a34c3c8 commit 5c3c54a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ method with the owners of this repository before making a change.

Adding a large new feature or/and component to Thanos should be done by first creating a [proposal](docs/proposals) document outlining the design decisions of the change, motivations for the change, and any alternatives that might have been considered.

## General Naming

In the code and documentation prefer non-offensive terminology, for example:

* `allowlist` / `denylist` (instead of `whitelist` / `blacklist`)
* `primary` / `replica` (instead of `master` / `slave`)

## Components Naming

Thanos is a distributed system composed with several services and CLI tools as listed [here](cmd/thanos).
Expand Down
8 changes: 4 additions & 4 deletions cmd/thanos/tools_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func registerBucketVerify(m map[string]setupFunc, root *kingpin.CmdClause, name
Short('r').Default("false").Bool()
issuesToVerify := cmd.Flag("issues", fmt.Sprintf("Issues to verify (and optionally repair). Possible values: %v", allIssues())).
Short('i').Default(verifier.IndexIssueID, verifier.OverlappedBlocksIssueID).Strings()
idWhitelist := cmd.Flag("id-whitelist", "Block IDs to verify (and optionally repair) only. "+
idAllowlist := cmd.Flag("id-allowlist", "Block IDs to verify (and optionally repair) only. "+
"If none is specified, all blocks will be verified. Repeated field").Strings()
deleteDelay := modelDuration(cmd.Flag("delete-delay", "Duration after which blocks marked for deletion would be deleted permanently from source bucket by compactor component. "+
"If delete-delay is non zero, blocks will be marked for deletion and compactor component is required to delete blocks from source bucket. "+
Expand Down Expand Up @@ -153,12 +153,12 @@ func registerBucketVerify(m map[string]setupFunc, root *kingpin.CmdClause, name
}

var idMatcher func(ulid.ULID) bool = nil
if len(*idWhitelist) > 0 {
if len(*idAllowlist) > 0 {
whilelistIDs := map[string]struct{}{}
for _, bid := range *idWhitelist {
for _, bid := range *idAllowlist {
id, err := ulid.Parse(bid)
if err != nil {
return errors.Wrap(err, "invalid ULID found in --id-whitelist flag")
return errors.Wrap(err, "invalid ULID found in --id-allowlist flag")
}
whilelistIDs[id.String()] = struct{}{}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/components/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Flags:
Issues to verify (and optionally repair). Possible
values: [duplicated_compaction index_issue
overlapped_blocks]
--id-whitelist=ID-WHITELIST ...
--id-allowlist=ID-ALLOWLIST ...
Block IDs to verify (and optionally repair) only. If
none is specified, all blocks will be verified.
Repeated field
Expand Down

0 comments on commit 5c3c54a

Please sign in to comment.