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

Namespace config validation #833

Merged
merged 3 commits into from
May 26, 2022
Merged

Conversation

shorsher
Copy link
Member

@shorsher shorsher commented May 24, 2022

Adding additional configuration validation to the namespace manager, as specified in FIR-12

  • name must be unique on this node
  • for historical reasons, "ff_system" is a reserved string and cannot be used as a name or remoteName
  • a database plugin is required for every namespace
  • if mode: multiparty is specified, plugins must include one each of blockchain,
    dataexchange, and sharedstorage
  • if mode: gateway is speicified, plugins must not include dataexchange or sharedstorage
  • at most one of each type of plugin is allowed per namespace, except for tokens (which
    may have many per namespace)

depends on changes in hyperledger/firefly-common#14

@codecov-commenter
Copy link

codecov-commenter commented May 24, 2022

Codecov Report

Merging #833 (b7b389e) into main (a425fde) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main      #833      +/-   ##
===========================================
+ Coverage   99.98%   100.00%   +0.01%     
===========================================
  Files         299       299              
  Lines       19457     19551      +94     
===========================================
+ Hits        19455     19551      +96     
+ Misses          1         0       -1     
+ Partials        1         0       -1     
Impacted Files Coverage Δ
internal/coreconfig/coreconfig.go 100.00% <ø> (ø)
internal/namespace/config.go 100.00% <100.00%> (ø)
internal/namespace/manager.go 100.00% <100.00%> (ø)
internal/orchestrator/orchestrator.go 100.00% <100.00%> (ø)
internal/apiserver/server.go 100.00% <0.00%> (+0.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a425fde...b7b389e. Read the comment docs.

 * `name` must be unique on this node
 * for historical reasons, "ff_system" is a reserved string and cannot be used as a `name` or `remoteName`
 * a `database` plugin is required for every namespace
 * if `mode: multiparty` is specified, plugins _must_ include one each of `blockchain`,
  `dataexchange`, and `sharedstorage`
 * if `mode: gateway` is speicified, plugins _must not_ include `dataexchange` or `sharedstorage`
 * at most one of each type of plugin is allowed per namespace, except for tokens (which
  may have many per namespace)

Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
@awrichar
Copy link
Contributor

It's worth calling out explicitly that this is config validation only - none of the newly added config is actually functional yet (which is fine for now).

Also, I don't see that this bullet is enforced yet for the plugins:

  • name must be unique on this node

It might be on orchestrator to enforce that before passing the list of plugins to Namespace Manager...

@shorsher
Copy link
Member Author

shorsher commented May 25, 2022

Thanks for the comments and added some new changes which rely on your changes in hyperledger/firefly-common#14

docs/reference/config.md Outdated Show resolved Hide resolved
Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validation looks good. I left a few minor comments which you can check on, but marking approved now.

 - Plugins names must be globally unique
 - Better handling of deprecated config in namespace manager
 - Updated config descriptions

Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
@shorsher shorsher merged commit ac42fb9 into hyperledger:main May 26, 2022
@shorsher shorsher deleted the ns-section branch May 26, 2022 18:30
@awrichar awrichar added this to the v1.1.0 milestone May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants