This feature allows the user to set the `controllers` field to a string
that points to either an environment variable or file.
We then dynamically pull out the value and parse it into the config.
* internal/host/plugin: remove custom queries for secrets
This removes the custom queries for host catalog secrets, now that #1658
has been merged.
It also does a lot of cleanup surrounding the related oplog entries,
using db.WithOplog natively.
* Simplify conflict actions by replacing SetColumnValues with SetColumns
* Remove unused oplog method
This feature allows the user to set the `tags` field to a string
that points to either an environment variable or file.
We then dynamically pull out the value and parse it into the config.
This can also be done at the keys level, where you set your keys
directly in Boundary's config file, but point the values to env/file.
This adds a new requirement onto subtypes to register a NewFunc.
Previously the subtypes where implementing this function anyway, but the
target package was not including them in the registry. This resulted in
packages that use the target package needing to import the subtypes
directly, which we want to avoid.
This refactor will require the subtypes to register their NewFunc which
can then be used by `target.New` so packages that need to create targets
can do so by only using the target package.
This also updates the tcp subpackage to register a NewFunc.
This adds new makefile targets and configuration to run the tests in the
api and sdk modules. These do not run by default since `go test ./...`
does not cross module boundaries.
Some phony targets where not included in the single .PHONY line, this
switches to marking targets as PHONY just before the target is defined,
which makes it easier to ensure the targets are correctly marked as
phony.
Raising a warning in the default trigger used for setting the value in
create_time columns creates unnecessary noise in the PostgreSQL log
files.
Closes#1744
* internal/host/plugin: ensure UpdateCatalog triggers updates for sets
This ensures that attribute updates to a host catalog triggers an update
to any of its downstream host sets. This ensures that updates to
elements that affect a host set, such as the region a host catalog is
configured for, take effect immediately instead of requiring a wait of
long as 10m after an update.
* Add WithNextRunIn to test sync job
This is to ensure it doesn't run right away when added. This ensures
that we can accurately test *when* the job is set to run immediately.
* Update internal/host/plugin/repository_host_catalog.go
Co-authored-by: Todd <T.Alan.Knight@gmail.com>
* Change TestRepository_UpdateCatalog_SyncSets to check next run time, not wait for run
* Remove explicit version increment and instead rely on implicit increment
* Fix lanuage for rows updated check when flagging host sets for sync
* remove errant non-zero check when looping over the thing we're checking
* remove scheduler start line from TestRepository_UpdateCatalog_SyncSets
Co-authored-by: Todd <T.Alan.Knight@gmail.com>
Adds tests to `SetupControllerPublicClusterAddress` and
`SetupWorkerPublicAddress` ahead of changes in these functions to
ensure functionality is preserved.
Internally attributes are not allowed to be the null value. However, as
currently implemented, this then breaks our normal model of sending an
explicit `null` in the JSON to reset/clear a field. This is a problem
because the CLI doesn't have a way to say "set this but to empty"
without a lot of hoops, and causes some issues for API users and TF as
well.
This changes PatchBytes and PatchStruct to return an empty value (or
marshaled empty value in the case of PatchBytes) if the source is null
or empty. In the host catalog update function we then always set this
value if it's in the db mask (removing the nil check). Together this
means a null value ends up coming out as an empty value (and thus valid
for the DB) from PatchStruct/PatchBytes, and our API translation
function already returns nothing for attributes if the length of the
fields are zero.