Commit Graph

432 Commits (9a36b73e1b8bb0deb560e21903937491589c1e45)

Author SHA1 Message Date
hc-github-team-consul-core cc9b6e2a02
Backport of fix formatting issue in envoy bootstrapping. into release/1.17.x (#20043)
backport of commit c4c2ddef30

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-12-21 16:20:45 -07:00
hc-github-team-consul-core 4208875d5b
Backport of NET-6942 - Replace usage of deprecated Envoy field envoy.config.cluster.v3.Cluster.http_protocol_options. into release/1.17.x (#20033)
* backport of commit 79711465e0

* backport of commit c9e5801e7e

---------

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-12-21 15:16:23 -07:00
hc-github-team-consul-core c8bbd39ca7
Backport of [NET-7009] security: update x/crypto to 0.17.0 into release/1.17.x (#20029)
backport of commit d8a33b4e72

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
2023-12-21 20:35:44 +00:00
hc-github-team-consul-core 94737e0718
Backport of NET-6317 - update usage of deprecated fields: http2_protocol_options and access_log_path into release/1.17.x (#19953)
* backport of commit 4d45c672b3

* backport of commit 1e8797522e

* backport of commit 691dab71bd

* backport of commit 924d61fc04

---------

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-12-14 14:10:25 -07:00
hc-github-team-consul-core fed1b2142d
Backport of Fix a test flake where a retry timer was being reused causing tests after the first to exit early into release/1.17.x (#19869)
backport of commit 4362d06542

Co-authored-by: Matt Keeler <mjkeeler7@gmail.com>
2023-12-08 13:28:21 -05:00
lornasong 81a22ae9b6
Manual Backport of [Cloud][CC-6925] Updates to pushing server state into release/1.17.x (#19810)
* [Cloud][CC-6925] Updates to pushing server state (#19682)

* Upgrade hcp-sdk-go to latest version v0.73

Changes:
- go get github.com/hashicorp/hcp-sdk-go
- go mod tidy

* From upgrade: regenerate protobufs for upgrade from 1.30 to 1.31

Ran: `make proto`

Slack: https://hashicorp.slack.com/archives/C0253EQ5B40/p1701105418579429

* From upgrade: fix mock interface implementation

After upgrading, there is the following compile error:

cannot use &mockHCPCfg{} (value of type *mockHCPCfg) as "github.com/hashicorp/hcp-sdk-go/config".HCPConfig value in return statement: *mockHCPCfg does not implement "github.com/hashicorp/hcp-sdk-go/config".HCPConfig (missing method Logout)

Solution: update the mock to have the missing Logout method

* From upgrade: Lint: remove usage of deprecated req.ServerState.TLS

Due to upgrade, linting is erroring due to usage of a newly deprecated field

22:47:56 [consul]: make lint
--> Running golangci-lint (.)
agent/hcp/testing.go:157:24: SA1019: req.ServerState.TLS is deprecated: use server_tls.internal_rpc instead. (staticcheck)
                time.Until(time.Time(req.ServerState.TLS.CertExpiry)).Hours()/24,
                                     ^

* From upgrade: adjust oidc error message

From the upgrade, this test started failing:

=== FAIL: internal/go-sso/oidcauth TestOIDC_ClaimsFromAuthCode/failed_code_exchange (re-run 2) (0.01s)
    oidc_test.go:393: unexpected error: Provider login failed: Error exchanging oidc code: oauth2: "invalid_grant" "unexpected auth code"

Prior to the upgrade, the error returned was:
```
Provider login failed: Error exchanging oidc code: oauth2: cannot fetch token: 401 Unauthorized\nResponse: {\"error\":\"invalid_grant\",\"error_description\":\"unexpected auth code\"}\n
```

Now the error returned is as below and does not contain "cannot fetch token"
```
Provider login failed: Error exchanging oidc code: oauth2: "invalid_grant" "unexpected auth code"

```

* Update AgentPushServerState structs with new fields

HCP-side changes for the new fields are in:
https://github.com/hashicorp/cloud-global-network-manager-service/pull/1195/files

* Minor refactor for hcpServerStatus to abstract tlsInfo into struct

This will make it easier to set the same tls-info information to both
 - status.TLS (deprecated field)
 - status.ServerTLSMetadata (new field to use instead)

* Update hcpServerStatus to parse out information for new fields

Changes:
 - Improve error message and handling (encountered some issues and was confused)
 - Set new field TLSInfo.CertIssuer
 - Collect certificate authority metadata and set on TLSInfo.CertificateAuthorities
 - Set TLSInfo on both server.TLS and server.ServerTLSMetadata.InternalRPC

* Update serverStatusToHCP to convert new fields to GNM rpc

* Add changelog

* Feedback: connect.ParseCert, caCerts

* Feedback: refactor and unit test server status

* Feedback: test to use expected struct

* Feedback: certificate with intermediate

* Feedback: catch no leaf, remove expectedErr

* Feedback: update todos with jira ticket

* Feedback: mock tlsConfigurator

* make proto for additional file in 1.17 not in main
2023-12-04 15:34:24 -05:00
Michael Zalimeni 0225d57b88
chore: Run go mod tidy on consul-container (#19743)
This submodule has gotten out of sync and is causing downstream CI
failure.
2023-11-27 14:07:16 -05:00
hc-github-team-consul-core 5e02ddf5fb
Backport of Integ test (test/deployer): upgrade test with service mesh into release/1.17.x (#19659)
* backport of commit 372d9f0372

* license header

---------

Co-authored-by: cskh <hui.kang@hashicorp.com>
2023-11-16 14:13:33 -05:00
hc-github-team-consul-core 50bd623a5f
Backport of upgrade test: remove duplicate test case into release/1.17.x (#19653)
backport of commit 172b5b6dec

Co-authored-by: cskh <hui.kang@hashicorp.com>
2023-11-15 18:18:11 +00:00
hc-github-team-consul-core 15952b763a
Backport of test: fix some multiport deployer bugs and remove a container test already handled by deployer tests into release/1.17.x (#19652)
backport of commit eb13295e2b

Co-authored-by: R.B. Boyer <rb@hashicorp.com>
2023-11-15 16:44:22 +00:00
hc-github-team-consul-core da2a57239e
Backport of Introduce randomized timings and reproducible randomization into controller integration tests. into release/1.17.x (#19575)
Introduce randomized timings and reproducible randomization into controller integration tests.

As the V2 architecture hinges on eventual consistency and controllers reconciling the existing state in response to writes, there are potential issues we could run into regarding ordering and timing of operations. We want to be able to guarantee that given a set of resources the system will always eventually get to the desired correct state. The order of resource writes and delays in performing those writes should not alter the final outcome of reaching the desired state.

To that end, this commit introduces arbitrary randomized delays before performing resources writes into the `resourcetest.Client`. Its `PublishResources` method was already randomizing the order of resource writes. By default, no delay is added to normal writes and deletes but tests can opt-in via either passing hard coded options when creating the `resourcetest.Client` or using the `resourcetest.ConfigureTestCLIFlags` function to allow processing of CLI parameters.

In addition to allowing configurability of the request delay min and max, the client also has a configurable random number generator seed. When Using the CLI parameter helpers, a test log will be written noting the currently used settings. If the test fails then you can reproduce the same delays and order randomizations by providing the seed during the previous test failure.

# Conflicts:
#	internal/catalog/catalogtest/run_test.go
#	internal/catalog/catalogtest/test_integration_v2beta1.go
#	test/integration/consul-container/test/catalog/catalog_test.go

Co-authored-by: Matt Keeler <mjkeeler7@gmail.com>
2023-11-08 16:39:28 -05:00
hc-github-team-consul-core 099e48a885
Backport of test: update certs for 10 year expiry into release/1.17.x (#19561)
backport of commit d6283a9352

Co-authored-by: DanStough <dan.stough@hashicorp.com>
2023-11-07 20:20:35 +00:00
hc-github-team-consul-core 1fbd59875b
Backport of Ci upgrade test 1 17 into release/1.17.x (#19537)
* backport of commit b229e292fe

* keep upgrade test from 1.15

* keep envoy version

---------

Co-authored-by: cskh <hui.kang@hashicorp.com>
2023-11-06 22:00:05 +00:00
hc-github-team-consul-core 3e0240caba
Backport of [NET-5916] Fix locality-aware routing config and tests (CE) into release/1.17.x (#19491)
backport of commit c0203fbcb5

Co-authored-by: Derek Menteer <derek.menteer@hashicorp.com>
2023-11-03 17:06:57 -05:00
hc-github-team-consul-core 757651b82a
Backport of chore: apply enterprise changes that were missed to some testing files into release/1.17.x (#19507)
chore: apply enterprise changes that were missed to some testing files (#19504)

This should align between CE ef35525 and ENT 7f95226dbe40151c8f17dd4464784b60cf358dc1 in:

- testing/integration/consul-container
- test-integ
- testing/deployer

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
2023-11-03 17:05:09 +00:00
Dan Stough 27cffd396d
Backport `1.17.x` - build: dependency updates for 1.17.0 (#19455)
build: dependency updates for 1.17.0
2023-11-03 11:44:34 -04:00
hc-github-team-consul-core 37ef09c43e
Backport of testing/deployer: support tproxy in v2 for dataplane into release/1.17.x (#19494)
testing/deployer: support tproxy in v2 for dataplane (#19094)

This updates the testing/deployer (aka "topology test") framework to allow for a 
v2-oriented topology to opt services into enabling TransparentProxy. The restrictions 
are similar to that of #19046

The multiport Ports map that was added in #19046 was changed to allow for the 
protocol to be specified at this time, but for now the only supported protocol is TCP 
as only L4 functions currently on main.

As part of making transparent proxy work, the DNS server needed a new zonefile 
for responding to virtual.consul requests, since there is no Kubernetes DNS and 
the Consul DNS work for v2 has not happened yet. Once Consul DNS supports v2 we should switch over. For now the format of queries is:

<service>--<namespace>--<partition>.virtual.consul

Additionally:

- All transparent proxy enabled services are assigned a virtual ip in the 10.244.0/24
  range. This is something Consul will do in v2 at a later date, likely during 1.18.
- All services with exposed ports (non-mesh) are assigned a virtual port number for use
  with tproxy
- The consul-dataplane image has been made un-distroless, and gotten the necessary
  tools to execute consul connect redirect-traffic before running dataplane, thus simulating
  a kubernetes init container in plain docker.

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
2023-11-02 21:49:15 +00:00
hc-github-team-consul-core 2b4d96a45e
Backport of testing/deployer: update deployer to use v2 catalog constructs when requested into release/1.17.x (#19492)
testing/deployer: update deployer to use v2 catalog constructs when requested (#19046)

This updates the testing/deployer (aka "topology test") framework to conditionally 
configure and launch catalog constructs using v2 resources. This is controlled via a 
Version field on the Node construct in a topology.Config. This only functions for a 
dataplane type and has other restrictions that match the rest of v2 (no peering, no 
wanfed, no mesh gateways).

Like config entries, you can statically provide a set of initial resources to be synced 
when bringing up the cluster (beyond those that are generated for you such as 
workloads, services, etc).

If you want to author a test that can be freely converted between v1 and v2 then that 
is possible. If you switch to the multi-port definition on a topology.Service (aka 
"workload/instance") then that makes v1 ineligible.

This also adds a starter set of "on every PR" integration tests for single and multiport 
under test-integ/catalogv2

Co-authored-by: R.B. Boyer <4903+rboyer@users.noreply.github.com>
2023-11-02 19:53:41 +00:00
hc-github-team-consul-core e557c80e9c
Backport of Regen expired test certs into release/1.17.x (#19479)
backport of commit d399654096

Co-authored-by: Semir Patel <semir.patel@hashicorp.com>
2023-11-02 15:48:43 +00:00
Michael Zalimeni 4c3c32d05e
Backport of [NET-6138] security: Bump google.golang.org/grpc to 1.56.3 (CVE-2023-44487) to release/1.17.x (#19417)
Bump google.golang.org/grpc to 1.56.3

This resolves [CVE-2023-44487](https://nvd.nist.gov/vuln/detail/CVE-2023-44487).

Co-authored-by: Chris Thain <chris.m.thain@gmail.com>
2023-10-30 08:45:42 -04:00
hc-github-team-consul-core 9f85516e7d
Backport of NET-6294 - v1 Agentless proxycfg datasource errors after v2 changes into release/1.17.x (#19416)
backport of commit fa50df4b2d

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-10-27 21:04:20 +00:00
Dhia Ayachi 448f7b885d
1.17.x backport: bump raft-wal version to 0.4.1 (#19314) (#19356)
bump raft-wal version to 0.4.1 (#19314)

* bump raft-wal version to 0.4.1

* changelog

* go mod tidy integration tests

* go mod tidy test-integ
2023-10-24 19:51:27 +00:00
hc-github-team-consul-core 2dcda57490
Backport of [NET-5944] security: Update Go version to 1.20.10 and `x/net` to 0.17.0 into release/1.17.x (#19235)
* backport of commit d7d9de9564

* backport of commit 0794b1ce74

---------

Co-authored-by: Michael Zalimeni <michael.zalimeni@hashicorp.com>
2023-10-16 22:09:58 +00:00
R.B. Boyer c26d5cf62c
test: fix container test enterprise drift (#19101) 2023-10-11 15:39:09 -05:00
Dhia Ayachi ab1e08f1a4
fix flaking container tests (#19134) 2023-10-11 11:26:07 -04:00
Chris S. Kim 92ce814693
Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
Eric Haberkorn ad3aab1ef7
Add traffic permissions integration tests. (#19008)
Add traffic permissions integration tests.
2023-10-06 12:06:12 -04:00
Eric Haberkorn 9656fd157f
Fix Explicit Destination Integration Test (#19060)
fix explicit destination integration test
2023-10-04 12:52:12 -04:00
Eric Haberkorn f2b7b4591a
Fix Traffic Permissions Default Deny (#19028)
Whenver a traffic permission exists for a given workload identity, turn on default deny.

Previously, this was only working at the port level.
2023-10-04 09:58:28 -04:00
Poonam Jadhav 6c92dd1359
NET-5600/container-test-acl-enabled (#18887)
* feat: add container tests for resource http api with acl enabled

* refactor: clean up
2023-10-03 10:55:31 -04:00
Matt Keeler 2240e746dd
Skip the catalog v2 upgrade test (#19005)
We intentionally broke api compatibility here as we are not yet maintaining backwards compat for the v2 apis
2023-09-26 17:05:19 -04:00
John Murret 6f0df20d10
NET-5657 - consul-containers test for explicit upstreams (#18952)
* Explicit container test

* remove static resources

* fix passing serviceBindPorts

* WIP

* fix explicit upstream test

* use my image in CI until dataplane is fixed.

* gofmt

* fixing reference to v2beta1 in test-containers

* WIP

* remove bad references

* add missing license headers

* allow access internal/resource/resourcetest

* fix check-allowed-imports to append array items

* use preview image for dataplane

* revert some inadverntent comment updates in peering_topology

* add building local consul-dataplane image to compatibility-tests CI

* fix substitution in CI

* change upstreams to destinations based on incoming change

* fixing use of upstreams in resource update

* remove commented out lines and enable envoy concurrency on dataplane.

* changes to addess PR feedback

* small fixes

---------

Co-authored-by: Eric <eric@haberkorn.co>
2023-09-26 16:21:47 -04:00
Iryna Shustava d88888ee8b
catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
Curt Bushko bc142cd152
NET-4884 - Terminating gateway tests for namespaces & partitions (#18820)
* Add gateway test to CE
2023-09-21 10:25:27 -04:00
John Landa 9eaa8eb026
dns token (#17936)
* dns token

fix whitespace for docs and comments

fix test cases

fix test cases

remove tabs in help text

Add changelog

Peering dns test

Peering dns test

Partial implementation of Peered DNS test

Swap to new topology lib

expose dns port for integration tests on client

remove partial test implementation

remove extra port exposure

remove changelog from the ent pr

Add dns token to set-agent-token switch

Add enterprise golden file

Use builtin/dns template in tests

Update ent dns policy

Update ent dns template test

remove local gen certs

fix templated policy specs

* add changelog

* go mod tidy
2023-09-20 15:50:06 -06:00
Chris Thain a071899684
Add otel-access-logging Envoy extension integration test (#18898) 2023-09-19 19:04:47 +00:00
Ashesh Vidyut 6fd33ba30d
NET-4519 Collecting journald logs in "consul debug" bundle (#18797)
* debug since

* fix docs

* chagelog added

* fix go mod

* debug test fix

* fix test

* tabs test fix

* Update .changelog/18797.txt

Co-authored-by: Ganesh S <ganesh.seetharaman@hashicorp.com>

---------

Co-authored-by: Ganesh S <ganesh.seetharaman@hashicorp.com>
2023-09-19 08:46:50 +05:30
sarahalsmiller 753c8f1774
Retry and timeout test acceptance test (#18791)
* retry and timeout test

* add docker mirrior

* checkpoint

* add in error

* add in delay

* up error rate

* fix status code
2023-09-15 11:54:51 -05:00
Ashesh Vidyut 0b6efbb9c1
Windows Integration Test Changes (#18758)
* some changes to debug

* revert machines

* increased timeout

* added sleep 10 seconds before test start

* chagne envoy version

* removed sleep

* revert timeout

* replace position

* removed date

* Revert "[NET-5217] [OSS] Derive sidecar proxy locality from parent service (#18437)"

This reverts commit 05604eeec1.

* fix build

* Revert "replace position"

This reverts commit 48e6af46a8.

* Revert "Revert "[NET-5217] [OSS] Derive sidecar proxy locality from parent service (#18437)""

This reverts commit d7c568e2be.

* comment out api gateway http hostnames test

* fix import

* revert integ test run on PR
2023-09-13 15:40:08 +05:30
Ashesh Vidyut 697836b19a
added time stamps (#18757) 2023-09-12 09:22:31 +00:00
Ashesh Vidyut 172e915074
Added logs for debugging (#18740)
* added logs

* added echo

* removed pull request
2023-09-11 14:24:50 +00:00
Nathan Coleman e5d26a13cd
NET-5530 Support response header modifiers on http-route config entry (#18646)
* Add response header filters to http-route config entry definitions

* Map response header filters from config entry when constructing route destination

* Support response header modifiers at the service level as well

* Update protobuf definitions

* Update existing unit tests

* Add response filters to route consolidation logic

* Make existing unit tests more robust

* Add missing docstring

* Add changelog entry

* Add response filter modifiers to existing integration test

* Add more robust testing for response header modifiers in the discovery chain

* Add more robust testing for request header modifiers in the discovery chain

* Modify test to verify that service filter modifiers take precedence over rule filter modifiers
2023-09-08 14:04:56 -04:00
Ronald bbef879f85
[NET-5325] ACL templated policies support in tokens and roles (#18708)
* [NET-5325] ACL templated policies support in tokens and roles
- Add API support for creating tokens/roles with templated-policies
- Add CLI support for creating tokens/roles with templated-policies

* adding changelog
2023-09-08 12:45:24 +00:00
Iryna Shustava 3c70e14713
sidecar-proxy controller: L4 controller with explicit upstreams (NET-3988) (#18352)
* This controller generates and saves ProxyStateTemplate for sidecar proxies.
* It currently supports single-port L4 ports only.
* It keeps a cache of all destinations to make it easier to compute and retrieve destinations.
* It will update the status of the pbmesh.Upstreams resource if anything is invalid.
* This commit also changes service endpoints to include workload identity. This made the implementation a bit easier as we don't need to look up as many workloads and instead rely on endpoints data.
2023-09-07 09:37:15 -06:00
John Murret 255aa158db
update comments and docs about running envoy integration tests with the ENVOY_VERSION set. (#18614)
update ENVOY_VERSION and documentation of it used in the bats envoy tests.

Co-authored-by: github-team-consul-core <github-team-consul-core@hashicorp.com>
2023-08-30 17:31:40 +00:00
Ashvitha 0f48b7af5e
[HCP Telemetry] Move first TelemetryConfig Fetch into the TelemetryConfigProvider (#18318)
* Add Enabler interface to turn sink on/off

* Use h for hcpProviderImpl vars, fix PR feeback and fix errors

* Keep nil check in exporter and fix tests

* Clarify comment and fix function name

* Use disable instead of enable

* Fix errors nit in otlp_transform

* Add test for refreshInterval of updateConfig

* Add disabled field in MetricsConfig struct

* Fix PR feedback: improve comment and remove double colons

* Fix deps test which requires a maybe

* Update hcp-sdk-go to v0.61.0

* use disabled flag in telemetry_config.go

* Handle 4XX errors in telemetry_provider

* Fix deps test

* Check 4XX instead

* Run make go-mod-tidy
2023-08-30 13:25:26 -04:00
John Murret 051f250edb
NET-5338 - NET-5338 - Run a v2 mode xds server (#18579)
* NET-5338 - NET-5338 - Run a v2 mode xds server

* fix linting
2023-08-24 16:44:14 -06:00
Semir Patel 53e28a4963
OSS -> CE (community edition) changes (#18517) 2023-08-22 09:46:03 -05:00
Michael Zalimeni 61b7c0d76f
[NET-5163] Support locality testing in consul-container (#18484)
* Support locality testing in consul-container

Support including locality in client sidecar config.

Also align test config structs with Ent to avoid future conflicts.

* Refactor consul-container fortio helpers

Refactor fortio test helpers to separate HTTP retries from waiting on
fortio result changes due to e.g. service startup and failovers.
2023-08-17 09:41:29 -04:00
Nitya Dhanushkodi 6b7ccd06cf
[NET-4799] [OSS] xdsv2: listeners L4 support for connect proxies (#18436)
* refactor to avoid future import cycles
2023-08-15 11:57:07 -07:00