Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service discovery: add initial MVP implementation #12368

Merged
merged 45 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7795188
state: add the table schema for the service_registrations table.
jrasell Feb 28, 2022
dda440e
mock: add service registration mock generation for test use.
jrasell Feb 28, 2022
51d1435
structs: add service registration struct and basic composed funcs.
jrasell Feb 28, 2022
d3b3547
state: add service registration state interaction functions.
jrasell Feb 28, 2022
1603323
state: add service registration restore functionality.
jrasell Feb 28, 2022
12265ee
events: add state objects and logic for service registrations.
jrasell Feb 28, 2022
f3f5a77
Merge pull request #12139 from hashicorp/f-gh-260
jrasell Mar 2, 2022
fdcb730
Merge pull request #12140 from hashicorp/f-gh-258
jrasell Mar 2, 2022
d22a3dd
fsm: add FSM functionality for service registration endpoints.
jrasell Mar 3, 2022
13da88b
helper: add ipaddr pkg to check for any IP addresses.
jrasell Mar 3, 2022
1fe826e
rpc: add service registration RPC endpoints.
jrasell Mar 3, 2022
487ec37
rpc: add alloc service registration list RPC endpoint.
jrasell Mar 3, 2022
a674fb3
rpc: add job service registration list RPC endpoint.
jrasell Mar 3, 2022
5093be7
http: add agent service registration HTTP endpoint.
jrasell Mar 3, 2022
d3f6343
http: add job service registration agent HTTP endpoint.
jrasell Mar 3, 2022
ab52b02
http: add alloc service registration agent HTTP endpoint.
jrasell Mar 3, 2022
16cb776
api: add service registration HTTP API wrapper.
jrasell Mar 3, 2022
621a89b
Merge pull request #12171 from hashicorp/f-gh-259
jrasell Mar 4, 2022
b10547d
Merge pull request #12172 from hashicorp/f-gh-262
jrasell Mar 4, 2022
463f938
jobspec: add service block provider parameter and validation.
jrasell Mar 14, 2022
86f02a3
hcl1: add service block provider parameter.
jrasell Mar 14, 2022
9215d0c
api: add service block provider parameter.
jrasell Mar 14, 2022
b78e436
config: add native service discovery admin boolean parameter.
jrasell Mar 14, 2022
8e2c71e
client: add service discovery feature enabled attribute.
jrasell Mar 14, 2022
f5be448
job: add native service discovery job constraint mutator.
jrasell Mar 14, 2022
4251860
Merge pull request #12189 from hashicorp/f-gh-264
jrasell Mar 14, 2022
b8ecce6
Merge pull request #12190 from hashicorp/f-gh-261
jrasell Mar 14, 2022
066747c
Merge pull request #12201 from hashicorp/f-gh-265
jrasell Mar 14, 2022
6e8f32a
client: refactor common service registration objects from Consul.
jrasell Mar 15, 2022
3fcec92
Merge pull request #12272 from hashicorp/f-gh-266-refactor
jrasell Mar 15, 2022
4722947
client: add service registration wrapper to handle providers.
jrasell Mar 15, 2022
93e9024
Merge pull request #12295 from hashicorp/f-gh-266-wrapper
jrasell Mar 17, 2022
9185316
client: add Nomad service registration implementation.
jrasell Mar 17, 2022
3668bac
Merge pull request #12298 from hashicorp/f-gh-266-nomad
jrasell Mar 21, 2022
131cda2
client: modify service wrapper to accomodate restore behaviour.
jrasell Mar 21, 2022
f0be952
client: hookup service wrapper for use within client hooks.
jrasell Mar 21, 2022
9944777
cli: add service commands for list, info, and delete.
jrasell Mar 21, 2022
b6f1e9d
Merge pull request #12329 from hashicorp/f-gh-266-touchdown
jrasell Mar 22, 2022
d49cf23
Merge branch 'main' into f-1.3-boogie-nights
jrasell Mar 23, 2022
6d002e9
core: remove node service registrations when node is down.
jrasell Mar 23, 2022
bd377c9
Merge pull request #12330 from hashicorp/f-gh-263
jrasell Mar 23, 2022
e89dd5d
test: move remaining tests to use ci.Parallel.
jrasell Mar 24, 2022
2ac318b
api: move serviceregistration client to servics to match CLI.
jrasell Mar 24, 2022
2d8b370
Merge branch 'main' into f-1.3-boogie-nights
jrasell Mar 25, 2022
dfe1854
ci: fix semgrep rule for RPC authentication
lgfa29 Mar 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/allocations.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ func (a *Allocations) Signal(alloc *Allocation, q *QueryOptions, task, signal st
return err
}

// Services is used to return a list of service registrations associated to the
// specified allocID.
func (a *Allocations) Services(allocID string, q *QueryOptions) ([]*ServiceRegistration, *QueryMeta, error) {
var resp []*ServiceRegistration
qm, err := a.client.query("/v1/allocation/"+allocID+"/services", &resp, q)
return resp, qm, err
}

// Allocation is used for serialization of allocations.
type Allocation struct {
ID string
Expand Down
4 changes: 4 additions & 0 deletions api/allocations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,7 @@ func TestAllocations_ShouldMigrate(t *testing.T) {
require.False(t, DesiredTransition{}.ShouldMigrate())
require.False(t, DesiredTransition{Migrate: boolToPtr(false)}.ShouldMigrate())
}

func TestAllocations_Services(t *testing.T) {
// TODO(jrasell) add tests once registration process is in place.
}
Loading