mirror of https://github.com/hashicorp/consul
Cleans up some drift between the OSS and Enterprise trees.
parent
4ab59af09e
commit
575d70aaa7
|
@ -603,7 +603,7 @@ func (p *PolicyACL) NodeWrite(name string, scope sentinel.ScopeFn) bool {
|
|||
pr := rule.(PolicyRule)
|
||||
switch pr.aclPolicy {
|
||||
case PolicyWrite:
|
||||
return p.executeCodePolicy(&pr.sentinelPolicy, scope)
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
@ -686,7 +686,7 @@ func (p *PolicyACL) ServiceWrite(name string, scope sentinel.ScopeFn) bool {
|
|||
pr := rule.(PolicyRule)
|
||||
switch pr.aclPolicy {
|
||||
case PolicyWrite:
|
||||
return p.executeCodePolicy(&pr.sentinelPolicy, scope)
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -127,8 +127,6 @@ func isPolicyValid(policy string) bool {
|
|||
// isSentinelValid makes sure the given sentinel block is valid, and will skip
|
||||
// out if the evaluator is nil.
|
||||
func isSentinelValid(sentinel sentinel.Evaluator, basicPolicy string, sp Sentinel) error {
|
||||
// TODO (slackpad) - Need a unit test for this.
|
||||
|
||||
// Sentinel not enabled at all, or for this policy.
|
||||
if sentinel == nil {
|
||||
return nil
|
||||
|
|
|
@ -631,7 +631,6 @@ func TestFSM_SnapshotRestore(t *testing.T) {
|
|||
default:
|
||||
t.Fatalf("bad")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestFSM_BadRestore(t *testing.T) {
|
||||
|
|
|
@ -30,7 +30,7 @@ func waitForLeader(servers ...*Server) error {
|
|||
}
|
||||
|
||||
// wantPeers determines whether the server has the given
|
||||
// number of raft peers.
|
||||
// number of voting raft peers.
|
||||
func wantPeers(s *Server, peers int) error {
|
||||
n, err := s.numPeers()
|
||||
if err != nil {
|
||||
|
|
|
@ -25,6 +25,10 @@ type Area struct {
|
|||
// RetryJoin specifies the address of Consul servers to join to, such as
|
||||
// an IPs or hostnames with an optional port number. This is optional.
|
||||
RetryJoin []string
|
||||
|
||||
// UseTLS specifies whether gossip over this area should be encrypted with TLS
|
||||
// if possible.
|
||||
UseTLS bool
|
||||
}
|
||||
|
||||
// AreaJoinResponse is returned when a join occurs and gives the result for each
|
||||
|
@ -100,6 +104,27 @@ func (op *Operator) AreaCreate(area *Area, q *WriteOptions) (string, *WriteMeta,
|
|||
return out.ID, wm, nil
|
||||
}
|
||||
|
||||
// AreaUpdate will update the configuration of the network area with the given ID.
|
||||
func (op *Operator) AreaUpdate(areaID string, area *Area, q *WriteOptions) (string, *WriteMeta, error) {
|
||||
r := op.c.newRequest("PUT", "/v1/operator/area/"+areaID)
|
||||
r.setWriteOptions(q)
|
||||
r.obj = area
|
||||
rtt, resp, err := requireOK(op.c.doRequest(r))
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
wm := &WriteMeta{}
|
||||
wm.RequestTime = rtt
|
||||
|
||||
var out struct{ ID string }
|
||||
if err := decodeBody(resp, &out); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
return out.ID, wm, nil
|
||||
}
|
||||
|
||||
// AreaGet returns a single network area.
|
||||
func (op *Operator) AreaGet(areaID string, q *QueryOptions) ([]*Area, *QueryMeta, error) {
|
||||
var out []*Area
|
||||
|
|
|
@ -40,9 +40,12 @@ Usage: consul snapshot <subcommand> [options] [args]
|
|||
|
||||
$ consul snapshot inspect backup.snap
|
||||
|
||||
Run a daemon process that locally saves a snapshot every hour (available only in
|
||||
Consul Enterprise) :
|
||||
|
||||
$ consul snapshot agent
|
||||
|
||||
For more examples, ask for subcommand help or view the documentation.
|
||||
|
||||
`
|
||||
return strings.TrimSpace(helpText)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue