Commit Graph
2008 Commits
Author SHA1 Message Date
Todd 731a45eba6 Merge the worker_status table with the worker table (#2111) 2022-06-01 13:25:29 -07:00
Jeff Mitchell 46e97a2b91 Update to new nodee lib bits (#2120) 2022-06-01 13:35:46 -04:00
Irena Rindos 5aebd5689f Merge pull request #2116 from hashicorp/irindos-update-workerauth-schemas
feat(workerauth): add storage for RootCertificates aggregate
2022-06-01 08:31:10 -04:00
irenarindos bf3b0340e5 feat(workerauth): add storage for RootCertificates aggregate 2022-06-01 08:16:14 -04:00
Jeff Mitchell 7bfe35da0d Update controller address handling (#2089)
* Don't assume it's non-empty or that this is an issue
* Ensure it's empty if the response is coming back through the multihop
  service so that it simply uses what is in the config file, at least
  for now
2022-06-01 01:09:56 -04:00
Michael Gaffney eece174e5e test(worker): Fix TestDeleteWorker 2022-05-31 13:57:50 -04:00
Todd fa2efe9878 Create the Worker API resource and the CRUDL operation definitions for a worker. (#2114) 2022-05-27 08:29:23 -07:00
Irena Rindos f3c1936e99 Merge pull request #2102 from hashicorp/irindos-move-worker-apis
refact(api): move worker handlers
2022-05-26 19:22:52 -04:00
irenarindos c811dff89b refact(api): move worker handlers 2022-05-26 19:19:07 -04:00
Irena Rindos 3e314a45f9 Merge pull request #2109 from hashicorp/irindos-delete-worker
feature(workers): add repository DeleteWorker
2022-05-26 19:18:13 -04:00
irenarindos 74fce3776b feature(workers): add repository DeleteWorker 2022-05-26 19:15:10 -04:00
Todd c2b2aa0857 Merge remote-tracking branch 'origin/main' into llb-byow
# Conflicts:
#	go.mod
2022-05-26 12:42:06 -07:00
Jim 70c5da1048 feature (workers): add repository CreateWorker(...) (#2105) 2022-05-26 13:32:21 -04:00
Johan Brandhorst-Satzkorn b20939ecb4 fix(cmd): Fix build error (#2107)
This seems to have been missed when #2094 was
reviewed and merged.

Blame: ec608b79da
2022-05-25 15:40:36 -04:00
Timothy Messier 1ce4ea9af5 chore(docker): Add dockerignore file to reduce context size (#2022)
Since the Dockerfile is now at the repository root, when running
building a docker image, the entire repository was being added to the
context sent to the docker daemon. However, only the compiled binary and
a few configs in `.release/docker` are needed to build the docker
images.

This ignore file will only send necessary fields into the context. This
helps speed up the docker image building.

For example, when building the dev image, without the ignore file:

    Sending build context to Docker daemon  2.043GB

And with this ignore file:

    Sending build context to Docker daemon  130.7MB

See:
    https://docs.docker.com/engine/reference/builder/#dockerignore-file
2022-05-25 14:34:53 -04:00
Todd a281d10206 Add worker config table and view (#2090)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id constraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.
2022-05-24 15:08:02 -07:00
Todd e5f02dfc26 Refactor the different repo methods into separate files (#2096)
* Refactor the different repo methods into separate files

* Move DefaultLiveness to the repository.go file to be shared across workers and controllers.
2022-05-23 09:07:30 -07:00
Johan Brandhorst-Satzkorn ec608b79da fix(cmd): Respect DB max open connections (#2094)
Both the init and migrate commands were ignoring
the configured max_open_connections database
setting. This fix ensures that both commands
respect the limits.
2022-05-23 08:21:15 -04:00
Todd 1c575a8762 make gen fix. 2022-05-20 11:58:40 -07:00
ToddandIrena Rindos 3fbf901739 Add source to worker tags table (#2087)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id contraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.

* Adding worker tag db writing test.

* Move the server table back to the top.

* Update comment for the worker object.

* Update comment for the worker table.

* Add worker tag sources ("config" or "api")

* Revert renaming of UpsertWorker until later.

* Remove no longer needed files.

* Moving the TestWorker into the servers package. Fix the worker tags test.

* Update internal/proto/controller/storage/servers/store/v1/worker.proto

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>

* Place the repos back together so they can be refactored in a different PR.

Co-authored-by: Irena Rindos <irenarindos@users.noreply.github.com>
2022-05-20 11:55:54 -07:00
Irena Rindos 12044af824 Merge pull request #2067 from hashicorp/irindos-pki-schemas
feat(pki): Add PKI schemas and protos
2022-05-20 13:53:12 -04:00
irenarindos af3f75ffaf fixup! feat(pki): Add PKI schemas and protos 2022-05-20 10:30:56 -04:00
Jeff Mitchell f6ef708466 Update against new nodeenrollment registration cache 2022-05-20 10:25:54 -04:00
irenarindos 20c314787d fixup! feat(pki): Add PKI schemas and protos 2022-05-20 10:23:15 -04:00
irenarindos 88a6ca036f feat(pki): Add PKI schemas and protos 2022-05-20 10:02:06 -04:00
Jeff Mitchell 1f550722a2 Sync against current library state 2022-05-19 14:17:01 -04:00
Todd 2ecd550e27 Add fields to server_worker to be a boundary resource (#2083)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id contraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.

* Updating server_id references to controller_id.

* Adding worker tag db writing test.

* Move the server table back to the top.

* Update comment for the worker object.

* Update comment for the worker table.

* Update the newWorkerId call to take a context and fix its error.

* Correct comment for the wt_network_address domain.
2022-05-18 17:03:24 -07:00
Timothy Messier c2d632f1a2 test(targets): Prevent panic due to non-deterministic order (#2086)
This test was using the third element in the result from a list request
to craft the input for the next assertion. However, one of the test
targets that is created does not have a default port set. Since the
target list call is not ordered, sometimes this element could be the
third element and a panic would result when default port interface was
converted to a float64.

This fixes the panic like:

    --- FAIL: TestList (1.31s)
    panic: interface conversion: interface {} is nil, not float64 [recovered]
            panic: interface conversion: interface {} is nil, not float64

    goroutine 1694 [running]:
    testing.tRunner.func1.2({0x14b2320, 0xc002f486f0})
        /prefix/usr/lib/go/src/testing/testing.go:1389 +0x24e
    testing.tRunner.func1()
        /prefix/usr/lib/go/src/testing/testing.go:1392 +0x39f
    panic({0x14b2320, 0xc002f486f0})
        /prefix/usr/lib/go/src/runtime/panic.go:838 +0x207
    github.com/hashicorp/boundary/internal/tests/api/targets_test.TestList(0xc000f81380)
        /go/src/github.com/hashicorp/boundary/internal/tests/api/targets/target_test.go:193 +0x174b
    testing.tRunner(0xc000f81380, 0x2b933a8)
        /prefix/usr/lib/go/src/testing/testing.go:1439 +0x102
    created by testing.(*T).Run
        /prefix/usr/lib/go/src/testing/testing.go:1486 +0x35f
    FAIL    github.com/hashicorp/boundary/internal/tests/api/targets    5.742s
    FAIL

Refs: #2003
2022-05-18 09:45:31 -04:00
Carlos Alcaide Corvo d7adc2cb5e Update UI version to consume the new renamed UI artifacts (#2080) 2022-05-17 16:32:36 -07:00
Louis Ruch 6f4cee88bf fix(vault_store): Correctly return expected errors (#2081)
* fix(vault_store): Correctly return errors
2022-05-17 12:20:01 -07:00
Todd 472d7d520a Remove the server_id from session table, change it to worker_id on session_connection (#2070)
* Remove the server_id from session table, change it to worker_id on session_connection

This is step 1 in updating the worker table.  The worker is becoming a public resource so it must have
a public id.  We drop the server_id column on the session_connection table and add the worker_id column
so we can use the wt_public_key type.  Since db migrations are applied while the controller is offline,
it should be safe to assume all session connections are not in a running state, thus allowing us to null
out all the worker ids in the session_connection table.

For now we don't have very good enforcement of the wt_public_id constraints, since the id is currently
defined in the worker config, but this will soon change and the worker's id will be generated by the
controller.
2022-05-16 15:14:12 -07:00
Carlos Alcaide Corvo ce0507ee99 Update UI artifacts consumption (#2074)
Update UI artifacts consumption to allow UI editions
2022-05-16 12:05:32 -07:00
irenarindos ff9470d7df Update changelog for 0.8.1 2022-05-16 15:03:45 -04:00
Jeff Mitchell 0581e164f1 Update nodeenrollment dep 2022-05-16 09:02:09 -04:00
Jim 6635778765 chore (kms): upgrade extras/kms dep which no longer directly deps on sqlite (#2078) 2022-05-15 12:56:32 -04:00
Jeff Mitchell 2f06513a3a Merge branch 'main' into llb-byow 2022-05-13 17:05:36 -04:00
Jeff Mitchell e84a2e639f Revert downgrade of go-kms-wrapping 2022-05-13 17:04:22 -04:00
Jim 785241237e refactor (kms): adopt the go-kms-wrapping/extras/kms package (#2027)
* feature (db): add Db.UnderlyingDB()

This is needed to allow for integration with bits that need a *dbw.DB

* feature (kms): add new go-kms-wrapping/extras/kms dependency

* refactor (kms): schema changes required to adopt extras/kms pkg

* refactor (kms/iam): rename to DeprecateCreateKeysTx(...)

* refactor (kms): remove deprecated test

* refactor (kms): refactor Kms type

This refactor includes renaming the existing type to DeprecatedKms
and then refactoring the Kms type to become a wrapper of
go-kms-wrapping/extras/kms

* refactor (kms): delete all the unneeded bits

All this stuff is not needed now that we're using
go-kms-wrapping/extras/kms

* refactor (db): fixup tests after kms refactor

* refactor (kms/tests): use testing.TB for test helpers

Our test helper packages were not possible to use
with benchmarks. This refactor switches to testing.TB
to allow both tests and benchmarks to use the helpers.

* tests (session benchmarks): refactor to use new Kms type

* refactor (schema): rm test which relies on deprecated Kms code

* refactor (kms): post rebase on main changes required

* chore (kms refactor): re-add unit test from main

* refactor (kms): uses migrations that don't include KMS schema changes
2022-05-13 13:53:22 -04:00
Jeff Mitchell 00e57db60f Adapt to library changes 2022-05-13 10:06:21 -04:00
Johan Brandhorst-Satzkorn 8cef1017e9 fix(session): Fix typo in connection documentation (#2075) 2022-05-12 16:11:35 -04:00
Irena Rindos a11b0e81a8 Merge pull request #2065 from hashicorp/irindos-session-nullfkey
bug(session): null fkey trigger also checks for session terminated state
2022-05-12 15:12:50 -04:00
irenarindos 54c30d2cad bug(session): null fkey trigger also checks for session terminated state 2022-05-12 14:59:22 -04:00
Cameron Perera 20f5185a8c chore: Change how update-ui-version gets the latest commit sha (#2069)
* chore: Change how update-ui-version gets the latest commit sha on main

* remove changelog edits

* chore: refactor uiupdate.sh to use UI_COMMITISH instead of main
2022-05-12 09:32:39 -05:00
Haotian 898da56a77 feat(workers): Add storage path parameter to worker config 2022-05-11 17:15:38 -07:00
Jeff Mitchell 8ebb8d1477 Merge remote-tracking branch 'origin/main' into llb-byow 2022-05-11 17:08:23 -04:00
Jeff Mitchell 99a16dafc2 Leave cluster listener up when bad data is sent (#2073)
Leave cluster listener up when bad data is sent

Removing the ALPN muxer exposed the underlying listener directly to the
gRPC server, which means that a quirk of the ALPN muxer (not surfacing
errors on accept) turned into the gRPC server receiving errors on
accept, and it turns out if the error does not satisfy a special
temporary interface the listener will be closed.

The obviously better thing to do would be to let the listener close
itself if there was truly a fatal error rather than relying on
undocumented interfaces, but here we are.
2022-05-11 17:02:36 -04:00
Irena Rindos 602941af28 Merge pull request #2071 from hashicorp/irindos-remove-cascade
Remove column cascade
2022-05-11 12:43:01 -04:00
irenarindos 0ef523ba77 Remove column cascade 2022-05-11 12:38:19 -04:00
Jeff Mitchell 837eb9e6f1 Update nodeenrollment dep against new dev branch 2022-05-10 16:33:47 -04:00
Todd b83f4ece39 Manual merge of main into llb-byow. 2022-05-09 14:45:30 -07:00