hc-github-team-consul-core
020f685f8c
* read endpoint (#18268) implement http read endpoint to expose resource grpc service read method * Net-2707/list resource endpoint (#18444) feat: list resources endpoint * Fix incorrect yaml in examples (#18463) * NET-5187: Upgrade test timeout due to log producer errors (#18461) Stop log producer before restarting container * [NET-4799] [OSS] xdsv2: listeners L4 support for connect proxies (#18436) * refactor to avoid future import cycles * resource: Make resource list tenancy aware (#18475) * [COMPLIANCE] License update (#18479) Update BUSL LICENSE to include licensed product and version. Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> * docs: specify manual server metadata intervention (#18477) * docs: Update OpenShift compatibility (#18478) Update compatibility.mdx * resource: Make resource delete tenancy aware (#18476) resource: Make resource delete tenancy awarae * Add license-checker action that fails when any backported file contains BUSL header (#18485) * Add license-checker action that fails when any backported file contains BUSL header * Quote echoed variable to retain line breaks * Add ticket to reference for more details * docs: Update K8s TGW tutorial to reliably obtain role ID (#18474) The `grep` command used to obtain the ID for the terminating gateway role is not reliable in all scenarios. For example, if there is a similarly named role, the command may return the wrong role ID for the active terminating gateway instance. This commit updates the command to use jq to obtain the role ID. If multiple roles are found, jq will raise an error informing the user that it cannot reliably determine the role ID. * NET-5371 License checker pt2 (#18491) * Update grep command to work on ubuntu * Run license checker when new commits are pushed to PR * README - Update KV use case to Dynamic App Configuration (#18301) * Update README.md * Update kv.mdx * Add BUSL badge * README - re-order badges and update hub link (#18498) Update README.md * [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. * NET-4853 - xds v2 - implement base connect proxy functionality for clusters (#18499) * Fix HCL (#18513) * Fix HCL * Update create-sameness-groups.mdx * NET-4932 - xds v2 - implement base connect proxy functionality for endpoints (#18500) * NET-4853 - xds v2 - implement base connect proxy functionality for clusters * NET-4853 - xds v2 - implement base connect proxy functionality for clusters * NET-4932 - xds v2 - implement base connect proxy functionality for endpoints * Update endpoints_test.go * gofmt * Update naming.go * Support custom watches on controller (#18439) * Support custom watches on controller * refactor mapper methods * NET-4858 - xds v2 - implement base connect proxy functionality for routes (#18501) * NET-4853 - xds v2 - implement base connect proxy functionality for clusters * NET-4853 - xds v2 - implement base connect proxy functionality for clusters * NET-4932 - xds v2 - implement base connect proxy functionality for endpoints * Update endpoints_test.go * gofmt * NET-4858 - Make connect proxy route tests pass using xds v2 * Update endpoints_test.go * Update naming.go * use alsoRunTestForV2 * remove unused makeAddress * gofmt * fixing clusters * bimapper: allow to untrack links and support reference or id (#18451) * bimapper: fix data race (#18519) * CI Split integration tests to run nightly and every PR (#18518) * CI Split integration tests to run nightly and every PR * Checkout release branch for nightly test * Fix broken links caught in weekly report (#18522) * fix broken link caught in weekly report * Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> --------- Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * Create nightly test-integration for consul release branch (#18530) * Create nightly test-integration for consul release branch * test * fix * docs: Fix spelling errors across various pages on the site (#18533) This commit fixes numerous spelling errors across the site and also removes unnecessary whitespace that was present in the edited files. * Make proto-public license MPL (#18531) * Make proto-public license MPL * Add proto-public dir to exclusion list in .copywrite.hcl * NET-4943 - Implement ProxyTracker (#18535) * resource: Make resource watchlist tenancy aware (#18539) * Reduce required type arguments for DecodedResource (#18540) * OSS -> CE (community edition) changes (#18517) * CI: fix envoy versions in CI of release branch (#18538) * CI: fix envoy versions in CI of release branch * - remove steps sds for 1.15 nightly run - checkout the release branch * add default name * fix * Update go-tests.yml * fix checkout code * add comments and revert schedule * catalog: add failover mode enum validation (#18545) * mesh: add validation for the new pbmesh resources (#18410) Adds validation for HTTPRoute, GRPCRoute, TCPRoute, DestinationPolicy, and ComputedRoutes. * xds controller: resolve ServiceEndpoints references in ProxyStateTemp… (#18544) xds controller: resolve ServiceEndpoints references in ProxyStateTemplate * mesh: adding type aliases for mesh resource usage (#18448) Introduces some simple type aliases for DecodedResource[*X] wrappers for each type which cut down on the verbosity * Update trust bundle into proxy-state-template (#18550) * catalog: validating Protocol and Health enums on Service, Workload, and ServiceEndpoints (#18554) * chore: fix missing/incorrect license headers (#18555) * fix for , non presence of consul-version meta (#18464) * fix for #18406 , non presence of consul-version meta * removed redundant checks * updated mock-api to mimic api response for synthetic nodes * added test to test getDistinctConsulVersions method with synthetic-node case * updated typo in comments * added change log * feat: add experiments flag to testserver sdk (#18541) * bug: prevent go routine leakage due to existing DeferCheck (#18558) * bug: prevent go routine leakage due to existing DeferCheck * add changelog * NET-5382 & PLAT-1159: Do not trigger workflow if only doc files are in commit history (#18528) NET-5382: Do not run workflow runs if at least one path matches * UI: community verbiage (#18560) * chore: update community verbiage * chore: add changelog entry * Fix Windows FIPS Build (#18357) * Fix Windows FIPS Build * create new file for windows arm * removed build tag * fix buidl tags * fix multiple go build * CE port of enterprise extension (#18572) CE commit * resource: Make resource listbyowner tenancy aware (#18566) * NET-5147: Added placeholder structs for JWT functionality (#18575) * Added placeholder structs for JWT functionality * Added watches for CE vs ENT * Add license header * Undo plumbing work * Add context arg * resource: Make resource writestatus tenancy aware (#18577) * NET-5338 - NET-5338 - Run a v2 mode xds server (#18579) * NET-5338 - NET-5338 - Run a v2 mode xds server * fix linting * CI: send slack notification on failed nightly job (#18578) * CE commit (#18583) * Fix broken link on sameness group page (#18511) fix broken link * Fix typo in permissive mTLS docs (#18551) Update onboarding-tproxy-mode.mdx * Set concurrency for workflows (#18567) * Set concurrency for workflows * test: run automated tests against Vault 1.11 - 1.14 (#18590) Begin to test against Vault 1.14. Drop tests against Vault 1.10. * Reduce the frequency of metric exports to minutely (#18584) * NET-4944 - wire up controllers with proxy tracker (#18603) Co-authored-by: github-team-consul-core <github-team-consul-core@hashicorp.com> * Watch the ProxyTracker from xDS controller (#18611) * Distinguish v2 catalog Protocol unset from default (#18612) Even though we intend to default to TCP when this field is not explicitly provided, uncluding an `UNSPECIFIED` default enum value allows us to create inheritance chains, e.g. service to workload. * Added OpenTelemetry Access Logging Envoy extension (#18336) * [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 * 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> * delete all v2 resources type when deleting a namespace (CE) (#18621) * add namespace scope to ServiceV1Alpha1Type * add CE portion of namespace deletion * resource: Allow nil tenancy (#18618) * PLAT-1192 - Run CI on smaller instances (#18624) Use smaller runners * NET-3181 - Allow log file naming like Nomad (#18617) * fixes file name for consul * added log file * added tests for rename method * Add the plumbing for APIGW JWT work (#18609) * Add the plumbing for APIGW JWT work * Remove unneeded import * Add deep equal function for HTTPMatch * Added plumbing for status conditions * Remove unneeded comment * Fix comments * Add calls in xds listener for apigateway to setup listener jwt auth * docs: admin partition and DNS clarification (#18613) * fix: make UNSPECIFIED protocol pass validation (#18634) We explicitly enumerate the allowed protocols in validation, so this change is necessary to use the new enum value. Also add tests for enum validators to ensure they stay aligned to protos unless we explicitly want them to diverge. * NET 1594 - Snapshot Agent Filename Should Include Consul Version / Datacenter (#18625) * init * tests added and few fixes * revert arg message * changelog added * removed var declaration * fix CI * fix test * added node name and status * updated save.mdx * added example * fix tense * fix description * Net 3181 consul gh issue 15709 allow log file naming like nomad - fix bug (#18631) * fixes file name for consul * added log file * added tests for rename method * append instead of trunc * fix file truncate issue * added changelog * fix for build destros ci * removed changelog * solaris * resource: Require scope for resource registration (#18635) * [NET-4958] Fix issue where envoy endpoints would fail to populate after snapshot restore (#18636) Fix issue where agentless endpoints would fail to populate after snapshot restore. Fixes an issue that was introduced in #17775. This issue happens because a long-lived pointer to the state store is held, which is unsafe to do. Snapshot restorations will swap out this state store, meaning that the proxycfg watches would break for agentless. * Add extra logging for mesh health endpoints. (#18647) * feat: Change global-read-only policy to non editable (#18602) * remove stray FIPS file (#18651) * Add known issue notice for #18636. (#18650) * fix: remove Intention test with latency to make consul-enterprise rep… (#18654) fix: remove Intention test with latency to make consul-enterprise repo tests work * fix: add telemetry bind socket to proxyConfiguration proto (#18652) * feat: copy edits for built-in policy alert (#18655) * test: fix snapshot save w/ append test for ENT (#18656) * Net 2714/xw cli read command (#18462) enable `consul resource read` command in cli * change log for audit log (#18668) * change log for audit log * fix file name * breaking change * Add TCP+TLS Healthchecks (#18381) * Begin adding TCPUseTLS * More TCP with TLS plumbing * Making forward progress * Keep on adding TCP+TLS support for healthchecks * Removed too many lines * Unit tests for TCP+TLS * Update tlsutil/config.go Co-authored-by: Samantha <hello@entropy.cat> * Working on the tcp+tls unit test * Updated the runtime integration tests * Progress * Revert this file back to HEAD * Remove debugging lines * Implement TLS enabled TCP socket server and make a successful TCP+TLS healthcheck on it * Update docs * Update agent/agent_test.go Co-authored-by: Samantha <hello@entropy.cat> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: Samantha <hello@entropy.cat> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: Samantha <hello@entropy.cat> * Update agent/checks/check.go Co-authored-by: Samantha <hello@entropy.cat> * Address comments * Remove extraneous bracket * Update agent/agent_test.go Co-authored-by: Samantha <hello@entropy.cat> * Update agent/agent_test.go Co-authored-by: Samantha <hello@entropy.cat> * Update website/content/docs/ecs/configuration-reference.mdx Co-authored-by: Samantha <hello@entropy.cat> * Update the mockTLSServer * Remove trailing newline * Address comments * Fix merge problem * Add changelog entry --------- Co-authored-by: Samantha <hello@entropy.cat> * Fix windows Ent runner (#18683) * fix windows image for enterprise * added quotesT * Removed nodename and status from consul snapshot save -append-filename command and using leader version in version (#18680) * init * fix tests * fix tests lint * fix api call inside dc * updated doc * address comments * update guide to reflect tenancy and scope (#18687) * update guide to reflect tenancy and scope * Apply suggestions from code review Co-authored-by: Semir Patel <semir.patel@hashicorp.com> * update ACLHooks signature * Update docs/resources/guide.md Co-authored-by: Semir Patel <semir.patel@hashicorp.com> --------- Co-authored-by: Semir Patel <semir.patel@hashicorp.com> * Add support for querying tokens by service name. (#18667) Add support for querying tokens by service name The consul-k8s endpoints controller has a workflow where it fetches all tokens. This is not performant for large clusters, where there may be a sizable number of tokens. This commit attempts to alleviate that problem and introduces a new way to query by the token's service name. * restore common-topo peering integration tests, but nightly [NET-5476] (#18673) * dataplane: Allow getting bootstrap parameters when using V2 APIs (#18504) This PR enables the GetEnvoyBootstrapParams endpoint to construct envoy bootstrap parameters from v2 catalog and mesh resources. * Make bootstrap request and response parameters less specific to services so that we can re-use them for workloads or service instances. * Remove ServiceKind from bootstrap params response. This value was unused previously and is not needed for V2. * Make access logs generation generic so that we can generate them using v1 or v2 resources. * switch all client nodes in dc2 to dataplane [NET-4299] (#18608) * Reformat proxy docs refresh (#18623) * first commit; reformat PD conf entry * updated proxies overview page * added Deploy SM proxy usage and removed reg index * moved sidecar proxy usage to main proxy folder * recast sidecar reg page as Deploy sidecar services * fix typos * recast SM reg as conf reference- set the sidebar * add redirects * fix links * add PD conf entry usage to appropro pages * edits to proxy conf ref * fix links on index page * example command to write PD conf entry * updated links to old SM proxy reg page * updated links to sidecar service reg page * tryna fix front matter issues * Apply suggestions from code review Co-authored-by: Ronald <roncodingenthusiast@users.noreply.github.com> * added paragraph about SM proxies to overivew * Apply suggestions from code review Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> --------- Co-authored-by: Ronald <roncodingenthusiast@users.noreply.github.com> Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> * 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. * test: update sidecarproxy/builder golden tests to use determinstic golden data (#18703) * [APIGW] NET-5017 JWT Cleanup/Status Conditions (#18700) * Fixes issues in setting status * Update golden files for changes to xds generation to not use deprecated methods * Fixed default for validation of JWT for route * Added changelog for jwt features (#18709) * fix: NET-1521 show latest config in /v1/agent/self (#18681) * fix: NET-1521 show latest config in /v1/agent/self * Using larger machine for Enterprise (#18713) using 4x large for ent * [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 * Adds PassiveHealthCheck Fields to ServiceDefaults and IngressGateway (#18532) Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com> * Instantiate secure resource service client after the grpc server (#18712) * ENT port: test-integ/peering: peer through mesh gateway [NET-4609] (#18605) Co-authored-by: Matt Keeler <mjkeeler7@gmail.com> * [CC-6039] Update builtin policy descriptions (#18705) * Net-2713/resource apply command (#18610) * feat: implement apply command * fix: resolve lint issues * refactor: use fixed types * fix: ci lint failures after main rebase * 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 * fix: emit consul version metric on a regular interval (#18724) * [NET-5330] Support templated policies in Binding rules (#18719) * [NET-5330] Support templated policies in Binding rules * changelog for templated policy support in binding rules * NET-5530 Generate deep-copy code (#18730) * Generate deep-copy code * Undo license header removal * sidecar-proxy controller: Add support for transparent proxy (NET-5069) (#18458) This commit adds support for transparent proxy to the sidecar proxy controller. As we do not yet support inferring destinations from intentions, this assumes that all services in the cluster are destinations. * Prefix sidecar proxy test files with source and destination. (#18620) * mesh-controller: handle L4 protocols for a proxy without upstreams * sidecar-controller: Support explicit destinations for L4 protocols and single ports. * 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. * endpoints-controller: add workload identity to the service endpoints resource * small fixes * review comments * Address PR comments * sidecar-proxy controller: Add support for transparent proxy This currently does not support inferring destinations from intentions. * PR review comments * mesh-controller: handle L4 protocols for a proxy without upstreams * sidecar-controller: Support explicit destinations for L4 protocols and single ports. * 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. * endpoints-controller: add workload identity to the service endpoints resource * small fixes * review comments * Make sure endpoint refs route to mesh port instead of an app port * Address PR comments * fixing copyright * tidy imports * sidecar-proxy controller: Add support for transparent proxy This currently does not support inferring destinations from intentions. * tidy imports * add copyright headers * Prefix sidecar proxy test files with source and destination. * Update controller_test.go --------- Co-authored-by: Iryna Shustava <iryna@hashicorp.com> Co-authored-by: R.B. Boyer <rb@hashicorp.com> Co-authored-by: github-team-consul-core <github-team-consul-core@hashicorp.com> * k8s: Update audit-logging docs to include K8s examples (#18721) Update audit-logging.mdx * Fix windows integrations tests machine size (#18736) fix windows integrations tests machine size * Increase timeout for integration test windows. (#18737) increase timeout * Net-4292/list command (#18649) * feat: implement list command * refactor: apply command file parsing * Added logs for debugging (#18740) * added logs * added echo * removed pull request * xds: update golden tests to be deterministic (#18707) * Run copyright after running deep-copy as part of the Makefile/CI (#18741) * execute copyright headers after performing deep-copy generation. * fix copyright install * Apply suggestions from code review Co-authored-by: Semir Patel <semir.patel@hashicorp.com> * Apply suggestions from code review Co-authored-by: Semir Patel <semir.patel@hashicorp.com> * rename steps to match codegen naming * remove copywrite install category --------- Co-authored-by: Semir Patel <semir.patel@hashicorp.com> * [NET-5333] Add api to read/list and preview templated policies (#18748) * NET-5132 - Configure multiport routing for connect proxies in TProxy mode (#18606) * mesh-controller: handle L4 protocols for a proxy without upstreams * sidecar-controller: Support explicit destinations for L4 protocols and single ports. * 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. * endpoints-controller: add workload identity to the service endpoints resource * small fixes * review comments * Address PR comments * sidecar-proxy controller: Add support for transparent proxy This currently does not support inferring destinations from intentions. * PR review comments * mesh-controller: handle L4 protocols for a proxy without upstreams * sidecar-controller: Support explicit destinations for L4 protocols and single ports. * 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. * endpoints-controller: add workload identity to the service endpoints resource * small fixes * review comments * Make sure endpoint refs route to mesh port instead of an app port * Address PR comments * fixing copyright * tidy imports * sidecar-proxy controller: Add support for transparent proxy This currently does not support inferring destinations from intentions. * tidy imports * add copyright headers * Prefix sidecar proxy test files with source and destination. * Update controller_test.go * NET-5132 - Configure multiport routing for connect proxies in TProxy mode * formatting golden files * reverting golden files and adding changes in manually. build implicit destinations still has some issues. * fixing files that were incorrectly repeating the outbound listener * PR comments * extract AlpnProtocol naming convention to getAlpnProtocolFromPortName(portName) * removing address level filtering. * adding license to resources_test.go --------- Co-authored-by: Iryna Shustava <iryna@hashicorp.com> Co-authored-by: R.B. Boyer <rb@hashicorp.com> Co-authored-by: github-team-consul-core <github-team-consul-core@hashicorp.com> * added time stamps (#18757) * fix: write endpoint errors out gracefully (#18743) * [NET-5574] Update Go version to 1.20.8 (#18742) Update Go version to 1.20.8 This resolves several CVEs (see changelog entry). * Add Envoy golden test for OTEL access logging extension (#18760) * mesh: create new routes-controller to reconcile xRoute types into a ComputedRoutes resource (#18460) This new controller produces an intermediate output (ComputedRoutes) that is meant to summarize all relevant xRoutes and related mesh configuration in an easier-to-use format for downstream use to construct the ProxyStateTemplate. It also applies status updates to the xRoute resource types to indicate that they are themselves semantically valid inputs. * xds controller: setup watches for and compute leaf cert references in ProxyStateTemplate, and wire up leaf cert manager dependency (#18756) * Refactors the leafcert package to not have a dependency on agent/consul and agent/cache to avoid import cycles. This way the xds controller can just import the leafcert package to use the leafcert manager. The leaf cert logic in the controller: * Sets up watches for leaf certs that are referenced in the ProxyStateTemplate (which generates the leaf certs too). * Gets the leaf cert from the leaf cert cache * Stores the leaf cert in the ProxyState that's pushed to xds * For the cert watches, this PR also uses a bimapper + a thin wrapper to map leaf cert events to related ProxyStateTemplates Since bimapper uses a resource.Reference or resource.ID to map between two resource types, I've created an internal type for a leaf certificate to use for the resource.Reference, since it's not a v2 resource. The wrapper allows mapping events to resources (as opposed to mapping resources to resources) The controller tests: Unit: Ensure that we resolve leaf cert references Lifecycle: Ensure that when the CA is updated, the leaf cert is as well Also adds a new spiffe id type, and adds workload identity and workload identity URI to leaf certs. This is so certs are generated with the new workload identity based SPIFFE id. * Pulls out some leaf cert test helpers into a helpers file so it can be used in the xds controller tests. * Wires up leaf cert manager dependency * Support getting token from proxytracker * Add workload identity spiffe id type to the authorize and sign functions --------- Co-authored-by: John Murret <john.murret@hashicorp.com> * Test: NET-5592 - update Nomad integration testing (#18768) NET-5592 - update Nomad integration testing * Add workload identity ACL rules (#18769) * 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 |
1 year ago | |
---|---|---|
.. | ||
watch | Backport of watch: support -filter for consul watch: checks, services, nodes, service into release/1.15.x (#17986) | 1 year ago |
.golangci.yml |
…
|
|
README.md | Update the README for the Consul API (#15936) | 2 years ago |
acl.go | [NET-5399] Add support for querying tokens by service name. (#18690) | 1 year ago |
acl_test.go | [NET-5399] Add support for querying tokens by service name. (#18690) | 1 year ago |
agent.go | Backport of member cli: add -filter expression to flags into release/1.15.x (#18279) | 1 year ago |
agent_test.go | Backport of member cli: add -filter expression to flags into release/1.15.x (#18279) | 1 year ago |
api.go | Backport of NET-4897 - update comment to include the current issue url from the go team. into release/1.15.x (#18265) | 1 year ago |
api_test.go | Synthesize anonymous token pre-bootstrap when needed (#16200) | 2 years ago |
catalog.go | fix(txn api): missing proxy config in registering proxy service (#14471) | 2 years ago |
catalog_test.go | fix(api): OSS<->ENT exported service incompatibility | 2 years ago |
ce_test.go | [BACKPORT] 1.15.x manual backport of OSS->CE branch (#18552) | 1 year ago |
config_entry.go | Manual backport 1.15.x of Disable remote proxy patching except AWS Lambda (#17432) | 2 years ago |
config_entry_discoverychain.go | Backport of Include RequestTimeout in marshal/unmarshal of ServiceResolverConfigE… into release/1.15.x (#19033) | 1 year ago |
config_entry_discoverychain_test.go | Backport of Include RequestTimeout in marshal/unmarshal of ServiceResolverConfigE… into release/1.15.x (#19033) | 1 year ago |
config_entry_exports.go | Update api package exported services comment. (#15285) | 2 years ago |
config_entry_exports_test.go | Rename `PeerName` to `Peer` on prepared queries and exported services (#14854) | 2 years ago |
config_entry_gateways.go | Backport of [API Gateway] Validate listener name is not empty into release/1.15.x (#16341) | 2 years ago |
config_entry_gateways_test.go | [BACKPORT] 1.15.x manual backport of OSS->CE branch (#18552) | 1 year ago |
config_entry_inline_certificate.go | Backport of Fix infinite recursion in inline-certificate config entry into release/1.15.x (#16281) | 2 years ago |
config_entry_inline_certificate_test.go | Backport of Add stricter validation and some normalization code for API Gateway ConfigEntries into release/1.15.x (#16317) | 2 years ago |
config_entry_intentions.go | Add SourcePeer fields to relevant Intentions types (#13390) | 3 years ago |
config_entry_intentions_test.go |
…
|
|
config_entry_mesh.go | feat: add PeerThroughMeshGateways to mesh config | 2 years ago |
config_entry_routes.go | Backport of [API Gateway] Various fixes for Config Entry fields into release/1.15.x (#16354) | 2 years ago |
config_entry_status.go | Backport of APIGW Normalize Status Conditions into release/1.15.x (#17844) | 1 year ago |
config_entry_status_test.go | Backport of APIGW Normalize Status Conditions into release/1.15.x (#17844) | 1 year ago |
config_entry_test.go | backport PR 15979 to 1.15.x (#17208) | 2 years ago |
connect.go | Rename hcp-metrics-collector to consul-telemetry-collector (#17327) (#17412) | 2 years ago |
connect_ca.go |
…
|
|
connect_ca_test.go | update config defaults, add docs (#15302) | 2 years ago |
connect_intention.go | Add SourcePeer fields to relevant Intentions types (#13390) | 3 years ago |
connect_intention_test.go | Support partitions in connect expose cmd | 3 years ago |
coordinate.go | Remove incorrect usage of url.PathEscape (#12184) | 3 years ago |
coordinate_test.go | fix(api): OSS<->ENT exported service incompatibility | 2 years ago |
debug.go | Allow consul debug on non-ACL consul servers (#15155) | 2 years ago |
debug_test.go |
…
|
|
discovery_chain.go | xds: ensure that all connect timeout configs can apply equally to tproxy direct dial connections (#12711) | 3 years ago |
discovery_chain_test.go | xds: ensure that all connect timeout configs can apply equally to tproxy direct dial connections (#12711) | 3 years ago |
event.go |
…
|
|
event_test.go |
…
|
|
go.mod | Backport of [NET-5146] security: Update Go version to 1.20.7 and `x/net` to 0.13.0 into release/1.15.x (#18362) | 1 year ago |
go.sum | Backport of [NET-5146] security: Update Go version to 1.20.7 and `x/net` to 0.13.0 into release/1.15.x (#18362) | 1 year ago |
health.go | Merge pull request #13388 from deblasis/feature/health-checks_windows_service | 2 years ago |
health_test.go | fix(api): OSS<->ENT exported service incompatibility | 2 years ago |
kv.go |
…
|
|
kv_test.go |
…
|
|
lock.go |
…
|
|
lock_test.go |
…
|
|
mock_api_test.go | removes ioutil usage everywhere which was deprecated in go1.16 (#15297) | 2 years ago |
namespace.go | remove gogo from acl protobufs | 3 years ago |
namespace_test.go | re-run gofmt on 1.17 (#11579) | 3 years ago |
operator.go |
…
|
|
operator_area.go |
…
|
|
operator_autopilot.go |
…
|
|
operator_autopilot_test.go |
…
|
|
operator_keyring.go | partitions: various refactors to support partitioning the serf LAN pool (#11568) | 3 years ago |
operator_keyring_test.go |
…
|
|
operator_license.go |
backport of commit ed697687c4 (#16402)
|
2 years ago |
operator_raft.go | Backport of [NET-3865] [Supportability] Additional Information in the output of 'consul operator raft list-peers' into release/1.15.x (#17737) | 1 year ago |
operator_raft_test.go | Leadership transfer cmd (#14132) | 2 years ago |
operator_segment.go |
…
|
|
operator_usage.go | Add the `operator usage instances` command and api endpoint (#16205) | 2 years ago |
operator_usage_test.go | Backport of [API Gateway] Fix rate limiting for API gateways into release/1.15.x (#17634) | 1 year ago |
partition.go | Clarify feature name in partition docstring | 3 years ago |
peering.go | Bring back parameter ServerExternalAddresses in GenerateToken endpoint (#15267) | 2 years ago |
peering_test.go | Bring back parameter ServerExternalAddresses in GenerateToken endpoint (#15267) | 2 years ago |
prepared_query.go | Remove empty tags 2 (#16113) | 2 years ago |
prepared_query_test.go | Remove empty tags 2 (#16113) | 2 years ago |
raw.go |
…
|
|
semaphore.go |
…
|
|
semaphore_test.go |
…
|
|
session.go |
…
|
|
session_test.go |
…
|
|
snapshot.go |
…
|
|
snapshot_test.go |
…
|
|
status.go |
…
|
|
status_test.go | bulk rewrite using this script | 3 years ago |
txn.go | Add kv txn get-not-exists operation. | 2 years ago |
txn_test.go | fix(api): OSS<->ENT exported service incompatibility | 2 years ago |
README.md
Consul API Client
This package provides the api
package which provides programmatic access to the full Consul API.
The full documentation is available on Godoc.
Usage
Below is an example of using the Consul client. To run the example, you must first install Consul and Go.
To run the client API, create a new Go module.
go mod init consul-demo
Copy the example code into a file called main.go
in the directory where the module is defined.
As seen in the example, the Consul API is often imported with the alias capi
.
package main
import (
"fmt"
capi "github.com/hashicorp/consul/api"
)
func main() {
// Get a new client
client, err := capi.NewClient(capi.DefaultConfig())
if err != nil {
panic(err)
}
// Get a handle to the KV API
kv := client.KV()
// PUT a new KV pair
p := &capi.KVPair{Key: "REDIS_MAXCLIENTS", Value: []byte("1000")}
_, err = kv.Put(p, nil)
if err != nil {
panic(err)
}
// Lookup the pair
pair, _, err := kv.Get("REDIS_MAXCLIENTS", nil)
if err != nil {
panic(err)
}
fmt.Printf("KV: %v %s\n", pair.Key, pair.Value)
}
Install the Consul API dependency with go mod tidy
.
In a separate terminal window, start a local Consul server.
consul agent -dev -node machine
Run the example.
go run .
You should get the following result printed to the terminal.
KV: REDIS_MAXCLIENTS 1000
After running the code, you can also view the values in the Consul UI on your local machine at http://localhost:8500/ui/dc1/kv