Skip to content

Commit

Permalink
Merge pull request #35 from mach6/mach6_fix_typo
Browse files Browse the repository at this point in the history
Fix typo in error msg and remove deprecated config option "whitelist"
  • Loading branch information
foosinn authored Jan 5, 2021
2 parents fbd5cd3 + c852f5f commit c879a87
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 15 deletions.
6 changes: 0 additions & 6 deletions cmd/drone-tree-config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ type (
BitBucketClient string `envconfig:"BITBUCKET_CLIENT"`
BitBucketSecret string `envconfig:"BITBUCKET_SECRET"`
ConsiderFile string `envconfig:"PLUGIN_CONSIDER_FILE"`
// Deprecated: Use AllowListFile instead.
WhitelistFile string `envconfig:"PLUGIN_WHITELIST_FILE"`
}
)

Expand All @@ -53,10 +51,6 @@ func main() {
if spec.BitBucketAuthServer == "" {
spec.BitBucketAuthServer = spec.Server
}
// TODO :: Remove this check, once the deprecation is deleted
if spec.AllowListFile == "" && spec.WhitelistFile != "" {
spec.AllowListFile = spec.WhitelistFile
}

handler := config.Handler(
plugin.New(
Expand Down
2 changes: 1 addition & 1 deletion plugin/configloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (p *Plugin) getDroneConfig(ctx context.Context, req *request, file string)
dc := droneConfig{}
err = yaml.Unmarshal([]byte(fileContent), &dc)
if err != nil {
logrus.Errorf("%s skipping: unable do parse yml file: %s %v", req.UUID, file, err)
logrus.Errorf("%s skipping: unable to parse yml file: %s %v", req.UUID, file, err)
return "", true, err
}
if dc.Name == "" || dc.Kind == "" {
Expand Down
2 changes: 0 additions & 2 deletions plugin/consider.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ func (c *ConsiderData) consider(path string) bool {
return exists
}

// ------

// newConsiderDataFromRequest returns the ConsiderData which is loaded from the considerFile
func (p *Plugin) newConsiderDataFromRequest(ctx context.Context, req *request) (*ConsiderData, error) {
cd := new(ConsiderData)
Expand Down
6 changes: 0 additions & 6 deletions plugin/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ func WithMaxDepth(maxDepth int) func(*Plugin) {
}
}

// WithWhitelistFile configures with repo slug regex match list file
// Deprecated: Use WithAllowlistFile instead.
func WithWhitelistFile(file string) func(*Plugin) {
return WithAllowListFile(file)
}

// WithAllowListFile configures with repo slug regex match list file
func WithAllowListFile(file string) func(*Plugin) {
return func(p *Plugin) {
Expand Down

0 comments on commit c879a87

Please sign in to comment.