Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into consul-template-v0.…
Browse files Browse the repository at this point in the history
…25.1
  • Loading branch information
greut committed Aug 24, 2020
2 parents f6037a1 + 7e3362c commit 5c0ea44
Show file tree
Hide file tree
Showing 167 changed files with 5,575 additions and 13,627 deletions.
2 changes: 1 addition & 1 deletion client/allocrunner/groupservice_hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func TestGroupServiceHook_getWorkloadServices(t *testing.T) {
// COMPAT(0.11) Only valid for upgrades from 0.8.
func TestGroupServiceHook_Update08Alloc(t *testing.T) {
// Create an embedded Consul server
testconsul, err := ctestutil.NewTestServerConfig(func(c *ctestutil.TestServerConfig) {
testconsul, err := ctestutil.NewTestServerConfigT(t, func(c *ctestutil.TestServerConfig) {
// If -v wasn't specified squelch consul logging
if !testing.Verbose() {
c.Stdout = ioutil.Discard
Expand Down
2 changes: 1 addition & 1 deletion client/allocrunner/taskrunner/connect_native_hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

func getTestConsul(t *testing.T) *consultest.TestServer {
testConsul, err := consultest.NewTestServerConfig(func(c *consultest.TestServerConfig) {
testConsul, err := consultest.NewTestServerConfigT(t, func(c *consultest.TestServerConfig) {
if !testing.Verbose() { // disable consul logging if -v not set
c.Stdout = ioutil.Discard
c.Stderr = ioutil.Discard
Expand Down
2 changes: 1 addition & 1 deletion client/allocrunner/taskrunner/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func newTestHarness(t *testing.T, templates []*structs.Template, consul, vault b
harness.taskDir = d

if consul {
harness.consul, err = ctestutil.NewTestServer()
harness.consul, err = ctestutil.NewTestServerConfigT(t, nil)
if err != nil {
t.Fatalf("error starting test Consul server: %v", err)
}
Expand Down
29 changes: 25 additions & 4 deletions client/fingerprint/bridge_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"regexp"

"github.com/hashicorp/nomad/nomad/structs"
"github.com/shirou/gopsutil/host"
)

const bridgeKernelModuleName = "bridge"
Expand Down Expand Up @@ -35,19 +36,39 @@ func (f *BridgeFingerprint) Fingerprint(req *FingerprintRequest, resp *Fingerpri
}

func (f *BridgeFingerprint) checkKMod(mod string) error {
file, err := os.Open("/proc/modules")
hostInfo, err := host.Info()
if err != nil {
return fmt.Errorf("could not read /proc/modules: %v", err)
return err
}

dynErr := f.checkKModFile(mod, "/proc/modules", fmt.Sprintf("%s\\s+.*$", mod))
if dynErr == nil {
return nil
}

builtinErr := f.checkKModFile(mod,
fmt.Sprintf("/lib/modules/%s/modules.builtin", hostInfo.KernelVersion),
fmt.Sprintf(".+\\/%s.ko$", mod))
if builtinErr == nil {
return nil
}

return fmt.Errorf("%v, %v", dynErr, builtinErr)
}

func (f *BridgeFingerprint) checkKModFile(mod, fileName, pattern string) error {
file, err := os.Open(fileName)
if err != nil {
return fmt.Errorf("could not read %s: %v", fileName, err)
}
defer file.Close()

scanner := bufio.NewScanner(file)
pattern := fmt.Sprintf("%s\\s+.*$", mod)
for scanner.Scan() {
if matched, err := regexp.MatchString(pattern, scanner.Text()); matched {
return nil
} else if err != nil {
return fmt.Errorf("could not parse /proc/modules: %v", err)
return fmt.Errorf("could not parse %s: %v", fileName, err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion command/agent/consul/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func TestConsul_Connect(t *testing.T) {
// Create an embedded Consul server
testconsul, err := testutil.NewTestServerConfig(func(c *testutil.TestServerConfig) {
testconsul, err := testutil.NewTestServerConfigT(t, func(c *testutil.TestServerConfig) {
// If -v wasn't specified squelch consul logging
if !testing.Verbose() {
c.Stdout = ioutil.Discard
Expand Down
2 changes: 1 addition & 1 deletion command/agent/consul/int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestConsul_Integration(t *testing.T) {
require := require.New(t)

// Create an embedded Consul server
testconsul, err := testutil.NewTestServerConfig(func(c *testutil.TestServerConfig) {
testconsul, err := testutil.NewTestServerConfigT(t, func(c *testutil.TestServerConfig) {
// If -v wasn't specified squelch consul logging
if !testing.Verbose() {
c.Stdout = ioutil.Discard
Expand Down
75 changes: 75 additions & 0 deletions contributing/issue-labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Nomad Issue Labels

This document briefly describes the labels the Nomad team will apply when you
open a GitHub issue. The workflows described here are a work-in-progress.

### Types

Type labels define the workflow for an issue. See the description of the
workflows below.

Label | Description
---|---
type/enhancement | Proposed improvement or new feature
type/bug | Feature does not function as expected or crashes Nomad
type/question | General questions

### Stages

Triage labels define the stages of a workflow for an issue.

Label | Description
---|---
stage/accepted | The Nomad team intends to work on this bug or feature, but does not commit to a specific timeline. This doesn’t mean the design of the feature has been fully completed, just that we want to do so.
stage/thinking | The Nomad team member who triages the issue needs a few days to think and respond to the issue
stage/needs-discussion | This topic needs discussion with the larger Nomad maintainers group before committing to it. This doesn’t signify that design needs to be discussed.
stage/needs-investigation | The issue described is detailed and complex. It will need some work and can't be immediately resolved.
stage/waiting-reply | We need more information from the reporter.
stage/not-a-bug | Reported as a bug but turned out to be expected behavior and was closed.

### Themes

Theme labels define the component of Nomad involved. These will frequently
change and new themes will be added for new features, so see the description
of each label for details.

## Workflows

### `type/enhancement`

When you as a community member make a feature request, a Nomad maintainer will
triage it and generally label the issue as follows:

* `stage/thinking`: The Nomad team member who triages the issue wants to think
about the idea some more.
* `stage/needs-discussion`: The Nomad team needs to discuss the idea within
the larger maintainers group before committing to it.
* `stage/waiting-reply`: The Nomad maintainer needs you to provide some more
information about the idea or its use cases.
* Closed: the Nomad team member may be able to tell right away that this
request is not a good fit for Nomad.

The goal for issue labeled `stage/thinking`, `stage/needs-discussion`, or
`stage/waiting-reply` is to move them to `stage/accepted` (or to close
them). At this point, you can submit a PR that we'll be happy to review, the
Nomad maintainer who triaged the issue may open a PR, or for complex features
it will get into the Nomad team's roadmap for scheduling.

### `type/bug`

When you as a community member report a bug, a Nomad maintainer will triage it and generally label the issue as follows:

* `stage/needs-investigation`: The Nomad maintainer thinks this bug needs some
initial investigation to determine if it's a bug or what system might be
involved.
* `stage/waiting-reply`: The Nomad team member needs you to provide more
information about the problem.
* `stage/accepted`: The bug will need more than a trivial amount of time to
fix. Depending on the severity, the Nomad maintainers will work on fixing it
immediately or get it into the roadmap for an upcoming release.
* `stage/not-a-bug`: The issue is not really a bug but is working as
designed. Often this is a documentation issue, in which case the label may
be changed to `type/enhancement` and `theme/docs`
* Fixed! If the issue is small, the Nomad maintainer may just immediately open
a PR to fix the problem and will let you know to expect the in the next
release.
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ replace (

require (
cloud.google.com/go/storage v1.0.0 // indirect
contrib.go.opencensus.io/exporter/ocagent v0.4.12 // indirect
github.com/Azure/azure-sdk-for-go v29.0.0+incompatible // indirect
github.com/Azure/go-autorest v11.7.1+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.4 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.1 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.0 // indirect
github.com/LK4D4/joincontext v0.0.0-20171026170139-1724345da6d5
github.com/Microsoft/go-winio v0.4.15-0.20200113171025-3fe6c5262873
github.com/Microsoft/hcsshim v0.8.8-0.20200312192636-fd0797d766b1 // indirect
Expand Down Expand Up @@ -50,11 +52,10 @@ require (
github.com/google/go-cmp v0.4.0
github.com/gorilla/websocket v1.4.2
github.com/grpc-ecosystem/go-grpc-middleware v1.2.1-0.20200228141219-3ce3d519df39
github.com/grpc-ecosystem/grpc-gateway v1.9.0 // indirect
github.com/hashicorp/consul v1.7.1-0.20200213195527-b137060630b4
github.com/hashicorp/consul v1.7.7
github.com/hashicorp/consul-template v0.25.1
github.com/hashicorp/consul/api v1.4.1-0.20200730220852-12f574c9de39
github.com/hashicorp/consul/sdk v0.5.0
github.com/hashicorp/consul/api v1.6.0
github.com/hashicorp/consul/sdk v0.6.0
github.com/hashicorp/cronexpr v1.1.0
github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de
github.com/hashicorp/go-cleanhttp v0.5.1
Expand Down Expand Up @@ -96,7 +97,7 @@ require (
github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286
github.com/mitchellh/copystructure v1.0.0
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b
github.com/mitchellh/go-testing-interface v1.0.0
github.com/mitchellh/go-testing-interface v1.0.3
github.com/mitchellh/hashstructure v1.0.0
github.com/mitchellh/mapstructure v1.3.1
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
Expand All @@ -108,7 +109,7 @@ require (
github.com/posener/complete v1.2.3
github.com/prometheus/client_golang v1.4.0
github.com/prometheus/common v0.9.1
github.com/rs/cors v0.0.0-20170801073201-eabcc6af4bbe
github.com/rs/cors v1.7.0
github.com/ryanuber/columnize v2.1.1-0.20170703205827-abc90934186a+incompatible
github.com/ryanuber/go-glob v1.0.0
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529
Expand All @@ -120,7 +121,7 @@ require (
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
github.com/zclconf/go-cty v1.4.1
go.opencensus.io v0.22.1-0.20190713072201-b4a14686f0a9 // indirect
golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136 // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/mod v0.3.0 // indirect
Expand Down
Loading

0 comments on commit 5c0ea44

Please sign in to comment.