Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into 2.3-incremental
Browse files Browse the repository at this point in the history
This brings in Christian's changes and resolves how we resolved the
conflicts differently. Also brings in a couple small develop updates.
  • Loading branch information
jameinel committed Jan 11, 2018
2 parents 8f07766 + d11a426 commit 990862a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ If you want to know more about contributing to `juju`, please read the
Installing prerequisites
------------------------

### *Making use of Makefile*

The `juju` repository contains a `Makefile`, which is the preferred way to install dependencies and other features.
It is advisable, when installing `juju` from source, to look at the [Makefile](./Makefile), located in `$GOPATH/src/github.com/juju/juju/Makefile`.

### *Dependencies*

Juju needs some dependencies in order to be installed and the preferred way to
collect the necessary packages is to use the provided `Makefile`.
The target `godeps` will download the go packages listed in `dependencies.tsv`. The following bash code will install the dependencies.

cd $GOPATH/src/github.com/juju/juju
export JUJU_MAKE_GODEPS=true
make godeps

### *Runtime Dependencies*

You can use `make install-dependencies` or, if you prefer to install
Expand Down
2 changes: 2 additions & 0 deletions juju/testing/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,12 +647,14 @@ func (s *JujuConnSuite) tearDownConn(c *gc.C) {
)
}
}

// Close the state pool before we close the underlying state.
if s.StatePool != nil {
err := s.StatePool.Close()
c.Check(err, jc.ErrorIsNil)
s.StatePool = nil
}

// Close state.
if s.State != nil {
err := s.State.Close()
Expand Down
4 changes: 4 additions & 0 deletions rpc/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,10 @@ func newRPCClientServer(
conn, err := net.Dial("tcp", l.Addr().String())
c.Assert(err, jc.ErrorIsNil)
server = <-srvStarted
if server == nil {
conn.Close()
c.Fatal(<-srvDone)
}
role := roleClient
if bidir {
role = roleBoth
Expand Down
9 changes: 9 additions & 0 deletions worker/apiserver/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

"github.com/juju/juju/agent"
"github.com/juju/juju/apiserver"
"github.com/juju/juju/core/auditlog"
"github.com/juju/juju/state"
)

Expand Down Expand Up @@ -114,6 +115,9 @@ func NewWorker(config Config) (worker.Worker, error) {
return nil, errors.Annotate(err, "cannot create RPC observer factory")
}

// TODO(babbageclunk): get this from agent config.
auditConfig := apiserver.DefaultAuditLogConfig()

serverConfig := apiserver.ServerConfig{
Clock: config.Clock,
Tag: config.AgentConfig.Tag(),
Expand All @@ -131,6 +135,11 @@ func NewWorker(config Config) (worker.Worker, error) {
RateLimitConfig: rateLimitConfig,
LogSinkConfig: &logSinkConfig,
PrometheusRegisterer: config.PrometheusRegisterer,
AuditLogConfig: auditConfig,
}
if auditConfig.Enabled {
serverConfig.AuditLog = auditlog.NewLogFile(
logDir, auditConfig.MaxSizeMB, auditConfig.MaxBackups)
}

listener, err := net.Listen("tcp", listenAddr)
Expand Down
5 changes: 5 additions & 0 deletions worker/apiserver/worker_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ func (s *WorkerStateSuite) TestStart(c *gc.C) {
c.Assert(config.NewObserver, gc.NotNil)
config.NewObserver = nil

c.Assert(config.AuditLog, gc.NotNil)
config.AuditLog = nil

rateLimitConfig := coreapiserver.DefaultRateLimitConfig()
logSinkConfig := coreapiserver.DefaultLogSinkConfig()
auditLogConfig := coreapiserver.DefaultAuditLogConfig()

c.Assert(config, jc.DeepEquals, coreapiserver.ServerConfig{
Clock: s.clock,
Expand All @@ -104,5 +108,6 @@ func (s *WorkerStateSuite) TestStart(c *gc.C) {
RateLimitConfig: rateLimitConfig,
LogSinkConfig: &logSinkConfig,
PrometheusRegisterer: &s.prometheusRegisterer,
AuditLogConfig: auditLogConfig,
})
}

0 comments on commit 990862a

Please sign in to comment.