Skip to content

Commit ea673de

Browse files
committed
Merge branch 'main' of ssh://github.com/hashicorp/consul
2 parents 5732d3b + f8d3721 commit ea673de

File tree

23 files changed

+173
-57
lines changed

23 files changed

+173
-57
lines changed

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ fmt: $(foreach mod,$(GO_MODULES),fmt/$(mod))
337337
.PHONY: fmt/%
338338
fmt/%:
339339
@echo "--> Running go fmt ($*)"
340-
@cd $* && go fmt ./...
340+
@cd $* && gofmt -s -l -w .
341341

342342
.PHONY: lint
343343
lint: $(foreach mod,$(GO_MODULES),lint/$(mod)) lint-container-test-deps

agent/config/builder.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,7 @@ func (b *builder) build() (rt RuntimeConfig, err error) {
828828
Version: stringVal(c.Version),
829829
VersionPrerelease: stringVal(c.VersionPrerelease),
830830
VersionMetadata: stringVal(c.VersionMetadata),
831+
Experiments: c.Experiments,
831832
// What is a sensible default for BuildDate?
832833
BuildDate: timeValWithDefault(c.BuildDate, time.Date(1970, 1, 00, 00, 00, 01, 0, time.UTC)),
833834

agent/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ type Config struct {
183183
EncryptKey *string `mapstructure:"encrypt" json:"encrypt,omitempty"`
184184
EncryptVerifyIncoming *bool `mapstructure:"encrypt_verify_incoming" json:"encrypt_verify_incoming,omitempty"`
185185
EncryptVerifyOutgoing *bool `mapstructure:"encrypt_verify_outgoing" json:"encrypt_verify_outgoing,omitempty"`
186+
Experiments []string `mapstructure:"experiments" json:"experiments,omitempty"`
186187
GossipLAN GossipLANConfig `mapstructure:"gossip_lan" json:"-"`
187188
GossipWAN GossipWANConfig `mapstructure:"gossip_wan" json:"-"`
188189
HTTPConfig HTTPConfig `mapstructure:"http_config" json:"-"`

agent/config/default.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ func DevSource() Source {
209209
ports = {
210210
grpc = 8502
211211
}
212+
experiments = [
213+
"resource-apis"
214+
]
212215
`,
213216
}
214217
}

agent/config/runtime.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,9 @@ type RuntimeConfig struct {
14981498

14991499
Reporting ReportingConfig
15001500

1501+
// List of experiments to enable
1502+
Experiments []string
1503+
15011504
EnterpriseRuntimeConfig
15021505
}
15031506

agent/config/runtime_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ func TestLoad_IntegrationWithFlags(t *testing.T) {
325325
rt.DisableAnonymousSignature = true
326326
rt.DisableKeyringFile = true
327327
rt.EnableDebug = true
328+
rt.Experiments = []string{"resource-apis"}
328329
rt.UIConfig.Enabled = true
329330
rt.LeaveOnTerm = false
330331
rt.Logging.LogLevel = "DEBUG"
@@ -6355,6 +6356,7 @@ func TestLoad_FullConfig(t *testing.T) {
63556356
EnableRemoteScriptChecks: true,
63566357
EnableLocalScriptChecks: true,
63576358
EncryptKey: "A4wELWqH",
6359+
Experiments: []string{"foo"},
63586360
StaticRuntimeConfig: StaticRuntimeConfig{
63596361
EncryptVerifyIncoming: true,
63606362
EncryptVerifyOutgoing: true,

agent/config/testdata/TestRuntimeConfig_Sanitize.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
"EnableRemoteScriptChecks": false,
200200
"EncryptKey": "hidden",
201201
"EnterpriseRuntimeConfig": {},
202+
"Experiments": [],
202203
"ExposeMaxPort": 0,
203204
"ExposeMinPort": 0,
204205
"GRPCAddrs": [],

agent/config/testdata/full-config.hcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ enable_syslog = true
285285
encrypt = "A4wELWqH"
286286
encrypt_verify_incoming = true
287287
encrypt_verify_outgoing = true
288+
experiments = [
289+
"foo"
290+
]
288291
http_config {
289292
block_endpoints = [ "RBvAFcGD", "fWOWFznh" ]
290293
allow_write_http_from = [ "127.0.0.1/8", "22.33.44.55/32", "0.0.0.0/0" ]

agent/config/testdata/full-config.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@
327327
"encrypt": "A4wELWqH",
328328
"encrypt_verify_incoming": true,
329329
"encrypt_verify_outgoing": true,
330+
"experiments": [
331+
"foo"
332+
],
330333
"http_config": {
331334
"block_endpoints": [
332335
"RBvAFcGD",
@@ -407,17 +410,17 @@
407410
"raft_snapshot_interval": "30s",
408411
"raft_trailing_logs": 83749,
409412
"raft_logstore": {
410-
"backend" : "wal",
411-
"disable_log_cache": true,
413+
"backend": "wal",
414+
"disable_log_cache": true,
412415
"verification": {
413-
"enabled": true,
414-
"interval":"12345s"
416+
"enabled": true,
417+
"interval": "12345s"
415418
},
416419
"boltdb": {
417-
"no_freelist_sync": true
420+
"no_freelist_sync": true
418421
},
419422
"wal": {
420-
"segment_size_mb": 15
423+
"segment_size_mb": 15
421424
}
422425
},
423426
"read_replica": true,
@@ -927,4 +930,4 @@
927930
"xds": {
928931
"update_max_per_second": 9526.2
929932
}
930-
}
933+
}

agent/consul/options.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ type Deps struct {
3939
// HCP contains the dependencies required when integrating with the HashiCorp Cloud Platform
4040
HCP hcp.Deps
4141

42+
Experiments []string
43+
4244
EnterpriseDeps
4345
}
4446

0 commit comments

Comments
 (0)