Skip to content

Commit

Permalink
Merge pull request #3204 from hashicorp/f-sync-acl
Browse files Browse the repository at this point in the history
sync acls
  • Loading branch information
dadgar authored Sep 13, 2017
2 parents 6bb30be + de870af commit dc9f3f1
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 32 deletions.
5 changes: 5 additions & 0 deletions acl/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ func NewACL(management bool, policies []*Policy) (*ACL, error) {
return acl, nil
}

// AllowNsOp is shorthand for AllowNamespaceOperation
func (a *ACL) AllowNsOp(ns string, op string) bool {
return a.AllowNamespaceOperation(ns, op)
}

// AllowNamespaceOperation checks if a given operation is allowed for a namespace
func (a *ACL) AllowNamespaceOperation(ns string, op string) bool {
// Hot path management tokens
Expand Down
6 changes: 3 additions & 3 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ type Config struct {
// Region to use. If not provided, the default agent region is used.
Region string

// SecretID to use. This can be overwritten per request.
SecretID string

// Namespace to use. If not provided the default namespace is used.
Namespace string

// httpClient is the client to use. Default will be used if not provided.
httpClient *http.Client

// SecretID to use. This can be overwritten per request.
SecretID string

// HttpAuth is the auth info to use for http access.
HttpAuth *HttpBasicAuth

Expand Down
1 change: 0 additions & 1 deletion nomad/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,6 @@ func (s *nomadSnapshot) Persist(sink raft.SnapshotSink) error {
sink.Cancel()
return err
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion nomad/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (s *Server) establishLeadership(stopCh chan struct{}) error {
}

// Setup any enterprise systems required.
if err := s.establishEnterpriseLeadership(); err != nil {
if err := s.establishEnterpriseLeadership(stopCh); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion nomad/leader_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package nomad

// establishEnterpriseLeadership is a no-op on OSS.
func (s *Server) establishEnterpriseLeadership() error {
func (s *Server) establishEnterpriseLeadership(stopCh chan struct{}) error {
return nil
}

Expand Down
14 changes: 6 additions & 8 deletions nomad/structs/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ import (

// MergeMultierrorWarnings takes job warnings and canonicalize warnings and
// merges them into a returnable string. Both the errors may be nil.
func MergeMultierrorWarnings(warnings, canonicalizeWarnings error) string {
if warnings == nil && canonicalizeWarnings == nil {
func MergeMultierrorWarnings(warnings ...error) string {
if len(warnings) == 0 {
return ""
}

var warningMsg multierror.Error
if canonicalizeWarnings != nil {
multierror.Append(&warningMsg, canonicalizeWarnings)
}

if warnings != nil {
multierror.Append(&warningMsg, warnings)
for _, warn := range warnings {
if warn != nil {
multierror.Append(&warningMsg, warn)
}
}

// Set the formatter
Expand Down
5 changes: 4 additions & 1 deletion vendor/github.com/hashicorp/go-plugin/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 29 additions & 4 deletions vendor/github.com/hashicorp/go-plugin/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 17 additions & 10 deletions vendor/github.com/hashicorp/go-plugin/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,10 @@
"revision": "d30f09973e19c1dfcd120b2d9c4f168e68d6b5d5"
},
{
"checksumSHA1": "n3FFMGGYEdVmtgl7TzGTPkB0VGg=",
"checksumSHA1": "R6me0jVmcT/OPo80Fe0qo5fRwHc=",
"path": "github.com/hashicorp/go-plugin",
"revision": "4e5a3725c607a756be8d35bf3a521c0f9c422666",
"revisionTime": "2017-07-25T21:30:12Z"
"revision": "3e6d191694b5a3a2b99755f31b47fa209e4bcd09",
"revisionTime": "2017-08-28T02:45:49Z"
},
{
"checksumSHA1": "ErJHGU6AVPZM9yoY/xV11TwSjQs=",
Expand Down

0 comments on commit dc9f3f1

Please sign in to comment.