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

Implement dynamic resource manipulation helpers #2850

Closed
wants to merge 1 commit into from

Conversation

fspmarshall
Copy link
Contributor

Provides a set of helper functions to support dynamically handling the validation and storage of common resource types.

This initial implementation covers only those resources supported by the resource-manipulation subcommands of tctl.

Includes a few basic tests to confirm compatibility with equivalent non-dynamic APIs.

note: This is in preparation for #2480, which will require the ability to dynamically initialize a set of resources at startup.

@russjones
Copy link
Contributor

Can you provide some more context on why you want to add support for this?

@fspmarshall
Copy link
Contributor Author

Can you provide some more context on why you want to add support for this?

Sure thing. I'm currently working on implementing the ability to backup and restore key components of auth server state. Based on my investigation of how state is handled and stored, as well as how a teleport process initializes itself, it seems that the easiest way to do this in a manner that is easy to reason about and extend is to allow a backed to be "bootstrapped" with a collection of resources. This necessitates the ability to accept a dynamic collection of resources, resolve their concrete types, ensure that none of them exist before any of them are written, and then write them all to the backend. There was enough variance in the way different concretely typed APIs in services/local operated (lookup by name vs by type, creation vs upsert, etc.) that it seemed clearer and more consistent to convert all resources into backend.Items, and manage storage/checks that way.

Provides a set of helper functions to support dynamically handling
the validation and storage of common resource types.

This initial implementation covers only those resources supported
by the resource-manipulation subcommands of `tctl`.

Includes a few basic tests to confirm compatibility with equivalent
non-dynamic APIs.
@fspmarshall
Copy link
Contributor Author

Retracting this PR in favor of adding these helpers alongside the features that require them.

@fspmarshall fspmarshall deleted the fspmarshall/resource-helpers branch July 16, 2019 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants