140 Commits

Author SHA1 Message Date
Semir Patel
217107f627
resource: Make resource list tenancy aware (#18475) 2023-08-15 16:57:59 -05:00
hashicorp-copywrite[bot]
5fb9df1640
[COMPLIANCE] License changes (#18443)
* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Adding explicit MPL license for sub-package

This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository.

* Updating the license from MPL to Business Source License

Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl.

* add missing license headers

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

* Update copyright file headers to BUSL-1.1

---------

Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 09:12:13 -04:00
Semir Patel
bee12c6b1f
resource: Make resource write tenancy aware (#18423) 2023-08-10 09:53:38 -05:00
Semir Patel
63cc037110
resource: Make resource read tenancy aware (#18397) 2023-08-07 16:37:03 -05:00
wangxinyi7
1f28ac2664
expose grpc as http endpoint (#18221)
expose resource grpc endpoints as http endpoints
2023-08-04 11:27:48 -07:00
Semir Patel
ada767fc9f
resource: Pass resource to Write ACL hook instead of just resource Id [NET-4908] (#18192) 2023-07-20 12:06:29 -05:00
Semir Patel
003370ded0
Call resource mutate hook before validate hook (NET-4907) (#18178) 2023-07-19 13:10:57 -05:00
Dan Upton
b117eb0126
resource: enforce consistent naming of resource types (#17611)
For consistency, resource type names must follow these rules:

- `Group` must be snake case, and in most cases a single word.
- `GroupVersion` must be lowercase, start with a "v" and end with a number.
- `Kind` must be pascal case.

These were chosen because they map to our protobuf type naming
conventions.
2023-06-26 13:25:14 +01:00
R.B. Boyer
820cdf53da
fix some testing.T retry.R mixups (#17600)
Fix some linter warnings before updating the lint-consul-retry code in hashicorp/lint-consul-retry#4
2023-06-07 13:53:27 -05:00
skpratt
a35cafa728
update tests for fips (#17592) 2023-06-07 10:57:56 -05:00
skpratt
a065eef3ef
add FIPS to dataplane features (#17522) 2023-05-31 10:53:37 -05:00
Derek Menteer
e2f15cfe56
Fix namespaced peer service updates / deletes. (#17456)
* Fix namespaced peer service updates / deletes.

This change fixes a function so that namespaced services are
correctly queried when handling updates / deletes. Prior to this
change, some peered services would not correctly be un-exported.

* Add changelog.
2023-05-24 16:32:45 -05:00
R.B. Boyer
e00280e7df
prototest: fix early return condition in AssertElementsMatch (#17416) 2023-05-22 13:49:50 -05:00
Matt Keeler
93bad3ea1b
Allow resource updates to omit an owner refs UID (#17423)
This change enables workflows where you are reapplying a resource that should have an owner ref to publish modifications to the resources data without performing a read to figure out the current owner resource incarnations UID.

Basically we want workflows similar to `kubectl apply` or `consul config write` to be able to work seamlessly even for owned resources.

In these cases the users intention is to have the resource owned by the “current” incarnation of the owner resource.
2023-05-22 10:44:49 -04:00
R.B. Boyer
21c6e0e8e6
fix two typos (#17389) 2023-05-17 08:50:26 -07:00
Semir Patel
abeccb4c76
Support update resource with change in GroupVersion (#17330) 2023-05-15 09:42:01 -05:00
Dan Upton
0a38fc1a2a
resource: handle ErrWatchClosed in WatchList endpoint (#17289) 2023-05-15 12:35:10 +01:00
Eric Haberkorn
8bb16567cd
sidecar-proxy refactor (#17328) 2023-05-12 16:49:42 -04:00
Dan Upton
5030101cdb
resource: add missing validation to the List and WatchList endpoints (#17213) 2023-05-10 10:38:48 +01:00
Semir Patel
40eefaba18
Reaper controller for cascading deletes of owner resources (#17256) 2023-05-09 13:57:40 -05:00
Dan Upton
d53a1d4a27
resource: add helpers for more efficiently comparing IDs etc (#17224) 2023-05-09 19:02:24 +01:00
Derek Menteer
50ef6a697e
Fix issue with peer stream node cleanup. (#17235)
Fix issue with peer stream node cleanup.

This commit encompasses a few problems that are closely related due to their
proximity in the code.

1. The peerstream utilizes node IDs in several locations to determine which
nodes / services / checks should be cleaned up or created. While VM deployments
with agents will likely always have a node ID, agentless uses synthetic nodes
and does not populate the field. This means that for consul-k8s deployments, all
services were likely bundled together into the same synthetic node in some code
paths (but not all), resulting in strange behavior. The Node.Node field should
be used instead as a unique identifier, as it should always be populated.

2. The peerstream cleanup process for unused nodes uses an incorrect query for
node deregistration. This query is NOT namespace aware and results in the node
(and corresponding services) being deregistered prematurely whenever it has zero
default-namespace services and 1+ non-default-namespace services registered on
it. This issue is tricky to find due to the incorrect logic mentioned in #1,
combined with the fact that the affected services must be co-located on the same
node as the currently deregistering service for this to be encountered.

3. The stream tracker did not understand differences between services in
different namespaces and could therefore report incorrect numbers. It was
updated to utilize the full service name to avoid conflicts and return proper
results.
2023-05-08 13:13:25 -05:00
Semir Patel
991a002fcc
resource: List resources by owner (#17190) 2023-05-08 12:26:19 -05:00
Semir Patel
1037bf7f69
Sync .golangci.yml from ENT (#17180) 2023-04-28 17:14:37 +00:00
Semir Patel
9fef1c7f17
Create tombstone on resource Delete (#17108) 2023-04-28 10:49:08 -05:00
Dan Upton
eff5dd1812
resource: owner references must include a uid (#17169) 2023-04-28 11:22:42 +01:00
Dan Upton
faae7bb5f2
testing: RunResourceService helper (#17068) 2023-04-26 11:57:10 +01:00
Semir Patel
e7bb8fdf15
Fix or disable pipeline breaking changes that made it into main in last day or so (#17130)
* Fix straggler from renaming Register->RegisterTypes

* somehow a lint failure got through previously

* Fix lint-consul-retry errors

* adding in fix for success jobs getting skipped. (#17132)

* Temporarily disable inmem backend conformance test to get green pipeline

* Another test needs disabling

---------

Co-authored-by: John Murret <john.murret@hashicorp.com>
2023-04-25 15:17:48 -05:00
Dan Upton
b9c485dcb8
Controller Supervision (#17016) 2023-04-25 12:52:35 +01:00
Semir Patel
46816071df
De-scope tenenacy requirements to OSS only for now. (#17087)
Partition and namespace must be "default"
Peername must be "local"
2023-04-24 08:14:51 -05:00
Semir Patel
53f49b2fa1
Enforce operator:write acl on WriteStatus endpoint (#17019) 2023-04-20 16:25:33 +00:00
hashicorp-copywrite[bot]
9f81fc01e9
[COMPLIANCE] Add Copyright and License Headers (#16854)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Ronald <roncodingenthusiast@users.noreply.github.com>
2023-04-20 12:40:22 +00:00
Dan Upton
a37a441991
server: wire up in-process Resource Service (#16978) 2023-04-18 10:03:23 +01:00
Semir Patel
2f7d591702
Tenancy wildcard validaton for Write, Read, and Delete endpoints (#17004) 2023-04-17 16:33:20 -05:00
Semir Patel
79b30476e0
Enforce Owner rules in Write endpoint (#16983) 2023-04-14 08:19:46 -05:00
Semir Patel
8611ec56f3
Fix delete when uid not provided (#16996) 2023-04-14 08:18:24 -05:00
Semir Patel
b8c9e133be
Add mutate hook to Write endpoint (#16958) 2023-04-12 16:50:07 -05:00
Semir Patel
3b83c7ee9a
Enforce ACLs on resource Write and Delete endpoints (#16956) 2023-04-12 16:22:44 -05:00
Dan Upton
d595e6ade9
resource: WriteStatus endpoint (#16886) 2023-04-11 19:23:14 +01:00
Semir Patel
317240fca7
Resource validation hook for Write endpoint (#16950) 2023-04-11 06:55:32 -05:00
Semir Patel
686f49346c
Check acls on resource Read, List, and WatchList (#16842) 2023-04-11 06:10:14 -05:00
Semir Patel
1794484298
Resource Delete endpoint (#16756) 2023-04-06 08:58:54 -05:00
Dan Upton
4fa2537b3b
Resource Write endpoint (#16786) 2023-04-06 10:40:04 +01:00
Dan Upton
671d5825ca
Raft storage backend (#16619) 2023-04-04 17:30:06 +01:00
Dan Upton
651549c97d
storage: fix resource leak in Watch (#16817) 2023-03-31 13:24:19 +01:00
Ronald
b64674623e
Copyright headers for missing files/folders (#16708)
* copyright headers for agent folder
2023-03-28 18:48:58 -04:00
Ronald
94ec4eb2f4
copyright headers for agent folder (#16704)
* copyright headers for agent folder

* Ignore test data files

* fix proto files and remove headers in agent/uiserver folder

* ignore deep-copy files
2023-03-28 14:39:22 -04:00
Semir Patel
440f11203f
Resource service List(..) endpoint (#16753) 2023-03-27 16:25:27 -05:00
Semir Patel
032aba3175
WatchList(..) endpoint for the resource service (#16726) 2023-03-27 14:37:54 -05:00
Semir Patel
3415689eb6
Read(...) endpoint for the resource service (#16655) 2023-03-27 10:35:39 -05:00